CN109919674B - Advertisement settlement method, device and equipment - Google Patents

Advertisement settlement method, device and equipment Download PDF

Info

Publication number
CN109919674B
CN109919674B CN201910160131.9A CN201910160131A CN109919674B CN 109919674 B CN109919674 B CN 109919674B CN 201910160131 A CN201910160131 A CN 201910160131A CN 109919674 B CN109919674 B CN 109919674B
Authority
CN
China
Prior art keywords
settled
settlement
account
information
accounts
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.)
Active
Application number
CN201910160131.9A
Other languages
Chinese (zh)
Other versions
CN109919674A (en
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 Meitu Home Technology Co ltd
Original Assignee
Xiamen Meitu 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 Xiamen Meitu Technology Co Ltd filed Critical Xiamen Meitu Technology Co Ltd
Priority to CN201910160131.9A priority Critical patent/CN109919674B/en
Publication of CN109919674A publication Critical patent/CN109919674A/en
Application granted granted Critical
Publication of CN109919674B publication Critical patent/CN109919674B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The application discloses an advertisement settlement method, device and equipment, which are used for settling exposure logs to be settled by using settled information which is successfully settled for the last time in a snapshot file, so that repeated calculation and calculation omission of the exposure logs of an account can be avoided. Specifically, to-be-settled data corresponding to an exposure log to be settled is obtained first, and the settled information of each account to be settled is obtained from the snapshot file; settling accounts to be settled in sequence according to the data to be settled and settled information of the accounts to be settled to obtain a settlement result of each account to be settled; then judging whether all accounts to be settled are successfully settled according to the settlement results of all accounts to be settled; and finally, under the condition of successful settlement, updating the snapshot file according to the settlement result.

Description

Advertisement settlement method, device and equipment
Technical Field
The application relates to the technical field of advertisement settlement, in particular to an advertisement settlement method, device and equipment.
Background
During advertisement exposure, an advertisement exposure log is generated, and the advertisement exposure log contains information of an advertiser. In the actual advertisement exposure process, the advertisement exposure logs of all the advertisers are stored in the same queue according to the exposure time of the advertisements, during settlement, one batch of advertisement log information is taken out in sequence according to the sequence of the advertisement exposure time, and then the advertisement money of all the advertisers is settled one by one according to the batch of advertisement exposure logs.
In the existing settlement method, if an error occurs in a batch of advertisements during the settlement process and recalculation is required, two methods are generally adopted, wherein one method is to adopt a settlement starting point of the latest advertisement settlement as a new settlement starting point and then perform the next settlement according to a batch of advertisement logs after the settlement starting point. Another way is to obtain the end point of the last settlement and then proceed the next settlement with the end point as the new settlement start point. In the first settlement method, since the new settlement starting point is the same as the settlement starting point of the previous settlement, the advertisement already settled is repeatedly settled at the next settlement, resulting in a problem of a large fee. In the second settlement method, the advertisement log of the same advertiser is settled together at the time of settlement, and in the second settlement method, there is a problem that the exposure log before the new settlement start point is not settled, and the fee is missed.
Disclosure of Invention
In order to overcome the above-mentioned deficiencies in the prior art, the present application aims to provide an advertisement settlement method, which is applied to an advertisement settlement system in which a snapshot file is stored in advance, wherein the snapshot file includes settled information of a plurality of accounts, the settled information includes a consumable amount of each account and a first settlement serial number, and the first settlement serial number is the largest serial number of exposure logs corresponding to the account in a first queue among all exposure logs which are successfully settled; the exposure log is record information of the advertisement successfully downloaded to the client, and the method comprises the following steps:
acquiring data to be settled corresponding to exposure logs to be settled, wherein the data to be settled comprises accounts to be settled corresponding to each exposure log, expense information to be deducted and queue serial numbers of the exposure logs in a first queue;
acquiring the settled information of each account to be settled from the snapshot file;
settling accounts to be settled in sequence according to the data to be settled and settled information of the accounts to be settled to obtain a settlement result of each account to be settled, wherein the settlement result comprises settled information corresponding to the account to be settled after the settlement is finished;
judging whether all accounts to be settled are successfully settled according to the settlement results of all accounts to be settled;
and if the accounts to be settled are successfully settled, updating the snapshot file according to the settlement result.
Optionally, the method further comprises:
if the account to be settled does not succeed in settlement, re-executing to obtain the data to be settled corresponding to the exposure log to be settled; acquiring the settled information of each account to be settled from the snapshot file; settling accounts to be settled in sequence according to the data to be settled and settled information of the accounts to be settled to obtain a settlement result of each account to be settled; and judging whether all accounts to be settled are successfully settled according to the settlement results of all accounts to be settled.
Optionally, the step of settling accounts to be settled in sequence according to the data to be settled and the settled information of the accounts to be settled until the settlement is finished to obtain the settlement result of each account to be settled includes:
selecting an account to be settled which is not settled as a target account to be settled for settlement operation, wherein the settlement operation comprises the following steps:
acquiring an exposure log corresponding to the target account to be settled from the exposure log to be settled;
calculating the amount of money to be deducted of the target account to be settled according to the exposure log corresponding to the target account to be settled and the expense information of the exposure log;
acquiring the maximum serial number of the exposure log corresponding to the target account to be settled in a first queue in the exposure logs to be settled as a second settlement serial number;
updating the settled information of the account to be settled according to the amount to be deducted and the second settlement serial number;
taking the settled information corresponding to the account to be settled at the end of settlement as a settlement result of the account to be settled;
and reselecting an account to be settled which is not settled as a new target account to be settled, and performing settlement operation.
Optionally, the step of determining whether all accounts to be settled are settled successfully according to the settlement results of all accounts to be settled includes:
respectively judging whether the consumable amount and the first settlement serial number of each account to be settled are updated;
if the consumable amount of each account to be settled is updated and the first settlement serial number is updated, determining that all accounts to be settled are settled successfully;
and if the consumable amount of the account to be settled is not updated or the first settlement serial number is not updated, determining that the account to be settled which is not successfully settled exists.
Optionally, the step of updating the snapshot file according to the settlement result includes:
storing the settlement results of all the accounts to be settled to a second queue;
and updating the snapshot file according to the settlement result of each account to be settled in the second queue.
Optionally, the method further comprises the step of,
and displaying advertisements according to the consumable amount of each account in the snapshot file.
Another object of the present invention is to provide an advertisement settlement apparatus, which is applied to an advertisement settlement system in which a snapshot file is stored in advance, wherein the snapshot file includes settled information of a plurality of accounts, the settled information includes a consumable amount of each account and a first settlement number, and the first settlement number is a number of exposure logs corresponding to the account, which is the largest in a first queue among all exposure logs successfully settled; the device comprises a first acquisition module, a second acquisition module, a settlement module and an updating module, wherein the exposure log is recorded information of successfully downloading the advertisement to the client;
the first acquisition module is used for acquiring data to be settled corresponding to exposure logs to be settled, wherein the data to be settled comprises accounts to be settled corresponding to each exposure log, expense information to be deducted and queue serial numbers of the exposure logs in a first queue;
the second obtaining module is configured to obtain the settled information of each account to be settled from the snapshot file;
the settlement module is used for sequentially settling accounts to be settled according to the data to be settled and the settled information of the accounts to be settled to obtain a settlement result of each account to be settled, wherein the settlement result comprises the settled information corresponding to the account to be settled after the settlement is finished;
the updating module is used for judging whether all accounts to be settled are successfully settled according to the settlement results of all accounts to be settled; and
and when the settlement of all accounts to be settled is successful, updating the snapshot file according to the settlement result.
Optionally, the updating module is further configured to, when there is an account to be settled for which settlement is not successful, enable the advertisement settlement apparatus to re-execute acquiring of data to be settled corresponding to the exposure log to be settled; acquiring the settled information of each account to be settled from the snapshot file; settling accounts to be settled in sequence according to the data to be settled and settled information of the accounts to be settled to obtain a settlement result of each account to be settled; and judging whether all accounts to be settled are successfully settled according to the settlement results of all accounts to be settled.
Optionally, the settlement module is configured to perform settlement on each account to be settled according to the data to be settled and the settled information of the account to be settled in sequence, and the step of obtaining the settlement result of each account to be settled includes:
selecting an account to be settled which is not settled as a target account to be settled for settlement operation, wherein the settlement operation comprises the following steps: acquiring an exposure log corresponding to the account to be settled of the target from the exposure log to be settled;
calculating the amount of money to be deducted of the target account to be settled according to the exposure log corresponding to the target account to be settled and the expense information of the exposure log;
acquiring the maximum serial number of the exposure log corresponding to the target account to be settled in a first queue in the exposure logs to be settled as a second settlement serial number;
updating the settled information of the account to be settled according to the amount to be deducted and the second settlement serial number;
taking the settled information corresponding to the account to be settled at the end of settlement as a settlement result of the account to be settled;
and reselecting an account to be settled which is not settled as a new target account to be settled, and performing settlement operation.
It is another object of the present application to provide an advertisement settlement device, comprising a communicatively connected memory having an executable program stored therein and a processor executing the program to implement the steps of the method as recited in any of the above.
Compared with the prior art, the method has the following beneficial effects:
in the advertisement settlement method, the device and the equipment disclosed by the embodiment of the application, when exposure log settlement is carried out, the data to be settled and the accounts to be settled corresponding to the exposure logs to be settled are firstly obtained, the settled information of each account to be settled is obtained from the snapshot file, then the settlement result of each account is obtained according to the data to be settled and the settled information of each account to be settled, then whether all the accounts to be settled are settled successfully or not is judged according to the settlement result of each account, and finally the snapshot file is updated according to the settlement result of each account to be settled under the condition that all the accounts to be settled are settled successfully settled. Because the settlement is carried out on the basis of the acquired settlement information in the snapshot file every time, and the settled information in the snapshot file is the updated data after all accounts to be settled are settled successfully every time, the problems of missed deduction and excessive deduction can be greatly avoided, and meanwhile, the phenomenon of overdose caused by settlement delay can be further avoided.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are required to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained from the drawings without inventive effort.
Fig. 1 is a schematic block diagram of a structure of an advertisement settlement apparatus provided in an embodiment of the present application;
FIG. 2 is a first flowchart illustrating an advertisement settlement method according to an embodiment of the present disclosure;
fig. 3 is a schematic flowchart of an advertisement settlement apparatus according to an embodiment of the present application;
fig. 4 is a schematic flowchart illustrating a third advertisement settlement method according to an embodiment of the present application;
fig. 5 is a fourth schematic flowchart of an advertisement settlement method according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of an advertisement settlement apparatus according to an embodiment of the present application.
Icon: 100-advertisement settlement equipment; 110-advertisement settlement means; 111-a first acquisition module; 112-a second acquisition module; 113-settlement module; 114-an update module; 120-a memory; 130-a processor.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some embodiments of the present application, but not all embodiments. The components of the embodiments of the present application, generally described and illustrated in the figures herein, can be arranged and designed in a wide variety of different configurations.
Thus, the following detailed description of the embodiments of the present application, presented in the accompanying drawings, is not intended to limit the scope of the claimed application, but is merely representative of selected embodiments of the application. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures.
In the advertisement engine of the advertisement system, there may be a service of showing advertisements, if the shown advertisements are successfully downloaded to the client, it is called advertisement exposure, and for each exposure of the advertisements, a corresponding exposure log is generated, so that the advertisements can be settled according to this exposure log. At present, the log quantity of a large advertisement system is generally in the hundred million level, billion level or even billion level, and in order to obtain high settlement performance and reduce resource consumption, exposure log settlement is generally carried out in a batch processing mode. That is, the exposure log of a plurality of advertisements generated within a time range is settled every settlement. These exposure logs are typically stored using a message queue, that is, the exposure logs are stored in the message queue according to the order of generation. The exposure logs are generally distinguished by advertisement IDs or advertiser IDs, and during batch processing, the same batch of exposure logs are likely to belong to advertisements displayed by different advertisers, so that the settlement of the batch of exposure logs is completed only after the settlement of the batch of advertisement logs is completed and the consumable amount of the corresponding advertiser is deducted, namely the settlement of the batch of exposure logs and the deduction of the consumable amount of the corresponding account are a transaction operation. In practice, to facilitate subsequent query and update operations, a relational database is generally used to store the amount of money that can be consumed by advertisers, and taking MySQL database as an example, after the exposure log of each account is settled, the cost information and the position information of settlement (the serial number of the settled exposure log in the message queue) are stored in the database separately, so that the update operation of the amount of money that can be consumed by a plurality of accounts is difficult to be a transaction operation. In this manner, once the advertisement settlement device 100 is restarted when only part of the advertiser's settled information is successfully updated, the device acquires the latest position of the exposure log before restarting from the database after restarting (the maximum serial number of all the settled exposure logs in the batch of exposure logs in the message queue), but since the updating operation before restarting is not a transaction operation, that is, the information corresponding to each advertiser is updated after the advertiser's corresponding exposure log is successfully settled, only the cost information and the position information of part of the accounts are successfully updated in the account involved in the last batch processing, and therefore, it is difficult to find the correct data recovery point from the database.
For ease of understanding, the following prior art is set forth in connection with practical examples: in the exposure log containing 10 to-be-settled accounts, 10 batches belong to 3 advertisers respectively: owner1, owner2, owner3, if the chronological order in which the exposure logs belonging to the respective advertisers are stored in the message queue is as follows: [ owner1, owner2, owner3, owner3, owner1, owner1, owner2, owner2, owner2, owner1], where the sequence numbers of the 10 exposure logs in the message queue correspond to order ═ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 10 exposure logs are aggregated according to an advertiser at the time of settlement, and the aggregation results are as follows: < owner1, total _ pv > 4, total _ cost > 1 total _ pv >, < owner2, total _ pv > 4, total _ cost > 2 total _ pv >, < owner3, total _ pv > 2, and total _ cost > 3 total _ pv >, wherein total _ pv is the number of exposure logs belonging to the same advertiser in the aggregated result, total _ cost is the amount to be deducted corresponding to the same advertiser in the aggregated result, total 1 represents the fee information corresponding to each exposure log of the advertiser owner1, total 2 represents the fee information corresponding to each exposure log of the advertiser owner2, and total 3 represents the fee information corresponding to each exposure log of the advertiser 3. And then, deducting the account of the corresponding advertiser, submitting the consumable amount after the account deduction, and settling the position of the last exposure log which is successful when each account is updated. Assuming that an unexpected event occurs in the step of submitting the consumable amount of the account (for example, a restart operation occurs), the consumable amount of a part of the accounts is successfully updated, and the consumable amount of a part of the accounts is unsuccessfully updated, taking the above-mentioned 10 exposure logs as an example, assuming that an unexpected event occurs before the account update success occurs in the owener 1 and the owener 2 after the consumable amount of the ower 3 account and the location of the last exposure log in which the settlement is successful are updated, after the restart, the settlement data recovery module compares the settlement start location of the exposure log in the restart according to the location of the last settled exposure log among the owers 1, 2 and 3. Specifically, there are two options for obtaining the starting position: one is to select the latest position of the previous settlement as the settlement starting position of the exposure log of the restart, that is, the position with order of 5 starts the settlement of the exposure log, in this way, since the settled information of the ower 1 exposure log with order of 1 and the ower 2 with order of 2 is not updated successfully in the last settlement before the restart, the ower 1 leaks the exposure log with order of 1, and the ower 2 leaks the exposure log with order of 2, that is, the exposure log loss problem occurs; the other is to select the initial position of the previous settlement as the initial position of the settlement of the exposure log restarted this time, that is, the settlement of the exposure log is started from order 1, and since some exposure logs after order 1 have already been settled, the situation of repeated charging can occur. At present, advertisement settlement and advertisement report services are compared with each other to make up for the problem of repeated charging or exposure log loss, but because the advertisement report services are generally non-real-time offline data statistics, correction work caused by restart has certain hysteresis, so that the phenomenon of account amount overdose (exposure logs are lost to cause more exposure advertisements needing to be sent by an engine) or the phenomenon of multi-deduction (the same exposure log is repeatedly charged) may also occur.
Referring to fig. 1, fig. 1 is a schematic block diagram illustrating a structure of an advertisement settlement apparatus 100 according to an embodiment of the present application, where the advertisement settlement apparatus 100 may be applied to solve at least one of the above-mentioned problems. The advertisement settlement device 100 may be a device having a data processing function, such as a computer or a server. The advertisement settlement device 100 comprises an advertisement settlement device 110, a memory 120 and a processor 130, wherein the memory and the processor 130 are directly or indirectly electrically connected with each other for realizing data interaction. For example, the components may be electrically connected to each other via one or more communication buses or signal lines. The advertisement settlement means 110 includes at least one software function module that may be stored in the memory 120 in the form of software or firmware (firmware) or solidified in an Operating System (OS) of the advertisement settlement device 100. The processor 130 is used for executing executable modules stored in the memory 120, such as software functional modules and computer programs included in the advertisement settlement device 110.
The Memory 120 may be, but is not limited to, a Random Access Memory 120 (RAM), a Read Only Memory 120 (ROM), a Programmable Read Only Memory 120 (PROM), an Erasable Read Only Memory 120 (EPROM), an electrically Erasable Read Only Memory 120 (EEPROM), and the like. The memory 120 is used for storing a program, and the processor 130 executes the program after receiving the execution instruction.
The processor 130 may be an integrated circuit chip having signal processing capabilities. The Processor 130 may be a general-purpose Processor 130, including a Central Processing Unit (CPU) 130, a Network Processor (NP) 130, and the like; but may also be a digital signal processor 130(DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware components. The various methods, steps, and logic blocks disclosed in the embodiments of the present application may be implemented or performed. The general purpose processor 130 may be a microprocessor 130 or the processor 130 may be any conventional processor 130 or the like.
The embodiment provides an advertisement settlement method, which is applied to an advertisement settlement system in which a snapshot file is stored in advance, wherein the advertisement settlement system comprises advertisement settlement equipment 100, the snapshot file comprises settled information of a plurality of accounts, the settled information comprises a consumable amount of each account and a first settlement serial number, and the first settlement serial number is the largest serial number of exposure logs corresponding to the account in a first queue among all exposure logs which are settled successfully; the settled information for each account corresponds to the identification information for that account-that is, the snapshot file includes the identification information for each account, the amount of the consumable money, and the first settlement serial number. The identification information, the consumable amount and the first settlement serial number of the same account are correspondingly stored, so that the consumable amount and the first settlement serial number corresponding to the account can be found according to the identification information of the account. Each exposure log is a log of information that the advertisement was successfully downloaded into the client. The amount of the consumable is an amount that each account can be used to pay the advertising fee, and the amount of the consumable may include an initial amount and a deducted amount. The snapshot file in this embodiment may be stored in a persistent storage area.
Further, the snapshot file may further include effective time information of each account, that is, a time for exposing an advertisement corresponding to the account.
Referring to fig. 2, fig. 2 is a schematic flowchart of an advertisement settlement method provided in an embodiment of the present application, where the method includes steps S110 to S150.
Step S110, acquiring data to be settled corresponding to the exposure log to be settled.
The data to be settled comprises accounts to be settled corresponding to each exposure log, expense information required to be deducted and queue serial numbers of the exposure logs in the first queue. The account to be settled is represented by identification information for identifying the account, the identification information and the account have a corresponding relationship, and the same identification information corresponds to the same account.
The method and the device are used for acquiring a batch of exposure logs to be settled and acquiring accounts to be settled corresponding to the batch of exposure logs to be settled according to the exposure logs to be settled. Specifically, the account to be settled may be determined by acquiring various types of identification information in the batch of exposure logs to be settled and then determining the account to be settled according to the identification information.
For convenience of understanding, the present embodiment will be described in detail with reference to examples.
The number of exposure logs of a batch to be settled is 10, and the 10 exposure logs have 3 pieces of identification information in total, that is, the 10 exposure logs respectively belong to 3 advertisers (accounts to be settled): owner1, owner2, owner 3. The exposure logs are stored in the first queue in the following order [ owner1, owner2, owner3, owner3, owner1, owner1, owner2, owner2, owner2, owner1], the sequence number of the exposure logs in the first queue1 is [1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009, 1010], and the cost information of the exposure logs is [10, 20, 30, 30, 10, 10, 20, 20, 10] in this order. The data to be settled comprises identification information of each exposure log to be settled, a serial number in the first queue and expense information.
Step S120, obtaining the settled information of each account to be settled from the snapshot file.
The embodiment is used for acquiring settled information corresponding to the account to be settled.
Optionally, when acquiring settled information corresponding to accounts to be settled, the snapshot file is loaded into a memory of the advertisement settlement device 100, and then the corresponding settled information is acquired according to the identification information of each account to be settled.
Still taking the above 10 exposure logs as an example, since the identification information of the account to be settled in the 10 exposure logs is already known, in this embodiment, the settled information of each account to be settled can be obtained according to the identification information. The settled information may include a time stamp, and when the settled information includes the time stamp, the settled information of the account to be settled ower 1 is [ ower 1, 1000, 200, [ { queue1, 990} ], 1543992784], the settled information of the account to be settled ower 2 is [ ower 2, 2000, 300, [ { queue1, 997} ], 1543992784], the settled information of the account to be settled ower 3 is [ ower 3, 1500, 150, [ { queue1, 999} ], 1543992784 ]. Each item in the settled information of each account to be settled corresponds to a representative in sequence: identification information, initial amount, deducted amount, queue identification, first settlement serial number, timestamp.
Step S130, obtaining the settlement result of each account to be settled.
Specifically, in this embodiment, settlement is sequentially performed on each account to be settled according to the data to be settled and the settled information of the account to be settled, so as to obtain a settlement result of each account to be settled. Since each account to be settled does not affect each other, in this embodiment, the settled information of each account to be settled can be acquired separately.
That is to say, the present embodiment is configured to select an account to be settled that is not settled as a target account to be settled for settlement operation, so as to obtain a settlement result of the account to be settled. This step is performed until a predetermined termination condition, that is, a predetermined condition for terminating the settlement of all accounts to be settled, is satisfied. And after the preset ending condition is met, if the accounts to be settled exist, acquiring a settlement result according to settlement information corresponding to the accounts to be settled. In this way, the settlement result corresponding to each account to be settled is obtained according to the ending condition of the settlement of the exposure log of the batch. The settlement status of all accounts to be settled can be judged accordingly.
In this embodiment, when acquiring the settled information, the information may be acquired when detecting that the settlement process for all the exposure logs of the current batch is finished. Here, the end of the settlement process may be that the settlement operation of all accounts has been completed. It may be the case where the settlement process for all the accounts to be settled is terminated due to a system failure, a restart of the advertisement settlement apparatus 100, or the like, that is, the case where only the exposure log settlement process for a part of the accounts is completed and the settlement for another part of the accounts to be settled is not completed.
Referring to fig. 3, in this embodiment, optionally, step S130 may include performing steps S131 to S136 on each account to be settled.
Step S131, selecting an account to be settled which is not settled as a target account to be settled for settlement operation.
The embodiment is used for determining the account to be settled for settlement.
Step S132, obtaining an exposure log corresponding to the target account to be settled from the exposure logs to be settled.
Specifically, for the target account to be settled, the exposure log corresponding to the target account to be settled is obtained from the exposure log to be settled.
The present embodiment is configured to obtain an exposure log corresponding to the account to be settled currently settled in the exposure log to be settled.
Step S133, calculating the amount of money to be deducted from the target account to be settled.
Specifically, the amount of money to be deducted of the target account to be settled is calculated according to the exposure log corresponding to the target account to be settled and the charge information of the exposure log.
Step S134, obtain the second settlement serial number of the target account to be settled.
Specifically, the maximum serial number of the exposure log corresponding to the target account to be settled in the first queue in the exposure logs to be settled is obtained as the second settlement serial number
Step S135, updating the settled information of the account to be settled according to the amount to be deducted and the second settlement serial number.
The embodiment is used for acquiring new settled information of the accounts to be settled which are already settled.
In step S136, the settled information corresponding to the account to be settled at the end of the settlement is used as the settlement result of the account to be settled.
Specifically, the settled information corresponding to the target account to be settled at the end of the settlement is used as the settlement result of the account to be settled.
After step S131 to step S136, if the preset end condition is not satisfied, step S131 to step S136 are re-executed.
And if the preset ending condition is met, the settled information of the account to be settled which is not settled is taken as the settlement result of the account to be settled.
In this embodiment, the obtained settled information of each account to be settled forms a settlement result of the account to be settled, and since there is a case that the settled information of the account to be settled does not change when the settlement is finished, in this embodiment, the settled information included in the settlement result of the account to be settled may be the settled information that is not updated.
The method and the device are used for aggregating the data to be settled of the exposure logs to be settled, and obtaining the settlement result of each account to be settled according to the number of the exposure logs belonging to the same account, the amount to be deducted and the second settlement serial number according to the information to be settled. Of course, the aggregation result may further include a queue identifier of the queue in which the exposure log is located.
For example, in the case that the data to be settled of the above 10 logs to be settled is already obtained, the 10 exposure logs to be settled are aggregated according to the account, and the aggregation result can be obtained as follows: [ owner1, cost ═ 40, queue1, max _ order ═ 1010], [ owner2, cost ═ 80, queue1, max _ order ═ 1009], [ owner3, cost ═ 60, queue1, max _ order ═ 1004], each of which in turn represents: identification information, amount to be deducted, queue identification and a second settlement serial number. The amount to be deducted is the sum of the charge information of the exposure logs corresponding to the same account.
Specifically, it is possible to copy an old piece of settled information of the data to be settled, that is, the settled information obtained from the snapshot file, and then perform the updating operations of steps S131 to S134 on the copied settled information.
In this embodiment, optionally, the consumable amount includes an initial amount and a deducted amount of the account, when the settlement information of the account to be settled is updated according to the amount to be deducted and the second settlement serial number, a new deducted amount of the account to be settled may be calculated according to the amount to be deducted and the deducted amount, so as to obtain a new consumable amount of the account to be settled, where the new consumable amount includes the initial amount and the new deducted amount. Then, the consumable amount in the existing settled information of the account to be settled is replaced by the new consumable amount, and the first settlement serial number is replaced by the second settlement serial number.
After each account to be settled is settled, new settled information corresponding to the account to be settled in the memory is changed into new settled information. Therefore, in this embodiment, whether the account to be settled is successfully settled can be determined according to the settled information of the account to be settled.
The embodiment is used for updating the first settlement serial number and the deducted amount of the account to be settled. Taking the above three accounts to be settled as an example, since the amount to be deducted of ower 1 is 40, and the second settlement serial number is 1010, the new deducted amount of ower 1 is the sum of the old deducted amount 200 of ower 1 and the amount to be deducted 40, that is, 240, and the new first settlement serial number of ower 1 is 1010. Similarly, the new deducted amount of available ower 2 is 380, the new first settlement order number of ower 2 is 1009, the new deducted amount of ower 3 is 210, and the new first settlement order number of ower 3 is 1004. When the settled information contains the timestamp, the settlement result of each account is respectively as follows: [ owner1, 1000, 240, [ { queue1, 1010} ], 1543992784], [ owner2, 2000, 380, [ { queue1, 1009} ], 1543992784], [ owner3, 1500, 210, [ { queue1, 1004} ], 1543992784 ].
Referring to fig. 2, in step S140, it is determined whether all accounts to be settled are successfully settled according to the settlement results of all accounts to be settled.
Referring to fig. 4, in the present embodiment, optionally, the step S140 includes steps S141 to S143.
Step S141, respectively determining whether the consumable amount and the first settlement serial number of each account to be settled are updated.
In step S142, if the consumable amount of each account to be settled has been updated and the first settlement serial number has been updated, it is determined that the settlement of all accounts to be settled is successful.
In step S143, if the consumable amount of the account to be settled is not updated or the first settlement serial number is not updated, it is determined that the account to be settled which has not been successfully settled exists.
The embodiment is used for judging whether all accounts to be settled have been settled successfully.
Referring to fig. 2, in step S150, if the accounts to be settled are settled successfully, the snapshot file is updated according to the settlement result.
Referring to fig. 5, step S150 includes steps S151 to S152.
Step S151, storing the settlement results of all the accounts to be settled to a second queue.
Step S152, updating the snapshot file according to the settlement result of each account to be settled in the second queue.
The embodiment is used for updating the settled information of the account to be settled stored in the snapshot file when the settlement of all the accounts to be settled is successful.
The method and the device for processing the exposure log are used for updating the settled information of the account to be settled in the snapshot file to be the new settled information corresponding to the account to be settled after the account to be settled corresponding to the exposure log to be settled is settled successfully. Thus, the snapshot file includes both the new settled information of the accounts to be settled that have already been settled and the settled information of the other accounts that have not settled in the batch. That is to say, in this embodiment, the settled information of all accounts can be saved in the snapshot file, so that it can be ensured that each snapshot file that is successfully persisted is a complete settlement data file, and each snapshot file that is successfully persisted can be used as a recovery point for database recovery. Specifically, new settled information of the account corresponding to the exposure log for each batch of settlement may be stored as a whole settlement file through the second queue, and then the settlement files may be read from the second queue at preset time intervals to update the snapshot file.
If the settlement fails, for example, when the advertisement settlement device 100 restarts due to a malfunction, the steps S110 to S140 are repeatedly performed. Of course, if the settled information obtained from the snapshot file still exists in the memory, step S110, step S130 and step S140 may be executed according to the settled information in the memory.
Without specific description, the snapshot files described in this embodiment refer to the most recently generated snapshot files relative to the time of obtaining the snapshot file in the scheme. The snapshot file with the earlier generation time compared with the snapshot file can be deleted, copied or moved according to the needs. When the snapshot file is updated, the original snapshot file can be backed up first, and then the updating operation is performed. In this embodiment, an identification number may be set for the updated snapshot file, so that when the corresponding snapshot file needs to be obtained, the corresponding snapshot file may be obtained according to the identification number.
When the settlement process is abnormal (abnormal settlement) and the settlement is carried out again, the settled information used for settlement is obtained from the snapshot file, and the settled information stored in the snapshot file is the settled information of each account after the settlement is successfully carried out for the last time, which is equivalent to the settlement state is restored to the state before the abnormal settlement, so that the phenomena of more fee deductions or less fee deductions can not occur.
In this embodiment, the advertisement display may be performed according to the consumable amount of each account in the snapshot file.
For example, when the consumable amount of the account is exhausted, the advertisement corresponding to the account is not displayed. Therefore, the corresponding advertisement can be displayed according to the consumable amount of the account.
Referring to fig. 6, an advertisement settlement apparatus 110 is further provided in an embodiment of the present application, which is applied to an advertisement settlement system in which a snapshot file is stored in advance, where the snapshot file includes settled information of a plurality of accounts, the settled information includes a consumable amount of each account and a first settlement serial number, and the first settlement serial number is a serial number of an exposure log corresponding to the account, which is the largest in a first queue, among all exposure logs that are successfully settled; the exposure log is record information of successful downloading of the advertisement to the client, and the device comprises a first obtaining module 111, a second obtaining module 112, a settlement module 113 and an updating module 114; the advertisement settlement apparatus 110 includes a software function module that may be stored in the memory 120 in the form of software or firmware or solidified in an Operating System (OS) of the image processing device.
The first obtaining module 111 obtains data to be settled corresponding to exposure logs to be settled, where the data to be settled includes accounts to be settled corresponding to each exposure log, charge information to be deducted, and a queue number of the exposure log in a first queue.
The first obtaining module 111 in this embodiment is configured to execute step S110, and for a detailed description of the first obtaining module 111, reference may be made to the description of step S110.
The second obtaining module 112 is configured to obtain the settled information of each account to be settled from the snapshot file.
The second obtaining module 112 in this embodiment is configured to perform step S120, and the detailed description about the second obtaining module 112 may refer to the description about the step S120.
The settlement module 113 is configured to perform settlement on each account to be settled in sequence according to the data to be settled and the settled information of the account to be settled, so as to obtain a settlement result of each account to be settled, where the settlement result includes the settled information corresponding to the account to be settled after the settlement is completed.
The settlement module 113 in this embodiment is configured to execute step S130, and the detailed description about the settlement module 113 may refer to the description about the step S130.
The updating module 114 is configured to determine whether all accounts to be settled are successfully settled according to the settlement results of all accounts to be settled, and update the snapshot file according to the settlement results when all accounts to be settled are successfully settled.
The updating module 114 in this embodiment is configured to execute steps S140 to S150, and the detailed description about the updating module 114 may refer to the description about the steps S140 to S150.
The updating module 114 is further configured to, when there is an account to be settled for which settlement is not successful, the advertisement settlement apparatus 110 re-executes to-be-settled data corresponding to the exposure log to be settled; acquiring the settled information of each account to be settled from the snapshot file; settling accounts to be settled in sequence according to the data to be settled and settled information of the accounts to be settled to obtain a settlement result of each account to be settled; and judging whether all accounts to be settled are successfully settled according to the settlement results of all accounts to be settled.
The updating module 114 in this embodiment is configured to execute steps S140 to S150, and the detailed description about the updating module 114 may refer to the description about the steps S140 to S150.
Optionally, the settlement module 113 is configured to perform settlement on each account to be settled according to the data to be settled and the settled information of the account to be settled in sequence, and the step of obtaining the settlement result of each account to be settled includes:
selecting an account to be settled which is not settled as a target account to be settled for settlement operation, wherein the settlement operation comprises the following steps: and acquiring the exposure log corresponding to the account to be settled of the target from the exposure log to be settled.
And calculating the amount of money to be deducted of the target account to be settled according to the exposure log corresponding to the target account to be settled and the expense information of the exposure log.
And acquiring the maximum serial number of the exposure log corresponding to the target account to be settled in the first queue in the exposure logs to be settled as a second settlement serial number.
And updating the settled information of the account to be settled according to the amount to be deducted and the second settlement serial number.
And taking the settled information corresponding to the account to be settled at the end of settlement as a settlement result of the account to be settled.
And reselecting an account to be settled which is not settled as a new target account to be settled, and performing settlement operation. The updating module 114 in this embodiment is specifically configured to execute steps S131 to S134, and the detailed description about the updating module 114 may refer to the description about the steps S131 to S134.
To sum up, in the advertisement settlement method, the advertisement settlement device, and the advertisement settlement apparatus disclosed in the embodiments of the present application, when performing exposure log settlement, to-be-settled data and accounts to be settled corresponding to exposure logs to be settled are first obtained, settlement information of each account to be settled is obtained from a snapshot file, a settlement result of each account is then obtained according to the to-be-settled data and the settlement information of each account to be settled, then it is determined whether all accounts to be settled are successfully settled according to the settlement result of each account, and finally, the snapshot file is updated according to the settlement result of each account to be settled under the condition that all accounts to be settled are successfully settled. Because the settlement is carried out on the basis of the acquired settlement information in the snapshot file every time, and the settled information in the snapshot file is the updated data after all accounts to be settled are settled successfully every time, the problems of missed deduction and excessive deduction can be greatly avoided, and meanwhile, the phenomenon of overdose caused by settlement delay can be further avoided. Meanwhile, the phenomenon of overdose caused by settlement delay can be further avoided.
The above description is only for the specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present application, and shall be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (10)

1. The advertisement settlement method is characterized by being applied to an advertisement settlement system which stores a snapshot file in advance, wherein the snapshot file comprises settled information of a plurality of accounts, the settled information comprises the consumable amount of each account and a first settlement serial number, and the first settlement serial number is the largest serial number in a first queue of exposure logs corresponding to the account in all exposure logs which are settled successfully; the exposure log is record information of the advertisement successfully downloaded to the client, and the method comprises the following steps:
acquiring data to be settled corresponding to exposure logs to be settled, wherein the data to be settled comprises accounts to be settled corresponding to each exposure log to be settled, expense information to be deducted and queue serial numbers of the exposure logs in a first queue;
acquiring the settled information of each account to be settled from the snapshot file;
settling accounts to be settled in sequence according to the data to be settled and settled information of the accounts to be settled to obtain a settlement result of each account to be settled, wherein the settlement result comprises settled information corresponding to the account to be settled after the settlement is finished;
judging whether all accounts to be settled are successfully settled according to the settlement results of all accounts to be settled;
and if the accounts to be settled are successfully settled, updating the snapshot file according to the settlement result.
2. The advertisement settlement method according to claim 1, further comprising:
if the account to be settled does not succeed in settlement, re-executing to obtain the data to be settled corresponding to the exposure log to be settled; acquiring the settled information of each account to be settled from the snapshot file; settling accounts to be settled in sequence according to the data to be settled and settled information of the accounts to be settled to obtain a settlement result of each account to be settled; and judging whether all accounts to be settled are successfully settled according to the settlement results of all accounts to be settled.
3. The advertisement settlement method according to claim 1 or 2, wherein the step of sequentially settling each account to be settled according to the data to be settled and the settled information of the account to be settled until the settlement is completed to obtain the settlement result of each account to be settled comprises:
selecting an account to be settled which is not settled as a target account to be settled for settlement operation, wherein the settlement operation comprises the following steps:
acquiring an exposure log corresponding to the target account to be settled from the exposure log to be settled;
calculating the amount of money to be deducted of the target account to be settled according to the exposure log corresponding to the target account to be settled and the expense information of the exposure log corresponding to the target account to be settled;
acquiring the maximum serial number of the exposure log corresponding to the target account to be settled in a first queue in the exposure logs to be settled as a second settlement serial number;
updating the settled information of the account to be settled according to the amount to be deducted and the second settlement serial number;
taking the settled information corresponding to the account to be settled at the end of settlement as a settlement result of the account to be settled;
and reselecting an account to be settled which is not settled as a new target account to be settled, and performing settlement operation.
4. The advertisement settlement method according to claim 3, wherein the step of determining whether all the accounts to be settled have been settled successfully according to the settlement results of all the accounts to be settled comprises:
respectively judging whether the consumable amount and the first settlement serial number of each account to be settled are updated;
if the consumable amount of each account to be settled is updated and the first settlement serial number is updated, determining that all accounts to be settled are settled successfully;
and if the consumable amount of the account to be settled is not updated or the first settlement serial number is not updated, determining that the account to be settled which is not successfully settled exists.
5. The advertisement settlement method according to claim 1, wherein the step of updating the snapshot file according to the settlement result comprises:
storing the settlement results of all the accounts to be settled to a second queue;
and updating the snapshot file according to the settlement result of each account to be settled in the second queue.
6. The advertisement settlement method according to claim 1, further comprising,
and displaying advertisements according to the consumable amount of each account in the snapshot file.
7. An advertisement settlement device is applied to an advertisement settlement system which stores a snapshot file in advance, wherein the snapshot file comprises settled information of a plurality of accounts, the settled information comprises a consumable amount of each account and a first settlement serial number, and the first settlement serial number is the largest serial number in a first queue of exposure logs corresponding to the account in all exposure logs which are successfully settled; the device comprises a first acquisition module, a second acquisition module, a settlement module and an updating module, wherein the exposure log is recorded information of successfully downloading the advertisement to the client;
the first acquisition module is used for acquiring data to be settled corresponding to exposure logs to be settled, and the data to be settled comprises accounts to be settled corresponding to each exposure log to be settled, expense information to be deducted and queue serial numbers of the exposure logs in a first queue;
the second obtaining module is configured to obtain the settled information of each account to be settled from the snapshot file;
the settlement module is used for sequentially settling accounts to be settled according to the data to be settled and the settled information of the accounts to be settled to obtain a settlement result of each account to be settled, wherein the settlement result comprises the settled information corresponding to the account to be settled after the settlement is finished;
the updating module is used for judging whether all accounts to be settled are successfully settled according to the settlement results of all accounts to be settled; and
and when the settlement of all accounts to be settled is successful, updating the snapshot file according to the settlement result.
8. The advertisement settlement device according to claim 7, wherein the updating module is further configured to, when there is an account to be settled for which settlement has not been successful, cause the advertisement settlement device to re-execute acquiring of data to be settled corresponding to an exposure log to be settled; acquiring the settled information of each account to be settled from the snapshot file; settling accounts to be settled in sequence according to the data to be settled and settled information of the accounts to be settled to obtain a settlement result of each account to be settled; and judging whether all accounts to be settled are successfully settled according to the settlement results of all accounts to be settled.
9. The advertisement settlement device according to claim 7 or 8, wherein the settlement module is configured to perform settlement on each account to be settled in sequence according to the data to be settled and the settled information of the account to be settled, and the step of obtaining the settlement result of each account to be settled comprises:
selecting an account to be settled which is not settled as a target account to be settled for settlement operation, wherein the settlement operation comprises the following steps: acquiring an exposure log corresponding to the account to be settled of the target from the exposure log to be settled;
calculating the amount of money to be deducted of the target account to be settled according to the exposure log corresponding to the target account to be settled and the expense information of the exposure log corresponding to the target account to be settled;
acquiring the maximum serial number of the exposure log corresponding to the target account to be settled in a first queue in the exposure logs to be settled as a second settlement serial number;
updating the settled information of the account to be settled according to the amount to be deducted and the second settlement serial number;
taking the settled information corresponding to the account to be settled at the end of settlement as a settlement result of the account to be settled;
and reselecting an account to be settled which is not settled as a new target account to be settled, and performing settlement operation.
10. An advertisement settlement device, characterized in that the advertisement settlement device comprises a memory and a processor which are connected in communication, wherein the memory stores an executable program, and the processor executes the program to realize the steps of the method according to any one of claims 1 to 6.
CN201910160131.9A 2019-03-04 2019-03-04 Advertisement settlement method, device and equipment Active CN109919674B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910160131.9A CN109919674B (en) 2019-03-04 2019-03-04 Advertisement settlement method, device and equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910160131.9A CN109919674B (en) 2019-03-04 2019-03-04 Advertisement settlement method, device and equipment

Publications (2)

Publication Number Publication Date
CN109919674A CN109919674A (en) 2019-06-21
CN109919674B true CN109919674B (en) 2021-06-01

Family

ID=66963079

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910160131.9A Active CN109919674B (en) 2019-03-04 2019-03-04 Advertisement settlement method, device and equipment

Country Status (1)

Country Link
CN (1) CN109919674B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112433886B (en) * 2020-11-24 2024-08-23 厦门美图之家科技有限公司 Data processing method and device, server and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030066880A1 (en) * 2001-10-05 2003-04-10 Hitachi, Ltd. Transaction management system and method
CN103793843A (en) * 2012-10-26 2014-05-14 阿里巴巴集团控股有限公司 Account data processing method and device
CN107133818A (en) * 2017-04-25 2017-09-05 微梦创科网络科技(中国)有限公司 The settlement method and settlement system of online advertisement in a kind of internet
CN107194734A (en) * 2017-05-25 2017-09-22 微梦创科网络科技(中国)有限公司 Automatically control the method and system of advertiser's malicious operation
CN107886352A (en) * 2017-10-27 2018-04-06 微梦创科网络科技(中国)有限公司 A kind of method and system of advertisement clearing
CN109242526A (en) * 2018-07-18 2019-01-18 北京三快在线科技有限公司 A kind of advertisement settlement method and device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030066880A1 (en) * 2001-10-05 2003-04-10 Hitachi, Ltd. Transaction management system and method
CN103793843A (en) * 2012-10-26 2014-05-14 阿里巴巴集团控股有限公司 Account data processing method and device
CN107133818A (en) * 2017-04-25 2017-09-05 微梦创科网络科技(中国)有限公司 The settlement method and settlement system of online advertisement in a kind of internet
CN107194734A (en) * 2017-05-25 2017-09-22 微梦创科网络科技(中国)有限公司 Automatically control the method and system of advertiser's malicious operation
CN107886352A (en) * 2017-10-27 2018-04-06 微梦创科网络科技(中国)有限公司 A kind of method and system of advertisement clearing
CN109242526A (en) * 2018-07-18 2019-01-18 北京三快在线科技有限公司 A kind of advertisement settlement method and device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于Kafka和Storm的实时日志流处理系统的设计与实现;周敏菲;《中国优秀硕士学位论文全文数据库信息科技辑》;20180415(第04期);第I138-1041页 *

Also Published As

Publication number Publication date
CN109919674A (en) 2019-06-21

Similar Documents

Publication Publication Date Title
CN108196878B (en) Method and device for generating application program installation package, electronic equipment and storage medium
CN104156244B (en) A kind of method and apparatus of software upgrading
CN112099825B (en) Method, device, equipment and storage medium for upgrading component
CN106991606B (en) Transaction data processing method and device
CN110968478A (en) Log collection method, server and computer storage medium
CN109919674B (en) Advertisement settlement method, device and equipment
CN111651304A (en) Software recovery method and device based on double-core intelligent electric meter and computer equipment
CN113703823A (en) BMC (baseboard management controller) firmware upgrading method and device, electronic equipment and storage medium
CN113468143A (en) Data migration method, system, computing device and storage medium
CN113515291A (en) Equipment online upgrading method and device
CN111198920B (en) Method and device for determining comparison table snapshot based on database synchronization
WO2024099586A1 (en) Method and system for handling application crash, and device for running application
CN112463411A (en) Data processing method, device, server and storage medium
CN116844443A (en) Display fault detection method and device, electronic equipment and medium
CN116226144A (en) Data processing method and device, computer readable storage medium and electronic equipment
CN111857740A (en) Software upgrading method and device
CN113934573A (en) Data recovery method and device for memory database
CN112099819A (en) Data processing method, data processing device and vehicle-mounted terminal
CN112487004A (en) Method, device, medium and system for automatically controlling task based on data blood margin
CN112527327A (en) Method, system, terminal and storage medium for factory restoration of UOS operating system
CN114579388A (en) Vehicle-mounted system state monitoring method and system, storage medium and electronic equipment
CN109726243A (en) A kind of purpose data classifying method, apparatus and system
CN111338677A (en) Component and drive association validity verification method, system, terminal and storage medium
CN113722075B (en) Task management method, system, equipment and storage medium
CN111338668B (en) Method and device for upgrading code in real-time computing

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
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20220628

Address after: 100000 3-701, floor 7, No. 28, Chengfu Road, Haidian District, Beijing

Patentee after: BEIJING MEITU HOME TECHNOLOGY Co.,Ltd.

Address before: B1f-089, Zone C, Huaxun building, software park, torch high tech Zone, Xiamen City, Fujian Province

Patentee before: XIAMEN HOME MEITU TECHNOLOGY Co.,Ltd.