Virtual item pushing method and device, electronic equipment and storage medium
By receiving display requests and determining target virtual items based on item type and priority, the problem of code redundancy during virtual item distribution is solved, improving development efficiency and management flexibility.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- BEIJING DAJIA INTERNET INFORMATION TECH CO LTD
- Filing Date
- 2022-05-05
- Publication Date
- 2026-07-14
AI Technical Summary
In existing technologies, the distribution of virtual items requires a large number of redundant logical judgments, which leads to code library pollution and low development efficiency.
By receiving display requests from the target account, candidate virtual items matching the account identifier are obtained, and the target virtual item is determined based on the item type and priority, thus avoiding code redundancy.
It improves the development efficiency of virtual item distribution, reduces code redundancy, and enables flexible virtual item management.
Smart Images

Figure CN117056381B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of Internet technology, and in particular to a method, apparatus, electronic device, computer-readable storage medium, and computer program product for pushing virtual items. Background Technology
[0002] With the development of internet technology, live streaming technology has been widely applied. In live streaming scenarios, when a user completes a task, they can be rewarded with virtual items (such as avatar frames, entrance effects, etc.). In some scenarios, it is necessary to reward users with different levels of virtual items based on the degree of task completion. For example, when a user completes task 1, they should be rewarded with a level 1 virtual item, and when they complete task 2, they should be rewarded with a level 2 virtual item. As similar business scenarios increase, the amount of redundant judgment logic required when rewarding virtual items also increases.
[0003] In related technologies, suppose two upgradable virtual items, A and B, are launched simultaneously. Item A includes two types, A1 and A2, with priority A2 > A1. Item B includes three types, B1, B2, and B3, with priority B3 > B2 > B1. If user C activates all virtual items, according to business rules, C should see the highest priority virtual items A2 and B3 in each type in the virtual item list. In traditional technologies, because product operations create five types of virtual items (A1, A2, B1, B2, and B3) in the backend, it's necessary to add judgment logic to the corresponding distribution interface (only A2 is distributed when A1 and A2 are both active; only B3 is distributed when B1, B2, and B3 are all active; only B2 is distributed when B1 and B2 are both active; and only B3 is distributed when B2 and B3 are both active) to ensure accurate distribution.
[0004] However, the above method requires adding similar priority judgment logic and logic code for virtual item expiration time and upgrade / downgrade judgment every time there is a need to upgrade virtual items. A large amount of redundant logic can easily pollute the code repository, making the code less readable, difficult to maintain, and resulting in a lot of repetitive development, which affects development efficiency. Summary of the Invention
[0005] This disclosure provides a method, apparatus, electronic device, computer-readable storage medium, and computer program product for pushing virtual items, to at least solve the problems of code redundancy and reduced development efficiency caused by the logical control methods for distributing virtual items in related technologies. The technical solution of this disclosure is as follows:
[0006] According to a first aspect of the present disclosure, a method for pushing virtual items is provided, comprising:
[0007] Receive a request from a target account to display virtual items, wherein the display request carries the account identifier of the target account;
[0008] Obtain candidate virtual items that match the account identifier, wherein the candidate virtual items have corresponding item identifiers, item types, and priorities;
[0009] Based on the item type of the candidate virtual items, obtain the candidate virtual item corresponding to the highest priority item identifier under each item type as the target virtual item;
[0010] The target virtual item is returned to the client, which instructs the client to display the target virtual item to the target account.
[0011] In one embodiment, obtaining candidate virtual items matching the account identifier includes: querying an item identifier matching the account identifier in a first database, the first database storing the correspondence between account identifiers and item identifiers of virtual items; querying the item type and priority of the virtual item corresponding to the item identifier in a second database to obtain candidate virtual items matching the account identifier, the second database storing the correspondence between the item identifier of the virtual item, its item type, and its priority.
[0012] In one embodiment, the step of obtaining the candidate virtual item corresponding to the highest priority item identifier under each item type as the target virtual item according to the item type of the candidate virtual item includes: obtaining the item identifier and priority of the corresponding candidate virtual item under the same item type according to the item type of the candidate virtual item; obtaining the candidate virtual item corresponding to the highest priority item identifier under the item type as the target virtual item corresponding to the item type; and obtaining the target virtual item corresponding to each item type according to each item type of the candidate virtual item.
[0013] In one embodiment, before obtaining candidate virtual items matching the account identifier, the method further includes: receiving account configuration information, the account configuration information including an account identifier and virtual items assigned to the account identifier, the virtual items having corresponding item identifiers and item configuration information, the item configuration information including the effective time of the virtual items; when the data update time arrives, obtaining account configuration information whose effective time is greater than the data update time; and generating the first database based on the obtained account configuration information.
[0014] In one embodiment, the item configuration information further includes the expiration time of the virtual item; the method further includes: when the data update time arrives, obtaining account configuration information whose expiration time is greater than the data update time; and updating the first database according to the obtained account configuration information.
[0015] In one embodiment, before obtaining candidate virtual items matching the account identifier, the method further includes: obtaining a creation request for a virtual item, the creation request including the item identifier of the virtual item and corresponding item configuration information; when receiving a type association request for the virtual item, the type association request including the item type to be associated and the corresponding priority; establishing a correspondence between the item identifier of the virtual item, the item type to be associated, the priority, and the corresponding item configuration information, and generating the second database based on the correspondence.
[0016] In one embodiment, the method further includes: when a modification request for the virtual item is received, updating the second database according to the modification request, wherein the modification request includes an item identifier of the virtual item, and a modification request for at least one of the following information: item type, priority, and item configuration information corresponding to the item identifier.
[0017] According to a second aspect of the present disclosure, a device for pushing virtual items is provided, comprising:
[0018] The display request receiving module is configured to receive a display request for virtual items from a target account, wherein the display request carries the account identifier of the target account;
[0019] The candidate virtual item acquisition module is configured to acquire candidate virtual items that match the account identifier, wherein the candidate virtual items have corresponding item identifiers, item types, and priorities;
[0020] The target virtual item determination module is configured to perform the following: based on the item type of the candidate virtual items, obtain the candidate virtual item corresponding to the highest priority item identifier under each item type as the target virtual item;
[0021] The return module is configured to return the target virtual item to the client, the target virtual item being used to instruct the client to display the target virtual item to the target account.
[0022] In one embodiment, the candidate virtual item acquisition module is configured to perform: querying a first database for item identifiers that match the account identifier, the first database storing the correspondence between account identifiers and item identifiers of virtual items; querying a second database for the item type and priority of the virtual item corresponding to the item identifier, to obtain candidate virtual items that match the account identifier, the second database storing the correspondence between the item identifier of the virtual item, its item type, and its priority.
[0023] In one embodiment, the target virtual item determination module is configured to perform: obtaining the item identifier and priority of the corresponding candidate virtual item under the same item type according to the item type of the candidate virtual item; obtaining the candidate virtual item corresponding to the item identifier with the highest priority under the item type as the target virtual item corresponding to the item type; and obtaining the target virtual item corresponding to each item type according to each item type of the candidate virtual item.
[0024] In one embodiment, the apparatus further includes a first database generation module configured to perform: receiving account configuration information, the account configuration information including an account identifier and a virtual item assigned to the account identifier, the virtual item having a corresponding item identifier and item configuration information, the item configuration information including the effective time of the virtual item; when the data update time arrives, acquiring account configuration information whose effective time is greater than the data update time; and generating the first database based on the acquired account configuration information.
[0025] In one embodiment, the item configuration information further includes the expiration time of the virtual item; the device further includes a first database update module configured to perform: when the data update time arrives, acquiring account configuration information whose expiration time is greater than the data update time; and updating the first database according to the acquired account configuration information.
[0026] In one embodiment, the apparatus further includes a second database generation module configured to perform: obtaining a creation request for a virtual item, the creation request including an item identifier of the virtual item and corresponding item configuration information; when receiving a type association request for the virtual item, the type association request including the requested item type and corresponding priority; establishing a correspondence between the item identifier of the virtual item, the requested item type, priority, and corresponding item configuration information, and generating the second database based on the correspondence.
[0027] In one embodiment, the apparatus further includes a second database update module configured to perform: when a modification request for the virtual item is received, updating the second database according to the modification request, wherein the modification request includes an item identifier of the virtual item, and a modification request for at least one of the following: item type, priority, and item configuration information corresponding to the item identifier.
[0028] According to a third aspect of the present disclosure, an electronic device is provided, comprising: a processor; and a memory for storing processor-executable instructions; wherein the processor is configured to execute the instructions to implement the virtual item push method as described in the first aspect above.
[0029] According to a fourth aspect of the present disclosure, a computer-readable storage medium is provided that, when instructions in the computer-readable storage medium are executed by a processor of an electronic device, enables the electronic device to perform the virtual item push method as described in the first aspect above.
[0030] According to a fifth aspect of the present disclosure, a computer program product is provided, the computer program product including instructions that, when executed by a processor of an electronic device, enable the electronic device to perform the virtual item push method as described in the first aspect above.
[0031] The technical solution provided by the embodiments of this disclosure brings at least the following beneficial effects: by receiving a request from a target account to display virtual items, candidate virtual items matching the account identifier are obtained, and according to the item type of the candidate virtual items, the candidate virtual item corresponding to the highest priority item identifier under each item type is obtained as the target virtual item, and then the target virtual item is returned to the client. Since this embodiment determines the target virtual item to be distributed to the user based on the corresponding item type and priority, compared with the traditional technology of controlling the distribution logic of virtual items through code, it can avoid code redundancy and improve development efficiency.
[0032] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description
[0033] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure, and are not intended to unduly limit this disclosure.
[0034] Figure 1 This is an application environment diagram illustrating a method for pushing virtual items according to an exemplary embodiment.
[0035] Figure 2 This is a flowchart illustrating a method for pushing virtual items according to an exemplary embodiment.
[0036] Figure 3 This is a flowchart illustrating the steps of obtaining candidate virtual items according to an exemplary embodiment.
[0037] Figure 4 This is a flowchart illustrating the steps of determining a target virtual item according to an exemplary embodiment.
[0038] Figure 5 This is a schematic diagram illustrating the process of generating a first database according to an exemplary embodiment.
[0039] Figure 6 This is a schematic diagram illustrating the process of generating a second database according to an exemplary embodiment.
[0040] Figure 7 This is a block diagram illustrating a virtual item delivery device according to an exemplary embodiment.
[0041] Figure 8 This is a block diagram illustrating an electronic device according to an exemplary embodiment. Detailed Implementation
[0042] To enable those skilled in the art to better understand the technical solutions of this disclosure, the technical solutions in the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings.
[0043] It should be noted that the terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this disclosure are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this disclosure described herein can be implemented in orders other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this disclosure as detailed in the appended claims.
[0044] It should also be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for display, data used for analysis, etc.) involved in this disclosure are all information and data authorized by the user or fully authorized by all parties.
[0045] The method for pushing virtual items provided in this disclosure can be applied to, for example... Figure 1In the application environment shown, terminal 102 communicates with server 104 via a network. A data storage system can store the data that server 104 needs to process. The data storage system can be integrated onto server 104 or located on the cloud or other network servers. Specifically, terminal 102 can be, but is not limited to, various personal computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices. IoT devices can include smart speakers, smart TVs, smart air conditioners, smart in-vehicle devices, etc. Portable wearable devices can include smartwatches, smart bracelets, head-mounted devices, etc. Server 104 can be implemented using a standalone server or a server cluster consisting of multiple servers.
[0046] In this embodiment, the terminal 102 has an application client installed, which can be any of the following: a short video application, a live streaming application, etc. The server 104 is the backend server for the corresponding application. Taking a live streaming application as an example, when a user completes a task, they can obtain corresponding virtual item rewards. These rewards can be displayed in the virtual item display panel of the live streaming page based on the user's request. Specifically, when the server 104 receives a request from a target account to display virtual items, it obtains candidate virtual items matching the account identifier. These candidate virtual items have corresponding item identifiers, item types, and priorities. Based on the item identifier, item type, and corresponding priority, the server determines the target virtual item, which is the candidate virtual item with the highest priority among those of the same item type. The server then returns the target virtual item to the client, allowing the client to display the target virtual item to the target account. Because this embodiment manages the distribution of virtual items by configuring the type and priority of virtual items, it avoids the code redundancy problems caused by traditional technologies and improves development efficiency.
[0047] Figure 2 This is a flowchart illustrating a method for pushing virtual items according to an exemplary embodiment, such as... Figure 2 As shown, this method is used for Figure 1 Taking a server as an example, the following steps are included.
[0048] In step S210, a request from the target account to display virtual items is received.
[0049] Virtual items refer to objects derived from the virtual online world; they are imagined and fictional things that can be seen but not touched, such as equipment and weapons in online games, and special effects and avatar frames in live streams. The target account is the user currently initiating the request to display the virtual item. Specifically, the display request carries the target account's account identifier, which is a unique identifier used to distinguish different users, such as a username or the user's application login account.
[0050] In a live streaming scenario, virtual items can be displayed in the virtual item display panel on the live streaming page based on user requests. When a target account wants to use a virtual item, it can initiate a display request through the live streaming application, allowing the application to access the virtual item display panel and show the corresponding virtual item for user use. In this embodiment, the specific virtual items that can be displayed will differ depending on the user's level or permissions. Therefore, the live streaming application sends the target account's virtual item display request to the server, which then distributes the virtual item corresponding to the target account's level or permissions.
[0051] In step S220, candidate virtual items that match the account identifier are obtained.
[0052] In this context, candidate virtual items are virtual items selected by the server from the database based on the target account's account identifier, matching the target account's level or permissions. In this embodiment, candidate virtual items have corresponding item identifiers, item types, and priorities.
[0053] Specifically, an item identifier is a unique marker used to distinguish different virtual items, such as the item name or item ID (Identity Document). Item type refers to the category or grouping of virtual items based on their function or attributes. For example, there are avatar frame virtual items used to decorate user avatars, and entrance effect virtual items used to decorate user entrance effects. For avatar frame virtual items, there may be various styles of avatar frames; therefore, all different styles of avatar frames can be classified as avatar frame virtual items, meaning that different styles of avatar frames share the same item type. Similarly, for other types of virtual items, each item type can include one or more different virtual items, and each different virtual item can be distinguished based on its corresponding item identifier. Priority refers to the level of virtual items within the same item type. Typically, higher-level virtual items are obtained by iterating through lower-level virtual items within the same item type.
[0054] Furthermore, due to differences in user levels or permissions, the specific virtual items that can be displayed will also differ, and user levels or permissions can be reflected through corresponding account identifiers. Therefore, in this embodiment, after the server receives a request from a target account to display virtual items, it can obtain candidate virtual items that match the account identifier based on the user identifier in the display request.
[0055] In step S230, based on the item type of the candidate virtual item, the candidate virtual item corresponding to the highest priority item identifier under each item type is obtained as the target virtual item.
[0056] The target virtual item is the virtual item that is ultimately displayed to the target account, selected from the candidate virtual items that match the account identifier. Specifically, the target virtual item is the highest-priority candidate virtual item of the same type.
[0057] In one scenario, due to the limited space of the virtual item display panel, it is difficult to display all matching virtual items when the user level is high. Therefore, for candidate virtual items of the same item type, only the candidate virtual item with the highest priority is displayed, thereby determining the candidate virtual item with the highest priority among the candidate virtual items of the same item type as the target virtual item.
[0058] In another scenario, since high-level virtual items are derived from iterations of low-level virtual items of the same item type, in order to enhance the fun of virtual items and improve user retention, when virtual items of a certain item type are iterated, the highest priority virtual item after the iteration can be sent to users with the corresponding permissions, thereby identifying the highest priority candidate virtual item of the same item type as the target virtual item.
[0059] In step S240, the target virtual item is returned to the client.
[0060] Specifically, after the server determines the target virtual item through the above steps, it can return the target virtual item to the client. This allows the client to display the corresponding target virtual item to the target account.
[0061] In the aforementioned method for pushing virtual items, a request to display virtual items from a target account is received. Candidate virtual items matching the account identifier are then obtained. Based on the item type of each candidate virtual item, the candidate virtual item corresponding to the highest-priority item identifier within that item type is selected as the target virtual item, which is then returned to the client. Since this embodiment determines the target virtual item to be sent to the user based on the corresponding item type and priority, compared to traditional technologies that manage the virtual item delivery logic through code, it avoids code redundancy and improves development efficiency.
[0062] In one exemplary embodiment, such as Figure 3 As shown, in step S220, candidate virtual items matching the account identifier are obtained, which may specifically include the following steps:
[0063] In step S222, an item identifier that matches the account identifier is queried in the first database.
[0064] The first database stores the correspondence between account identifiers and item identifiers of virtual items. In other words, the first database stores the association information of each user (i.e., account identifier) and the virtual items (different virtual items are distinguished by item identifiers) that match the user's level or permissions.
[0065] Therefore, in this embodiment, the server can query the first database based on the user identifier in the received display request to obtain the item identifier of the virtual item that matches the account identifier, that is, query the first database for the item identifier of the virtual item that corresponds to the user identifier in the display request.
[0066] In step S224, the item type and priority of the virtual item corresponding to the item identifier are queried in the second database to obtain candidate virtual items that match the account identifier.
[0067] The second database stores the correspondence between the item identifier, item type, and priority of each virtual item. Candidate virtual items are those selected by the server based on the target account's account identifier and matched with it.
[0068] In this embodiment, the server retrieves the item identifier of the virtual item that corresponds to the user identifier in the display request from the first database, and then retrieves the item type and priority information of the virtual item corresponding to the item identifier from the second database, and determines the information of the retrieved virtual item as a candidate virtual item that matches the account identifier.
[0069] In the above embodiments, by querying the first database for item identifiers that match the account identifier, and querying the second database for the item type and priority of the virtual item corresponding to the item identifier, candidate virtual items that match the account identifier are obtained. Since this embodiment stores user information and virtual item information in different databases, information maintenance is easier. Furthermore, because this embodiment configures item type and priority information for virtual items, compared to the traditional method of controlling the distribution logic of virtual items through code, code redundancy is avoided, and development efficiency is improved.
[0070] In one exemplary embodiment, such as Figure 4 As shown, in step S230, based on the item type of the candidate virtual item, the candidate virtual item corresponding to the highest priority item identifier under each item type is obtained as the target virtual item. Specifically, this may also include the following steps:
[0071] In step S232, based on the item type of the candidate virtual item, the item identifier and priority of the corresponding candidate virtual item under the same item type are obtained.
[0072] Specifically, for example, if the candidate virtual items matching the account identifier obtained according to the above method include A1, A2, B1, B2, and B3, where A1, A2, B1, B2, and B3 are the item identifiers of the candidate virtual items, and if the priorities of A1, A2, B1, B2, and B3 are 1, 2, 1, 2, and 3 respectively, and virtual items A1 and A2 belong to item type A, while B1, B2, and B3 belong to item type B.
[0073] For candidate virtual items A1, A2, B1, B2, and B3 that match the account identifier, the item types involved include A and B. Therefore, for item type A, the corresponding candidate virtual item identifiers are A1 and A2, where A1 has a priority of 1 and A2 has a priority of 2. For item type B, the corresponding candidate virtual item identifiers are B1, B2, and B3, where B1 has a priority of 1, B2 has a priority of 2, and B3 has a priority of 3. This yields the item identifiers and priorities of the corresponding candidate virtual items for the same item type.
[0074] In step S234, the candidate virtual item corresponding to the highest priority item identifier under the item type is obtained as the target virtual item corresponding to the item type.
[0075] Specifically, using the example above, for item type A, which includes candidate virtual items A1 and A2, and since the priority 2 of A2 is higher than the priority 1 of A1, the candidate virtual item corresponding to the highest priority item identifier under item type A is A2. Similarly, for item type B, the candidate virtual item corresponding to the highest priority item identifier under item type B is B3. Therefore, the candidate virtual item corresponding to the highest priority item identifier A2 under item type A can be used as the target virtual item corresponding to item type A. The candidate virtual item corresponding to the highest priority item identifier B3 under item type B can be used as the target virtual item corresponding to item type B.
[0076] In step S236, the target virtual item corresponding to each item type is obtained according to each item type of the candidate virtual item.
[0077] Specifically, for each item type of the candidate virtual item, the target virtual item corresponding to each item type is obtained. For example, if there are two item types, A and B, among the candidate virtual items, the target virtual item corresponding to item type A and the target virtual item corresponding to item type B are obtained respectively, thus obtaining the final target virtual item that can be displayed to the target account.
[0078] In the above embodiments, based on the item type of the candidate virtual items, the item identifier and priority of the corresponding candidate virtual items under the same item type are obtained. The candidate virtual item corresponding to the item identifier with the highest priority under the item type is obtained as the target virtual item corresponding to the item type. For each item type corresponding to the candidate virtual items, the target virtual item corresponding to each item type is obtained separately. Since this embodiment obtains the final target virtual item that can be displayed to the target account based on the item type and priority of the candidate virtual items, compared with the traditional technology of controlling the distribution logic of virtual items through code, it can avoid code redundancy, improve development efficiency, and make the distribution process flexible and controllable.
[0079] In one exemplary embodiment, such as Figure 5 As shown, in step S220, before obtaining candidate virtual items matching the account identifier, the above method may further include:
[0080] In step S510, account configuration information is received.
[0081] The account configuration information includes an account identifier and the virtual items assigned to that account identifier. Specifically, each virtual item has a corresponding item identifier and item configuration information. The item configuration information includes the effective time of the corresponding virtual item. The effective time is used to manage the lifecycle of the virtual item; the corresponding virtual item is only valid when the effective time arrives.
[0082] In this embodiment, to effectively manage the correspondence between users and virtual items, virtual items corresponding to their levels or permissions can be assigned to all user accounts of the application; that is, user accounts are configured through the server. Specifically, the server can receive the corresponding account configuration information and process it based on subsequent steps.
[0083] In step S520, when the data update time arrives, account configuration information whose effective time is greater than the data update time is obtained.
[0084] The data update time is the set start time for a scheduled task used to automatically retrieve and update data. Since the corresponding virtual item is only valid when the effective time arrives, meaning the corresponding account configuration information is valid only then, in this embodiment, valid account configuration information can be retrieved from the account configuration information periodically based on the scheduled task. Specifically, if the scheduled task starts every half hour, then based on the initial time of the scheduled task, it starts every half hour, meaning the data update time arrives every half hour.
[0085] In this embodiment, when the data update time arrives, the account configuration information of virtual items with an effective time greater than the data update time is filtered from all account configuration information of the application. That is, the account configuration information corresponding to all currently valid virtual items is obtained relative to the data update time.
[0086] In step S530, a first database is generated based on the obtained account configuration information.
[0087] Specifically, based on the account configuration information obtained above, a first database is generated, which stores the account configuration information corresponding to currently valid virtual items.
[0088] In the above embodiments, by receiving account configuration information, when the data update time arrives, account configuration information with an effective time greater than the data update time is obtained, and then a first database is generated based on the obtained account configuration information. This embodiment generates the first database based on a scheduled task that retrieves the account configuration information corresponding to currently valid virtual items, thereby effectively improving the efficiency of finding candidate virtual items that match the user. Compared with searching in the entire dataset, this embodiment has a faster response speed.
[0089] In an exemplary embodiment, the aforementioned item configuration information further includes the expiration time of the virtual item. The method then further includes: when the data update time arrives, obtaining account configuration information whose expiration time is greater than the data update time, and updating the first database based on the obtained account configuration information.
[0090] Specifically, the lifecycle of virtual items can also be managed based on their corresponding expiration time. For example, when the expiration time arrives, the corresponding virtual item becomes invalid. Therefore, in this embodiment, when the expiration time arrives, the corresponding virtual item is in an invalid state, meaning that the corresponding account configuration information contains invalid virtual items.
[0091] Therefore, in this embodiment, when the data update time arrives, account configuration information with an expiration time greater than the data update time can also be obtained. This means obtaining the account configuration information corresponding to virtual items currently in an invalid state, and updating the first database accordingly. For example, deleting invalid virtual items from the account configuration information stored in the first database removes the association between invalid virtual items and their corresponding account identifiers. This effectively manages the account configuration information in the first database, ensuring its accuracy.
[0092] In one exemplary embodiment, such as Figure 6 As shown, in step S220, before obtaining candidate virtual items matching the account identifier, the above method may further include:
[0093] In step S610, a request to create a virtual item is obtained.
[0094] The creation request for a virtual item refers to the request to create a virtual item. The creation request includes the item identifier and corresponding item configuration information for the virtual item. Specifically, the item identifier is a marker used to distinguish different virtual items, while the configuration information can be a description of the virtual item, including but not limited to the item name and the virtual item's lifecycle (i.e., effective time, expiration time, etc.).
[0095] In step S620, when a request for associating the type of a virtual item is received, a second database is generated.
[0096] A type association request refers to a request that associate a virtual item with a specific item type. Specifically, a type association request includes the item type to be associated and its corresponding priority.
[0097] In this embodiment, when the server receives a type association request for a virtual item, it obtains the requested item type and its corresponding priority from the request, establishes a correspondence between the virtual item's identifier, the requested item type, priority, and corresponding item configuration information, and then generates a second database based on this correspondence. That is, the second database stores the correspondence between the virtual item's identifier, the requested item type, priority, and corresponding item configuration information.
[0098] In the above embodiments, by obtaining a request to create a virtual item, and upon receiving a request to associate a virtual item with its type, a correspondence is established between the virtual item's identifier, the requested item type, priority, and corresponding item configuration information. A second database is then generated based on this correspondence. This embodiment, by associating the virtual item's identifier and configuration information with its item type and priority, and generating a second database based on this association, enables effective management of virtual items. Compared to traditional technologies that manage the distribution logic of virtual items through code, this avoids code redundancy, improves development efficiency, makes the distribution process flexible and controllable, and is easy to maintain.
[0099] In one exemplary embodiment, the method may further include: upon receiving a modification request for a virtual item, updating the second database according to the modification request. The modification request includes an item identifier for the virtual item, and a modification request for at least one of the following: item type, priority, and item configuration information corresponding to the item identifier. In other words, when the server receives a modification request for at least one of the following: item type, priority, and item configuration information for a virtual item, it updates the corresponding information in the second database according to the modification request, thereby effectively managing the virtual item information in the second database and ensuring the accuracy of the virtual item information in the second database.
[0100] It should be understood that, although Figures 1-6 The steps in the flowchart are shown sequentially as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order in which these steps are executed, and they can be performed in other orders. Figures 1-6 At least some of the steps in the process may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but may be executed at different times. The execution order of these steps or stages is not necessarily sequential, but may be executed in turn or alternately with other steps or at least some of the steps or stages in other steps.
[0101] It is understood that the same / similar parts between the various embodiments of the methods described above in this specification can be referred to each other. Each embodiment focuses on the differences from other embodiments, and relevant parts can be referred to the description of other method embodiments.
[0102] Figure 7 This is a block diagram illustrating a virtual item delivery device according to an exemplary embodiment. (Refer to...) Figure 7The device includes a display request receiving module 702, a candidate virtual item acquisition module 704, a target virtual item determination module 706, and a return module 708.
[0103] The display request receiving module 702 is configured to receive a display request for virtual items from a target account, wherein the display request carries the account identifier of the target account;
[0104] The candidate virtual item acquisition module 704 is configured to acquire candidate virtual items that match the account identifier, wherein the candidate virtual items have corresponding item identifiers, item types, and priorities;
[0105] The target virtual item determination module 706 is configured to execute the target virtual item determination module, and to obtain the candidate virtual item corresponding to the highest priority item identifier under each item type as the target virtual item according to the item type of the candidate virtual item;
[0106] Return module 708 is configured to return the target virtual item to the client, the target virtual item being used to instruct the client to display the target virtual item to the target account.
[0107] In an exemplary embodiment, the candidate virtual item acquisition module is configured to perform the following: querying a first database for item identifiers that match the account identifier, the first database storing a correspondence between account identifiers and item identifiers of virtual items; querying a second database for the item type and priority of the virtual item corresponding to the item identifier, to obtain candidate virtual items that match the account identifier, the second database storing a correspondence between the item identifier of the virtual item, its item type, and its priority.
[0108] In an exemplary embodiment, the target virtual item determination module is configured to perform: obtaining the item identifier and priority of the corresponding candidate virtual item under the same item type according to the item type of the candidate virtual item; obtaining the candidate virtual item corresponding to the item identifier with the highest priority under the item type as the target virtual item corresponding to the item type; and obtaining the target virtual item corresponding to each item type according to each item type of the candidate virtual item.
[0109] In an exemplary embodiment, the apparatus further includes a first database generation module configured to perform: receiving account configuration information, the account configuration information including an account identifier and a virtual item assigned to the account identifier, the virtual item having a corresponding item identifier and item configuration information, the item configuration information including the effective time of the virtual item; when a data update time arrives, acquiring account configuration information whose effective time is greater than the data update time; and generating the first database based on the acquired account configuration information.
[0110] In one exemplary embodiment, the item configuration information further includes the expiration time of the virtual item; the device further includes a first database update module configured to perform: when the data update time arrives, acquiring account configuration information whose expiration time is greater than the data update time; and updating the first database according to the acquired account configuration information.
[0111] In one exemplary embodiment, the apparatus further includes a second database generation module configured to perform: obtaining a creation request for a virtual item, the creation request including an item identifier of the virtual item and corresponding item configuration information; when receiving a type association request for the virtual item, the type association request including the requested item type and corresponding priority; establishing a correspondence between the item identifier of the virtual item, the requested item type, priority, and corresponding item configuration information, and generating the second database based on the correspondence.
[0112] In one exemplary embodiment, the apparatus further includes a second database update module configured to perform: when a modification request for the virtual item is received, updating the second database according to the modification request, wherein the modification request includes a modification request for the virtual item's item identifier, and at least one of the following: item type, priority, and item configuration information corresponding to the item identifier.
[0113] Regarding the apparatus in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated upon here.
[0114] Figure 8 This is a block diagram illustrating an electronic device S00 for pushing virtual items, according to an exemplary embodiment. For example, the electronic device S00 can be a server. (Refer to...) Figure 8The electronic device S00 includes a processing component S20, which further includes one or more processors, and memory resources represented by a memory S22 for storing instructions, such as application programs, that can be executed by the processing component S20. The application programs stored in the memory S22 may include one or more modules, each corresponding to a set of instructions. Furthermore, the processing component S20 is configured to execute instructions to perform the methods described above.
[0115] The electronic device S00 may further include: a power supply component S24 configured to perform power management of the electronic device S00, a wired or wireless network interface S26 configured to connect the electronic device S00 to a network, and an input / output (I / O) interface S28. The electronic device S00 can operate on an operating system stored in memory S22, such as Windows Server, Mac OS X, Unix, Linux, FreeBSD, or similar.
[0116] In an exemplary embodiment, a computer-readable storage medium including instructions is also provided, such as a memory S22 including instructions, which can be executed by a processor of an electronic device S00 to perform the above-described method. The storage medium can be a computer-readable storage medium, for example, a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device, etc.
[0117] In an exemplary embodiment, a computer program product is also provided, the computer program product including instructions that can be executed by a processor of an electronic device S00 to perform the above method.
[0118] It should be noted that the above-mentioned apparatus, electronic equipment, computer-readable storage medium, computer program product, etc., may also include other implementation methods according to the description of the method embodiments. For specific implementation methods, please refer to the description of the relevant method embodiments, which will not be elaborated here.
[0119] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the claims.
[0120] It should be understood that this disclosure is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this disclosure is limited only by the appended claims.
Claims
1. A method for pushing virtual items, characterized in that, The method includes: Receive a request from a target account to display virtual items, wherein the display request carries the account identifier of the target account; The process involves: obtaining candidate virtual items that match the account identifier, each candidate virtual item having a corresponding item identifier, item type, and priority; obtaining candidate virtual items that match the account identifier includes: querying a first database for item identifiers that match the account identifier, the first database storing the correspondence between account identifiers and item identifiers of virtual items; querying a second database for the item type and priority of the virtual item corresponding to the item identifier, to obtain candidate virtual items that match the account identifier, the second database storing the correspondence between the item identifier, item type, and priority of virtual items; Based on the item type of the candidate virtual item, obtain the item identifier and priority of the corresponding candidate virtual item under the same item type; Obtain the candidate virtual item corresponding to the highest priority item identifier under the item type, and use it as the target virtual item corresponding to the item type; Based on each item type corresponding to the candidate virtual items, obtain the target virtual item corresponding to each item type; The target virtual item is returned to the client, which instructs the client to display the target virtual item to the target account.
2. The method according to claim 1, characterized in that, Before obtaining candidate virtual items that match the account identifier, the method further includes: Receive account configuration information, which includes an account identifier and virtual items assigned to the account identifier. The virtual items have corresponding item identifiers and item configuration information, which includes the effective time of the virtual items. When the data update time arrives, retrieve the account configuration information whose effective time is greater than the data update time; The first database is generated based on the obtained account configuration information.
3. The method according to claim 2, characterized in that, The item configuration information also includes the expiration time of the virtual item; the method further includes: When the data update time arrives, obtain the account configuration information whose expiration time is greater than the data update time; The first database is updated based on the obtained account configuration information.
4. The method according to claim 1, characterized in that, Before obtaining candidate virtual items that match the account identifier, the method further includes: Obtain a creation request for a virtual item, wherein the creation request includes the item identifier of the virtual item and the corresponding item configuration information; When a type association request for the virtual item is received, the type association request includes the item type to be associated and the corresponding priority; Establish a correspondence between the item identifier, the requested associated item type, priority, and the corresponding item configuration information of the virtual item, and generate the second database based on the correspondence.
5. The method according to claim 4, characterized in that, The method further includes: When a modification request for the virtual item is received, the second database is updated according to the modification request. The modification request includes the item identifier of the virtual item, and a modification request for at least one of the following information: item type, priority, and item configuration information corresponding to the item identifier.
6. A device for pushing virtual items, characterized in that, include: The display request receiving module is configured to receive a display request for virtual items from a target account, wherein the display request carries the account identifier of the target account; The candidate virtual item acquisition module is configured to acquire candidate virtual items that match the account identifier, wherein the candidate virtual items have corresponding item identifiers, item types, and priorities; the candidate virtual item acquisition module is further configured to: query a first database for item identifiers that match the account identifier, wherein the first database stores the correspondence between account identifiers and item identifiers of virtual items; and query a second database for the item type and priority of the virtual items corresponding to the item identifiers, thereby obtaining candidate virtual items that match the account identifier, wherein the second database stores the correspondence between the item identifiers, item types, and priorities of virtual items; The target virtual item determination module is configured to: obtain, based on the item type of the candidate virtual items, the candidate virtual item corresponding to the highest priority item identifier under each item type as the target virtual item; the target virtual item determination module is configured to: obtain, based on the item type of the candidate virtual items, the item identifier and priority of the corresponding candidate virtual items under the same item type; obtain the candidate virtual item corresponding to the highest priority item identifier under the item type as the target virtual item corresponding to the item type; and obtain the target virtual item corresponding to each item type according to each item type of the candidate virtual items. The return module is configured to return the target virtual item to the client, the target virtual item being used to instruct the client to display the target virtual item to the target account.
7. The apparatus according to claim 6, characterized in that, The device further includes a first database generation module, configured to perform: Receive account configuration information, which includes an account identifier and virtual items assigned to the account identifier. The virtual items have corresponding item identifiers and item configuration information, which includes the effective time of the virtual items. When the data update time arrives, retrieve the account configuration information whose effective time is greater than the data update time; The first database is generated based on the obtained account configuration information.
8. The apparatus according to claim 7, characterized in that, The item configuration information also includes the expiration time of the virtual item; the device also includes a first database update module, configured to perform: When the data update time arrives, obtain the account configuration information whose expiration time is greater than the data update time; The first database is updated based on the obtained account configuration information.
9. The apparatus according to claim 6, characterized in that, The device also includes a second database generation module, configured to perform: Obtain a creation request for a virtual item, wherein the creation request includes the item identifier of the virtual item and the corresponding item configuration information; When a type association request for the virtual item is received, the type association request includes the item type to be associated and the corresponding priority; Establish a correspondence between the item identifier, the requested associated item type, priority, and the corresponding item configuration information of the virtual item, and generate the second database based on the correspondence.
10. The apparatus according to claim 9, characterized in that, The device also includes a second database update module configured to perform: When a modification request for the virtual item is received, the second database is updated according to the modification request. The modification request includes the item identifier of the virtual item, and a modification request for at least one of the following information: item type, priority, and item configuration information corresponding to the item identifier.
11. An electronic device, characterized in that, include: processor; Memory used to store the processor's executable instructions; The processor is configured to execute the instructions to implement the method for pushing virtual items as described in any one of claims 1 to 5.
12. A computer-readable storage medium, characterized in that, When the instructions in the computer-readable storage medium are executed by the processor of the electronic device, the electronic device is able to perform the method for pushing virtual items as described in any one of claims 1 to 5.