CN113326095A - Commission data processing method and device - Google Patents

Commission data processing method and device Download PDF

Info

Publication number
CN113326095A
CN113326095A CN202110582366.4A CN202110582366A CN113326095A CN 113326095 A CN113326095 A CN 113326095A CN 202110582366 A CN202110582366 A CN 202110582366A CN 113326095 A CN113326095 A CN 113326095A
Authority
CN
China
Prior art keywords
plan
index
identifier
guest
plans
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
CN202110582366.4A
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.)
Beijing Jingdong Century Trading Co Ltd
Beijing Wodong Tianjun Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Wodong Tianjun Information Technology 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 Beijing Jingdong Century Trading Co Ltd, Beijing Wodong Tianjun Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN202110582366.4A priority Critical patent/CN113326095A/en
Publication of CN113326095A publication Critical patent/CN113326095A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2228Indexing structures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution
    • G06F16/24552Database cache management
    • 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/0241Advertisements
    • G06Q30/0251Targeted advertisements
    • G06Q30/0253During e-commerce, i.e. online transactions
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45579I/O management, e.g. providing access to device drivers or storage

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Business, Economics & Management (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • Accounting & Taxation (AREA)
  • General Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Finance (AREA)
  • Data Mining & Analysis (AREA)
  • Strategic Management (AREA)
  • Development Economics (AREA)
  • Entrepreneurship & Innovation (AREA)
  • Game Theory and Decision Science (AREA)
  • Computational Linguistics (AREA)
  • Economics (AREA)
  • Marketing (AREA)
  • General Business, Economics & Management (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention discloses a commission data processing method and device, and relates to the technical field of computers. One embodiment of the method comprises: after receiving an ordering operation on an article, acquiring article promotion information and guest pushing information in ordering information, and inquiring inverted indexes corresponding to the article promotion information and the guest pushing information; reading plan identification in the reverse index, determining a forward index corresponding to the plan identification, obtaining a plan list in the forward index, and screening out a plurality of plans of which the ordering time is within the range of plan starting time and plan ending time; and taking the plan with the highest priority level in the plurality of plans as a target plan, and calculating the commission amount paid to the guest based on the order amount and the commission ratio in the target plan. The embodiment establishes the forward and reverse indexes, avoids searching and comparing one by one, stores the indexes to Redis to reduce the storage pressure of MySQL, adds JVM to reduce the cache pressure of Redis, and improves the stability and the availability of system operation.

Description

Commission data processing method and device
Technical Field
The invention relates to the technical field of computers, in particular to a commission data processing method and device.
Background
With the continuous development of e-commerce services, the number of resident merchants is gradually increased, the promotion requirements of merchants are also continuously expanded, and an e-commerce advertisement alliance platform is provided to meet the promotion requirements of merchants for providing better services. The advertiser uses the commercial advertising alliance platform to popularize the articles and stores, and the buyer uses the commercial advertising alliance platform to popularize the articles and stores so as to obtain commission. CPS (Cost Per Sales, i.e., pay Per sale) plan queries as a core therein, essentially matching by business logic which advertiser pays a commission for the promotion based on the promotion of the tweet.
The current implementation logic is: the advertiser creates a plan and stores the plan in MySQL, when the plan is matched, the plan in MySQL is read according to the information of the pushers and the information of the promoted items, and then the optimal plan, namely the optimal commission proportion, is selected through business logic so as to determine how much commission is paid to the pushers.
In the process of implementing the invention, the inventor finds that the prior art has at least the following problems: after a user clicks item promotion information to perform ordering operation, the ordering operation is transmitted to MySQL to match a plan, so that two obvious disadvantages exist, namely that the reading plan is too slow, and the MySQL is possibly down to influence the whole CPS service when the ordering amount of the user is too much.
Disclosure of Invention
In view of this, embodiments of the present invention provide a commission data processing method and apparatus, which can at least solve the problem in the prior art that all order placing information is transmitted to MySQL processing, which results in too slow query planning.
To achieve the above object, according to an aspect of an embodiment of the present invention, there is provided a commission data processing method including:
after receiving an ordering operation on an article, acquiring article promotion information and guest pushing information in ordering information, and inquiring inverted indexes corresponding to the article promotion information and the guest pushing information; wherein the access link of the item is obtained by clicking a plan, which is created by an advertiser and promoted by a guest;
reading plan identification in the reverse index, determining a forward index corresponding to the plan identification, obtaining a plan list in the forward index, and screening out a plurality of plans of which the ordering time is within the range of plan starting time and plan ending time;
and taking the plan with the highest priority level in the plurality of plans as a target plan, and calculating the commission amount paid to the guest based on the order amount and the commission proportion in the target plan.
Optionally, before the querying the reverse index corresponding to the item promotion information and the guest pushing information, the method further includes:
taking the plan starting time and the plan ending time as query conditions, and querying a plan in a database in a current running state;
for any plan, creating an inverted index according to the item promotion information and the plan identification in the any plan; and
determining all plans corresponding to the identification of any plan, and creating a forward index by combining the plan identifications;
and writing the reverse index and the forward index of each plan into a cache database together.
Optionally, the plan includes at least one of a shop plan, a category plan, and an explosive plan;
for the shop plan, the key name of the inverted index is a shop identifier, and the key value is a shop plan identifier list corresponding to the shop identifier; the key name of the forward index is a store plan identifier, and the key value is a store plan list corresponding to the store plan identifier;
for the category plan, the key name of the inverted index is formed by sequentially combining a first-level category identifier, a second-level category identifier and a third-level category identifier in the plan, and the key value is a category plan identifier list corresponding to the key name of the inverted index; the key name of the forward index is a category plan identifier, and the key value is a category plan list corresponding to the category plan identifier;
for explosive item plans, the key name of the inverted index is an item identifier, and the key value is an explosive item plan identifier list corresponding to the item identifier; the key name of the positive index is an explosive plan identifier, and the key value is an explosive plan list corresponding to the explosive plan identifier.
Optionally, after the writing the reverse index and the forward index of each plan into the cache database together, the method further includes:
writing the planned inverted index in the cache database into the virtual machine; and
and calculating the size of the residual resource after the virtual machine writes the reverse index of the plan, if the size of the residual resource is larger than the size of the resource occupied by the forward index of the plan, writing the forward index of the plan in the cache database into the virtual machine, otherwise, not processing.
Optionally, the method further includes: and accumulating a preset value for the previous version number to generate a current version number, and adding and storing the current version number for each key name of the inverted index.
Optionally, the method further includes: and in the cache database, judging whether a plan reaches a preset cleaning time point of the plan or not, and if so, filtering the plan.
Optionally, the method further includes: and after the plan forward index is written into the cache database, representing the attribute of each plan by using a preset data format type.
Optionally, the system further comprises a plan station leader binding relationship, which is used for storing the binding relationship between the plan and the guest push;
the method further comprises the following steps:
creating a reverse index and a forward index of the binding relationship of the planned station length, and writing the reverse index and the forward index into a cache database together; the key name of the inverted index is a guest pushing identifier, and the key value is a plan identifier list corresponding to the guest pushing identifier; the key name of the forward index is a plan identifier, and the key value is a list formed by the binding relationship of plan station lengths corresponding to the plan identifier;
and performing intersection processing on a plan identification list in the inverted index searched according to the article promotion information and a plan identification list in the inverted index searched according to the guest pushing identification.
Optionally, the taking a plan with the highest priority level among the plurality of plans as a target plan includes:
screening out a first plan with the highest priority level from the plurality of plans, and judging whether the number of the first plans is one;
if the number of the second plans is one, taking the first plan as a target plan, otherwise, screening out a second plan with the highest commission ratio from the first plan, and judging whether the number of the second plans is one;
and if the number of the second plans is one, taking the second plan as a target plan, otherwise, screening a third plan with the earliest creation time from the second plan, and taking the third plan as the target plan.
To achieve the above object, according to another aspect of an embodiment of the present invention, there is provided a commission data processing apparatus including:
the query module is used for acquiring the article promotion information and the guest pushing information in the ordering information after receiving ordering operation on an article, and querying the reverse index corresponding to the article promotion information and the guest pushing information; wherein the access link of the item is obtained by clicking a plan, which is created by an advertiser and promoted by a guest;
the screening module is used for reading the plan identification in the reverse index, determining the forward index corresponding to the plan identification, acquiring a plan list in the forward index, and further screening out a plurality of plans of which the ordering time is within the range of the plan starting time and the plan ending time;
and the calculation module is used for taking the plan with the highest priority level in the plurality of plans as a target plan, and calculating the commission amount paid to the guest based on the order amount and the commission proportion in the target plan.
Optionally, the apparatus further includes an index creating module, configured to:
taking the plan starting time and the plan ending time as query conditions, and querying a plan in a database in a current running state;
for any plan, creating an inverted index according to the item promotion information and the plan identification in the any plan; and
determining all plans corresponding to the identification of any plan, and creating a forward index by combining the plan identifications;
and writing the reverse index and the forward index of each plan into a cache database together.
Optionally, the plan includes at least one of a shop plan, a category plan, and an explosive plan;
for the shop plan, the key name of the inverted index is a shop identifier, and the key value is a shop plan identifier list corresponding to the shop identifier; the key name of the forward index is a store plan identifier, and the key value is a store plan list corresponding to the store plan identifier;
for the category plan, the key name of the inverted index is formed by sequentially combining a first-level category identifier, a second-level category identifier and a third-level category identifier in the plan, and the key value is a category plan identifier list corresponding to the key name of the inverted index; the key name of the forward index is a category plan identifier, and the key value is a category plan list corresponding to the category plan identifier;
for explosive item plans, the key name of the inverted index is an item identifier, and the key value is an explosive item plan identifier list corresponding to the item identifier; the key name of the positive index is an explosive plan identifier, and the key value is an explosive plan list corresponding to the explosive plan identifier.
Optionally, the apparatus further includes an index storage module, configured to:
writing the planned inverted index in the cache database into the virtual machine; and
and calculating the size of the residual resource after the virtual machine writes the reverse index of the plan, if the size of the residual resource is larger than the size of the resource occupied by the forward index of the plan, writing the forward index of the plan in the cache database into the virtual machine, otherwise, not processing.
Optionally, the system further includes a version adding module, configured to: and accumulating a preset value for the previous version number to generate a current version number, and adding and storing the current version number for each key name of the inverted index.
Optionally, the system further includes an expiration clearing module, configured to: and in the cache database, judging whether a plan reaches a preset cleaning time point of the plan or not, and if so, filtering the plan.
Optionally, the apparatus further includes a format change module, configured to: and after the plan forward index is written into the cache database, representing the attribute of each plan by using a preset data format type.
Optionally, the system further comprises a plan station leader binding relationship, which is used for storing the binding relationship between the plan and the guest push;
the device further comprises:
creating a reverse index and a forward index of the binding relationship of the planned station length, and writing the reverse index and the forward index into a cache database together; the key name of the inverted index is a guest pushing identifier, and the key value is a plan identifier list corresponding to the guest pushing identifier; the key name of the forward index is a plan identifier, and the key value is a list formed by the binding relationship of plan station lengths corresponding to the plan identifier;
and performing intersection processing on a plan identification list in the inverted index searched according to the article promotion information and a plan identification list in the inverted index searched according to the guest pushing identification.
Optionally, the calculating module is configured to:
screening out a first plan with the highest priority level from the plurality of plans, and judging whether the number of the first plans is one;
if the number of the second plans is one, taking the first plan as a target plan, otherwise, screening out a second plan with the highest commission ratio from the first plan, and judging whether the number of the second plans is one;
and if the number of the second plans is one, taking the second plan as a target plan, otherwise, screening a third plan with the earliest creation time from the second plan, and taking the third plan as the target plan.
To achieve the above object, according to still another aspect of embodiments of the present invention, there is provided a commission data processing electronic device.
The electronic device of the embodiment of the invention comprises: one or more processors; a storage device for storing one or more programs which, when executed by the one or more processors, cause the one or more processors to implement any of the commission data processing methods described above.
To achieve the above object, according to still another aspect of embodiments of the present invention, there is provided a computer-readable medium on which a computer program is stored, the program, when executed by a processor, implementing any of the commission data processing methods described above.
According to the scheme provided by the invention, one embodiment of the invention has the following advantages or beneficial effects: the CQRS framework separates the planned reading and writing, so that maintenance is easier to perform, forward and reverse indexes are established, the process of searching and comparing one by one is avoided, the forward and reverse indexes are stored to Redis to reduce the storage pressure of MySQL, and JVM is added to reduce the cache pressure of Redis, so that the stability and the availability of the system are improved.
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 three-tier architecture employed by a prior E-commerce advertising alliance platform;
FIG. 2 is a plan read-write separation architecture employing a CQRS architecture diagram;
FIG. 3 is a flowchart illustrating a method for constructing a plan index according to an embodiment of the invention;
fig. 4 is a schematic main flow chart of a commission data processing method according to the embodiment of the invention;
fig. 5 is a schematic diagram of main blocks of a commission 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 with a mobile device or server implementing an embodiment of the 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.
At the initial stage of the creation of the e-commerce advertising alliance platform, since the e-commerce advertising alliance platform is unknown to the public, the advertising programs of advertisers are less, and the promotion behaviors of customers are less. With the rapid development of business, the e-commerce advertising alliance platform is well known by more and more advertisers and buyers, and the advertisers create more plans and the buyers have more popularization behaviors. Referring to fig. 1, the e-commerce advertising alliance platform adopts a traditional three-layer architecture, and the application is divided into: the system comprises a display layer, an application layer and a data access layer, wherein the display layer is used for checking information promoted by the pushers and inquiring the optimal commission proportion, the application layer is used for matching a plan, and the data access layer is used for reading the plan from MySQL.
At present, the plan is d +1 effective, namely the plan created today is effective tomorrow, so the scheme adopts a CQRS architecture diagram to change the three-layer architecture in FIG. 1 into a plan read-write separation architecture, and is easier to maintain. As shown in fig. 2. The upper half part is used for loading the plan, the reverse index and the forward index of the plan are loaded to Redis, the full loading is preferably carried out once a day, and no pressure exists for MySQL; the bottom half is for scheduled reads, and every 5 minutes (for example only) to read scheduled or write JVM from Redis, there is no pressure for more ordering operations.
Referring to fig. 3, a main flowchart of a method for constructing a plan index according to an embodiment of the present invention is shown, which includes the following steps:
s301: taking the plan starting time and the plan ending time as query conditions, and querying a plan in a database in a current running state;
s302: for any plan, creating an inverted index according to the item promotion information and the plan identification in the any plan;
s303: determining all plans corresponding to the identification of any plan, and creating a forward index by combining the plan identifications;
s304: and writing the reverse index and the forward index of each plan into a cache database together.
In the above embodiment, the plan in the present embodiment is an abstract term in terms of nouns in steps S301 to S302, and includes a plan start/end time, advertiser information, commission ratio, plan type, and the like, and the item includes a commodity and a store. The information contained in the plan created by the advertiser is as follows:
1) shop planning: planId (plan id), popId (store id), basicRatio (commission ratio), startDate (start date), endDate (end date).
2) And (4) category planning: planId (plan id), cat 1 (primary category id), cat 2 (secondary category id), cat 3 (tertiary category id), communisionratio (commission proportion), startDate (start date), endDate (end date).
3) And (4) blasting the product: planId (plan id), skuId, comissionratio (commission ratio), startDate (start date), endDate (end date).
And (3) with the plan starting time and the plan ending time as query conditions and the plan not suspended as an additional condition, querying all plans created by the advertisers meeting the requirements from the MySQL database, and then creating indexes one by one. For any plan, a plan inverted index can be created according to the item promotion information and the guest pushing information in the plan:
1) map < Long, List < Long > > planBasicIndex (is an inverted index structure), wherein Key of Map is pop id, and Value is a List consisting of store plan ids corresponding to the pop id.
2) Category plan inverted index: map < Long, List < Long > > planCatendex, where the Key of Map is cat 1_ cat 2_ cat 3, and Value is the List of the category plan id corresponding to this cat 1_ cat 2_ cat 3.
3) Explosive plan inverted index: map < Long, List < Long > > planGoodsIndex, wherein Key of Map is skuId, and Value is a List composed of explosive plan ids corresponding to the skuId.
And simultaneously, creating a plan forward index according to the plan id:
1) map < Long, List < Plan > > planBasicMap, wherein Key is a store Plan id, and value is an abstract Plan List corresponding to the store Plan id. It should be noted that, since the types of plans are various, one store plan id may correspond to a plurality of store plans, and therefore, it is preferable to present them in a list form. In actual operation, the used information can be abstracted into a uniform planning model according to actual needs.
2) Category plan forward indexing: map < Long, List < Plan > > planCateMap, wherein Key of Map is category Plan id, and Value is abstract Plan List corresponding to the category Plan id.
3) Explosive plan forward-ranking index: map < Long, List < Plan > > planGoodsMap, wherein Key of the Map is explosive Plan id, and Value is an abstract Plan List corresponding to the explosive Plan id.
For step S303, after the forward index and the reverse index of each plan are created, all the planned forward indexes and reverse indexes are stored together in Redis. In order to further improve the planned reading speed, a virtual machine JVM is introduced on the basis of Redis to reduce the cache pressure of the Redis. Considering that the reverse index only stores keys, the data size is small, and not too much resources are occupied, while the forward index stores all planning information and occupies too many resources, the planning reverse index in Redis is preferably written into the JVM.
Furthermore, considering the Key expiration problem of Redis, a version number, such as v1, v2, and v3., may be added to each Key of the inverted index, and each change may be accumulated with a preset value to upgrade a version number, which is convenient for cleaning in the future. The expiration time of the Key is affected by the planned end time, and is usually greater than the planned end time, if the planned end time is 2021/04/03, the Key expiration time is set to 2021/04/04; if the Key expiration problem is not considered, the Key can always occupy Redis resources, and the resource cost is increased. And because the keys of the inverted indexes generated each time are different, the running of original data on the line cannot be influenced.
For the plan forward index, the JVM memory remaining resources are viewed through the JVM command (for example, viewing through a set visual interface), and the JVM memory remaining resources can also be written into the JVM under the condition that the JVM memory remaining resources are sufficient, so that the plan acquisition speed is accelerated. Furthermore, in order to reduce occupation of Redis resources by the forward index as much as possible, all attributes in the play object of the forward index are preferably represented by Java basic data types.
When the advertiser creates a plan, it needs to create a plan site-length binding relationship for each plan, including a planId (plan id), a unionId (guest pushing id), a startDate (start date), and an endDate (end date). Thus, for a partial plan, a tweet promotion can be specified, such as plan 1-tweet 1, tweet 2, tweet 3, whose plan information can include a list of tweet information that promotes the plan.
Considering that the planned length-of-site binding relationship also needs to be stored in the Redis, the planned length-of-site binding relationship reverse index and reverse index are also generally generated according to the above manner of generating the planned reverse index and forward index:
1) reverse indexing of the binding relationship of the planned station leader: map < Long, List < Long > > planGoodsIndex, wherein Key of Map is unioniD, and Value is a List consisting of plan ids corresponding to unioniD.
2) Forward indexing of the binding relationship of the planned station leader: map < Long, List < UnionPlan > > unionPlanMap, wherein Key of Map is plan id, and Value is a List formed by the binding relationship of plan station length corresponding to plan id.
If a CQRS architecture is not used, a large number of JVM resources are occupied by constructing a plan reverse index and a plan forward index, and if a large flow high concurrency condition is met, the system is likely to crash due to exhaustion of the JVM resources, so that a Redis cluster is relied on, the occupation of the JVM resources is reduced, and the system crash is avoided. The planned reads and writes are separated by using the CRQS architecture, with read being one application, write being another application, and storage and reading of data being done intermediately through Redis.
In the method provided by the embodiment, Redis is designed based on the memory, and compared with MySQL, Redis can bear more ordering information and bear a part of pressure on MySQL, and the virtual machine is considered to be faster than the read-write speed of Redis, so that the virtual machine is further introduced to reduce the cache pressure of Redis.
Referring to fig. 4, a main flowchart of a commission data processing method according to an embodiment of the present invention is shown, which includes the following steps:
s401: after receiving an ordering operation on an article, acquiring article promotion information and guest pushing information in ordering information, and inquiring inverted indexes corresponding to the article promotion information and the guest pushing information; wherein the access link of the item is obtained by clicking a plan, which is created by an advertiser and promoted by a guest;
s402: reading plan identification in the reverse index, determining a forward index corresponding to the plan identification, obtaining a plan list in the forward index, and screening out a plurality of plans of which the ordering time is within the range of plan starting time and plan ending time;
s403: and taking the plan with the highest priority level in the plurality of plans as a target plan, and calculating the commission amount paid to the guest based on the order amount and the commission proportion in the target plan.
In the above embodiment, in step S401, the shopper promotes the item information to the user through the promotion plan, and the user clicks the item information, i.e. the user can access the item through the access link therein, and then the user places an order to indicate that the shopper needs to be paid for a certain commission. The ordering information includes:
1) article information: skuId, vender Id (store id), cat 1 (class one), cat 2 (class two), cat 3 (class three), pop (whether pop commodity or not)
2) Pushing the guest information: unionId (Guest push id), unionUserLevel (level)
3) Order information: orderId, orderTime (order time)
The E-commerce advertisement alliance platform and the E-commerce platform establish communication link, after receiving order placing operation of a user on a promoted article, the E-commerce advertisement alliance platform can acquire guest pushing information and promoted article information from the order placing information, and then searches corresponding inverted indexes by taking the article information as keys. Here, a key may contain one or more of an id of a store to which the item belongs, an id of a category to which the item belongs, and a skiid. The inverted index here, reads from the JVM:
1) map < Long, List < Long > > planBasicIndex (is an inverted index structure), wherein Key of Map is pop id, and Value is a List consisting of store plan ids corresponding to the pop id.
2) Category plan inverted index: map < Long, List < Long > > planCatendex, where the Key of Map is cat 1_ cat 2_ cat 3, and Value is the List of the category plan id corresponding to this cat 1_ cat 2_ cat 3.
3) Explosive plan inverted index: map < Long, List < Long > > planGoodsIndex, wherein Key of Map is skuId, and Value is a List composed of explosive plan ids corresponding to the skuId.
And searching a corresponding inverted index according to the fact that the guest pushing id is a key: reverse indexing of the binding relationship of the planned station leader: map < Long, List < Long > > planGoodsIndex, wherein Key of Map is unioniD, and Value is a List consisting of plan ids corresponding to unioniD.
For step S402, performing intersection processing on the plan identifier list in the inverted index found according to the item promotion information and the plan identifier in the inverted index found according to the guest pushing identifier to obtain a plan id for subsequent use. The plan id is the Key of the forward index, so that the value of the forward index, i.e. the plan list, can be obtained. For example, according to the popId (store id) in the item promotion information, the planId in the planbasicndex is read, and the corresponding plan list is obtained from the planBasicMap through the planId. It should be noted that the forward index is stored in the JVM if the JVM resources are sufficient, and otherwise remains in the Redis, so the forward index here may be obtained from the Redis or the JVM.
The ordering information includes ordering time, and the ending time of some plans is earlier than the ordering time or the starting time is later than the ordering time, so that after the plan list is acquired, a plurality of plans with ordering time within the range of the starting and ending time of the plans are screened.
For step S403, when the advertiser creates a plan, different priorities are set according to different plan types, such as explosive > category > store, explosive > store > category. Therefore, the screened plan lists meeting the conditions are sorted according to the priority order and the like, if the number of the first plans with the highest priority is one, the first plans are used as target plans, and if not, the screening is continued. Preferably, the commission ratio is screened, a second plan with the highest commission ratio is screened from the first plans, if the number of the second plans is one, the second plan is used as a target plan, otherwise, the screening is continued, and a third plan with the earliest creation time in the selected area is used as the target plan.
Each plan includes plan start and end time, advertiser information, commission ratio, plan type, etc. so that the commission ratio in the target plan is multiplied by the amount the user places an order to obtain the commission amount to be paid to the guest.
The method provided by the embodiment establishes the plan forward and backward indexes, avoids the process of searching and comparing one by one, and improves the query speed; even if a plurality of plans are inquired, the filtering is continued through the plan starting and ending time, the priority level, the commission ratio and the creation time, so that the calculation accuracy of the commission amount is improved.
The method provided by the embodiment of the invention provides a plan query scheme based on forward and reverse indexes and a CQRS framework aiming at the problems of slow plan query and possible crash caused by excessive existing MySQL storage plans:
1) the planned reading and writing are separated through a CQRS framework, and maintenance is easier to carry out.
2) The forward and reverse indexes are established, so that the process of searching and comparing one by one is avoided;
3) under the conditions of less planning information and enough JVM resources, the forward index can be written into the memory to improve the interface performance, otherwise, only the reverse index is stored in the JVM, and although partial performance is lost, the stability and the availability of the system are improved, and the storage bottleneck can not be generated in the face of increasing popularization.
Referring to fig. 5, a schematic diagram of main modules of a commission data processing device 500 provided by the embodiment of the invention is shown, including:
the query module 501 is configured to, after receiving an order placing operation for an article, acquire article promotion information and guest pushing information in the order placing information, and query reverse indexes corresponding to the article promotion information and the guest pushing information; wherein the access link of the item is obtained by clicking a plan, which is created by an advertiser and promoted by a guest;
a screening module 502, configured to read a plan identifier in the inverted index, determine a forward index corresponding to the plan identifier, obtain a plan list in the forward index, and further screen out multiple plans whose ordering time is within a plan start time and an ending time range;
and a calculating module 503, configured to take the plan with the highest priority level in the plurality of plans as a target plan, and calculate a commission amount to be paid to the guest based on the order amount and the commission proportion in the target plan.
The device for implementing the invention also comprises an index creating module, which is used for:
taking the plan starting time and the plan ending time as query conditions, and querying a plan in a database in a current running state;
for any plan, creating an inverted index according to the item promotion information and the plan identification in the any plan; and
determining all plans corresponding to the identification of any plan, and creating a forward index by combining the plan identifications;
and writing the reverse index and the forward index of each plan into a cache database together.
In the implementation device of the invention, the plan comprises at least one of a shop plan, a category plan and an explosive plan;
for the shop plan, the key name of the inverted index is a shop identifier, and the key value is a shop plan identifier list corresponding to the shop identifier; the key name of the forward index is a store plan identifier, and the key value is a store plan list corresponding to the store plan identifier;
for the category plan, the key name of the inverted index is formed by sequentially combining a first-level category identifier, a second-level category identifier and a third-level category identifier in the plan, and the key value is a category plan identifier list corresponding to the key name of the inverted index; the key name of the forward index is a category plan identifier, and the key value is a category plan list corresponding to the category plan identifier;
for explosive item plans, the key name of the inverted index is an item identifier, and the key value is an explosive item plan identifier list corresponding to the item identifier; the key name of the positive index is an explosive plan identifier, and the key value is an explosive plan list corresponding to the explosive plan identifier.
The device for implementing the invention also comprises an index storage module, which is used for:
writing the planned inverted index in the cache database into the virtual machine; and
and calculating the size of the residual resource after the virtual machine writes the reverse index of the plan, if the size of the residual resource is larger than the size of the resource occupied by the forward index of the plan, writing the forward index of the plan in the cache database into the virtual machine, otherwise, not processing.
The device for implementing the invention also comprises a version adding module used for:
and accumulating a preset value for the previous version number to generate a current version number, and adding and storing the current version number for each key name of the inverted index.
The implementation device of the invention also comprises an overdue cleaning module which is used for:
and in the cache database, judging whether a plan reaches a preset cleaning time point of the plan or not, and if so, filtering the plan.
The implementation device of the invention also comprises a format change module used for:
and after the plan forward index is written into the cache database, representing the attribute of each plan by using a preset data format type.
The implementation device also comprises a plan station leader binding relationship which is used for storing the binding relationship between the plan and the guest pushing;
the device further comprises:
creating a reverse index and a forward index of the binding relationship of the planned station length, and writing the reverse index and the forward index into a cache database together; the key name of the inverted index is a guest pushing identifier, and the key value is a plan identifier list corresponding to the guest pushing identifier; the key name of the forward index is a plan identifier, and the key value is a list formed by the binding relationship of plan station lengths corresponding to the plan identifier;
and performing intersection processing on a plan identification list in the inverted index searched according to the article promotion information and a plan identification list in the inverted index searched according to the guest pushing identification.
In the device for implementing the present invention, the calculating module 503 is configured to:
screening out a first plan with the highest priority level from the plurality of plans, and judging whether the number of the first plans is one;
if the number of the second plans is one, taking the first plan as a target plan, otherwise, screening out a second plan with the highest commission ratio from the first plan, and judging whether the number of the second plans is one;
and if the number of the second plans is one, taking the second plan as a target plan, otherwise, screening a third plan with the earliest creation time from the second plan, and taking the third plan as the target plan.
In addition, the detailed implementation of the device in the embodiment of the present invention has been described in detail in the above method, so that the repeated description is not repeated here.
Fig. 6 shows an exemplary system architecture 600 in which embodiments of the invention may be applied, including terminal devices 601, 602, 603, a network 604 and a server 605 (by way of example only).
The terminal devices 601, 602, 603 may be various electronic devices having display screens and supporting web browsing, and installed with various communication client applications, and users may interact with the server 605 through the network 604 using the terminal devices 601, 602, 603 to receive or transmit messages and the like.
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.
The server 605 may be a server providing various services for performing operations of receiving ordering information, querying a forward and reverse index, screening a target plan, and calculating a payment commission.
It should be noted that the method provided by the embodiment of the present invention is generally executed by the server 605, and accordingly, the 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 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 in accordance with 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 the embodiments of the present disclosure, the processes described above with reference to the flowcharts 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 many 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 query module, a screening module, and a calculation module. Where the names of these modules do not in some way constitute a limitation on the modules themselves, for example, a computing module may also be described as a "commission computing module".
As another aspect, the present invention also provides a computer-readable medium that 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:
after receiving an ordering operation on an article, acquiring article promotion information and guest pushing information in ordering information, and inquiring inverted indexes corresponding to the article promotion information and the guest pushing information; wherein the access link of the item is obtained by clicking a plan, which is created by an advertiser and promoted by a guest;
reading plan identification in the reverse index, determining a forward index corresponding to the plan identification, obtaining a plan list in the forward index, and screening out a plurality of plans of which the ordering time is within the range of plan starting time and plan ending time;
and taking the plan with the highest priority level in the plurality of plans as a target plan, and calculating the commission amount paid to the guest based on the order amount and the commission proportion in the target plan.
According to the technical scheme of the embodiment of the invention, aiming at the problems of slow plan query and possible crash caused by excessive existing MySQL storage plans, the plan query scheme based on forward and reverse indexes and a CQRS framework is provided:
1) the planned reading and writing are separated through a CQRS framework, and maintenance is easier to carry out.
2) The forward and reverse indexes are established, so that the process of searching and comparing one by one is avoided;
3) under the conditions of less planning information and enough JVM resources, the forward index can be written into the memory to improve the interface performance, otherwise, only the reverse index is stored in the JVM, and although partial performance is lost, the stability and the availability of the system are improved, and the storage bottleneck can not be generated in the face of increasing popularization.
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 (12)

1. A commission data processing method, comprising:
after receiving an ordering operation on an article, acquiring article promotion information and guest pushing information in ordering information, and inquiring inverted indexes corresponding to the article promotion information and the guest pushing information; wherein the access link of the item is obtained by clicking a plan, which is created by an advertiser and promoted by a guest;
reading plan identification in the reverse index, determining a forward index corresponding to the plan identification, obtaining a plan list in the forward index, and screening out a plurality of plans of which the ordering time is within the range of plan starting time and plan ending time;
and taking the plan with the highest priority level in the plurality of plans as a target plan, and calculating the commission amount paid to the guest based on the order amount and the commission proportion in the target plan.
2. The method of claim 1, further comprising, prior to said querying the inverted index corresponding to the item promotion information and the guest information:
taking the plan starting time and the plan ending time as query conditions, and querying a plan in a database in a current running state;
for any plan, creating an inverted index according to the item promotion information and the plan identification in the any plan; and
determining all plans corresponding to the identification of any plan, and creating a forward index by combining the plan identifications;
and writing the reverse index and the forward index of each plan into a cache database together.
3. The method of claim 2, wherein the plan comprises at least one of a store plan, a category plan, an explosive plan;
for the shop plan, the key name of the inverted index is a shop identifier, and the key value is a shop plan identifier list corresponding to the shop identifier; the key name of the forward index is a store plan identifier, and the key value is a store plan list corresponding to the store plan identifier;
for the category plan, the key name of the inverted index is formed by sequentially combining a first-level category identifier, a second-level category identifier and a third-level category identifier in the plan, and the key value is a category plan identifier list corresponding to the key name of the inverted index; the key name of the forward index is a category plan identifier, and the key value is a category plan list corresponding to the category plan identifier;
for explosive item plans, the key name of the inverted index is an item identifier, and the key value is an explosive item plan identifier list corresponding to the item identifier; the key name of the positive index is an explosive plan identifier, and the key value is an explosive plan list corresponding to the explosive plan identifier.
4. The method of claim 2 or 3, further comprising, after writing the reverse index and the forward index of each plan together to the cache database:
writing the planned inverted index in the cache database into the virtual machine; and
and calculating the size of the residual resource after the virtual machine writes the reverse index of the plan, if the size of the residual resource is larger than the size of the resource occupied by the forward index of the plan, writing the forward index of the plan in the cache database into the virtual machine, otherwise, not processing.
5. The method of claim 2 or 3, further comprising:
and accumulating a preset value for the previous version number to generate a current version number, and adding and storing the current version number for each key name of the inverted index.
6. The method of claim 2 or 3, further comprising:
and in the cache database, judging whether a plan reaches a preset cleaning time point of the plan or not, and if so, filtering the plan.
7. The method of claim 2 or 3, further comprising:
and after the plan forward index is written into the cache database, representing the attribute of each plan by using a preset data format type.
8. The method of claim 1, further comprising a planned sitemap binding relationship for storing a binding relationship between a plan and a guest;
the method further comprises the following steps:
creating a reverse index and a forward index of the binding relationship of the planned station length, and writing the reverse index and the forward index into a cache database together; the key name of the inverted index is a guest pushing identifier, and the key value is a plan identifier list corresponding to the guest pushing identifier; the key name of the forward index is a plan identifier, and the key value is a list formed by the binding relationship of plan station lengths corresponding to the plan identifier;
and performing intersection processing on a plan identification list in the inverted index searched according to the article promotion information and a plan identification list in the inverted index searched according to the guest pushing identification.
9. The method of claim 1, wherein said targeting a plan of the plurality of plans with a highest priority level comprises:
screening out a first plan with the highest priority level from the plurality of plans, and judging whether the number of the first plans is one;
if the number of the second plans is one, taking the first plan as a target plan, otherwise, screening out a second plan with the highest commission ratio from the first plan, and judging whether the number of the second plans is one;
and if the number of the second plans is one, taking the second plan as a target plan, otherwise, screening a third plan with the earliest creation time from the second plan, and taking the third plan as the target plan.
10. A commission data processing apparatus, comprising:
the query module is used for acquiring the article promotion information and the guest pushing information in the ordering information after receiving ordering operation on an article, and querying the reverse index corresponding to the article promotion information and the guest pushing information; wherein the access link of the item is obtained by clicking a plan, which is created by an advertiser and promoted by a guest;
the screening module is used for reading the plan identification in the reverse index, determining the forward index corresponding to the plan identification, acquiring a plan list in the forward index, and further screening out a plurality of plans of which the ordering time is within the range of the plan starting time and the plan ending time;
and the calculation module is used for taking the plan with the highest priority level in the plurality of plans as a target plan, and calculating the commission amount paid to the guest based on the order amount and the commission proportion in the target plan.
11. 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-9.
12. 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-9.
CN202110582366.4A 2021-05-26 2021-05-26 Commission data processing method and device Pending CN113326095A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110582366.4A CN113326095A (en) 2021-05-26 2021-05-26 Commission data processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110582366.4A CN113326095A (en) 2021-05-26 2021-05-26 Commission data processing method and device

Publications (1)

Publication Number Publication Date
CN113326095A true CN113326095A (en) 2021-08-31

Family

ID=77421494

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110582366.4A Pending CN113326095A (en) 2021-05-26 2021-05-26 Commission data processing method and device

Country Status (1)

Country Link
CN (1) CN113326095A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113709059A (en) * 2021-08-27 2021-11-26 中国工商银行股份有限公司 Link flow recording method and node
CN114116775A (en) * 2021-11-08 2022-03-01 北京达佳互联信息技术有限公司 Information processing method, device, equipment and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113709059A (en) * 2021-08-27 2021-11-26 中国工商银行股份有限公司 Link flow recording method and node
CN114116775A (en) * 2021-11-08 2022-03-01 北京达佳互联信息技术有限公司 Information processing method, device, equipment and storage medium

Similar Documents

Publication Publication Date Title
CN106844372B (en) Logistics information query method and device
CN109947788A (en) Data query method and apparatus
CN110472207A (en) List generation method and device
CN105530272A (en) Method and device for application data synchronization
CN113326095A (en) Commission data processing method and device
CN110019258A (en) The method and apparatus for handling order data
CN111221855B (en) Data processing method and device
CN113205402A (en) Account checking method and device, electronic equipment and computer readable medium
CN111127214A (en) Method and apparatus for portfolio
CN103942702A (en) System and method for carrying out e-business based on electronic business cards
CN111339743B (en) Account number generation method and device
KR101405622B1 (en) Monetization of interactive networked-based information objects
CN111275450A (en) Method and system for processing associated preferential information after goods return
CN110928594A (en) Service development method and platform
CN113760521A (en) Virtual resource allocation method and device
CN113762863A (en) Inventory management method and device
CN111831868A (en) Method and apparatus for financial product configuration
CN115775172A (en) Product shelving information display method and system, electronic equipment and readable storage medium
CN115391343A (en) Bill data processing method and device, electronic equipment and storage medium
CN111309722A (en) Data processing method and device
CN114445128A (en) Card ticket management method and device, electronic equipment and computer readable medium
CN109033343B (en) Method and apparatus for generating information
CN113592470A (en) Service processing method and device, electronic equipment and storage medium
CN112256566A (en) Test case preservation method and device
CN113496386A (en) Method and device for combined charging

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