CN113283940A - Advertisement exposure method and device - Google Patents

Advertisement exposure method and device Download PDF

Info

Publication number
CN113283940A
CN113283940A CN202110608195.8A CN202110608195A CN113283940A CN 113283940 A CN113283940 A CN 113283940A CN 202110608195 A CN202110608195 A CN 202110608195A CN 113283940 A CN113283940 A CN 113283940A
Authority
CN
China
Prior art keywords
advertisement
frequency
terminal
modification
order frequency
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
CN202110608195.8A
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.)
Guangdong Huanwang Technology Co Ltd
Original Assignee
Guangdong Huanwang 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 Guangdong Huanwang Technology Co Ltd filed Critical Guangdong Huanwang Technology Co Ltd
Priority to CN202110608195.8A priority Critical patent/CN113283940A/en
Publication of CN113283940A publication Critical patent/CN113283940A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q30/00Commerce
    • G06Q30/02Marketing; Price estimation or determination; Fundraising
    • G06Q30/0241Advertisements
    • G06Q30/0242Determining effectiveness of advertisements
    • G06Q30/0245Surveys
    • 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/0277Online advertisement

Landscapes

  • Business, Economics & Management (AREA)
  • Engineering & Computer Science (AREA)
  • Accounting & Taxation (AREA)
  • Development Economics (AREA)
  • Strategic Management (AREA)
  • Finance (AREA)
  • Game Theory and Decision Science (AREA)
  • Entrepreneurship & Innovation (AREA)
  • Economics (AREA)
  • Marketing (AREA)
  • Physics & Mathematics (AREA)
  • General Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

The invention discloses an advertisement exposure method and device, belonging to the field of advertisement putting, after receiving an advertisement request sent by a terminal, firstly judging whether the advertisement frequency in redis reaches a preset frequency, and if not, sending advertisement data to the terminal; and if the preset frequency is reached, not sending the advertisement data to the terminal. Because the advertisement frequency is counted by adopting a redis atomic self-increment mode, even if the order frequency is modified, the modification can be in a sequence, so that the finally obtained order frequency is consistent with the actual condition, and the data consistency can be ensured without additional processing.

Description

Advertisement exposure method and device
Technical Field
The present invention relates to the field of advertisement delivery, and in particular, to an advertisement exposure method and apparatus.
Background
When the existing advertisement is exposed, the advertisement system directly corresponds to the terminal after receiving the exposure data, then generates a task according to the exposure data of the terminal, sends the task to the thread pool for processing, and then counts to obtain the exposure frequency. The conventional statistical method is based on a conventional cache system, and in processing, due to the fact that a plurality of processes or threads simultaneously read and write one cached key, data may generate inconsistency, for example, if the original key is 1, if the key is exposed twice, the key should be changed into 3, but if two processes or threads simultaneously read and write the key, both processes or threads may change the key into 2, which is inconsistent with the actual situation. Therefore, based on the traditional statistical method, additional data consistency processing is needed.
Disclosure of Invention
In order to overcome the defects of the prior art, the invention provides an advertisement exposure method and an advertisement exposure device, which are used for solving the problems that data are inconsistent and additional data consistency processing is needed in a traditional statistical mode.
The technical scheme adopted by the invention for solving the technical problems is as follows:
on the one hand, the method comprises the following steps of,
an advertisement exposure method comprising the steps of:
receiving an advertisement request sent by a terminal;
judging whether the advertisement frequency in the redis reaches a preset frequency or not, wherein the advertisement frequency is counted in a redis atomic self-increment mode;
if not, sending advertisement data to the terminal; and if so, not sending the advertisement data to the terminal.
Further, still include:
when an advertisement request sent by a terminal is received for the first time, sending advertisement data to the terminal so as to facilitate the terminal to expose;
receiving exposure data sent by the terminal;
and generating a task for counting the order frequency in the thread pool according to the exposure data.
Further, after generating the task of counting the order frequency in the thread pool, the method further comprises the following steps:
and calling an application program interface of the redis, and performing atomic incremental increase on the order frequency in the task by adopting a redis atomic incremental mode.
Further, the atomic increment of the order frequency in the task in a redis atomic self-increment manner includes:
after exposure data sent by the terminal is received again, a modification request for modifying order frequency is generated;
acquiring all modification requests;
and modifying the order frequency according to the modification request in sequence.
Further, the modifying the order frequency according to the modification request in sequence includes:
and when only one modification request exists at the same time, modifying the order frequency directly according to the modification request.
Further, the modifying the order frequency according to the modification request in sequence comprises:
when at least two modification requests exist at the same time, sequencing the modification requests according to any rule;
and modifying the order frequency according to the sequence of the modification request.
Further, for the modified order frequency:
and if the order frequency modification according to any one of the at least two modification requests fails, determining that the order frequency modification result according to all the modification requests fails.
On the other hand, in the case of a liquid,
an advertisement exposure apparatus comprising:
the advertisement request receiving module is used for receiving an advertisement request sent by a terminal;
the advertisement frequency judging module is used for judging whether the advertisement frequency in the redis reaches a preset frequency or not, and the advertisement frequency is counted in a redis atomic self-increment mode;
the advertisement data sending module is used for sending the advertisement data to the terminal if the advertisement data is not reached; and if so, not sending the advertisement data to the terminal.
This application adopts above technical scheme, possesses following beneficial effect at least:
the technical scheme of the application provides an advertisement exposure method and device, after receiving an advertisement request sent by a terminal, firstly judging whether the advertisement frequency in redis reaches a preset frequency, and if not, sending advertisement data to the terminal; and if the preset frequency is reached, not sending the advertisement data to the terminal. Because the advertisement frequency is counted by adopting a redis atomic self-increment mode, even if the order frequency is modified, the modification can be in a sequence, so that the finally obtained order frequency is consistent with the actual condition, and the data consistency can be ensured without additional processing.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a flow chart of an advertisement exposure method according to an embodiment of the present invention;
fig. 2 is a block diagram of an advertisement exposure apparatus according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the following detailed description of the technical solutions of the present invention is provided with reference to the accompanying drawings and examples. It is to be understood that the embodiments described are only a few embodiments of the present application and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the examples given herein without making any creative effort, shall fall within the protection scope of the present application.
Referring to fig. 1, an embodiment of the present invention provides an advertisement exposure method, including the following steps:
receiving an advertisement request sent by a terminal;
judging whether the advertisement frequency in the redis reaches a preset frequency or not, wherein the advertisement frequency is counted in a redis atomic self-increment mode;
if not, sending advertisement data to the terminal; and if so, not sending the advertisement data to the terminal.
After receiving an advertisement request sent by a terminal, the advertisement exposure method provided by the embodiment of the invention firstly judges whether the advertisement frequency in redis reaches a preset frequency, and if the advertisement frequency does not reach the preset frequency, sends advertisement data to the terminal; and if the preset frequency is reached, not sending the advertisement data to the terminal. Because the advertisement frequency is counted by adopting a redis atomic self-increment mode, even if the order frequency is modified, the modification can be in a sequence, so that the finally obtained order frequency is consistent with the actual condition, and the data consistency can be ensured without additional processing.
As a supplementary explanation to the above-described embodiment, when an advertisement request transmitted from a terminal is received for the first time, advertisement data is transmitted to the terminal so that the terminal performs exposure;
receiving exposure data sent by a terminal;
and generating a task for counting the order frequency in the thread pool according to the exposure data.
And further, calling an application program interface of the redis, and performing atomic incremental increase on the order frequency in the task by adopting a redis atomic incremental increase mode.
It should be noted that performing atomic increment on the order frequency in the task by using a redis atomic auto-increment manner includes:
after exposure data sent by the terminal is received again, a modification request for modifying the order frequency is generated;
acquiring all modification requests;
and modifying the order frequency according to the modification request in turn.
Specifically, when only one modification request is available at the same time, the order frequency is modified directly according to the modification request. When only one modification request is required, the modification can be directly carried out without sequencing.
When at least two modification requests exist at the same time, sequencing the modification requests according to any rule; namely, a plurality of modification requests at the same time are processed separately, and simultaneous modification is avoided.
And modifying the order frequency according to the sequence of the modification requests. Wherein, when the order is modified frequently:
and if the order frequency modification according to any one of the at least two modification requests fails, determining that the order frequency modification result according to all the modification requests fails. Illustratively, if three modification requests exist at the same time, the order frequency is modified in sequence after the ordering; if 1 of the modification results are not successful, the other two modification results are not accepted. I.e., either successful at the same time or all failed.
It should be noted that the order frequency is to specify how many times an advertisement can be played by one MAC in one delivery period. For example, the required periodic frequency is 6, that is, in the round of delivery, one MAC limits that the advertisement can be played only 6 times at most.
The process based on the frequency modification by atomic self-increment needs to be explained as follows:
assuming that the frequency of a certain MAC for a certain order is currently 1, the format is similar to < order ID-MAC1,1 >; here the key is the order ID-MAC 1.
The non-atomic self-increment method comprises the following steps: if two requests modify the value corresponding to the same key at the same time, the corresponding value needs to be read out, then 1 is added, and finally, the two requests modify the value to 2, which is not in accordance with the reality.
The atomic self-increment method comprises the following steps: if two requests are simultaneously used for modifying the value corresponding to the same key, the value does not need to be read and then modified, only the increment method needs to be called, and the method can ensure that the two modifications have the precedence order, namely the modification is firstly changed into 2 and then changed into 3. Each modification is atomic.
Atomic concept interpretation: atomic means that multiple operations will either all succeed or all fail in the same execution. The previous modification was 1. read the original value 2. add 1 to the corresponding value the purpose of these two operations being treated as an atom is to ensure either success or failure.
In one embodiment, the present invention provides an advertisement exposure apparatus, as shown in fig. 2, comprising:
an advertisement request receiving module 21, configured to receive an advertisement request sent by a terminal;
the advertisement frequency judging module 22 is configured to judge whether the advertisement frequency in the redis reaches a preset frequency, where the advertisement frequency is counted in a redis atomic self-increment manner;
the advertisement data sending module 23 is configured to send advertisement data to the terminal if the advertisement data is not received; and if so, not sending the advertisement data to the terminal.
It should be noted that, when receiving an advertisement request sent by the terminal for the first time, sending advertisement data to the terminal so that the terminal can perform exposure;
receiving exposure data sent by a terminal;
and generating a task for counting the order frequency in the thread pool according to the exposure data.
And further, calling an application program interface of the redis, and performing atomic incremental increase on the order frequency in the task by adopting a redis atomic incremental increase mode.
It should be noted that performing atomic increment on the order frequency in the task by using a redis atomic auto-increment manner includes:
after exposure data sent by the terminal is received again, a modification request for modifying the order frequency is generated;
acquiring all modification requests;
and modifying the order frequency according to the modification request in turn.
Specifically, when only one modification request is available at the same time, the order frequency is modified directly according to the modification request.
When at least two modification requests exist at the same time, sequencing the modification requests according to any rule;
and modifying the order frequency according to the sequence of the modification requests. Wherein, when the order is modified frequently:
and if the order frequency modification according to any one of the at least two modification requests fails, determining that the order frequency modification result according to all the modification requests fails.
According to the exposure device provided by the embodiment of the invention, after exposure data is received for the first time, a task is established in a process pool, then a redis api is called, and atomic self-increment is carried out on the order frequency in a redis atomic self-increment mode; therefore, even if the order frequency is modified at the same time, the simultaneous modification can be changed into sequential modification; while ensuring that the modifications either succeed or fail at the same time. Through the exposure device, the embodiment of the invention does not need to additionally carry out consistency processing on data, and is simple and convenient.
It is understood that the same or similar parts in the above embodiments may be mutually referred to, and the same or similar parts in other embodiments may be referred to for the content which is not described in detail in some embodiments.
It should be noted that, in the description of the present application, the terms "first", "second", etc. are used for descriptive purposes only and are not to be construed as indicating or implying relative importance. Further, in the description of the present application, the meaning of "a plurality" means at least two unless otherwise specified.
Any process or method descriptions in flow charts or otherwise described herein may be understood as representing modules, segments, or portions of code which include one or more executable instructions for implementing specific logical functions or steps of the process, and the scope of the preferred embodiments of the present application includes other implementations in which functions may be executed out of order from that shown or discussed, including substantially concurrently or in reverse order, depending on the functionality involved, as would be understood by those reasonably skilled in the art of the present application.
It should be understood that portions of the present application may be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, the various steps or methods may be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, any one or combination of the following techniques, which are known in the art, may be used: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application specific integrated circuit having an appropriate combinational logic gate circuit, a Programmable Gate Array (PGA), a Field Programmable Gate Array (FPGA), or the like.
It will be understood by those skilled in the art that all or part of the steps carried by the method for implementing the above embodiments may be implemented by hardware related to instructions of a program, which may be stored in a computer readable storage medium, and when the program is executed, the program includes one or a combination of the steps of the method embodiments.
In addition, functional units in the embodiments of the present application may be integrated into one processing module, or each unit may exist alone physically, or two or more units are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. The integrated module, if implemented in the form of a software functional module and sold or used as a stand-alone product, may also be stored in a computer readable storage medium.
The storage medium mentioned above may be a read-only memory, a magnetic or optical disk, etc.
In the description herein, reference to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the application. In this specification, the schematic representations of the terms used above do not necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
Although embodiments of the present application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present application, and that variations, modifications, substitutions and alterations may be made to the above embodiments by those of ordinary skill in the art within the scope of the present application.

Claims (8)

1. An advertisement exposure method, comprising the steps of:
receiving an advertisement request sent by a terminal;
judging whether the advertisement frequency in the redis reaches a preset frequency or not, wherein the advertisement frequency is counted in a redis atomic self-increment mode;
if not, sending advertisement data to the terminal; and if so, not sending the advertisement data to the terminal.
2. The method of claim 1, further comprising:
when an advertisement request sent by a terminal is received for the first time, sending advertisement data to the terminal so as to facilitate the terminal to expose;
receiving exposure data sent by the terminal;
and generating a task for counting the order frequency in the thread pool according to the exposure data.
3. The method of claim 2, wherein: generating a task for counting order frequency in a thread pool, and then:
and calling an application program interface of the redis, and performing atomic incremental increase on the order frequency in the task by adopting a redis atomic incremental mode.
4. The method of claim 3, wherein: the atomic incremental increase of the order frequency in the task by adopting a redis atomic incremental mode comprises the following steps:
after exposure data sent by the terminal is received again, a modification request for modifying order frequency is generated;
acquiring all modification requests;
and modifying the order frequency according to the modification request in sequence.
5. The method of claim 4, wherein: the modifying the order frequency according to the modification request in sequence comprises:
and when only one modification request exists at the same time, modifying the order frequency directly according to the modification request.
6. The method of claim 4, wherein: the modifying the order frequency according to the modification request in sequence comprises:
when at least two modification requests exist at the same time, sequencing the modification requests according to any rule;
and modifying the order frequency according to the sequence of the modification request.
7. The method of claim 6, wherein: and when the order is modified frequently:
and if the order frequency modification according to any one of the at least two modification requests fails, determining that the order frequency modification result according to all the modification requests fails.
8. An advertisement exposure apparatus, comprising:
the advertisement request receiving module is used for receiving an advertisement request sent by a terminal;
the advertisement frequency judging module is used for judging whether the advertisement frequency in the redis reaches a preset frequency or not, and the advertisement frequency is counted in a redis atomic self-increment mode;
the advertisement data sending module is used for sending the advertisement data to the terminal if the advertisement data is not reached; and if so, not sending the advertisement data to the terminal.
CN202110608195.8A 2021-06-01 2021-06-01 Advertisement exposure method and device Pending CN113283940A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110608195.8A CN113283940A (en) 2021-06-01 2021-06-01 Advertisement exposure method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110608195.8A CN113283940A (en) 2021-06-01 2021-06-01 Advertisement exposure method and device

Publications (1)

Publication Number Publication Date
CN113283940A true CN113283940A (en) 2021-08-20

Family

ID=77283032

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110608195.8A Pending CN113283940A (en) 2021-06-01 2021-06-01 Advertisement exposure method and device

Country Status (1)

Country Link
CN (1) CN113283940A (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150170070A1 (en) * 2013-08-05 2015-06-18 Tencent Technology (Shenzhen) Company Limited Method, apparatus, and system for monitoring website
CN105491454A (en) * 2015-11-25 2016-04-13 合一网络技术(北京)有限公司 Frequency control method and device in precise recommendation
CN105608207A (en) * 2015-12-25 2016-05-25 广州华多网络科技有限公司 Data statistics system based on Redis database and statistics method of data statistics system
CN106130972A (en) * 2016-06-22 2016-11-16 腾讯科技(深圳)有限公司 Resource access control method and device
CN107563813A (en) * 2017-09-05 2018-01-09 北京奇艺世纪科技有限公司 A kind of control method and system of the PDB advertisement pushings frequency
CN110048907A (en) * 2019-03-29 2019-07-23 苏宁易购集团股份有限公司 Global flow control method and device under a kind of cluster environment
CN111352967A (en) * 2020-02-27 2020-06-30 携程旅游网络技术(上海)有限公司 Frequency control method, system, device and medium for sliding window algorithm

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150170070A1 (en) * 2013-08-05 2015-06-18 Tencent Technology (Shenzhen) Company Limited Method, apparatus, and system for monitoring website
CN105491454A (en) * 2015-11-25 2016-04-13 合一网络技术(北京)有限公司 Frequency control method and device in precise recommendation
CN105608207A (en) * 2015-12-25 2016-05-25 广州华多网络科技有限公司 Data statistics system based on Redis database and statistics method of data statistics system
CN106130972A (en) * 2016-06-22 2016-11-16 腾讯科技(深圳)有限公司 Resource access control method and device
CN107563813A (en) * 2017-09-05 2018-01-09 北京奇艺世纪科技有限公司 A kind of control method and system of the PDB advertisement pushings frequency
CN110048907A (en) * 2019-03-29 2019-07-23 苏宁易购集团股份有限公司 Global flow control method and device under a kind of cluster environment
CN111352967A (en) * 2020-02-27 2020-06-30 携程旅游网络技术(上海)有限公司 Frequency control method, system, device and medium for sliding window algorithm

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
张程: "《分布式系统架构》", 31 May 2020, 机械工业出版社, pages: 178 - 179 *

Similar Documents

Publication Publication Date Title
CN109194960B (en) Image frame rendering method and device and electronic equipment
CN106888236B (en) Session management method and session management device
CN109391843B (en) Online video speed doubling playing method, device, medium and intelligent terminal
CN109344066B (en) Method, system and terminal for testing browser page
CN109634989B (en) HIVE task execution engine selection method and system
CN111427859A (en) Message processing method and device, electronic equipment and storage medium
CN110198427B (en) Video call method and device
CN115269544A (en) Database cluster upgrading method and device, electronic equipment and storage medium
US8732228B2 (en) Publishing documents in a publish/subscribe data processing system
CN114356581A (en) Memory cleaning method and related equipment
CN113283940A (en) Advertisement exposure method and device
CN111078693B (en) Method and device for generating database record primary key
CN112363980A (en) Data processing method and device for distributed system
CN111049913B (en) Data file transmission method and device, storage medium and electronic equipment
CN109871226B (en) Configuration method, device and medium of downloader and electronic equipment
CN111552537B (en) Theme switching method and device, computer equipment and storage medium
US11463493B2 (en) Method and apparatus for playing media file
CN108874560B (en) Method and communication device for communication
CN113507529A (en) Method for realizing file downloading based on Web application
CN109144788B (en) Method, device and system for reconstructing OSD
CN112527276A (en) Data updating method and device in visual programming tool and terminal equipment
CN112202636B (en) Communication test method and system
WO2023125219A1 (en) Debugging method, iot device, debugging server and debugging system
CN113900830B (en) Resource processing method and device, electronic equipment and storage medium
CN111352992B (en) Data consistency detection method, device and server

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