Data query method and device, server and storage medium
By recording user activity participation information in the server, and querying activity interaction information only for the activities participated in by the target user, the problem of low data query efficiency in the existing technology is solved, and more efficient data query is achieved.
Patent Information
- Application Number
- CN202511470277.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-15
- Publication Date
- 2026-02-06
AI Technical Summary
In existing technologies, when a server receives an activity query request from a terminal, it needs to traverse all activities to confirm the user's interaction with each activity, resulting in low data query efficiency.
After receiving an activity query request from a terminal, the server first determines which activities the target user has participated in based on the recorded activity participation information of the target user, and then queries the activity interaction information only for these activities to reduce the amount of data query.
This improves the server's efficiency in retrieving data from activity query requests and reduces the amount of data retrieval required by the server.
Smart Images

Figure CN121478833A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data query technology, and in particular to a data query method, apparatus, server and storage medium. Background Technology
[0002] To attract users, the platform launches various activities, and the platform's server notifies the terminal of these activities so that the terminal can display the activities launched by the platform to the user.
[0003] When displaying an activity interface to a user, the terminal needs to differentiate the activities the user has already participated in from other activities. Furthermore, for activities the user has already participated in, the terminal can further differentiate the display based on the user's interaction with the activity (e.g., whether reminders were sent or rewards were distributed). Therefore, before rendering the activity interface, the terminal needs to send an activity query request to the server to obtain information about the user's interaction with the activity.
[0004] In existing technologies, each time a server receives an activity query request from a terminal, it needs to traverse all the activities that the terminal wants to display to confirm the user's interaction with each activity, resulting in very low data query efficiency. Summary of the Invention
[0005] The purpose of this application is to provide a data query method, apparatus, server, and storage medium, which improves the efficiency of server data query to a certain extent. The specific technical solution is as follows:
[0006] In a first aspect, embodiments of this application provide a data query method applied to a server, the method comprising:
[0007] Receive the target user's activity query request sent by the terminal;
[0008] From the recorded activity participation information of each user, the target activity participation information of the target user is obtained, wherein the user's activity participation information is used to record the activities that the user has participated in, and the activities that the user has participated in are: the activities that the user has registered for;
[0009] Based on the target activity participation information, the activities that the target user has participated in are selected from the various activities to be displayed on the terminal and designated as target activities. The activity interaction information between the target user and the target activity is determined, wherein the activity interaction information is used to record the interaction between the user and the activity.
[0010] The activity interaction information corresponding to the target activity is returned to the terminal, so that the terminal can render the activity display interface based on the activity interaction information corresponding to the target activity.
[0011] Optionally, after returning the activity interaction information corresponding to the target activity to the terminal, the method further includes:
[0012] The terminal receives an activity participation request from the target user, wherein the activity participation request includes: an activity identifier of the first activity that the target user has registered for based on the activity display interface;
[0013] The activity identifier is added to the target activity participation information to record that the target user has participated in the first activity.
[0014] Optionally, the target activity participation information stored in the server's cache includes: the target user's activity interaction information with the activities they have already participated in;
[0015] Determining the activity interaction information between the target user and the target activity includes:
[0016] For each target activity, the activity interaction information between the target user and the target activity is determined based on the target user's participation information in the target activity.
[0017] Optionally, the server's database records the correspondence between user identifiers and activity interaction information, and the method further includes:
[0018] When a change is detected in the activity interaction information recorded in the database, the activity participation information corresponding to the activity interaction information is determined in the cache based on the user identifier corresponding to the activity interaction information.
[0019] Update the activity participation information corresponding to the activity interaction information based on the changes in the activity interaction information.
[0020] Optionally, the server's database records the correspondence between user identifiers and activity interaction information;
[0021] Determining the activity interaction information between the target user and the target activity includes:
[0022] For each target activity, based on the user identifier of the target user, the activity interaction information between the target user and the target activity is queried in the database.
[0023] Optional,
[0024] The step of querying the database for the activity interaction information between the target user and the target activity based on the target user's user identifier includes:
[0025] Based on the user identifier of the target user, a single query is performed in the database to obtain the activity interaction information between the target user and the target activity, wherein the activity interaction information corresponding to the target user includes various types of interaction sub-information;
[0026] or,
[0027] The database includes: sub-databases, each sub-database recording: for each activity, the correspondence between a user identifier and a type of interaction sub-information; the step of querying the activity interaction information between the target user and the target activity in the database based on the target user's user identifier includes:
[0028] According to the query logic relationship of each sub-database, based on the user identifier of the target user, various types of interactive sub-information corresponding to the target user are queried sequentially in each sub-database. The query logic relationship of each sub-database includes: the query order between each sub-database, and the conditions that the query results of the preceding sub-database must meet when data is queried in the subsequent sub-database.
[0029] The various types of interaction information obtained from the query are identified as the activity interaction information between the target user and the target activity.
[0030] Optionally, the database is a remote dictionary server Redis database.
[0031] Secondly, embodiments of this application provide a data query device applied to a server, the device comprising:
[0032] The request receiving module is used to receive activity query requests from the target user sent by the terminal.
[0033] The activity participation information determination module is used to obtain the target activity participation information of the target user from the recorded activity participation information of each user. The activity participation information of the user is used to record the activities that the user has participated in. The activities that the user has participated in are: the activities that the user has registered for.
[0034] The activity interaction information determination module is used to filter out the activities that the target user has participated in from the various activities to be displayed on the terminal based on the target activity participation information, and to determine the activity interaction information between the target user and the target activity, wherein the activity interaction information is used to record the interaction between the user and the activity;
[0035] The information sending module is used to return the activity interaction information corresponding to the target activity to the terminal, so that the terminal can render the activity display interface based on the activity interaction information corresponding to the target activity.
[0036] Thirdly, embodiments of this application provide a server, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus;
[0037] Memory, used to store computer programs;
[0038] When a processor executes a program stored in memory, it implements any of the steps described in the first aspect above.
[0039] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program, which, when executed by a processor, implements any of the steps described in the first aspect above.
[0040] The solution provided in this application embodiment allows the server to first determine which activities the target user has participated in based on the recorded activity participation information of the target user after receiving the activity query request from the terminal. Then, among the various activities to be displayed on the terminal, the server can query the activity interaction information only for the activities in which the target user participated, thereby reducing the amount of data queryed by the server and improving the efficiency of the server in querying data for activity query requests. Attached Figure Description
[0041] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below.
[0042] Figure 1 A flowchart illustrating a data query method provided in an embodiment of this application;
[0043] Figure 2 A schematic diagram of the structure of a data query device provided in an embodiment of this application;
[0044] Figure 3 This is a schematic diagram of a server structure provided in an embodiment of this application. Detailed Implementation
[0045] The technical solutions in the embodiments of this application will now be described with reference to the accompanying drawings.
[0046] To improve the efficiency of server data query, this application provides a data query method, apparatus, server, computer-readable storage medium, and computer program product. The data query method provided in this application is described below.
[0047] like Figure 1 As shown, a data query method, applied to a server, includes:
[0048] S101, Receive the target user's activity query request sent by the terminal.
[0049] S102, obtain the target user's target activity participation information from the recorded activity participation information of each user.
[0050] Among them, the user's activity participation information is used to record the activities that the user has participated in. The activities that the user has participated in are those that the user has registered for.
[0051] S103, based on the target activity participation information, filter out the activities that the target user has participated in from the various activities to be displayed on the terminal, and determine the activity interaction information between the target user and the target activity.
[0052] Among them, the activity interaction information is used to record the user's interaction with the activity.
[0053] S104, return the activity interaction information corresponding to the target activity to the terminal, so that the terminal can render the activity display interface based on the activity interaction information corresponding to the target activity.
[0054] In the solution provided in this application embodiment, after receiving the target user's activity query request sent by the terminal, the server can first determine which activities the target user has participated in based on the recorded activity participation information of the target user. Then, among the various activities to be displayed on the terminal, the server can query the activity interaction information only for the activities in which the target user participated, thereby reducing the amount of data queryed by the server and improving the efficiency of the server in querying data for activity query requests.
[0055] To attract users, the platform launches various activities. The platform's server notifies the terminals of these activities, enabling the terminals to display these activities to users based on the activity display interface. The terminals can have preset activity display conditions (e.g., the user clicks on the activity display component on the terminal, or the user opens the terminal). When the terminal detects that the activity display conditions are met, it can determine that the activity display interface should be shown to the user.
[0056] However, when displaying the activity showcase interface to the user, the terminal needs to differentiate between activities the user has participated in and those the user has not. Furthermore, for activities the user has participated in, the terminal needs to further differentiate the display based on the user's interaction with the activity. Based on this, before displaying the activity showcase interface, the terminal can generate an activity query request carrying the user identifier of the currently logged-in target user, and then send this request to the server. This allows the server to query which activities the target user has participated in, and to query the target user's interaction with those activities, thus determining the target user's corresponding activity interaction information.
[0057] The specific type of activity interaction information can be set according to the specific use scenario. This application embodiment does not make specific limitations on this. For example, activity interaction information can be: whether the user has successfully participated in the activity, whether the user is reminded of the activity, whether the activity reward is issued to the user, the type of reward issued to the user and / or the number of rewards issued to the user, etc.
[0058] The server's cache can record each user's activity participation information. This information records which activities the user has participated in, i.e., which activities the user has registered for. For example, the server's cache records the activity participation information of user A and user B. User A's activity participation information records that user A has participated in activities 1, 4, and 7, while user B's activity participation information records that user B has participated in activities 2, 4, and 5.
[0059] Based on this, after receiving the target user's activity query request sent by the terminal, the server can obtain the target user's target activity participation information from the activity participation information of each user recorded in its own cache, according to the user identifier of the target user carried in the activity query request, and then determine which activities the target user has participated in based on the target activity participation information.
[0060] In addition, the server can maintain a correspondence between terminals and activities, that is, it can pre-record what kind of activities are pushed to each terminal for display. Based on this, for a terminal that sends an activity query request, the server can determine the various activities to be displayed for that terminal according to the terminal type, terminal identifier, etc., and in accordance with the correspondence between terminals and activities maintained above.
[0061] After determining which activities the target user has participated in and which activities the terminal needs to display, the server can filter out the activities the target user has participated in from the various activities to be displayed on the terminal, and designate the filtered activities as the target activities. In other words, the target activities are those the target user has participated in and those the terminal wants to display. Furthermore, the server can determine the interaction information between the target user and the target activity specifically for the target activity. The specific method for determining the interaction information between the target user and the target activity will be described in detail in subsequent embodiments and will not be repeated here.
[0062] For example, after receiving an activity query request from a terminal, the server determines that the target user has participated in activities 1, 8, 23, and 36 based on the target user's identifier and the recorded activity participation information of each user carried in the activity query request. Furthermore, the server determines that the activities to be displayed on the terminal are activities 1 through 20 based on the terminal type or terminal identifier, etc.
[0063] Since among the various activities 1-20 to be displayed on the terminal, activities 1 and 8 are activities that the target user has already participated in, the server can use activities 1 and 8 as target activities. Thus, the server can determine the activity interaction information only for the target activities, that is, only determine the activity interaction information between the target user and activity 1, and determine the activity interaction information between the target user and activity 8, without having to traverse the activity interaction information between the target user and activities 1-20.
[0064] Once the server retrieves the activity interaction information corresponding to the target activity, it can return it to the terminal. This allows the terminal to render the activity identifier for each target activity on the activity display interface based on the corresponding interaction information. Additionally, it can render the activity identifiers for activities the target user has not participated in, using a default rendering method. This allows for the differentiation between activities the target user has participated in and those they haven't, and also enables the differentiated display of the target activities the user has participated in based on different interaction patterns.
[0065] Continuing with the above example, suppose the interaction information between the target user and Activity 1 is "The user successfully participated in Activity 1, but the reward for Activity 8 has not been issued to the user", and the interaction information between the target user and Activity 8 is "The user successfully participated in Activity 8, and the reward for Activity 8 has been issued to the user".
[0066] After the server sends the activity interaction information corresponding to Activity 1 and Activity 8 to the terminal, the terminal can render the activity identifier of Activity 1 in "yellow", the activity identifier of Activity 8 in "green", and the default rendering color of "gray" for the activities that the target user has not participated in (Activities 2-7, Activities 9-20) to be displayed on the terminal. This distinguishes between the activities that the target user has participated in "Activities 1 and 8" and the activities that he has not participated in "Activities 2-7 and Activities 9-20", and also distinguishes between the activities that the target user has participated in "Activities 1" and "Activities 8" based on different interaction situations.
[0067] In the solution provided in this application embodiment, after receiving the target user's activity query request sent by the terminal, the server can first determine which activities the target user has participated in based on the recorded activity participation information of the target user. Then, among the various activities to be displayed on the terminal, the server can query the activity interaction information only for the activities in which the target user participated, thereby reducing the amount of data queryed by the server and improving the efficiency of the server in querying data for activity query requests.
[0068] The following describes a method for updating "Users have participated in activities" provided by an embodiment of this application.
[0069] After the terminal renders the activity display interface based on the activity interaction information returned by the server, the target user can view the detailed information of the activities they have participated in (e.g., whether the participation was successful, whether the reward was issued, etc.) on the activity display interface, and can also register for new activities on the activity display interface.
[0070] When a target user registers for a new activity (the first activity) based on the activity display interface, the terminal can generate an activity participation request that includes the "activity identifier of the first activity" and the "user identifier of the target user" and send the activity participation request to the server.
[0071] Because the user identifier and activity identifier in the activity participation request represent "the target user has registered for the first activity", after receiving the activity participation request, the server can first determine the activity participation information corresponding to the user identifier in the activity participation request from the various activity participation information stored in the cache, that is, the target activity participation information, and then add the activity identifier in the activity participation request to the target activity participation information to record that the target user has participated in the first activity.
[0072] The solution provided in this application embodiment is that after the server sends activity interaction information to the terminal to enable the terminal to render and display the activity display interface, when it receives an activity participation request from the target user based on the activity display interface, it can automatically and in real time update the activities that the target user has participated in according to the user identifier and activity identifier in the activity participation request, so as to ensure that the correct activity interaction information can be returned after receiving the target user's activity query request in the future.
[0073] The following will introduce two specific forms of "activity participation information" stored in the server's cache and the corresponding methods for "determining activity interaction information".
[0074] I. User activity participation information includes: the second activity that the user has participated in and the user's interaction information with the second activity. In other words, user activity participation information includes the user's interaction information with the activities they have participated in.
[0075] 1. How to determine the interactive information of the activity.
[0076] When the "activity participation information" is data in the above format, the server can determine the activity interaction information between the target user and the target activity directly based on the target user's target activity participation information for each target activity.
[0077] For example, the target user's participation information in the target activities stored in the server's cache is shown in Table 1. This includes: the second activities the user has participated in are Activity 1, Activity 3, and Activity 4, respectively; and the user's interaction information with each second activity is: "Successfully participated, no reminder, no reward issued" for Activity 1; "Successfully participated, reminded, no reward issued" for Activity 3; and "Successfully participated, reminded, reward issued" for Activity 4. The server determines the activities to be displayed on the terminal as Activity 1, Activity 2, and Activities 5-10 based on the current terminal's terminal type, terminal identifier, etc.
[0078] Based on this, the server can determine that the target user has participated in Activities 1, 3, and 4 according to the target activity participation information shown in Table 1. Therefore, it can filter out Activity 1 from the various activities (Activity 1, Activity 2, Activities 5-10) to be displayed on the terminal, thus identifying Activity 1 as the target activity. Then, the server can determine the corresponding activity interaction information for Activity 1 as "Successfully participated, No reminder, No reward issued" based on the target activity participation information shown in Table 1.
[0079] Table 1
[0080]
[0081] It should be noted that, in this embodiment of the application, for a specific activity, "participated" means that the user has registered for the activity, but may subsequently pass the review and successfully participate in the activity, or may fail to participate due to reasons such as the user failing the activity review. That is, as long as the user registers for the activity, the user is considered to have participated in the activity. "Successfully participated" means that after registering for the activity, the user has passed the activity review and other conditions and has successfully participated in the activity.
[0082] 2. How to update activity participation information.
[0083] In this embodiment, the activity participation information includes "participated in the activity (e.g., column 1 of Table 1)" and "activity interaction information of the participated activity (e.g., columns 2-4 of Table 1)". The update methods of these two types of information will be described below.
[0084] Regarding the "participated in activity" information.
[0085] When the server receives a user's request to participate in an activity, it can update the activity based on the aforementioned method of "updating the user's participation in the activity according to the request to participate in the activity", which will not be elaborated here.
[0086] The activity participation information includes "activity interaction information of those who have participated in the activity".
[0087] In addition to the activity participation information stored in the server's cache, which may include activity interaction information, the server's database may also record the correspondence between user identifiers and activity interaction information. That is, both the server's cache and database store user interaction information.
[0088] Based on this, the server can monitor the activity interaction information recorded in the database. When a change is detected in the activity interaction information recorded in the database, the server determines the activity participation information corresponding to the activity interaction information in the cache according to the user identifier corresponding to the activity interaction information. Then, based on the change of the activity interaction information, the server updates the activity participation information corresponding to the activity interaction information, specifically updating the "activity interaction information" in the activity participation information.
[0089] For example, when the terminal displays the activity display interface to the target user, it sends a request to the server for the target user to participate in Activity 2 based on the target user's registration operation. At the same time, it reminds the target user about Activity 1 and sends a notification message to the server after reminding the user that "Activity 1 has been reminded".
[0090] Based on this, on the one hand, after receiving the target user's request to participate in Activity 2, the server can add "Activity 2" to the activity interaction information shown in Table 1 to record that the target user has participated in Activity 2. In addition, the activity interaction information of "Activity 2" can be set to a default option, that is, all of them can be set to "No".
[0091] On the other hand, based on the "Activity 1 has been reminded" notification sent by the terminal, the server updates the activity interaction information corresponding to the target user's user identifier in the database, changing the reminder status of Activity 1 to "Reminded". In this case, the activity participation information update module in the server can detect the change in the activity interaction information corresponding to the target user's user identifier in the database. Therefore, the activity participation information update module in the server can first determine the activity participation information corresponding to the target user's user identifier in the cache, i.e., the target activity participation information shown in Table 1. Then, based on the changes in the activity interaction information in the database, it updates the activity interaction information corresponding to "Activity 1" in the target activity participation information shown in Table 1, that is, updates the reminder status of "Activity 1" in Table 1 to "Reminded". In other words, the server can synchronously update the "activity interaction information" in the cached activity participation information based on the changes in the "activity interaction information" stored in the database.
[0092] Through the above two updates, the server can obtain the updated activity participation information shown in Table 2.
[0093] Table 2
[0094]
[0095] In this embodiment, the server can record the second activity that the user has participated in and the user's interaction information with the second activity in the user's activity participation information in real time. In this way, when the server receives the activity query request of the target user, it can return the activity interaction information to the terminal based only on the target user's activity participation information. That is, the server can respond to the activity query request with a single query, thereby greatly reducing the amount of data querying by the server and further improving the efficiency of the server in querying data for activity query requests.
[0096] Second, the user's activity participation information only includes: the second activity that the target user has participated in, but the server's database records: the correspondence between user identifiers and activity interaction information.
[0097] 1. How to determine the interactive information of the activity.
[0098] When the "activity participation information" is data in the above format, when the server determines the activity interaction information between the target user and the target activity, it can query the activity interaction information corresponding to the target user's user identifier in the correspondence between user identifiers and activity interaction information recorded in the server's database for each target activity.
[0099] For example, the target user's (User A) target activity participation information stored in the server's cache includes: the user has participated in each of the secondary activities, namely Activity 1, Activity 3, and Activity 4. The server determines the activities to be displayed on the terminal as Activity 1, Activity 2, and Activities 5-10 based on the current terminal's terminal type, terminal identifier, etc.
[0100] Based on this, the server can identify Activity 1 as the activity the target user has participated in from the various activities (Activity 1, Activity 2, Activities 5-10) to be displayed on the terminal, and thus determine the target activity as Activity 1. Then, for Activity 1, the server can query the correspondence between the user identifier and the activity interaction information recorded in the server's database as shown in Table 3, and obtain the activity interaction information between the target user and Activity 1 as "successfully participated, no reminder was given, no reward was issued".
[0101] Table 3
[0102]
[0103] 2. How to update activity participation information.
[0104] In this embodiment, the activity participation information only includes "participated in the activity". Therefore, when the server receives a user's activity participation request, it can update the activity participation information based on the aforementioned method of "updating the user's participation in the activity according to the activity participation request", which will not be repeated here.
[0105] In this embodiment, the server can record only the second activity that the user has participated in in real time in the user's activity participation information. This reduces the workload of the server in maintaining the activity participation information. On the other hand, when the server receives an activity query request from a target user, it can determine which activities the user has participated in based on the target user's activity participation information, and then query the database for activity interaction information only for these activities. This also reduces the amount of data queryed by the server and improves the efficiency of the server in querying data for activity query requests.
[0106] The following will introduce two methods for "storing activity interaction information in the database" and the corresponding methods for "querying activity interaction information in the database".
[0107] The first approach is that when storing activity interaction information, the database uniformly stores various types of interaction sub-information corresponding to each user identifier. That is, a single query based on the user identifier can retrieve multiple interaction sub-information corresponding to the user identifier.
[0108] When the database stores activity interaction information in the manner described above, when the server queries the activity interaction information between the target user and the target activity for each target activity, it can perform a single query in the database based on the user identifier of the target user to obtain various types of interaction sub-information between the target user and the target activity, which can be used as the activity interaction information between the target user and the target activity.
[0109] For example, the database records the correspondence between user identifiers and various interactive sub-information (whether participation was successful, whether a reminder was given, and whether a reward was issued) for each activity, as shown in Table 4.
[0110] Based on this, assuming the target activities are Activity 1 and Activity 2, and the target user is User A, the server can determine the various interactive sub-information corresponding to the user identifier for each target activity by performing a query based on the information recorded in the database: For Activity 1, the various interactive sub-information corresponding to User A are "Successfully participated", "No reminder", and "No reward issued"; for Activity 2, the various interactive sub-information corresponding to User A are "Successfully participated", "Reminder issued", and "No reward issued".
[0111] Table 4
[0112]
[0113] In this embodiment, the server can store various types of interaction sub-information and user identifiers in a unified manner. In this way, when the server queries activity interaction information, it can obtain various types of interaction sub-information with only one query, thereby greatly reducing the amount of data querying by the server and further improving the efficiency of the server in querying data for activity query requests.
[0114] The second type of database includes: sub-databases, each of which records the correspondence between user identifiers and a type of interactive sub-information for each activity.
[0115] When the database stores activity interaction information in the manner described above, when the server queries the activity interaction information between the target user and the target activity for each target activity, it can query the various types of interaction sub-information corresponding to the target user in each sub-database in turn according to the query logic relationship of each sub-database, and then determine the various types of interaction information obtained from the query as the activity interaction information between the target user and the target activity.
[0116] For example, the database includes sub-databases 1-3. Sub-database 1 records the correspondence between user identifiers and interactive sub-information such as "whether participation was successful" for each activity, as shown in Table 5. Sub-database 2 records the correspondence between user identifiers and interactive sub-information such as "whether to remind" for each activity, as shown in Table 6. Sub-database 3 records the correspondence between user identifiers and interactive sub-information such as "whether to issue rewards" for each activity, as shown in Table 7.
[0117] Based on this, assuming the target activities are Activity 1 and Activity 2, and the target user is User A, then the server can determine, based on the information recorded in sub-database 1, that for Activity 1, User A's corresponding interaction sub-information is "Successfully participated"; based on the information recorded in sub-database 2, it can determine that for Activity 1, User A's corresponding interaction sub-information is "No reminder"; and based on the information recorded in sub-database 3, it can determine that for Activity 1, User A's corresponding interaction sub-information is "Reward not issued".
[0118] Table 5
[0119]
[0120] Table 6
[0121]
[0122] Table 7
[0123]
[0124] In one implementation, when the server queries data in each sub-database, it can perform the queries sequentially according to the query logic relationship between each sub-database (the query order between each sub-database, and the conditions that the query results of the preceding sub-database must meet when triggering a query in the subsequent sub-database).
[0125] Continuing with the examples of sub-databases 1-3 above, the query order among sub-databases 1-3 can be: first query sub-database 1, then query sub-database 2, and finally query sub-database 3. Furthermore, since "reminders" and "rewards" can only exist if a user has successfully participated in the activity, when querying data in subsequent sub-databases (sub-databases 2-3), the query result of the preceding sub-database (sub-database 1) must be "yes" (i.e., the user has successfully participated in the activity). In other words, only if the query result of sub-database 1 is "yes" will the query operation in sub-databases 2-3 be triggered.
[0126] In this embodiment, the server can store various types of interactive sub-information into separate sub-databases. This allows for several advantages: First, when updating, adding, or deleting certain types of interactive sub-information, only the specific sub-database needs to be accessed. Second, when the server queries each sub-database sequentially, if the query results of a preceding sub-database do not meet the query trigger conditions for a subsequent sub-database, the server does not need to perform queries on that sub-database, thus reducing the amount of data retrieval and further improving the server's efficiency in responding to active query requests.
[0127] As one implementation of this application, in order to improve the speed of the server querying the database, the database can be a Redis (Remote Dictionary Server) database.
[0128] Corresponding to the above data query method, this application embodiment also provides a data query device, which will be described below.
[0129] like Figure 2 As shown, a data query device, applied to a server, includes:
[0130] The request receiving module 201 is used to receive the activity query request of the target user sent by the terminal.
[0131] The activity participation information determination module 202 is used to obtain the target activity participation information of the target user from the recorded activity participation information of each user. The user's activity participation information is used to record the activities that the user has participated in. The activities that the user has participated in are: the activities that the user has registered for.
[0132] The activity interaction information determination module 203 is used to filter out the activities that the target user has participated in from the various activities to be displayed on the terminal based on the target activity participation information, and to determine the activity interaction information between the target user and the target activity. The activity interaction information is used to record the interaction between the user and the activity.
[0133] The information sending module 204 is used to return the activity interaction information corresponding to the target activity to the terminal, so that the terminal can render the activity display interface based on the activity interaction information corresponding to the target activity.
[0134] As one embodiment of this application, the above-described apparatus may further include:
[0135] An activity participation request receiving module is used to receive an activity participation request from the target user sent by the terminal, wherein the activity participation request includes: an activity identifier of the first activity registered by the target user based on the activity display interface;
[0136] The activity participation information update module is used to add the activity identifier to the target activity participation information to record that the target user has participated in the first activity.
[0137] As one embodiment of this application, the target activity participation information stored in the server's cache includes: activity interaction information of the target user and the activities they have participated in;
[0138] The activity interaction information determination module can be specifically used to determine the activity interaction information between the target user and the target activity based on the target user's participation information in the target activity for each target activity.
[0139] As one embodiment of this application, the server's database records the correspondence between user identifiers and activity interaction information. The above-mentioned apparatus may further include:
[0140] The activity participation information update module is used to detect changes in activity interaction information recorded in the database, determine the corresponding activity participation information in the cache based on the user identifier corresponding to the activity interaction information, and update the corresponding activity participation information according to the changes in the activity interaction information.
[0141] As one embodiment of this application, the server's database records the correspondence between user identifiers and activity interaction information;
[0142] The activity interaction information determination module can be specifically used to query the database for the activity interaction information between the target user and the target activity based on the user identifier of the target user for each target activity.
[0143] As one implementation method of this application,
[0144] The activity interaction information determination module can be specifically used to perform a single query in the database based on the user identifier of the target user to obtain the activity interaction information between the target user and the target activity, wherein the activity interaction information corresponding to the target user includes various types of interaction sub-information;
[0145] or,
[0146] The database includes sub-databases, each recording the correspondence between a user identifier and a type of interactive sub-information for each activity. The activity interaction information determination module can be specifically used to query the various types of interactive sub-information corresponding to the target user in each sub-database according to the user identifier of the target user, based on the query logic relationship of each sub-database. The query logic relationship of each sub-database includes the query order between the sub-databases and the conditions that the query results of the preceding sub-databases must meet when data is queried in subsequent sub-databases. The various types of interactive information obtained from the query are determined as the activity interaction information between the target user and the target activity.
[0147] In one embodiment of this application, the database is a remote dictionary server Redis database.
[0148] This application also provides a server, such as... Figure 3 As shown, it includes a processor 301, a communication interface 302, a memory 303, and a communication bus 304, wherein the processor 301, the communication interface 302, and the memory 303 communicate with each other through the communication bus 304.
[0149] Memory 303 is used to store computer programs;
[0150] The processor 301, when executing the program stored in the memory 303, implements the data query method described in any of the above embodiments.
[0151] The communication bus mentioned in the above server can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into address bus, data bus, control bus, etc. For ease of illustration, only one thick line is used to represent it in the diagram, but this does not mean that there is only one bus or one type of bus.
[0152] The communication interface is used for communication between the aforementioned server and other devices.
[0153] The memory may include random access memory (RAM) or non-volatile memory, such as at least one disk storage device. Optionally, the memory may also be at least one storage device located remotely from the aforementioned processor.
[0154] The processors mentioned above can be general-purpose processors, including central processing units (CPUs), network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0155] In another embodiment provided in this application, a computer-readable storage medium is also provided, wherein a computer program is stored therein, and when the computer program is executed by a processor, it implements any of the data query methods described in the above embodiments.
[0156] In another embodiment provided in this application, a computer program product containing instructions is also provided, which, when run on a computer, causes the computer to execute any of the data query methods described in the above embodiments.
[0157] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially as a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid state disk (SSD)).
[0158] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0159] The various embodiments in this specification are described in a related manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the embodiments of apparatus, servers, computer-readable storage media, and computer program products are basically similar to the method embodiments, and therefore the descriptions are relatively simple; relevant parts can be referred to the descriptions of the method embodiments.
[0160] The above description is merely a preferred embodiment of this application and is not intended to limit the scope of protection of this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application are included within the scope of protection of this application.
Claims
1. A data query method, characterized by, The method applied to a server comprises: receiving an activity query request of a target user sent by a terminal; acquiring target activity participation information of the target user from recorded activity participation information of each user, wherein the activity participation information of the user is used to record activities in which the user has participated, and the activities in which the user has participated are activities that the user has signed up for; according to the target activity participation information, screening out activities in which the target user has participated from each activity to be displayed by the terminal as target activities, and determining activity interaction information of the target user and the target activities, wherein the activity interaction information is used to record interaction between the user and the activities; returning the activity interaction information corresponding to the target activities to the terminal, so that the terminal renders an activity display interface based on the activity interaction information corresponding to the target activities.
2. The method of claim 1, wherein, After the activity interaction information corresponding to the target activities is returned to the terminal, the method further comprises: receiving an activity participation request of the target user sent by the terminal, wherein the activity participation request comprises an activity identifier of a first activity signed up for by the target user based on the activity display interface; adding the activity identifier to the target activity participation information to record that the target user has participated in the first activity.
3. The method of claim 1, wherein, The target activity participation information stored in the cache of the server comprises activity interaction information of the target user and activities in which the target user has participated; The determination of the activity interaction information of the target user and the target activities comprises: for each target activity, determining the activity interaction information of the target user and the target activity according to the target activity participation information of the target user.
4. The method of claim 3, wherein, The database of the server records a corresponding relationship between a user identifier and activity interaction information, and the method further comprises: when a change in the activity interaction information recorded in the database is monitored, determining activity participation information corresponding to the activity interaction information in the cache according to a user identifier corresponding to the activity interaction information; updating the activity participation information corresponding to the activity interaction information according to a change in the activity interaction information.
5. The method of claim 1, wherein, The database of the server records a corresponding relationship between a user identifier and activity interaction information; The determination of the activity interaction information of the target user and the target activities comprises: for each target activity, querying the activity interaction information of the target user and the target activity in the database according to a user identifier of the target user.
6. The method of claim 5, wherein: the querying of the activity interaction information of the target user and the target activity in the database according to the user identifier of the target user comprises: performing a single query in the database according to the user identifier of the target user to obtain the activity interaction information of the target user and the target activity, wherein the activity interaction information corresponding to the target user comprises various types of interaction sub-information; or The database comprises: each sub-database, each sub-database recording: for each activity, the corresponding relationship between the user identifier and a type of interaction sub-information; the target user's activity interaction information with the target activity is queried in the database according to the user identifier of the target user, comprising: According to the query logic relationship of each sub-database, the corresponding interaction sub-information of the target user is sequentially queried in each sub-database according to the user identifier of the target user, wherein the query logic relationship of each sub-database comprises: the query order between each sub-database, and the condition required to be met by the query result of the previous sub-database when triggering the query data in the subsequent sub-database; The query result of each type of interaction information is determined as the target user's activity interaction information with the target activity.
7. The method according to any one of claims 4-6, characterized in that, The database is a remote dictionary server Redis database.
8. A data query apparatus, characterized by comprising: The device is applied to a server, and the device comprises: The request receiving module is configured to receive an activity query request of a target user sent by a terminal; The activity participation information determination module is configured to obtain target activity participation information of the target user in recorded activity participation information of each user, wherein the activity participation information of the user is used to record the activities that the user has participated in, and the activities that the user has participated in are the activities that the user has signed up for; The activity interaction information determination module is configured to filter out the target user's participated activities from each activity to be displayed by the terminal as a target activity according to the target activity participation information, and determine activity interaction information of the target user with the target activity, wherein the activity interaction information is used to record the interaction between the user and the activity; The information sending module is configured to return the activity interaction information corresponding to the target activity to the terminal, so that the terminal renders an activity display interface based on the activity interaction information corresponding to the target activity.
9. A server, characterized by The device comprises a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory complete mutual communication through the communication bus; The memory is used to store a computer program; The processor is used to execute the program stored on the memory, and realizes the method in any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, The computer program is stored in the computer readable storage medium, and the computer program is executed by the processor to realize the method in any one of claims 1-7.