CN115496544A - Data processing method and device - Google Patents

Data processing method and device Download PDF

Info

Publication number
CN115496544A
CN115496544A CN202211316597.1A CN202211316597A CN115496544A CN 115496544 A CN115496544 A CN 115496544A CN 202211316597 A CN202211316597 A CN 202211316597A CN 115496544 A CN115496544 A CN 115496544A
Authority
CN
China
Prior art keywords
user
point data
ranking
personal
personal point
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211316597.1A
Other languages
Chinese (zh)
Inventor
王帅
丁明翼
王瀚晨
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Construction Bank Corp
CCB Finetech Co Ltd
Original Assignee
China Construction Bank Corp
CCB Finetech Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Construction Bank Corp, CCB Finetech Co Ltd filed Critical China Construction Bank Corp
Priority to CN202211316597.1A priority Critical patent/CN115496544A/en
Publication of CN115496544A publication Critical patent/CN115496544A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q30/00Commerce
    • G06Q30/02Marketing; Price estimation or determination; Fundraising
    • G06Q30/0207Discounts or incentives, e.g. coupons or rebates
    • G06Q30/0211Determining the effectiveness of discounts or incentives

Landscapes

  • Business, Economics & Management (AREA)
  • Engineering & Computer Science (AREA)
  • Accounting & Taxation (AREA)
  • Development Economics (AREA)
  • Strategic Management (AREA)
  • Finance (AREA)
  • Game Theory and Decision Science (AREA)
  • Entrepreneurship & Innovation (AREA)
  • Economics (AREA)
  • Marketing (AREA)
  • Physics & Mathematics (AREA)
  • General Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a data processing method and device, and relates to the technical field of computers. One embodiment of the method comprises: receiving an integral ranking list acquisition request sent by a front end, wherein the integral ranking list acquisition request indicates a ranking type; acquiring a score ranking list corresponding to the ranking type, wherein the score ranking list is acquired according to a Zset set in Redis; and returning the score ranking list to the front end. According to the embodiment, the point ranking list corresponding to the ranking type is obtained by the ordered set, so that the multi-angle analysis of the point ranking list is realized, the use condition of the points of the client can be analyzed, the labor cost is reduced, and the efficiency and the accuracy are improved.

Description

Data processing method and device
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method and an apparatus for data processing.
Background
The financial institution can lead the client to transact the point exchange business by utilizing the accumulated personal points through the point feedback business. With the continuous expansion of the customer point service and the continuous increase of access channels, the number of customers is continuously increased, and the customers have diversified point use, such as commodity exchange, cash return and the like, so that the analysis of the use condition of the customer points is of great significance.
In the related art, manual statistics is generally adopted to analyze the personal point use condition of a client, and the method is low in efficiency and poor in accuracy.
Disclosure of Invention
In view of this, embodiments of the present invention provide a data processing method and apparatus, which can obtain a score ranking list corresponding to a ranking type by using an ordered set, so that the score ranking list can be analyzed in multiple angles, a use condition of a customer score can be analyzed, a labor cost is reduced, and efficiency and accuracy are improved.
To achieve the above object, according to an aspect of an embodiment of the present invention, there is provided a data processing method including:
receiving a score ranking list acquisition request sent by a front end, wherein the score ranking list acquisition request indicates a ranking type;
acquiring a score ranking list corresponding to the ranking type, wherein the score ranking list is acquired according to a Zset set in Redis;
and returning the score ranking list to the front end.
Optionally, the score ranking list acquisition request includes a channel identifier; before obtaining the score ranking list corresponding to the ranking type, the method includes:
and verifying the channel identification and determining that the verification is successful.
Optionally, the score ranking list obtaining request further includes a mechanism identifier and a role identifier, and before obtaining the score ranking list corresponding to the ranking type, the method includes:
and verifying the mechanism identifier and the role identifier, and determining that the verification is successful.
Optionally, a preset message interface is used to receive the score ranking list acquisition request sent by the client, where the message is in an XML format.
Optionally, the score ranking list obtaining request further includes a paging identifier; acquiring a score ranking list corresponding to the ranking type, wherein the acquisition comprises the following steps:
and acquiring the score ranking list according to the ranking type and the paging identifier.
Optionally, before obtaining the score leaderboard corresponding to the ranking type, the method further includes:
for any sorting type, determining a time range corresponding to the any sorting type;
acquiring personal point data of all users in the time range;
storing each user and the personal point data thereof into a Zset set of Redis to obtain the personal point data ranking of each user;
and obtaining a score ranking list corresponding to any ranking type according to the personal score data ranking of each user.
Optionally, before storing each user and their personal point data into Zset set of Redis, including:
under the condition that a plurality of users have the same personal point data, determining the weight corresponding to the personal point data of each user in the plurality of users according to a preset rule;
and determining the updated personal point data of each user in the plurality of users according to the personal point data of each user in the plurality of users and the corresponding weight thereof, and taking the updated personal point data of each user in the plurality of users as the personal point data of the user.
Optionally, determining a weight corresponding to the personal point data of each of the plurality of users according to a preset rule includes:
acquiring the number of times of updating personal point data of each user in the plurality of users;
and determining the weight corresponding to the personal point data according to the updating times of the personal point data.
Optionally, after obtaining the top board corresponding to any ranking type according to the personal point data ranking of each user, the method further includes:
responding to the update of personal point data of any user, and caching the updated personal point data corresponding to the user;
acquiring personal point data before updating according to the user identification of any user, and deleting the user identification of any user and the personal point data before updating from the point leaderboard;
and storing the user identification of any user and the updated score data into a Zset set so as to obtain an updated score ranking list.
Optionally, after obtaining the top board corresponding to any ranking type according to the personal point data ranking of each user, the method further includes:
in response to receiving a splitting instruction of personal point data of any user, splitting the personal point data of the any user into first point data and second point data, wherein the first point data corresponds to a user identifier of the any user, and the second point data corresponds to a new user identifier of the any user;
acquiring personal point data before splitting according to the user identification of any user, and deleting the user identification of any user and the personal point data before splitting from the point ranking list;
and storing the user identifier of any user, the first point data, the newly added user identifier and the second point data into a Zset set so as to obtain an updated point ranking list.
Optionally, the storing of the personal point data of all users is implemented by a Redis cluster.
Another aspect of the embodiments of the present invention provides a data processing apparatus, including:
the receiving module is used for receiving a score ranking list acquisition request sent by a front end, wherein the score ranking list acquisition request indicates a ranking type;
the acquisition module is used for acquiring a score ranking list corresponding to the ranking type, wherein the score ranking list is acquired according to a Zset set in a Redis cache;
and the sending module returns the score ranking list to the front end.
Optionally, the score ranking list acquisition request includes a channel identifier; the receiving module is further configured to: and before acquiring the score ranking list corresponding to the ranking type, verifying the channel identifier and determining that the verification is successful.
Optionally, the score leaderboard obtaining request further includes a mechanism identifier and a role identifier, and the receiving module is further configured to: before the point ranking list corresponding to the ranking type is obtained, verifying the mechanism identification and the role identification, and determining that the verification is successful.
Optionally, a preset message interface is used to receive the score ranking list acquisition request sent by the client, where the message is in an XML format.
Optionally, the score ranking list obtaining request further includes a paging identifier; the obtaining module is further configured to: and acquiring the score ranking list according to the ranking type and the paging identifier.
Optionally, the obtaining module is further configured to: prior to obtaining a leaderboard of points corresponding to the ranking type,
for any sorting type, determining a time range corresponding to the any sorting type;
acquiring personal point data of all users in the time range;
storing each user and the personal point data thereof into a Zset set of Redis to obtain the personal point data ranking of each user;
and determining a score ranking list corresponding to any ranking type according to the personal score data ranking of each user.
Optionally, the obtaining module is further configured to: before each user and their personal point data are stored in the Zset set of Redis,
under the condition that a plurality of users have the same personal point data, determining the weight corresponding to the personal point data of each user in the plurality of users according to a preset rule;
and determining the updated personal point data of each user in the plurality of users according to the personal point data of each user in the plurality of users and the corresponding weight thereof, and taking the updated personal point data of each user in the plurality of users as the personal point data of the user.
Optionally, the obtaining module is further configured to: acquiring the number of times of updating personal point data of each user in the plurality of users; and determining the weight corresponding to the personal point data according to the updating times of the personal point data.
Optionally, the obtaining module is further configured to: after determining a leaderboard corresponding to the any one ranking type according to each user's personal point data ranking,
responding to the update of personal point data of any user, and caching the updated personal point data corresponding to the user;
acquiring personal point data before updating according to the user identification of any user, and deleting the user identification of any user and the personal point data before updating from the point ranking list;
and storing the user identification of any user and the updated score data into a Zset set so as to obtain an updated score ranking list.
Optionally, the obtaining module is further configured to: after determining a leaderboard corresponding to the any one ranking type according to each user's personal point data ranking,
in response to receiving a splitting instruction of personal point data of any user, splitting the personal point data of the any user into first point data and second point data, wherein the first point data corresponds to a user identifier of the any user, and the second point data corresponds to a new user identifier of the any user;
acquiring personal point data before splitting according to the user identification of any user, and deleting the user identification of any user and the personal point data before splitting from the point leaderboard;
and storing the user identifier of any user, the first point data, the newly added user identifier and the second point data into a Zset set so as to obtain an updated point ranking list.
Optionally, the storing of the personal point data of all users is implemented by a Redis cluster.
Another aspect of an embodiment of the present invention provides an electronic device, including:
one or more processors;
a storage device for storing one or more programs,
when the one or more programs are executed by the one or more processors, the one or more processors implement the method of data processing of the embodiment of the present invention.
A further aspect of the embodiments of the present invention provides a computer-readable medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the method for data processing of the embodiments of the present invention.
In a further aspect, embodiments of the present invention provide a computer program product, which includes a computer program, and when the computer program is executed by a processor, the computer program implements the method for data processing according to the embodiments of the present invention.
One embodiment of the above invention has the following advantages or benefits: according to the data processing method, the front end transmits the ranking type in the score ranking list acquisition request, so that the score ranking list corresponding to the ranking type can be acquired, the score ranking list is acquired according to the Zset set of Redis, the personal score data of the user can be analyzed in multiple angles through different ranking types, the score using condition of the user can be analyzed more accurately, the efficiency and the accuracy are improved, the labor cost is reduced, and accurate marketing of the user can be realized by each mechanism according to the analysis result
Further effects of the above-mentioned non-conventional alternatives will be described below in connection with the embodiments.
Drawings
The drawings are included to provide a better understanding of the invention and are not to be construed as unduly limiting the invention. Wherein:
FIG. 1 is a schematic diagram of a main flow of a method of data processing according to an embodiment of the invention;
FIG. 2 is a schematic diagram of a main flow of another method of data processing according to an embodiment of the invention;
FIG. 3 is a schematic diagram of the main flow of yet another method of data processing according to an embodiment of the invention;
FIG. 4 is a schematic diagram of the main flow of yet another method of data processing according to an embodiment of the invention;
FIG. 5 is a schematic diagram of the main blocks of a data processing apparatus according to an embodiment of the present invention;
FIG. 6 is an exemplary system architecture diagram in which embodiments of the present invention may be employed;
fig. 7 is a schematic block diagram of a computer system suitable for use in implementing a terminal device or server according to an embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present invention are described below with reference to the accompanying drawings, in which various details of embodiments of the invention are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
It should be noted that, in the technical solution of the present application, the acquisition, storage, application, processing, etc. of data all conform to the regulations of the relevant national laws and regulations, and do not violate the good customs of the public order.
Fig. 1 is a schematic diagram of a main flow of a method of data processing according to an embodiment of the present invention, as shown in fig. 1, the method including the steps of:
step S101: receiving an integral ranking list acquisition request sent by a front end, wherein the integral ranking list acquisition request indicates a ranking type;
step S102: acquiring a score ranking list corresponding to the ranking type, wherein the score ranking list is acquired according to a Zset set in Redis;
step S103: and returning the score ranking list to the front end.
In the embodiment of the present invention, the score chart acquisition request may be sent by any channel having a right in the front end, such as an application program, an applet, a PC, and the like, where each channel has a corresponding channel identifier, and the score chart acquisition request may include a channel identifier. In order to ensure that the score ranking list is provided for the channels with the authority, the acquisition request needs to be verified before the score ranking list is acquired, the method comprises the steps of verifying channel identification, judging whether the channel identification has the authority or not, if yes, the verification is passed, otherwise, the verification fails, and information without the authority is returned. That is, the score ranking list can be returned only when the channel identifier is determined to be successfully verified.
In the embodiment of the invention, the score ranking list can be acquired by any mechanism and role with authority, the mechanism can be each operation subject for performing business analysis by adopting the score ranking list, the role can be staff with different authorities in the mechanism, each mechanism has a corresponding mechanism identifier, and each role has a corresponding role identifier. The point ranking list acquisition request also comprises a mechanism identifier and a role identifier, in order to ensure that the point ranking list is returned to the mechanism and the role with the authority, before the point ranking list corresponding to the ranking type is acquired, the point ranking list acquisition request is required to be authenticated, namely whether the mechanism identifier and the role identifier have the authority or not is judged, if yes, the verification is successful, and if not, the verification is failed. That is, the point chart can be returned only when the mechanism identifier and the role identifier are successfully verified. The authority verification is carried out on the integral ranking list acquisition request, so that the safety of data transmission can be ensured.
In the embodiment of the invention, a preset message interface is adopted to receive the score ranking list acquisition request sent by the client, and the message is in an XML format. Through the preset unified standard message interface, when the preset message interface is called by any channel at the front end, the score ranking list acquisition request is sent by adopting a preset message format, namely an XML message format, so that the compatibility is good, and the acquisition request can be conveniently analyzed. For example, parameter customization may be performed in a preset XML message format, the message of the acquisition request includes a value of a field indicating a ranking type, for example, a number 1 may be defined to represent Zhou Paihang list, 2 represents monthly ranking, and 3 represents Ji Paihang, and if the value of the field indicating the ranking type in the message of the received acquisition request is 1, the acquisition request is a request for acquiring a weekly ranking list.
In the embodiment of the invention, the score ranking list acquisition request further comprises a paging identifier; acquiring a score ranking list corresponding to the ranking type, wherein the acquiring comprises the following steps: and acquiring the score ranking list according to the ranking type and the paging identifier. The score ranking list can be displayed according to the paging identifier, and the corresponding Zhou Paihang ranking range can be returned according to the paging identifier by acquiring the paging identifier in the request. The query data size can be determined through the paging identification, so that full data query is avoided, query efficiency is improved, and network congestion is avoided.
In this embodiment of the present invention, after receiving the score ranking list request sent by the front end, before obtaining the score ranking list corresponding to the ranking type, the method further includes: and determining that the score ranking list corresponding to the ranking type exists in the memory or the cache. Namely, the score ranking list corresponding to the ranking type can be obtained from the memory or Redis cache; or if the memory exists, acquiring the data from the memory according to the sorting type; and if the memory does not exist, acquiring the data from the Redis cache according to the sorting type.
In this embodiment of the present invention, as shown in fig. 2, before acquiring the top board of points corresponding to the ranking types, the method further includes:
step S201: determining a time range corresponding to any sorting type aiming at any sorting type;
step S202: acquiring personal point data of all users in a time range;
step S203: storing each user and the personal point data thereof into a Zset set of Redis to obtain the personal point data ranking of each user;
step S204: and obtaining a point ranking list corresponding to any ranking type according to the personal point data ranking of each user.
In an embodiment of the invention, the leaderboard of points is obtained from a set of zsets (an ordered set of Redis) in Redis. The sorting type can be Zhou Paihang, monthly row and seasonal row. For any sort type, the time range corresponding to that sort type may be determined, e.g., for Zhou Paihang, the time range corresponding to Zhou Paihang may be determined to be one week. After the time range is determined, the personal point data of all users in the time range, such as the personal point data of each user in the week, is acquired. Each user and the personal point data thereof are stored in a Key-Value pair (Key-Value) mode, wherein Key is a user identifier, and Value is the personal point data corresponding to the user identifier. And then, adding each user and the personal point data thereof into the Zset by using a Zadd command to obtain the personal point data ranking of each user. The storage of each user and the personal point data thereof can be realized by adopting a bottom-layer storage structure skip (skip list) in the Zset set; then, a dit (a composite data structure in Redis) can be adopted to store the mapping relations between the users and the personal point data in the Zset set and between the personal point data and the ranking, and the mapping relations between the Zset set and the ranking types can also be stored. And obtaining a score ranking list corresponding to the ranking type according to the score data ranking of each user in the Zset set.
In the embodiment of the present invention, before storing each user and their personal point data into Zset set of Redis, the following steps are included: under the condition that a plurality of users have the same personal point data, determining the weight corresponding to the personal point data of each user in the plurality of users according to a preset rule; and determining the updated personal point data of each user in the plurality of users according to the personal point data of each user in the plurality of users and the corresponding weight thereof, and taking the updated personal point data of each user in the plurality of users as the personal point data of the user.
In the embodiment of the present invention, determining the weight corresponding to the personal point data of each of the plurality of users according to a preset rule includes: acquiring the number of times of updating personal point data of each user in the plurality of users; and determining the weight corresponding to the personal point data according to the updating times of the personal point data.
After acquiring the personal point data of all users in a time range corresponding to any sort type, a plurality of users may have the same personal point data, in this case, a weight corresponding to each piece of personal point data in the same personal point data may be determined according to a preset rule, updated personal point data is determined by a product of the personal point data and the weight, and the updated personal point data is stored as the personal point data of the users in a Zset set of Redis, wherein the weight may be determined according to the update times of the personal point data, a plurality of update time ranges may be set, and a corresponding weight is set for each update time range, so that a corresponding weight is determined according to the update times of each piece of personal point data to obtain updated personal point data, and sorting is performed by using the updated personal point data, so that the point use condition of the users may be better and accurately analyzed.
In the case where a plurality of users have the same personal point data, the update time stamps of the personal point data may be acquired, and a plurality of time ranges and weights corresponding to the time ranges may be set, so that the corresponding weights may be determined according to the time ranges corresponding to the update time stamps of the personal point data, and the product of the personal point data and the weights may be used as the updated personal point data, and the updated personal point data may be sorted. The activity degree of the user using the personal points can be obtained by taking the update time stamp of the personal point data as the corresponding weight, so that the business analysis and the accurate marketing are facilitated.
In this embodiment of the present invention, as shown in fig. 3, after obtaining the point leaderboard corresponding to any ranking type according to the personal point data ranking of each user, the method further includes:
step S301: responding to the update of the personal point data of any user, and caching the updated personal point data corresponding to any user;
step S302: acquiring personal point data before updating according to the user identification of any user, and deleting the user identification of any user and the personal point data before updating from the point ranking list;
step S303: and storing the user identification of any user and the updated score data into the Zset set so as to obtain the updated score ranking list.
In the embodiment of the invention, after the point ranking list corresponding to the ranking type is obtained, the point ranking list is returned to the front end, meanwhile, the personal point data of each user is obtained at regular time, if the personal point data of any user is updated, the updated point data of the user and the user identifier of the user are correspondingly stored in the Redis cache, meanwhile, the personal point data before the user is updated can be obtained from the Zset set, then the user and the personal point data before the user is updated are deleted from the point ranking list, namely, the user and the personal point data thereof are deleted from the Zset corresponding to the point ranking list, and then the user and the updated personal point data thereof are added to the Zset by using a Zadd command, so that the updated point ranking list is obtained. Because the Zset set is an ordered set, the personal point data can be ranked from high to low, when the personal point data of one or more users in the Zset set is deleted or added, the real-time update of the point ranking list can be automatically realized, and the update efficiency is high.
In this embodiment of the present invention, as shown in fig. 4, after obtaining the point leaderboard corresponding to any ranking type according to the personal point data ranking of each user, the method further includes:
step S401: in response to a received splitting instruction of personal point data of any user, splitting the personal point data of the any user into first point data and second point data, wherein the first point data corresponds to a user identifier of the any user, and the second point data corresponds to a newly added user identifier of the any user;
step S402: acquiring personal point data before splitting according to the user identification of any user, and deleting the user identification of any user and the personal point data before splitting from the point ranking list;
step S403: and storing the user identifier of any user, the first point data, the newly added user identifier and the second point data into the Zset set to obtain the updated point ranking list.
In the embodiment of the invention, after the point ranking list is obtained, when a splitting instruction aiming at the personal point data of any user is received, the personal point data of the user can be split into one or more point data, if the personal point data is split into the first point data and the second point data, the user identifier corresponding to the first point data is not changed and is the user identifier of the user, the user identifier of the second point data is a newly added user identifier, the user identifier of the user and the first point data are correspondingly stored, and the newly added user identifier and the second point data are correspondingly stored; the method comprises the steps of obtaining personal point data of a user before splitting of the user identification of the user, deleting the personal point data before splitting from a Zset set corresponding to the point ranking list, adding the user identification of the user, first point data, newly added user identification and second point data into the Zset set through a Zadd command, and obtaining ranking of the first point data and the second point data so as to obtain the updated point ranking list.
In the embodiment of the invention, the storage of the personal point data of all the users is realized by a Redis cluster. Under the great condition of data bulk, can adopt Redis cluster to carry out the distributed storage of data, redis cluster includes a plurality of nodes, through can carrying out the fragmentation to data, can obtain a plurality of fragmentation identifications, every fragmentation identification corresponds many data, every node in the cluster can store the data that corresponds fragmentation identification to realized the split of data, promoted query efficiency, follow-up also can be according to the quantity of actual demand increase node, scalability is strong.
According to the data processing method provided by the embodiment of the invention, the front end transmits the ranking type in the score ranking list acquisition request, so that the score ranking list corresponding to the ranking type can be acquired, the score ranking list is acquired according to the Zset set of Redis, and the personal score data of the user can be analyzed in multiple angles through different ranking types, so that the score using condition of the user can be analyzed more accurately, the efficiency and the accuracy are improved, the labor cost is reduced, and accurate marketing to the user can be realized by each mechanism according to the analysis result. A uniform message interface is adopted to be used by any channel at the front end; the permission removal verification is carried out on the acquisition request, so that the safety of data transmission is ensured; by transmitting the paging identifier into the acquisition request, the query data volume can be controlled, and the query efficiency is improved; when the personal point data are updated or split, the personal point data before updating are deleted from the Zset set, the updated personal point data are added, the updated point ranking list can be obtained, the point ranking list can be updated timely through the Zset set, and the updating efficiency is high. And the Redis cluster is adopted for data distributed storage, so that the expandability is strong.
As shown in fig. 5, another aspect of the present invention provides an apparatus 500 for data processing, including:
the receiving module 501 receives a score ranking list acquisition request sent by a front end, where the score ranking list acquisition request indicates a ranking type;
the obtaining module 502 is configured to obtain a score ranking list corresponding to the ranking type, where the score ranking list is obtained according to a Zset set in a Redis cache;
the sending module 503 returns the point leaderboard to the front end.
In the embodiment of the invention, the score ranking list acquisition request comprises a channel identifier; the receiving module 501 is further configured to: and before the point ranking list corresponding to the ranking type is obtained, verifying the channel identification and determining that the verification is successful.
In this embodiment of the present invention, the score leaderboard acquisition request further includes a mechanism identifier and a role identifier, and the receiving module 501 is further configured to: before the point ranking list corresponding to the ranking type is obtained, the mechanism identification and the role identification are verified, and the success of verification is determined.
In the embodiment of the invention, a preset message interface is adopted to receive the score ranking list acquisition request sent by the client, and the message is in an XML format.
In the embodiment of the invention, the score ranking list acquisition request further comprises a paging identifier; an obtaining module 502, further configured to: and acquiring the score ranking list according to the ranking type and the paging identifier.
In this embodiment of the present invention, the obtaining module 503 is further configured to: before obtaining the leaderboard of points corresponding to the ranking type,
determining a time range corresponding to any sorting type aiming at any sorting type;
acquiring personal point data of all users in a time range;
storing each user and the personal point data thereof into a Zset set cached by Redis to obtain the personal point data ranking of each user;
and determining a point ranking list corresponding to any ranking type according to the personal point data ranking of each user.
In this embodiment of the present invention, the obtaining module 503 is further configured to: before each user and personal point data thereof are stored in a Zset set of Redis, determining the weight corresponding to the personal point data of each user in a plurality of users according to a preset rule under the condition that the plurality of users have the same personal point data; and determining the updated personal point data of each user in the plurality of users according to the personal point data of each user in the plurality of users and the corresponding weight thereof, and taking the updated personal point data of each user in the plurality of users as the personal point data of the user.
In this embodiment of the present invention, the obtaining module 503 is further configured to: acquiring the number of times of updating personal point data of each user in the plurality of users; and determining the weight corresponding to the personal point data according to the updating times of the personal point data.
In this embodiment of the present invention, the obtaining module 503 is further configured to: after determining a leaderboard corresponding to any sort type based on each user's personal point data ranking,
responding to the update of the personal point data of any user, and caching the updated personal point data corresponding to any user;
acquiring personal point data before updating according to the user identification of any user, and deleting the user identification of any user and the personal point data before updating from the point ranking list;
and storing the user identification of any user and the updated score data into the Zset set so as to obtain the updated score ranking list.
In this embodiment of the present invention, the obtaining module 503 is further configured to: after determining a leaderboard corresponding to any sort type based on each user's personal point data ranking,
in response to a received splitting instruction of personal point data of any user, splitting the personal point data of any user into first point data and second point data, wherein the first point data corresponds to a user identifier of any user, and the second point data corresponds to a newly added user identifier of the user identifier of any user;
acquiring personal point data before splitting according to the user identification of any user, and deleting the user identification of any user and the personal point data before splitting from the point ranking list;
and storing the user identifier and the first point data of any user, the newly added user identifier and the second point data into the Zset set so as to obtain the updated point ranking list.
In the embodiment of the invention, the storage of the personal point data of all the users is realized by a Redis cluster.
Another aspect of an embodiment of the present invention provides an electronic device, including: one or more processors; a storage device, configured to store one or more programs, which when executed by one or more processors, cause the one or more processors to implement the method for data processing of the embodiments of the present invention.
A further aspect of the embodiments of the present invention provides a computer-readable medium on which a computer program is stored, where the computer program is executed by a processor to implement the method for data processing of the embodiments of the present invention.
A further aspect of the embodiments of the present invention provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the computer program implements the method for data processing according to the embodiments of the present invention.
Fig. 6 shows an exemplary system architecture 600 of a data processing apparatus or a method of data processing to which embodiments of the present invention may be applied.
As shown in fig. 6, the system architecture 600 may include terminal devices 601, 602, 603, a network 604, and a server 605. The network 604 serves to provide a medium for communication links between the terminal devices 601, 602, 603 and the server 605. Network 604 may include various types of connections, such as wire, wireless communication links, or fiber optic cables, to name a few.
A user may use the terminal devices 601, 602, 603 to interact with the server 605 via the network 604 to receive or send messages or the like. The terminal devices 601, 602, 603 may have installed thereon various communication client applications, such as shopping applications, web browser applications, search applications, instant messaging tools, mailbox clients, social platform software, etc. (by way of example only).
The terminal devices 601, 602, 603 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like.
The server 605 may be a server providing various services, such as a background management server (for example only) providing support for shopping websites browsed by users using the terminal devices 601, 602, 603. The backend management server may analyze and perform other processing on the received data such as the product information query request, and feed back a processing result (for example, target push information, product information — just an example) to the terminal device.
It should be noted that the data processing method provided by the embodiment of the present invention is generally executed by the server 605, and accordingly, the data processing apparatus is generally disposed in the server 605.
It should be understood that the number of terminal devices, networks, and servers in fig. 6 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for an implementation.
Referring now to FIG. 7, shown is a block diagram of a computer system 700 suitable for use with a terminal device implementing an embodiment of the present invention. The terminal device shown in fig. 7 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present invention.
As shown in fig. 7, the computer system 700 includes a Central Processing Unit (CPU) 701, which can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 702 or a program loaded from a storage section 708 into a Random Access Memory (RAM) 703. In the RAM 703, various programs and data necessary for the operation of the system 700 are also stored. The CPU 701, the ROM 702, and the RAM 703 are connected to each other via a bus 704. An input/output (I/O) interface 705 is also connected to bus 704.
The following components are connected to the I/O interface 705: an input portion 706 including a keyboard, a mouse, and the like; an output section 707 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage section 708 including a hard disk and the like; and a communication section 709 including a network interface card such as a LAN card, a modem, or the like. The communication section 709 performs communication processing via a network such as the internet. A drive 710 is also connected to the I/O interface 705 as needed. A removable medium 711 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 710 as necessary, so that a computer program read out therefrom is mounted into the storage section 708 as necessary.
In particular, according to embodiments of the present disclosure, the processes described above with reference to the flow diagrams may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program can be downloaded and installed from a network through the communication section 709, and/or installed from the removable medium 711. The computer program performs the above-described functions defined in the system of the present invention when executed by the Central Processing Unit (CPU) 701.
It should be noted that the computer readable medium shown in the present invention can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present invention, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present invention, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules described in the embodiments of the present invention may be implemented by software or hardware. The described modules may also be provided in a processor, which may be described as: a processor includes a receiving module, an obtaining module, and a sending module. The names of the modules do not limit the module itself under certain conditions, and for example, the receiving module may also be described as a module that receives the score chart acquisition request sent by the front end.
As another aspect, the present invention also provides a computer-readable medium, which may be contained in the apparatus described in the above embodiments; or may be separate and not incorporated into the device. The computer readable medium carries one or more programs which, when executed by a device, cause the device to comprise: receiving an integral ranking list acquisition request sent by a front end, wherein the integral ranking list acquisition request indicates a ranking type; acquiring a score ranking list corresponding to the ranking type, wherein the score ranking list is acquired according to a Zset set in Redis; and returning the score ranking list to the front end.
According to the technical scheme of the embodiment of the invention, the front end transmits the ranking type in the score ranking list acquisition request, so that the score ranking list corresponding to the ranking type can be acquired, the score ranking list is acquired according to the Zset set of Redis, and the personal score data of the user can be analyzed in multiple angles through different ranking types, so that the score use condition of the user can be analyzed more accurately, the efficiency and the accuracy are improved, the labor cost is reduced, and accurate marketing to the user can be realized by each mechanism according to the analysis result. A uniform message interface is adopted to be used by any channel at the front end; the permission removal verification is carried out on the acquisition request, so that the safety of data transmission is ensured; by transmitting the paging identifier into the acquisition request, the query data volume can be controlled, and the query efficiency is improved; when the personal point data are updated or split, the personal point data before updating are deleted from the Zset set, the updated personal point data are added, the updated point ranking list can be obtained, the point ranking list can be updated in time through the Zset set, and the updating efficiency is high. And the Redis cluster is adopted for data distributed storage, so that the expandability is strong.
The above-described embodiments should not be construed as limiting the scope of the invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions can occur, depending on design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (25)

1. A method of data processing, comprising:
receiving a score ranking list acquisition request sent by a front end, wherein the score ranking list acquisition request indicates a ranking type;
acquiring a score ranking list corresponding to the ranking type, wherein the score ranking list is acquired according to a Zset set in Redis;
and returning the score ranking list to the front end.
2. The method of claim 1, wherein the leaderboard acquisition request includes a channel identification; before acquiring the score ranking list corresponding to the ranking type, the method comprises the following steps:
and verifying the channel identification and determining that the verification is successful.
3. The method according to claim 2, wherein the score leaderboard acquisition request further includes a mechanism identifier and a role identifier, and before acquiring the score leaderboard corresponding to the ranking type, the method includes:
and verifying the mechanism identifier and the role identifier, and determining that the verification is successful.
4. The method according to claim 1, wherein a preset message interface is adopted to receive the score ranking list acquisition request sent by the client, and the message is in an XML format.
5. The method of claim 1, wherein the leaderboard acquisition request further includes a pagination identification; acquiring a score ranking list corresponding to the ranking type, wherein the acquiring comprises the following steps:
and acquiring the score ranking list according to the ranking type and the paging identifier.
6. The method recited in claim 1, wherein prior to obtaining the leaderboard of points corresponding to the type of ranking, further comprising:
aiming at any sorting type, determining a time range corresponding to the sorting type;
acquiring personal point data of all users in the time range;
storing each user and the personal point data thereof into a Zset set of Redis to obtain the personal point data ranking of each user;
and obtaining a score ranking list corresponding to any ranking type according to the personal score data ranking of each user.
7. The method of claim 6, wherein before storing each user and their personal point data into a Zset set of Redis, comprising:
under the condition that a plurality of users have the same personal point data, determining the weight corresponding to the personal point data of each user in the plurality of users according to a preset rule;
and determining the updated personal point data of each user in the plurality of users according to the personal point data of each user in the plurality of users and the corresponding weight thereof, and taking the updated personal point data of each user in the plurality of users as the personal point data of the user.
8. The method of claim 7, wherein determining the weight corresponding to the personal point data of each of the plurality of users according to a preset rule comprises:
acquiring the number of times of updating personal point data of each user in the plurality of users;
and determining the weight corresponding to the personal point data according to the updating times of the personal point data.
9. The method of claim 6, further comprising, after obtaining a leaderboard corresponding to the any of the types of rankings based on the personal point data rankings of each user:
responding to the update of personal point data of any user, and caching the updated personal point data corresponding to the user;
acquiring personal point data before updating according to the user identification of any user, and deleting the user identification of any user and the personal point data before updating from the point leaderboard;
and storing the user identification of any user and the updated score data into a Zset set so as to obtain an updated score ranking list.
10. The method of claim 6, further comprising, after obtaining a leaderboard corresponding to the any of the types of rankings based on the personal point data rankings of each user:
in response to receiving a splitting instruction of personal point data of any user, splitting the personal point data of the any user into first point data and second point data, wherein the first point data corresponds to a user identifier of the any user, and the second point data corresponds to a new user identifier of the any user;
acquiring personal point data before splitting according to the user identification of any user, and deleting the user identification of any user and the personal point data before splitting from the point ranking list;
and storing the user identifier of any user, the first point data, the newly added user identifier and the second point data into a Zset set so as to obtain an updated point ranking list.
11. Method according to claim 6, wherein the storage of the personal point data of all users is implemented by Redis clustering.
12. An apparatus for data processing, comprising:
the receiving module is used for receiving a score ranking list acquisition request sent by a front end, wherein the score ranking list acquisition request indicates a ranking type;
the acquisition module is used for acquiring a score ranking list corresponding to the ranking type, wherein the score ranking list is acquired according to a Zset set in Redis;
and the sending module returns the score ranking list to the front end.
13. The apparatus of claim 12, wherein the leaderboard acquisition request includes a channel identification; the receiving module is further configured to: and before acquiring the score ranking list corresponding to the ranking type, verifying the channel identifier and determining that the verification is successful.
14. The apparatus of claim 13, wherein the leaderboard acquisition request further includes a house identifier and a role identifier, and wherein the receiving module is further configured to: before the point ranking list corresponding to the ranking type is obtained, verifying the mechanism identification and the role identification, and determining that the verification is successful.
15. The apparatus according to claim 12, wherein a predetermined message interface is used to receive the score leaderboard acquisition request sent by the client, and the message is in an XML format.
16. The apparatus of claim 12, wherein the leaderboard acquisition request further includes a pagination identification; the obtaining module is further configured to: and acquiring the score ranking list according to the ranking type and the paging identifier.
17. The apparatus of claim 12, wherein the obtaining module is further configured to: prior to obtaining a leaderboard of points corresponding to the ranking type,
for any sorting type, determining a time range corresponding to the any sorting type;
acquiring personal point data of all users in the time range;
storing each user and the personal point data thereof into a Zset set of Redis to obtain the personal point data ranking of each user;
and determining a score ranking list corresponding to any ranking type according to the personal score data ranking of each user.
18. The apparatus of claim 17, wherein the obtaining module is further configured to: before each user and their personal point data are stored in the Zset set of Redis,
under the condition that a plurality of users have the same personal point data, determining the weight corresponding to the personal point data of each user in the plurality of users according to a preset rule;
and determining the updated personal point data of each user in the plurality of users according to the personal point data of each user in the plurality of users and the corresponding weight thereof, and taking the updated personal point data of each user in the plurality of users as the personal point data of the user.
19. The method of claim 18, wherein the obtaining module is further configured to:
acquiring the number of times of updating personal point data of each user in the plurality of users;
and determining the weight corresponding to the personal point data according to the updating times of the personal point data.
20. The apparatus of claim 17, wherein the obtaining module is further configured to: after determining a leaderboard corresponding to the any one ranking type according to each user's personal point data ranking,
responding to the update of personal point data of any user, and caching the updated personal point data corresponding to the user;
acquiring personal point data before updating according to the user identification of any user, and deleting the user identification of any user and the personal point data before updating from the point ranking list;
and storing the user identification of any user and the updated score data into a Zset set so as to obtain an updated score ranking list.
21. The apparatus of claim 17, wherein the obtaining module is further configured to: after determining a leaderboard corresponding to the any one ranking type according to each user's personal point data ranking,
in response to receiving a splitting instruction of personal point data of any user, splitting the personal point data of the any user into first point data and second point data, wherein the first point data corresponds to a user identifier of the any user, and the second point data corresponds to a new user identifier of the any user;
acquiring personal point data before splitting according to the user identification of any user, and deleting the user identification of any user and the personal point data before splitting from the point ranking list;
and storing the user identifier of any user, the first point data, the newly added user identifier and the second point data into a Zset set so as to obtain an updated point ranking list.
22. The apparatus of claim 17, wherein the storage of the personal point data of all users is implemented by a Redis cluster.
23. An electronic device, comprising:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-11.
24. A computer-readable medium, on which a computer program is stored, which, when being executed by a processor, carries out the method according to any one of claims 1-11.
25. A computer program product comprising a computer program, wherein the computer program, when executed by a processor, implements the method of any one of claims 1-11.
CN202211316597.1A 2022-10-26 2022-10-26 Data processing method and device Pending CN115496544A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211316597.1A CN115496544A (en) 2022-10-26 2022-10-26 Data processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211316597.1A CN115496544A (en) 2022-10-26 2022-10-26 Data processing method and device

Publications (1)

Publication Number Publication Date
CN115496544A true CN115496544A (en) 2022-12-20

Family

ID=85114852

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211316597.1A Pending CN115496544A (en) 2022-10-26 2022-10-26 Data processing method and device

Country Status (1)

Country Link
CN (1) CN115496544A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116570928A (en) * 2023-04-24 2023-08-11 北京科乐园网络科技有限公司 Information processing method, device and server based on NFT

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116570928A (en) * 2023-04-24 2023-08-11 北京科乐园网络科技有限公司 Information processing method, device and server based on NFT

Similar Documents

Publication Publication Date Title
CN107302597B (en) Message file pushing method and device
CN111125107A (en) Data processing method, device, electronic equipment and medium
CN110321252B (en) Skill service resource scheduling method and device
CN111258988B (en) Asset management method, device, electronic equipment and medium
CN111460129A (en) Method and device for generating identification, electronic equipment and storage medium
CN112835904A (en) Data processing method and data processing device
CN112118352B (en) Method and device for processing notification trigger message, electronic equipment and computer readable medium
CN111044062A (en) Path planning and recommending method and device
CN110569424A (en) Information recommendation method and device
CN115496544A (en) Data processing method and device
CN113761565A (en) Data desensitization method and apparatus
CN112836201A (en) Method, device, equipment and computer readable medium for multi-platform information intercommunication
CN112948733A (en) Interface maintenance method, device, computing equipment and medium
CN113434754A (en) Method and device for determining recommended API (application program interface) service, electronic equipment and storage medium
CN114285743B (en) Method, device, electronic equipment and storage medium for updating configuration information
CN110851561A (en) Matching method and device for distribution sites
CN117478535B (en) Log storage method and device
CN113778909B (en) Method and device for caching data
CN110019026A (en) A kind of method and apparatus of file clean-up
CN110597802B (en) Message processing method and device
CN118400256A (en) Method, apparatus, device and computer readable medium for locating faults
CN113760346A (en) Information management method and device
CN112925791A (en) Method, device and system for acquiring information
CN115114364A (en) Method, device, equipment and computer readable medium for matching interface
CN113778660A (en) System and method for managing hot spot data

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination