CN113986966A - Event processing method and device, electronic equipment and storage medium - Google Patents

Event processing method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN113986966A
CN113986966A CN202111222206.5A CN202111222206A CN113986966A CN 113986966 A CN113986966 A CN 113986966A CN 202111222206 A CN202111222206 A CN 202111222206A CN 113986966 A CN113986966 A CN 113986966A
Authority
CN
China
Prior art keywords
event
resource
exposure
database
exposure event
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
CN202111222206.5A
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.)
Amusement Starcraft Beijing Technology Co ltd
Original Assignee
Amusement Starcraft Beijing 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 Amusement Starcraft Beijing Technology Co ltd filed Critical Amusement Starcraft Beijing Technology Co ltd
Priority to CN202111222206.5A priority Critical patent/CN113986966A/en
Publication of CN113986966A publication Critical patent/CN113986966A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution
    • G06F16/24552Database cache management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2453Query optimisation
    • G06F16/24534Query rewriting; Transformation
    • G06F16/24539Query rewriting; Transformation using cached or materialised query results

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The disclosure relates to an event processing method, an event processing device, an electronic device and a storage medium. The method comprises the following steps: receiving a resource exposure event sent by a resource delivery platform, and respectively sending the resource exposure event to a cache and a database for storage; responding to a resource triggering event generated by a user terminal, and inquiring a first exposure event in the cache, wherein the first exposure event is a resource exposure event matched with the resource triggering event; and if the first exposure event is not inquired in the cache, inquiring the first exposure event in the database, and feeding the inquired first exposure event back to the resource delivery platform. According to the scheme, effective feedback of the first exposure event matched with the resource trigger event can be realized under a high TPS scene, and the equipment cost is remarkably reduced on the premise that the transaction processing requirement is met.

Description

Event processing method and device, electronic equipment and storage medium
Technical Field
The present disclosure relates to the field of data storage technologies, and in particular, to a method and an apparatus for processing an event, an electronic device, and a storage medium.
Background
At the present stage, online resource release is usually realized by a uniform resource release platform. Taking an advertisement delivery process of an APP (Application program) as an example, after an advertisement is delivered by an advertisement platform, an advertisement exposure event for the delivered advertisement is sent to an advertisement system of a service platform, and is stored in a database (Data Base, DB) by the advertisement platform. In order to evaluate and analyze the advertisement platform for the delivery effect, after receiving the application activation message generated by the user terminal (indicating that the user terminal downloads, installs and activates the APP), the advertisement system needs to query the database for the advertisement exposure event matching the trigger message and call back the advertisement exposure event to the advertisement platform.
However, since the Transaction concurrency capability of the database itself is generally weak, in the case of high TPS (Transaction Per Second), a large number of resource exposure events received in a short time cannot be written into the database in time. Accordingly, after receiving the application activation message, the resource management system may not be able to query the corresponding resource exposure event in the database, and thus cannot complete the event callback.
In the related art, a horizontal capacity expansion mode is usually adopted to solve the problem, for example, more database devices are used to improve the transaction concurrency capability of the whole database. But to support the transient high TPS, very much equipment often needs to be added; and as the service volume of resource delivery increases, more devices need to be continuously added subsequently. Therefore, this approach inevitably leads to excessive database costs.
Disclosure of Invention
The present disclosure provides an event processing method, an event processing apparatus, an electronic device, and a storage medium to solve at least technical problems in the related art. The technical scheme of the disclosure is as follows:
according to a first aspect of the embodiments of the present disclosure, a method for processing an event is provided, including:
receiving a resource exposure event sent by a resource delivery platform, and respectively sending the resource exposure event to a cache and a database for storage;
responding to a resource triggering event generated by a user terminal, and inquiring a first exposure event in the cache, wherein the first exposure event is a resource exposure event matched with the resource triggering event;
and if the first exposure event is not inquired in the cache, inquiring the first exposure event in the database, and feeding the inquired first exposure event back to the resource delivery platform.
Optionally, the resource exposure event includes a terminal identifier, a resource identifier, and an exposure time, and querying the first exposure event includes:
determining a target terminal identifier, a target resource identifier and a triggering moment in the resource triggering event;
and inquiring the resource exposure event containing the target terminal identifier and the target resource identifier in the resource exposure event with the exposure time earlier than the trigger time to serve as the first exposure event.
Optionally, the method further comprises:
if the first exposure event is not inquired in the database, setting the resource triggering event as a to-be-processed event;
and querying a second exposure event in the database, and feeding the queried second exposure event back to the resource delivery platform, wherein the second exposure event is a resource exposure event matched with the event to be processed.
Optionally, the setting the resource triggering event as a pending event includes:
adding a mark to be processed for the resource triggering event; alternatively, the first and second electrodes may be,
and adding the resource triggering event into a to-be-processed event table, wherein the to-be-processed event table is used for recording the resource triggering event of which the corresponding first exposure event is not inquired yet.
Optionally, the querying the database for a second exposure event includes:
inquiring a second exposure event in the database according to a preset inquiry period; alternatively, the first and second electrodes may be,
and under the condition that the resource occupancy rate of the database is lower than a preset threshold value, inquiring a second exposure event in the database.
Optionally, the method further comprises:
and if the second exposure event is inquired in the database, deleting the event to be processed.
Optionally, the method further comprises:
and if the first exposure event is inquired in the cache, feeding the inquired first exposure event back to the resource delivery platform.
Optionally, the resource exposure event is generated by the resource release platform according to resource display data, and the resource display data is generated by the terminal in the process of displaying the released resource.
According to a second aspect of the embodiments of the present disclosure, an apparatus for processing an event is provided, including:
the event receiving module is configured to receive the resource exposure events sent by the resource delivery platform and respectively send the resource exposure events to the cache and the database for storage;
the event query module is configured to respond to a resource triggering event generated by a user terminal, and query a first exposure event in the cache, wherein the first exposure event is a resource exposure event matched with the resource triggering event;
the first sending module is configured to query the first exposure event in the database and feed back the queried first exposure event to the resource delivery platform if the first exposure event is not queried in the cache.
Optionally, the resource exposure event includes a terminal identifier, a resource identifier, and an exposure time, and the event query module is further configured to:
determining a target terminal identifier, a target resource identifier and a triggering moment in the resource triggering event;
and inquiring the resource exposure event containing the target terminal identifier and the target resource identifier in the resource exposure event with the exposure time earlier than the trigger time to serve as the first exposure event.
Optionally, the system further comprises a message setting module configured to:
if the first exposure event is not inquired in the database, setting the resource triggering event as a to-be-processed event;
and querying a second exposure event in the database, and feeding the queried second exposure event back to the resource delivery platform, wherein the second exposure event is a resource exposure event matched with the event to be processed.
Optionally, the message setting module is further configured to:
adding a mark to be processed for the resource triggering event; alternatively, the first and second electrodes may be,
and adding the resource triggering event into a to-be-processed event table, wherein the to-be-processed event table is used for recording the resource triggering event of which the corresponding first exposure event is not inquired yet.
Optionally, the method further comprises:
the period query module is configured to query a second exposure event in the database according to a preset query period; alternatively, the first and second electrodes may be,
an idle query module configured to query a second exposure event in the database if the resource occupancy of the database is lower than a preset threshold.
Optionally, the method further comprises:
and the message deleting module is configured to delete the event to be processed if the second exposure event is inquired in the database.
Optionally, the method further comprises:
the second sending module is configured to feed back the inquired first exposure event to the resource delivery platform if the first exposure event is inquired in the database.
Optionally, the resource exposure event is generated by the resource release platform according to resource display data, and the resource display data is generated by the terminal in the process of displaying the released resource.
According to a third aspect of the embodiments of the present disclosure, an electronic device is provided, including:
a processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement the method for processing the event as described in any of the embodiments of the first aspect.
According to a fourth aspect of the embodiments of the present disclosure, a storage medium is proposed, in which instructions are executed by a processor of an event processing electronic device, so that the event processing electronic device can execute the event processing method described in any one of the above first aspects.
According to a fifth aspect of embodiments of the present disclosure, there is provided a computer program product comprising a computer program and/or instructions which, when executed by a processor, implement the method for processing events according to any one of the embodiments of the first aspect.
The technical scheme provided by the embodiment of the disclosure at least brings the following beneficial effects:
according to the embodiment of the disclosure, after receiving a resource exposure event sent by a resource delivery platform, a resource management system respectively sends the resource exposure event to a cache and a database for storage, and after receiving a resource trigger event generated by a user terminal, in response to the message, a first exposure event matched with the message is preferentially inquired from the cache, and if the first exposure event is not inquired, the event is inquired from the database, and finally the first exposure event inquired in the cache or the database is fed back to the resource delivery platform.
According to the scheme, after the resource exposure event is received, the event is not only sent to the database for storage, but also sent to the cache for storage. By utilizing the cache with the transaction concurrency capability far stronger than that of the database, even under the condition of high TPS, the resource exposure event received by the resource management system can be completely written into the cache in a short time, and the database is written according to the writing speed of the database. Accordingly, the first exposure event matching the message is preferably queried from the cache in response to the resource triggering event, and the corresponding first exposure event can be queried at a high rate. Under the condition that the query in the cache is not available, the query is continued from the database, and the corresponding first exposure event can be queried as far as possible. Therefore, the method can realize effective inquiry and feedback of the first exposure event in the high TPS scene. In addition, only a small amount of cache is required to be added on the basis of the original database, and a large amount of database equipment is not required to be added.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this disclosure, illustrate embodiments consistent with the disclosure and together with the description, serve to explain the principles of the disclosure and are not to be construed as limiting the disclosure.
FIG. 1 is an architectural diagram of a resource management system provided by an exemplary embodiment;
FIG. 2 is a flow chart illustrating a method of processing an event according to an embodiment of the present disclosure;
FIG. 3 is an interaction flow diagram illustrating a method of processing an advertising event in accordance with an embodiment of the present disclosure;
FIG. 4 is a flow chart illustrating a query process for a second exposure event according to an embodiment of the present disclosure;
FIG. 5 is a schematic block diagram illustrating an event processing device according to an embodiment of the present disclosure;
fig. 6 is a block diagram illustrating an electronic device according to an embodiment of the present disclosure.
Detailed Description
In order to make the technical solutions of the present disclosure better understood by those of ordinary skill in the art, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings.
It should be noted that the terms "first," "second," and the like in the description and claims of the present disclosure and in the above-described drawings are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the disclosure described herein are capable of operation in sequences other than those illustrated or otherwise described herein. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
At the present stage, online resource release is usually realized by a uniform resource release platform. For example, an advertisement publisher of an APP may submit an advertisement material for the APP on an advertisement platform, and perform advertisement publishing on a service platform (such as a social platform, a game platform, a video community, etc.) by the advertisement platform, so as to push an advertisement for the APP to a user terminal used by a user of the service platform. In order to facilitate the advertisement platform to evaluate and analyze the delivery effect, the advertisement system of the service platform needs to call back a corresponding advertisement exposure event to the advertisement platform when determining that the user downloads the APP by triggering an advertisement.
In the process, the resource release platform sends the resource exposure event of the resource to the resource management system of the service platform, so that the resource exposure event is stored in the database by the resource management system. Correspondingly, after receiving an application activation message (indicating that the user terminal downloads, installs and activates the APP) generated by the user terminal, the resource management system queries a resource exposure event matched with the trigger message from the database and calls back the resource exposure event to the resource delivery platform.
However, due to the generally weak concurrency capability of the database itself, a large number of resource exposure events received in a short time often cannot be written into the database in time under the condition of high TPS. Therefore, after receiving the application activation message, the resource management system may not be able to query the corresponding resource exposure event in the database, and thus cannot complete the event callback.
In the related art, the above problem is usually solved by using a horizontal capacity expansion mode, for example, more database devices are used to improve the transaction concurrency capability of the whole database. But to support the transient high TPS, very much equipment often needs to be added; and as the amount of traffic for resource delivery increases, more devices need to be added continuously, which results in high database cost.
Therefore, the present disclosure provides an event processing method, which includes storing a resource exposure event sent by a resource delivery platform by using a database, introducing a cache with strong transaction concurrency capability, storing the resource exposure event by using the cache, and preferentially querying a first exposure event corresponding to a resource trigger event in the cache.
FIG. 1 is an architectural diagram of a resource management system according to an exemplary embodiment. As shown in fig. 1, the system may include a network 10, a number of servers, such as server 11 and server 12, a database 13, a cache 14, a number of electronic devices, such as cell phone 15, cell phone 16, and cell phone 17, etc.
The server 11 or the server 12 may be a physical server including an independent host, or may also be a virtual server, a cloud server, etc. carried by a host cluster. The cell phones 15-17 are just one type of electronic device that a user may use. In fact, it is obvious that the user can also use electronic devices of the type such as: tablet devices, notebook computers, Personal Digital Assistants (PDAs), wearable devices (e.g., smart glasses, smart watches, etc.), etc., to which one or more embodiments of the present disclosure are not limited. The network 10 may include various types of wired or wireless networks.
In an embodiment, the server 11 may be implemented as a resource delivery platform, and the server 12 may be implemented as a social platform, a game platform, a video community, or other service platform, which may include or be associated with a corresponding resource management system. The database 13 may be MySQL, Oracle, Sqlserver, etc., and the cache 14 may be Redis, Memcache, Squid, etc., and the present disclosure does not limit the specific forms of the database 13 and the cache 14. The database 13 and the cache 14 are data storage devices corresponding to the service platform. The server 11, the server 12, the database 13, and the cache 14 may cooperate with the handsets 15-17 to feed back, by a resource management system corresponding to the server 12, the first exposure event to the resource delivery platform based on the processing scheme of the events of the present disclosure. This scheme is described in detail below with reference to the accompanying drawings.
Fig. 2 is a flowchart illustrating a method for processing an event according to an exemplary embodiment of the present disclosure. As shown in fig. 2, the method applied to the resource management system corresponding to the service platform may include the following steps:
step 202, receiving a resource exposure event sent by a resource delivery platform, and respectively sending the resource exposure event to a cache and a database for storage.
In this embodiment, the resource delivery platform may receive a resource delivery task of a resource delivery party. For example, a merchant that wants to sell a certain commodity may generate an advertising task for the commodity, an advertising sponsor that wants to promote a certain APP may generate an advertising task for the APP, and so on. Under the above scenario, the advertisement is the delivered resource. Of course, the resources described in the embodiments of the present disclosure may also be network resources in various forms such as push messages, videos, audios, and texts, and are not described in detail any more.
Correspondingly, the resource delivery platform can generate corresponding delivered resources after acquiring the resource materials generated by the resource delivery platform or uploaded by the resource delivery party. The resource material can be in at least one form of characters, pictures, videos, audios and the like. And then, the resource releasing platform can send the released resources to the user terminal corresponding to the service platform through a promotion mechanism. Specifically, the resource delivery platform may generate a resource delivery rule according to the delivery time specified by the resource delivery party, the location of the terminal, the device type, and other information, and push the delivered resource to the corresponding user terminal according to the rule, so as to implement resource delivery. For example, the user terminal may display the received released resource according to a trigger condition such as a preset time node and a preset trigger operation in the process of displaying the information stream to the user, or may display the released resource randomly. Of course, the specific process of resource delivery may be implemented by the resource delivery platform and the service platform (or the resource management system) in a matching manner, and the specific process may refer to records in the related art and is not described herein again.
For the user terminal, the released resources received by the user terminal can be displayed, and corresponding resource display data is generated in the display process. For example, the user terminal may record the resource identifier of the released resource during the process of showing the released resource. Different released resources have different resource identifiers, and resources with the same resource identifier can be respectively displayed by different user terminals (for example, different mobile phones respectively display a certain resource). For another example, the user terminal may also count the display time information of the released resource, such as the display start time, the display end time, the display duration calculated based on the above time, and the like. For another example, in a case that the released resource is an interactive resource, the user may perform a preset interactive operation in the display process of the released resource, such as clicking to view details, downloading and installing an APP, triggering to jump to a preset connection, purchasing a preset commodity, and the like, and accordingly, the user terminal may further determine resource interaction information such as an interaction type, an interaction progress, and the like of the released resource according to the detected operation. The resource identifier, the display time information, the resource interaction information and the like are resource display data generated by the user terminal in the process of displaying the released resources.
Further, the user terminal may generate a corresponding resource exposure event according to the resource display data. For example, when it is determined that the delivered resource is displayed and the resource display data is collected, the user terminal may determine its own device identifier, and then may generate a resource exposure event using the device identifier as an index, where the event may include the resource display data. Furthermore, the user terminal may send the generated resource exposure event to the resource delivery platform. Or, the user terminal may also send the acquired resource display data and the device identifier of the user terminal to the resource delivery platform, so that the resource delivery platform generates the resource exposure event by itself.
It should be noted that, for a plurality of user terminals connected to the service platform, respective resource display data may be generated in the process of displaying corresponding released resources, and then the resource release platform may acquire (receive or generate) corresponding resource exposure events. Any resource exposure event can be used for representing a display process of a user terminal to a released resource. In other words, a user terminal displaying different released resources may generate different resource exposure events, and a user terminal displaying the same released resource multiple times may also generate multiple different resource exposure events.
The device Identifier is used for uniquely identifying the user terminal, and may be an Identifier in a general form such as an IMEI (International Mobile Equipment Identity), an MEID (Mobile Equipment Identity), or a combination of multiple information such as a device brand, a model, and a network address (or a hash value of the combination information), and the like.
After the resource exposure event is acquired, the resource delivery platform may send the resource exposure event to a resource management system. Accordingly, the resource management system can send the received resource exposure event to the database and the cache respectively for saving. It can be understood that the database and the cache are storage devices corresponding to the resource management system, and therefore, the deployment locations of the database and the cache may be geographically close to the resource management system, such as being deployed in the same machine room as the resource management system.
The process of sending the resource exposure event to the database and the cache for storage respectively is the process of writing the resource exposure event into the database and the cache respectively. It is understood that, in order to avoid damage to the database device, the data writing logic of the database usually includes mechanisms such as current limiting, peak clipping, etc., so that the transaction concurrency capability (i.e., the capability of processing concurrent transactions) of the database is weak, and therefore, it is difficult for the resource management system to write a large number of resource exposure events into the database in a short time. In order to make up for the above disadvantages of the database, the present solution introduces a cache and simultaneously stores the resource exposure event sent by the resource management system. It will be appreciated that due to differences in hardware conditions and storage mechanisms, cached transactions are significantly more concurrent than the aforementioned databases. Therefore, the resource management system can write a large number of resource exposure events into the cache in a short time-compared with the time spent writing the database, the writing into the cache can be considered to be completed in a moment or a very short time.
In order to ensure the resource delivery quality, the resource delivery platform may deliver the delivered resources in a centralized manner within a high-frequency use time period (such as 18:00-23:00 at night every day) of the user terminal; alternatively, the released resource may be set with an effective time interval, such as a preference for purchasing goods via the purchase link displayed by the released advertisement within a certain time interval. In all the above situations, a large number of user terminals corresponding to the service platform may collectively display the released resources in a short time, and correspondingly, the resource releasing platform may acquire and send a large number of resource exposure events (for example, send 10 ten thousand resource exposure events in 20 s) to the resource management system in a short time, so that the resource management system is in a high TPS scenario.
In this scenario, the resource management system may send the received large number of resource exposure events to the database and the cache, respectively, so that the resource exposure events are saved by the database and the cache, respectively. Here, the "separate transmission" may be performed simultaneously. Correspondingly, the database can sequentially store the received resource exposure events in the local according to the normal sequence of the original data writing logic; and the cache can save all received resource exposure events locally within a very short time. It can be seen that, for a large number of resource exposure events in a high TPS scenario, on one hand, they can be immediately saved in the cache, and on the other hand, they can be sequentially saved in the database for a long time.
Step 204, responding to a resource triggering event generated by the user terminal, and querying a first exposure event in the cache, wherein the first exposure event is a resource exposure event matched with the resource triggering event.
In the process of displaying the released resource, the user terminal may perform a triggering operation for the resource, such as clicking to check details, and the like, and then the user terminal or the resource releasing platform may generate a corresponding resource triggering event, and further determine whether a first exposure event corresponding to the resource triggering event is stored in the database and the cache. The resource triggering event may also include information such as a device identifier, a resource identifier, and a triggering time of the user equipment.
It is understood that any resource exposure event described in this disclosure corresponding to any released resource corresponds to the process in which the released resource is presented in the user terminal, i.e., indicates that the resource was actually presented in the user terminal. Correspondingly, any resource triggering event corresponding to any released resource described in the present disclosure corresponds to a triggering operation performed by a user in a user terminal for a released resource (e.g., an advertisement) or an associated object corresponding to the resource (e.g., a product link corresponding to the advertisement), that is, a triggering operation for the released resource actually occurs in the user terminal.
As described above, for any one of the launched resources, any one of the user terminals shows that the launched resource (generating the corresponding resource exposure event) is ahead, and the user triggers the launched resource (generating the corresponding resource trigger event) behind, so that the resource exposure event matching any one of the resource trigger events must occur before the resource trigger event. In addition, given that it may take a relatively long time for the resource management system to write a resource exposure event to the database, while it may take only a very short time for the resource exposure event to be written to the cache, the resource management system may preferentially look up the first exposure event in the cache that matches the resource trigger event in response to the received resource trigger event.
For example, the resource management system may first look up a first exposure event in the cache that matches the resource trigger event. Specifically, under the condition that the resource exposure event includes the terminal identifier, the resource identifier and the exposure time, the resource management system may first determine the target terminal identifier and the target resource identifier exposure time in the resource trigger event, then query the resource exposure event including the target terminal identifier and the target resource identifier in the resource exposure event whose exposure time recorded in the cache is earlier than the trigger time (that is, determine which resource exposure event includes the terminal identifier that is the target terminal identifier and the resource identifier that is the target resource identifier in each resource exposure event stored in the cache), and take the queried resource exposure event as the corresponding first exposure event.
By the method, the inquired first exposure event and the resource trigger event can be guaranteed to contain the same target terminal identifier and the same target resource identifier, namely the two events correspond to the same released resource displayed by the same terminal, and the triggering behavior of the user is further shown to be implemented for the released resource corresponding to the first exposure event. If the first exposure event is found in the cache, then the process may proceed directly to step 206.
Caches have limited storage space, so caches typically implement efficient utilization of storage space using data-deletion policies and data-eviction policies. For example, data stored in a cache is usually moved out of the cache after a certain period of time or if the access amount is below a certain threshold, so as to reclaim the corresponding storage space for storing new data. Thus, for any resource triggering event, the event may have been evicted or deleted from the cache when the first exposure event matching the event is queried. For example, after a long time when the user terminal shows the released resource, the user performs the triggering operation for the resource, so that the time interval between the time when the resource management system receives the resource triggering event and the time when the cache writes the first exposure event corresponding to the event is too long, so that at the time of querying by the resource management system, the first exposure event is already deleted from the cache, and thus the first exposure event is failed to be queried in the cache (that is, the first exposure event matching the resource triggering event cannot be queried).
In this case, the resource management system may instead query the database for the first exposure event that matches the resource trigger event. The specific query process is similar to the above embodiment of querying in the cache, and is not described again. Normally, because of the aforementioned interval time process, the database will have already completed writing for the corresponding resource exposure event, and therefore the resource management system will be able to query the database for the first exposure event. It should be noted that, for a plurality of resource trigger events that may be received, the query process of the resource management system for each resource trigger event may be independent, that is, the received resource trigger events are respectively queried for the corresponding first exposure event, and the specific process is not described in detail.
Step 206, if the first exposure event is not queried in the cache, querying the first exposure event in the database, and feeding the queried first exposure event back to the resource delivery platform.
Through the above-described query process, the resource management system may query the first exposure event matching the resource trigger event in a cache or a database. Then, the resource management system may feed back the queried first exposure event to the resource delivery platform, that is, send the event to the resource delivery platform, so as to implement call back on the first exposure event.
However, if the time interval between the time when the resource management system receives the resource trigger event and the time when the cache writes the first exposure event corresponding to the resource trigger event is relatively moderate, when the resource management system receives the resource trigger event, the first exposure event matching the resource trigger event and stored in the cache has been deleted or evicted, and the first exposure event has not been written in the database, so the resource management system cannot query the first exposure event in both the cache and the database.
In one embodiment, if the first exposure event matching the resource trigger event is not queried in the database, the resource management system may set the resource trigger event as a pending event. Furthermore, a second exposure event can be queried in the database, and the queried event is fed back to the resource delivery platform. And the second exposure event is a resource exposure event matched with the event to be processed. It will be appreciated that although the process of writing resource exposure events to the database is slow, the writing can always be done long enough. Therefore, the resource exposure event matched with the resource trigger event can be ensured to be inquired through the bottom-trapping strategy.
The resource management system can set the resource trigger event as a pending event in various ways. For example, the resource management system may add a pending flag to a resource trigger event to flag a resource exposure event added with the flag as a pending event. The method can be realized only by recording the mark to be processed in any data field of each resource triggering event, and is beneficial to saving storage space. For another example, the resource management system may also pre-establish a pending event table for recording resource trigger events that have not been queried for the corresponding first exposure event, and add (i.e., record) the resource trigger events in the event table, so as to set the resource trigger events as pending events. The to-be-processed event table may be stored locally in the resource management system, or may be stored in the database. Although a certain storage space is consumed for establishing the to-be-processed event table, when the subsequent query is matched with the second exposure event of the to-be-processed event, the to-be-processed event table can be directly obtained from the event table without sequentially searching the to-be-processed events in all resource exposure events, so that the query speed of the event is improved. The events to be processed set in the above manner can be recorded in a database. For example, the resource trigger event added with the to-be-processed flag may be recorded in a database, or the to-be-processed event table may be established in the database, which is not described in detail again.
In this way, at least one event to be processed can be set. Further, the resource management system may query the second exposure event matching the pending event in a variety of ways. For example, the resource management system may preset a query period, such as querying once every 5min, and accordingly, the resource management system may query the database for the second exposure event matching the event to be processed according to the period. As mentioned above, after waiting for a sufficient time, all resource exposure events received by the resource management system are always written into the database, so that it is ensured that the corresponding second exposure event is queried in the database. Or the resource management system may also preset a resource occupancy threshold for the database, for example, if the number of concurrent transactions is less than 50, and accordingly, the resource management system may query the database for a second exposure event matching the event to be processed when the resource occupancy of the database is lower than the threshold. By the method, adverse effects of the query operation of the second exposure event on the normal data reading and writing process of the database can be reduced as much as possible, and the normal data reading and writing process of the database is ensured.
It should be noted that, for any resource Trigger Event, if the Event is set as a Delay Trigger Event to be processed, the first exposure Event corresponding to the Trigger Event and the second exposure Event corresponding to the Delay Trigger Event that need to be queried are the same resource exposure Event. For example, a resource exposure Event that contains the same device identifier as the target device identifier contained in the Event and the same resource identifier as the target resource identifier contained in the Trigger Event may be used.
If the second exposure event corresponding to the event to be processed is queried in a certain query process, the resource management system can feed the event back to the resource delivery platform, that is, the event is sent to the resource delivery platform, so as to realize the callback of the second exposure event. In addition, the resource management system may also delete the to-be-processed event from the local or database when querying the second exposure event corresponding to the to-be-processed event, so as to avoid repeatedly querying the second exposure event corresponding to the event.
In the above embodiments, for any received exposure event (e.g., the first exposure event and/or the second exposure event), the resource delivery platform may use the event to analyze the delivery effect of the delivered resource. For example, for any resource corresponding to any resource identifier, the resource delivery platform may determine the trigger rate of the resource according to the number of exposure events including the resource identifier, which are fed back by the resource management system, and the number of resource exposure events including the resource identifier, which is acquired by the resource management system. For example, for a certain resource identifier, when the resource delivery platform acquires 10 ten thousand resource exposure events, if 3 ten thousand first exposure events and 1 ten thousand second exposure events fed back by the resource management system are received, the resource delivery platform may determine that the trigger rate of the delivered resource corresponding to the resource identifier is (3 ten thousand +1 ten thousand)/10 ten thousand-40%. Further, the resource delivery platform may determine the charge amount for the delivered resource according to the resource delivery effect, and the like, which is not described again.
According to the embodiment of the disclosure, after receiving a resource exposure event sent by a resource delivery platform, a resource management system sends the resource exposure event to a cache and a database respectively for storage, and after receiving a resource trigger event generated by a user terminal, in response to the message, a first exposure event matched with the message is preferentially inquired from the cache, and if the first exposure event is not inquired, the event is inquired from the database, and finally the first exposure event inquired in the cache or the database is fed back to the resource delivery platform.
According to the scheme, after the resource exposure event is received, the event is not only sent to the database for storage, but also sent to the cache for storage. By utilizing the cache with the transaction concurrency capability far stronger than that of the database, even under the condition of high TPS, the resource exposure event received by the resource management system can be completely written into the cache in a short time, and the database is written according to the writing speed of the database. Accordingly, the first exposure event matching the message is preferably queried from the cache in response to the resource triggering event, and the corresponding first exposure event can be queried at a high rate. Under the condition that the query in the cache is not available, the query is continued from the database, and the corresponding first exposure event can be queried as far as possible. Therefore, the method can realize effective inquiry and feedback of the first exposure event in the high TPS scene. In addition, only a small amount of cache is required to be added on the basis of the original database, and a large amount of database equipment is not required to be added.
The following describes an event processing method according to the present disclosure with reference to fig. 3, taking a delivered resource as an example of an advertisement for recommending APP to a user for downloading. FIG. 3 is an interaction flow diagram illustrating a method of processing an advertising event in accordance with an exemplary embodiment of the present disclosure. The following describes a process of an advertisement event with reference to fig. 3, taking an example of an advertisement being delivered for recommending the downloading of APP to a user. As shown in fig. 3, the resource delivery platform (advertisement platform) and the resource management system (advertisement system) involved in the method may be the server 11 and the server 12 shown in fig. 1, the user terminal may be the mobile phone 15-17 shown in fig. 1, the database may be the database 13 shown in fig. 1, and the cache may be the cache 14 shown in fig. 1.
The process may include the steps of:
step 301, the advertisement platform pushes the delivered advertisement to the user terminal.
In this embodiment, an advertisement delivery party (e.g., an issuer) who wants to promote an APP may generate an advertisement delivery task for the product and submit the task to an advertisement platform; or the advertisement putting party can upload advertisement materials in the forms of characters, pictures, videos, audios and the like to the advertisement platform so that the advertisement platform generates an advertisement putting task by itself. The advertising platform may generate a delivered advertisement for the APP based on the advertising material. Furthermore, the advertisement platform may push the delivered advertisement to the user terminal, or may also send the delivered advertisement to a server of any application program, so that the server pushes the advertisement to the user terminal running the corresponding application program.
After receiving the pushed served advertisement, the user terminal (which may be specifically a client of an application) may present the served advertisement to the user for viewing by the user. In the process of displaying the delivered advertisement, the user can implement a trigger operation for the advertisement, and then the user terminal can determine corresponding advertisement display data. For example, the user terminal may determine an advertisement identifier of the delivered advertisement, display time information during the advertisement display process, user interaction information, and the like, as advertisement display data corresponding to the delivered advertisement.
Step 302, the advertisement platform generates and sends an advertisement exposure event to the advertisement system.
Further, the user terminal may generate an advertisement exposure event according to the determined advertisement display data. Alternatively, the advertisement presentation data may also be sent to the advertisement platform for generation of advertisement exposure events by the advertisement platform based on the data. Or, the advertisement platform can also directly generate an advertisement exposure event containing the advertisement identification, the equipment identification and the pushing time information according to the advertisement pushing record.
After retrieving (receiving or generating) the ad exposure event described above, the ad platform may send the ad exposure event to the ad system. It will be appreciated that in a high TPS scenario, the advertising system may receive a large number of advertising exposure events sent by the advertising platform in a short period of time.
Step 303a, the advertisement system sends an advertisement exposure event to the database.
At step 304a, the database stores the received ad exposure event.
In the case of receiving advertisement exposure events sent by the advertisement platform, on the one hand, the advertisement system may send the advertisement exposure events to the database for storage, i.e., write the advertisement exposure events into the database. Because of the poor transaction concurrency capability of the database, in the case of high TPS, the database may sequentially write each advertisement exposure event it receives in order according to its own original data writing logic — possibly taking a long time to write all. Specifically, the database may sequentially write each advertisement exposure event into the local data table according to the receiving time. Each advertisement exposure event can be written into the data table by taking the terminal identifier as an index, so that the corresponding advertisement exposure event can be inquired subsequently according to the terminal identifier.
Step 303b, the advertisement system sends an advertisement exposure event to the cache.
Step 304b, cache save the received ad exposure event.
In the case of receiving the advertisement exposure events sent by the advertisement platform, on the other hand, the advertisement system may send the advertisement exposure events to the cache for storage, that is, write the advertisement exposure events into the cache. Because of the strong concurrency capability of the cached transactions, the database can be completely written in a short time under the condition of high TPS, and the writing time is extremely short. Similarly, the cache may sequentially write the advertisement exposure events into the local data table according to the receiving time. Wherein, each advertisement exposure event can be written into the data table according to the terminal identifier as an index.
Step 305, the user terminal activates APP.
In the process of displaying the delivered advertisements at the user terminal, if the user is interested in the promoted APP corresponding to the advertisements, the advertisements can be triggered. For example, in the case that the APP is an application program of a C/S architecture, the user terminal may jump to an application download page in response to the trigger to download and install the APP. Or, in the case that the APP is an application of a B/S architecture, the user terminal may directly jump to a corresponding application page without installing the APP. After installing the APP or displaying an application page of the APP, the user terminal may register an account or log in to activate the APP. Of course, the user terminal opening the APP for the first time may also be regarded as activating the APP, and the specific activation form of the APP is not limited in the embodiment of the present disclosure.
In step 306, the user terminal sends an advertisement triggering event to the advertisement system.
Step 307, the advertisement system queries the cache for a first exposure event that matches the advertisement trigger event.
After detecting that APP is activated, the user terminal may send a corresponding advertisement trigger event to the advertisement system. The advertisement triggering event comprises a target advertisement identifier, a target terminal identifier and a triggering moment. Accordingly, the advertisement system may preferentially query the cache for a first exposure event matching the event in response to the event. The first exposure event matched with the advertisement trigger event is an advertisement exposure event which contains the same device identifier and the same advertisement identifier as the target device identifier and the target advertisement identifier in the resource exposure event with the exposure time earlier than the trigger time.
Specifically, a first event query request may be sent by the advertisement system to the cache to instruct the cache to query the corresponding first exposure event from all advertisement exposure events stored locally. As previously described, since the ad exposure events stored in the cache may be deleted or evicted from the cache, the ad system may or may not succeed in querying the cache for the first exposure event. In the case that the first exposure event is queried in the cache (i.e., the query is successful), step 308 may be performed; otherwise, in case the first exposure event is not found in the cache (i.e. the query fails), step 309 may be proceeded to.
In step 308, the advertisement system feeds back the queried first exposure event to the advertisement platform.
At this time, the advertisement system may feed back the first exposure event queried in the cache to the advertisement platform, that is, send the queried first exposure event to the advertisement platform.
In step 309, the advertisement system queries the database for a first exposure event that matches the advertisement trigger event.
At this point, it is indicated that the first exposure event held in the cache has been deleted or evicted. But because of the existence of steps 303b and 304b, the first exposure event may have been successfully saved to the database, so the advertising system may instead query the database for the first exposure event. Similarly, a first event query request may be sent by the advertisement system to the database to instruct the database to query the corresponding first exposure event from among all advertisement exposure events stored locally.
The first exposure event may not yet be written to the database due to the poor transaction concurrency capability of the database, i.e., the slow writing speed of the event. The advertising system may then either succeed or fail in querying the database for the first exposure event. In the case that the first exposure event is queried in the database (i.e., the query is successful), step 310 may be entered; otherwise, in case the first exposure event is not queried in the database (i.e. the query fails), step 311 may be proceeded to.
In step 310, the advertisement system feeds back the queried first exposure event to the advertisement platform.
At this time, the advertisement system may feed back the first exposure event queried in the database to the advertisement platform, that is, send the queried first exposure event to the advertisement platform.
In step 311, the advertisement system sets the advertisement triggering event as a pending event.
The advertisement system periodically queries the database for a second exposure event, step 312.
At this point, it is indicated that the first exposure event has not been written to the database. But because of the existence of steps 303b and 304b, this first exposure event must be written to the database after a sufficiently long time. Thus, to ensure that the corresponding exposure event is queried, the advertisement system may set the advertisement trigger event as a pending event and periodically query the database for a corresponding second exposure event until the second exposure event is queried in the database. For a specific process of the periodic query, reference may be made to the following embodiment corresponding to fig. 4, which is not described herein again.
Similar to the first exposure event, the second exposure event matched with the event to be processed is the advertisement exposure event whose exposure time is earlier than the trigger time and whose device identifier and advertisement identifier are respectively the same as the target device identifier and target advertisement identifier. Since the advertisement triggering event and the pending event are only referred to by different terms at different times, and the event content (such as the terminal identifier, the resource identifier, the exposure time, and other information included therein) is not changed, for a certain advertisement triggering event E1 and the pending event D1 obtained according to the event setting, the first exposure event matching the advertisement triggering event E1 and the second exposure event matching the pending event D1 are the same advertisement exposure event.
After receiving the advertisement exposure event, the scheme not only sends the event to the database for storage, but also sends the event to the cache for storage. By utilizing the cache of which the transaction concurrency capability is far stronger than that of the database, even under the condition of high TPS, the advertisement exposure event received by the advertisement system can be completely written into the cache in a short time, and the database is written according to the writing speed of the database. Accordingly, the first exposure event matching the message is preferably queried from the cache in response to the advertisement triggering event, and the corresponding first exposure event can be queried at a high rate. Under the condition that the query in the cache is not available, the query is continued from the database, and the corresponding first exposure event can be queried as far as possible. Therefore, the method can realize effective feedback of the first exposure event in a high TPS scene. In addition, only a small amount of cache is required to be added on the basis of the original database, and a large amount of database equipment is not required to be added.
Fig. 4 is a flow chart illustrating a query process for a second exposure event according to an embodiment of the disclosure. It should be noted that fig. 4 only shows the process of querying the second exposure event matching any pending event in any query cycle. The process shown in fig. 4 may be performed multiple times periodically during the periodic polling of the second exposure event.
In the embodiment shown in fig. 3, the pending event is saved in the database. Accordingly, the execution subject of the process shown in FIG. 4 is a database, and the process may include steps 401 and 406 described below.
Step 401, determining a pending event.
At the beginning of the cycle, the database may determine a locally stored pending event. For example, the database may read all the events to be processed recorded in the locally saved event table to be processed, and query the locally saved advertisement exposure events for the corresponding second exposure events, respectively, according to the events to be processed. For any event to be processed, the query process is as follows.
Step 402, a second exposure event is queried.
Step 403, determine whether the second exposure event is queried.
For any event to be processed, if a second exposure event for the event is indeed queried, the database may proceed to step 404; otherwise, the second exposure event query process for the pending event may be directly ended.
Step 404, feeding back the second exposure event to the advertisement platform through the advertisement system.
At this time, the database may send the queried second exposure event to the advertisement system, so that the advertisement system feeds the event back to the advertisement platform.
Step 405, determine whether the feedback is successful.
In the feedback process, feedback failure may be caused by more concurrent tasks or network failure. If the feedback is successful, the database may proceed to step 406; otherwise, if the feedback fails, the database may directly end the second exposure event query process for the event to be processed.
And step 406, deleting the locally stored event to be processed.
The database may delete the current pending event recorded therein in the local pending event table a number of times, so as to avoid repeatedly processing the event again in the next query cycle.
And under the condition that the second exposure event is not inquired in the database or the second exposure event is not fed back successfully, the database directly ends the inquiry process of the second exposure event aiming at the event to be processed. At this point, the database may proceed to determine the next pending event and begin the query process for the second exposure event that matches the event. And sequentially carrying out the processing process for each event to be processed in the event table to be processed until all the events to be processed are processed, and waiting for the next query cycle.
The present disclosure also proposes an embodiment of a processing apparatus of an event, corresponding to the embodiment of the processing method of the foregoing event.
Fig. 5 is a schematic block diagram illustrating an event processing apparatus according to an embodiment of the present disclosure. The event processing device shown in this embodiment may be applied to a resource management system corresponding to a service platform, and the system may be a physical server including an independent host, a virtual server borne by a host cluster, a cloud server, and the like.
As shown in fig. 5, the event processing device may include:
the event receiving module 501 is configured to receive a resource exposure event sent by a resource delivery platform, and send the resource exposure event to a cache and a database for storage;
an event query module 502 configured to query a first exposure event in the cache in response to a resource trigger event generated by a user terminal, where the first exposure event is a resource exposure event matched with the resource trigger event;
a first sending module 503, configured to query the first exposure event in the database if the first exposure event is not queried in the cache, and feed back the queried first exposure event to the resource delivery platform.
Optionally, the resource exposure event includes a terminal identifier, a resource identifier, and an exposure time, and the event query module 502 is further configured to:
determining a target terminal identifier, a target resource identifier and a triggering moment in the resource triggering event;
and inquiring the resource exposure event containing the target terminal identifier and the target resource identifier in the resource exposure event with the exposure time earlier than the trigger time to serve as the first exposure event.
Optionally, a message setting module 504 is further included, configured to:
if the first exposure event is not inquired in the database, setting the resource triggering event as a to-be-processed event;
and querying a second exposure event in the database, and feeding the queried second exposure event back to the resource delivery platform, wherein the second exposure event is a resource exposure event matched with the event to be processed.
Optionally, the message setting module 504 is further configured to:
adding a mark to be processed for the resource triggering event; alternatively, the first and second electrodes may be,
and adding the resource triggering event into a to-be-processed event table, wherein the to-be-processed event table is used for recording the resource triggering event of which the corresponding first exposure event is not inquired yet.
Optionally, the method further comprises:
a period query module 505 configured to query the database for a second exposure event according to a preset query period; alternatively, the first and second electrodes may be,
an idle query module 506 configured to query the database for a second exposure event if the resource occupancy of the database is below a preset threshold.
Optionally, the method further comprises:
a message deleting module 507 configured to delete the event to be processed if the second exposure event is queried in the database.
Optionally, the method further comprises:
a second sending module 508, configured to, if the first exposure event is queried in the database, feed back the queried first exposure event to the resource delivery platform.
Optionally, the resource exposure event is generated by the resource release platform according to resource display data, and the resource display data is generated by the terminal in the process of displaying the released resource.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
An embodiment of the present disclosure also provides an electronic device, including:
a processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement the event processing method according to any of the above embodiments.
Embodiments of the present disclosure also provide a computer-readable storage medium, where instructions of the storage medium, when executed by a processor of an electronic device, enable the electronic device to perform the event processing method according to any of the above embodiments.
Embodiments of the present disclosure also provide a computer program product comprising a computer program and/or instructions which, when executed by a processor, implement the above-mentioned event processing method.
Fig. 6 is a schematic block diagram illustrating an electronic device in accordance with an embodiment of the present disclosure. For example, the electronic device 600 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, an exercise device, a personal digital assistant, and the like.
Referring to fig. 6, electronic device 600 may include one or more of the following components: processing component 602, memory 604, power component 606, multimedia component 608, audio component 610, input/output (I/O) interface 612, sensor component 614, and communication component 618.
The processing component 602 generally controls overall operation of the electronic device 600, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing component 602 may include one or more processors 620 to execute instructions to perform all or a portion of the steps of the processing method for the events described above. Further, the processing component 602 can include one or more modules that facilitate interaction between the processing component 602 and other components. For example, the processing component 602 can include a multimedia module to facilitate interaction between the multimedia component 608 and the processing component 602.
The memory 604 is configured to store various types of data to support operations at the electronic device 600. Examples of such data include instructions for any application or method operating on the electronic device 600, contact data, phonebook data, messages, pictures, videos, and so forth. The memory 604 may be implemented by any type or combination of volatile or non-volatile memory devices such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks.
Power supply component 606 provides power to the various components of electronic device 600. The power components 606 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the electronic device 600.
The multimedia component 608 includes a screen that provides an output interface between the electronic device 600 and a user. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive an input signal from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 608 includes a front facing camera and/or a rear facing camera. The front camera and/or the rear camera may receive external multimedia data when the electronic device 600 is in an operation mode, such as a shooting mode or a video mode. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
The audio component 610 is configured to output and/or input audio signals. For example, the audio component 610 includes a Microphone (MIC) configured to receive external audio signals when the electronic device 600 is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals may further be stored in the memory 604 or transmitted via the communication component 618. In some embodiments, audio component 610 further includes a speaker for outputting audio signals.
The I/O interface 612 provides an interface between the processing component 602 and peripheral interface modules, which may be keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to: a home button, a volume button, a start button, and a lock button.
The sensor component 614 includes one or more sensors for providing status assessment of various aspects of the electronic device 600. For example, the sensor component 614 may detect an open/closed state of the electronic device 600, the relative positioning of components, such as a display and keypad of the electronic device 600, the sensor component 614 may also detect a change in the position of the electronic device 600 or a component of the electronic device 600, the presence or absence of user contact with the electronic device 600, orientation or acceleration/deceleration of the electronic device 600, and a change in the temperature of the electronic device 600. The sensor assembly 614 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 614 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 614 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The image capture component 616 can be used to capture image data of a subject to form an image about the subject and can perform the necessary processing on the image. The Image capturing component 616 may include a camera module, in which an Image Sensor (Sensor) senses light from a subject through a lens, and provides the obtained light sensing data to an Image Signal Processor (ISP), which generates an Image corresponding to the subject according to the light sensing data. The image sensor may be a CMOS sensor or a CCD sensor, and may also be an infrared sensor, a depth sensor, or the like; the camera module may be built in the electronic device 600, or may be an external module of the electronic device 600; the ISP may be built in the camera module or may be externally hung on the electronic device (not in the camera module).
The communication component 618 is configured to facilitate wired or wireless communication between the electronic device 600 and other devices. The electronic device 600 may access a wireless network based on a communication standard, such as WiFi, a carrier network (such as 2G, 3G, 4G, or 5G), or a combination thereof. In an exemplary embodiment, the communication component 618 receives a broadcast signal or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 618 further includes a Near Field Communication (NFC) module to facilitate short-range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, Ultra Wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
In an embodiment of the present disclosure, the electronic device 600 may be implemented by one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), controllers, micro-controllers, microprocessors or other electronic components for performing the processing method of the above-described events.
In an exemplary embodiment, a computer-readable storage medium comprising instructions, such as the memory 604 comprising instructions, executable by the processor 620 of the electronic device 600 to perform the above-described method is also provided. Alternatively, the computer readable storage medium may be a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
It is noted that, in the present disclosure, relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. The terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The method and apparatus provided by the embodiments of the present disclosure are described in detail above, and the principles and embodiments of the present disclosure are explained herein by applying specific examples, and the above description of the embodiments is only used to help understanding the method and core ideas of the present disclosure; meanwhile, for a person skilled in the art, based on the idea of the present disclosure, there may be variations in the specific embodiments and the application scope, and in summary, the present disclosure should not be construed as a limitation to the present disclosure.

Claims (10)

1. A method for processing an event, comprising:
receiving a resource exposure event sent by a resource delivery platform, and respectively sending the resource exposure event to a cache and a database for storage;
responding to a resource triggering event generated by a user terminal, and inquiring a first exposure event in the cache, wherein the first exposure event is a resource exposure event matched with the resource triggering event;
and if the first exposure event is not inquired in the cache, inquiring the first exposure event in the database, and feeding the inquired first exposure event back to the resource delivery platform.
2. The method of claim 1, wherein the resource exposure event comprises a terminal identifier, a resource identifier and an exposure time, and querying the first exposure event comprises:
determining a target terminal identifier, a target resource identifier and a triggering moment in the resource triggering event;
and inquiring the resource exposure event containing the target terminal identifier and the target resource identifier in the resource exposure event with the exposure time earlier than the trigger time to serve as the first exposure event.
3. The method of claim 1, further comprising:
if the first exposure event is not inquired in the database, setting the resource triggering event as a to-be-processed event;
and querying a second exposure event in the database, and feeding the queried second exposure event back to the resource delivery platform, wherein the second exposure event is a resource exposure event matched with the event to be processed.
4. The method of claim 3, wherein setting the resource triggering event as a pending event comprises:
adding a mark to be processed for the resource triggering event; alternatively, the first and second electrodes may be,
and adding the resource triggering event into a to-be-processed event table, wherein the to-be-processed event table is used for recording the resource triggering event of which the corresponding first exposure event is not inquired yet.
5. The method of claim 3, wherein querying the database for a second exposure event comprises:
inquiring a second exposure event in the database according to a preset inquiry period; alternatively, the first and second electrodes may be,
and under the condition that the resource occupancy rate of the database is lower than a preset threshold value, inquiring a second exposure event in the database.
6. The method of claim 5, further comprising:
and if the second exposure event is inquired in the database, deleting the event to be processed.
7. An apparatus for processing an event, comprising:
the event receiving module is configured to receive the resource exposure events sent by the resource delivery platform and respectively send the resource exposure events to the cache and the database for storage;
the event query module is configured to respond to a resource triggering event generated by a user terminal, and query a first exposure event in the cache, wherein the first exposure event is a resource exposure event matched with the resource triggering event;
the first sending module is configured to query the first exposure event in the database and feed back the queried first exposure event to the resource delivery platform if the first exposure event is not queried in the cache.
8. An electronic device, comprising:
a processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement a method of processing events as claimed in any one of claims 1 to 6.
9. A computer-readable storage medium, wherein instructions in the computer-readable storage medium, when executed by a processor of an electronic device, enable the electronic device to perform the method of processing the event of any of claims 1 to 6.
10. A computer program product comprising a computer program and/or instructions, characterized in that the computer program and/or instructions, when executed by a processor, implement a method of processing events according to any one of claims 1 to 6.
CN202111222206.5A 2021-10-20 2021-10-20 Event processing method and device, electronic equipment and storage medium Pending CN113986966A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111222206.5A CN113986966A (en) 2021-10-20 2021-10-20 Event processing method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111222206.5A CN113986966A (en) 2021-10-20 2021-10-20 Event processing method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN113986966A true CN113986966A (en) 2022-01-28

Family

ID=79739648

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111222206.5A Pending CN113986966A (en) 2021-10-20 2021-10-20 Event processing method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113986966A (en)

Similar Documents

Publication Publication Date Title
US20210334856A1 (en) Telecommunications call augmentation system
CN110366013B (en) Promotion content pushing method and device and storage medium
JP2017532700A (en) This application is filed on the basis of a Chinese patent application whose application number is CN20150946713.6 and the filing date is August 13, 2015, claiming priority of the Chinese patent application, The entire contents of the Chinese patent application are hereby incorporated herein by reference.
CN108804244B (en) Data transmission method, device and storage medium
CN109634762B (en) Data recovery method and device, electronic equipment and storage medium
CN108073593B (en) Method, device and system for generating media content
CN111435377A (en) Application recommendation method and device, electronic equipment and storage medium
CN104933085B (en) Update method, terminal and the server of e-book
CN110908814A (en) Message processing method and device, electronic equipment and storage medium
CN108012258B (en) Data traffic management method and device for virtual SIM card, terminal and server
CN113986966A (en) Event processing method and device, electronic equipment and storage medium
CN113553509B (en) Content recommendation method and device, electronic equipment and storage medium
CN112862349B (en) Data processing method, device and equipment based on ABS service data
CN111988669B (en) Video interaction data processing method and device, electronic equipment and storage medium
CN114066370A (en) Inventory service calling method, device, equipment, storage medium and program product
CN113709572A (en) Content promotion method and device, electronic equipment and storage medium
CN112632184A (en) Data processing method and device, electronic equipment and storage medium
EP3222030A1 (en) Telecommunications call augmentation system
CN111526084A (en) Information processing method, device, equipment and storage medium
CN108021399B (en) Note processing method, device and equipment and storage medium
JP5339989B2 (en) Content provision system
CN106021587B (en) Page updating method, device and system
CN105450510A (en) Friend management method, device and server for social network platform
CN110995767B (en) Request processing method and device
CN112182455B (en) Page display method, device, electronic equipment and storage medium

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