WO2022206054A1 - Material incremental processing method and apparatus, electronic device, and computer storage medium - Google Patents

Material incremental processing method and apparatus, electronic device, and computer storage medium Download PDF

Info

Publication number
WO2022206054A1
WO2022206054A1 PCT/CN2021/140584 CN2021140584W WO2022206054A1 WO 2022206054 A1 WO2022206054 A1 WO 2022206054A1 CN 2021140584 W CN2021140584 W CN 2021140584W WO 2022206054 A1 WO2022206054 A1 WO 2022206054A1
Authority
WO
WIPO (PCT)
Prior art keywords
queue
preset
increment instruction
instruction
target
Prior art date
Application number
PCT/CN2021/140584
Other languages
French (fr)
Chinese (zh)
Inventor
李贵阳
闫创
Original Assignee
北京沃东天骏信息技术有限公司
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 北京沃东天骏信息技术有限公司 filed Critical 北京沃东天骏信息技术有限公司
Publication of WO2022206054A1 publication Critical patent/WO2022206054A1/en

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
    • 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/23Updating
    • G06F16/2358Change logging, detection, and notification
    • 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/25Integrating or interfacing systems involving database management systems
    • G06F16/252Integrating or interfacing systems involving database management systems between a Database Management System and a front-end application

Definitions

  • the present application relates to the technical field of data processing, and in particular, to a material increment processing method, device, electronic device and computer storage medium.
  • the system executes the corresponding plan according to the uploaded materials.
  • materials For example, in the advertising delivery system, users need to upload advertising materials on the delivery platform.
  • the delivery platform will store the advertising materials in the database, and then the material transmission module will transfer the advertising materials to the specified location (usually a network disk), Then, the advertising system obtains advertising materials for advertising delivery. That is to say, the advertising materials need to be transferred from the database to the designated location before the advertisement can be delivered.
  • the present application provides a material incremental processing method, device, electronic equipment and computer storage medium, which can not only improve the real-time performance and throughput of material incremental processing, but also improve the processing speed, thereby shortening the time for material change to take effect. .
  • an embodiment of the present application provides a method for processing material increments, the method comprising:
  • the material increment instruction is used to indicate that the material data stored in the source location is changed;
  • an embodiment of the present application provides a material increment processing device, and the material increment processing device includes an acquisition unit, an analysis unit, and a processing unit; wherein,
  • an acquiring unit configured to acquire a material increment instruction; wherein, the material increment instruction is used to indicate that the material data stored in the source location is changed;
  • an analysis unit configured to perform attribute analysis on the material increment instruction, and determine a target queue corresponding to the material increment instruction in a plurality of preset queues according to the attribute analysis result;
  • the processing unit is configured to process the material increment instruction by using the target queue to obtain target material information.
  • an embodiment of the present application provides an electronic device, the electronic device includes a memory and a processor; wherein,
  • the memory for storing a computer program executable on the processor
  • the processor is configured to execute the steps of the method according to the first aspect when running the computer program.
  • an embodiment of the present application provides a computer storage medium, where the computer storage medium stores a computer program, and when the computer program is executed by a plurality of processors, implements the steps of the method described in the first aspect.
  • the embodiments of the present application provide a material increment processing method, device, electronic device and computer storage medium, by acquiring a material increment instruction, wherein the material increment instruction is used to indicate that the material data stored in the source location is changed; Perform attribute analysis on the material increment instruction, and determine a target queue corresponding to the material increment instruction in a plurality of preset queues according to the attribute analysis result; use the target queue to process the material increment instruction, and obtain Target material information.
  • the corresponding target queue is determined from multiple preset queues, so that the material increment instruction can be processed in real time by using the target queue, which can not only improve the real-time performance and throughput of material increment processing It can also improve the processing speed of material increment instructions, thereby shortening the time for material changes to take effect.
  • FIG. 1 is a schematic flowchart of a material incremental processing method provided by the related art
  • FIG. 2 is a schematic flowchart of a material increment processing method provided by an embodiment of the present application
  • FIG. 3 is a schematic diagram 1 of an application scenario of a material increment processing method provided by an embodiment of the present application
  • FIG. 4 is a schematic diagram 2 of an application scenario of a material increment processing method provided by an embodiment of the present application
  • FIG. 5 is a schematic diagram 3 of an application scenario of a material increment processing method provided by an embodiment of the present application.
  • FIG. 6 is a schematic structural diagram of a material increment processing device provided by an embodiment of the present application.
  • FIG. 7 is a schematic diagram of a hardware structure of an electronic device provided by an embodiment of the present application.
  • FIG. 8 is a schematic diagram of the composition and structure of an electronic device according to an embodiment of the present application.
  • Advertiser The user who places the ad.
  • Advertising material The content displayed within the advertisement. Specifically, the basic forms of advertising materials are text, picture, and flash type (a file type).
  • RPC Remote Procedure Call
  • Protocol Buffer or PB for short; specifically, it refers to a language-independent, platform-independent, and extensible method of serializing structured data.
  • the advertising delivery system is a platform for advertisers to upload advertising materials and set delivery methods, also known as a delivery platform (Platform).
  • the delivery platform generally corresponds to a specific database (called a material library, such as MySQL) for storing the advertising materials uploaded by the advertiser.
  • a material library such as MySQL
  • the delivery platform detects the material change, it needs to convert the advertising material information into PB data in units of advertising units and transmit it to the recall system (Retrieval). Bidding queue, displayed to users after successful bidding.
  • the data interaction method agreed between the delivery platform and the recall system is the Network File System (NFS).
  • NFS Network File System
  • the network file system is also called a network disk.
  • the modified material transmission process needs to be realized by polling the change event.
  • the specific principle is as follows: Create a task queue (task_queue) table in the database (MySQL) in the delivery platform module.
  • the delivery platform (Platform) monitors any operation of the advertiser, it will add a change record in it.
  • the dimensions may be plans/units/creatives, etc.; then, the material transfer service obtains this value based on the offset that was processed last time (that is, to determine the unexecuted change record) and the window size that needs to be processed this time (that is, the task throughput).
  • the next change instruction that needs to be processed query the material library to obtain the modified material data, splicing the modified material data, and obtain the material unit data corresponding to the advertising unit (material unit data can also be called material information, generally PB data is used format representation) and persisted to the network disk.
  • material unit data can also be called material information, generally PB data is used format representation
  • each operation of writing change events needs to be coupled in the Platform process.
  • the process of writing the task_queue table and the process of changing material data ensure atomicity through database transactions. .
  • the material transmission service needs to periodically pull the change records, and then reversely check the material information according to the change records, splicing it into advertising material data, and then writing it to the network disk.
  • FIG. 1 shows a schematic diagram of an application scenario of a material increment processing method provided by the related art.
  • the application scenario includes a delivery platform module, a material transfer module, and a recall inversion module (Retrieval).
  • the task_queue table it can include an identification field (Auto_pk), a type field (Task_type), and a content field (Task_rfid) and the Created time field.
  • the process of material transmission is as follows: the platform module needs to first verify the validity of the input parameters (that is, the validity of the input parameters); secondly, the schedule table is modified according to the input parameters, and the task_queue table is written, especially On the other hand, modifying the plan table (this step is embodied in modifying the budget material campaign field) and writing to the task_queue table need to be placed in a transaction to ensure atomicity; then, record the operation log to the log configuration tool (Elastic Search, ES ) for the advertiser to view; finally, the material transfer module periodically pulls the change record, retrieves the material of the changed advertising unit according to the material table of the change record, and re-splices it, obtains the material information corresponding to the advertising unit, and stores the material information Write to the network disk for recalling the inverted module.
  • the platform module needs to first verify the validity of the input parameters (that is, the validity of the input parameters); secondly, the schedule table is modified according to the input parameters, and the task_queu
  • the records of the task_queue table are strongly coupled with the normal advertiser operations, and the perception of the change records of material transmission also depends on the frequency of regularly pulling the task_queue table. In this case, it is difficult to control the time period threshold for pulling the task_queue table and the number of modified records in the pulling task_queue table, which may lead to some defects.
  • the delivery logic is strongly coupled, and all material-related operations must rewrite the task_queue Tables; and splicing advertising material data according to the change records need to be executed sequentially, and the throughput is low; in addition, due to the poor real-time performance of regular polling, it takes a long time for material changes to take effect.
  • an embodiment of the present application provides a material increment processing method, the basic idea of which is: acquiring a material increment instruction; wherein the material increment instruction is used to indicate that the material data stored in the source location is changed; Perform attribute analysis on the material increment instruction, and determine a target queue corresponding to the material increment instruction in a plurality of preset queues according to the attribute analysis result; use the target queue to process the material increment instruction, and obtain Target material information.
  • the corresponding target queue is determined from multiple preset queues, so that the material increment instruction can be processed in real time by using the target queue, which can not only improve the real-time performance and throughput of material increment processing It can also improve the processing speed of material increment instructions, thereby shortening the time for material changes to take effect.
  • the embodiments of the present application will be described in detail below with reference to the accompanying drawings.
  • the methods in the embodiments of the present application may be executed by an electronic device.
  • the electronic device may be implemented as a terminal, and may also be implemented as a server, which is not limited in this embodiment of the present application.
  • FIG. 2 shows a schematic flowchart of a material increment processing method provided by the embodiment of the present application.
  • the method may include:
  • the embodiments of the present application can be applied to the field of e-commerce material delivery, the field of advertising material delivery, and the like. It should be understood that, in the case where the information is changed, when the modified information needs to be transmitted from one location to another location, the method provided by the implementation of the present application can be adopted.
  • the embodiments of the present application all take the advertisement material delivery scenario as an example for subsequent description.
  • the advertising material delivery scenario generally includes a delivery platform module, a material transmission module, and a recall inversion module.
  • the delivery platform module stores the received advertising materials in the source location (such as a database); thirdly, the material transmission module determines according to the database.
  • the modified advertising unit is re-spliced into the new material information of the advertising unit; finally, the material transmission module transmits the new material information of the advertising unit to the target location (such as a network file storage system), waiting for subsequent advertising.
  • the material increment instruction is used to indicate that the material data at the source location is changed, and the source location refers to the data storage location on the side of the material delivery user (such as an advertiser).
  • the determining at least one material increment instruction may include: collecting log information of the database when a material change event occurs in the database; The log information of the database is filtered by using preset keywords, and the material increment instruction is generated according to the filtering result.
  • the log information of the database can be filtered by using a preset keyword, thereby generating a material increment instruction.
  • the preset keyword is pre-configured according to the application scenario, and is used to extract a field value of the database log to obtain the changed data location, and then generate the material increment instruction according to the changed data location.
  • log information (such as a binary log) of the database is collected.
  • the binary log of the database (equivalent to log information) is obtained; then, the log of the database is filtered according to the preset keywords. and extraction to generate material increment instructions.
  • the material change event includes not only modifying the existing material data, but also writing new material data.
  • the delivery platform module monitors any operation of the advertiser, a change record is added in it, and then the material transmission module is processed according to the last offset ( That is, determine the last processed change record) and the window size to be processed this time (that is, determine the number of change records to be processed this time), and obtain the material increment instruction that needs to be processed this time, so as to carry out subsequent operations.
  • the material delivery logic is strongly coupled with the advertiser, and all material-related operations must remember to rewrite the task_queue table, which is inefficient.
  • the database's own tools are used to monitor modification events, and use the database's own tools to monitor modification events.
  • the binary log is used to obtain material increment instructions. The operation is simple and efficient, and the task_queue table is no longer required.
  • S102 Perform attribute analysis on the material increment instruction, and determine a target queue corresponding to the material increment instruction from a plurality of preset queues according to the attribute analysis result.
  • the embodiment of the present application adopts a multi-queue processing mode, and according to the attributes of the material increment instruction, it can be allocated to the target queues among the multiple preset queues.
  • multiple preset queues can be executed separately by different processes to improve task throughput and processing speed.
  • the material increment instruction may indicate a specific instruction for modifying one advertising material, or may include multiple specific instructions for respectively instructing the modification of multiple advertising materials.
  • the specific instructions will be allocated to different preset queues according to the attribute analysis result, thereby improving throughput and real-time performance.
  • the multiple preset queues may include a first preset queue and a second preset queue
  • determining the target queue from the multiple preset queues according to the attribute analysis result may include: In the case that the attribute analysis result satisfies the preset screening condition, the first preset queue is determined as the target queue, and the material increment instruction is stored in the first preset queue; In the case that the attribute analysis result does not meet the preset screening conditions, the second preset queue is determined as the target queue, and the material increment instruction is stored in the second preset queue; wherein, the The first preset queue is different from the second preset queue.
  • the material increment instruction if the attribute analysis result satisfies the preset filter conditions, the material increment instruction is allocated to the first preset queue; if the attribute analysis result does not meet the preset filter conditions, then Allocate the material increment instruction to the second preset queue.
  • the first preset queue is used to store some instructions with low execution speed or low priority (that is, material increment instructions that meet the preset screening conditions), which can also be called the slow queue
  • the second preset queue is used for It is used to store other common instructions (that is, material increment instructions that do not meet the preset screening conditions), which can also be called standard queues. Due to the difference in the material increment instructions included, the execution speed of the slow queue is slower than that of the standard queue.
  • multiple preset queues can include slow queues and standard queues.
  • this part of the material will be Incremental instructions are put into the slow queue for execution; for most common material incremental instructions, they are put into the standard queue.
  • the preset filter conditions can be determined according to actual application scenarios.
  • the token bucket capacity of the first preset queue is smaller than the token bucket capacity of the second preset queue.
  • the principle of the token bucket is: put the token into the bucket at a constant speed, if the request needs to be processed, you need to get a token from the bucket first, when there is no token in the bucket, then Denial of service.
  • the capacity of the token bucket represents the maximum number of tasks in the queue.
  • the corresponding target queue can be determined in multiple preset queues, and the material increment instruction can be processed in a targeted manner, thereby improving the efficiency of material transmission.
  • S103 Based on the material data stored in the source location, process the material increment instruction through the target queue to obtain target material information.
  • the corresponding material data is obtained from the source location according to the material increment instruction for processing, so as to obtain the target material information.
  • the material increment instruction may include a first material increment instruction and a second material increment instruction, and the first material increment instruction is stored in the first preset queue, and the first material increment instruction is stored in the first preset queue. Two material increment instructions are stored in the second preset queue. Therefore, in some embodiments of the present application, using the target queue to process the material increment instruction to obtain target material information may include: using the first preset queue and the second preset queue A queue is set to process the first material increment instruction and the second material increment instruction in parallel to obtain the target material information.
  • the material increment instruction includes the first material increment instruction and the second material increment instruction
  • the first material increment instruction is stored in the first preset queue
  • the second material increment instruction is stored in the first preset queue. If the quantity instruction is stored in the second preset queue, the first preset queue and the second preset queue can be executed in parallel through two specific processes, so as to obtain the material information of the first material increment instruction and the second material increment instruction material information.
  • the concurrent multi-queue mode can ensure that the material increment command can be executed efficiently, and the classification of slow queues and standard queues can avoid the blockage of a certain task, so that the material increment command takes effect in high real-time, and multiple Preset queues also increase task bandwidth and expand task throughput.
  • the obtaining target material information based on the processing of the material increment instruction through the target queue may include: acquiring the material increment instruction from the target queue, Determine the target material identifier according to the material increment instruction; determine the target material data set from the material data stored in the source location according to the material identifier; perform data splicing processing on the target material data set to obtain the target Material information.
  • the material data is stored in the source location in the form of an advertisement unit, that is, the source location stores multiple material identifiers and respective material data sets of the multiple material identifiers.
  • a material ID represents a specific advertising plan, or a material ID represents an advertising unit.
  • the acquisition process of the target material information includes the following steps: first, take out the material increment instruction from the target queue, and determine the modified target material identifier according to the material increment instruction; then, according to the target material identifier, from the The target material data set corresponding to the material identifier is determined in the material data stored in the source location; finally, the data in the target material data set is spliced to obtain target material information.
  • the material data corresponding to an advertisement can be divided into multiple levels, such as user (user) data, plan (campaign) data, unit (ad_group) data, and creative (ad) data.
  • This is called an ad unit.
  • the respective data of multiple ad units are stored, and the data of one ad unit includes data of four different levels of user/campaign/ad_group/ad.
  • there will be an independent material identification (Identity Document, ID) for each advertisement, and the material ID of the modified material will be carried in the material increment instruction, but the specific modification information will not be recorded.
  • the material increment instruction specifically indicates a certain material unit that has been modified.
  • advertisers may repeatedly modify a material unit in a short period of time.
  • the first preset queue and the second preset queue can be designed without The form of an ordered set, thus avoiding repeated operations.
  • the material transmission module determines from the log of the database that the material unit 335 has been modified, and generates (material increment instruction: material unit 335); and assigns (material increment instruction: material unit 335) to the second pre-order Set up a queue, if before the modification of (material increment instruction: material unit 335) is processed, the material transfer module determines from the database log again that material unit 335 has been modified twice, and once again generates (material increment instruction : material unit 335).
  • the second preset queue is an unordered set, the new material increment instruction will not be put into the second preset queue again.
  • (material increment instruction: material unit 335) is executed, the latest material data needs to be acquired from the database for splicing, and the result has already covered two modifications.
  • the second preset queue as an unordered set
  • deduplication can be performed naturally and redundant operations can be avoided.
  • there is also a disadvantage of unordered collections that is, due to the randomness of execution, when new material increment instructions flow in continuously, it is possible that an old material increment instruction will never be flushed out for processing. Therefore, this drawback can be avoided by using the flush queue mechanism.
  • the plurality of preset queues further include a third preset queue
  • the method may further include: starting a timer; The material increment instruction stored in the second preset queue is moved to the third preset queue.
  • the plurality of preset queues further include a third preset queue, and the third preset queue refers to a flushing queue of the second preset queue.
  • the material increment instruction stored in the second preset queue may be moved to the third preset queue according to a preset preset duration.
  • the common material increment instruction is put into the second preset queue; All unprocessed material increment instructions in the preset queue are moved to the third preset queue.
  • the third preset queue is preferentially processed, thereby avoiding the disadvantage that a certain material increment instruction cannot be processed for a long time.
  • the third preset queue is also an unordered set.
  • the obtaining the material increment instruction from the target queue may include: in the case that the attribute analysis result satisfies a preset screening condition, obtaining the material increment instruction from the first preset queue Obtain the material increment instruction from ; if the attribute analysis result does not meet the preset screening conditions, determine whether the third preset queue is empty; if the third preset queue is not empty, then The material increment instruction is acquired from the third preset queue; if the third preset queue is empty, the material increment instruction is acquired from the second preset queue.
  • the material increment instructions in the first preset queue can be fetched and executed in sequence.
  • the third preset queue takes precedence over the second preset queue.
  • the default queue is executed. In other words, when the third preset queue is not empty, the instructions in the third preset queue need to be executed first; when the third preset queue is empty, the instructions in the second preset queue are executed. Material increment instruction.
  • the plurality of preset queues may further include a fourth preset queue, and in the case that the processing of the material increment instruction fails, the method may further include: based on the material Incremental instruction, a retry instruction is generated in the fourth preset queue; according to the retry instruction, the material increment instruction is retried through the fourth preset queue.
  • the processing of the material increment instruction fails, a retry instruction will be generated in the fourth preset queue accordingly, so that the failed material increment instruction will be executed again in the fourth preset queue. , to avoid blocking a queue.
  • the first preset queue, the second preset queue/third preset queue, and the fourth preset queue are performed concurrently through three processes (the second preset queue and the third preset queue share one process). .
  • the method may further include: generating alarm information based on the material increment instruction; wherein the alarm information is used to inform the management The personnel prompts that the material increment instruction is abnormal.
  • alarm information can also be generated so as to prompt that the material increment instruction is in an abnormal state, so as to remind the management personnel to handle it.
  • the processing strategy of infinite retry and alarm ie, alarm
  • the method further includes: transmitting the target material information to a target location; sorting the target material information at the target location, and performing material delivery according to the sorting result.
  • the target material information can be obtained, and the target material information can be transmitted. Go to the target location (usually a distributed network file system), and then recall the inverted module to obtain the target material information from the target location and enter the sorting step, so as to carry out subsequent material delivery.
  • the target location usually a distributed network file system
  • the material is transferred from the source position to the target position, which improves the real-time performance and throughput of material transmission.
  • the embodiment of the present application provides a material increment processing method, by acquiring a material increment instruction; wherein, the material increment instruction is used to indicate that the material data stored in the source location is changed; attribute the material increment instruction parsing, determining a target queue corresponding to the material increment instruction in a plurality of preset queues according to the attribute parsing result; using the target queue to process the material increment instruction to obtain target material information.
  • the corresponding target queue is determined from multiple preset queues, so that the material increment instruction can be processed in real time by using the target queue, which can not only improve the real-time performance and throughput of material increment processing It can also improve the processing speed of material increment instructions, thereby shortening the time for material changes to take effect.
  • FIG. 3 it shows a schematic diagram of an application scenario of a material increment processing method provided by an embodiment of the present application.
  • the application scenario includes a delivery platform module 201 , a material transmission module 202 and a recall inversion module 203 , and the delivery platform module includes a database 2011 .
  • the material increment processing method provided in the embodiment of the present application focuses on the interaction between the delivery platform module 201 and the material transmission module 202 and internal processes.
  • the delivery platform module 201 receives the modification instruction of the advertiser, and for the modification instruction, performs the steps of parameter validity check, modification plan table and recording operation log; here, modifying the plan table refers to modifying the plan table according to the operation of the advertiser
  • the material data in the database 2011 and the recording operation log are used to present the corresponding modification records to the advertiser.
  • the material transmission module 202 according to the material increment instruction in the increment instruction queue, the material table in the database is reversely checked to obtain the target material information (or material unit data) of the PB data structure, and the material unit is Data is written to the network disk.
  • the recall and inversion module 203 takes out the material unit data (equivalent to the aforementioned target material information) from the network disk, and enters a specific sorting and placing process.
  • the core of the material increment processing method provided by the embodiment of the present application is mainly to upgrade the information interaction mode, so that the responsibilities of each module are clearer and a self-closed loop is formed; the overall application architecture can also be optimized, and the material online ( Ad modifications take effect) time.
  • the delivery platform module there is no need to write the task_queue table separately for each operation that needs to trigger the material increment.
  • the changes of the database table can be obtained by collecting the binary log (Binlog) at the database level. , configure the table/field changes to be detected (equivalent to monitoring keywords) for filtering. It should be understood that this process needs to adjust the Binlog mode of the database to a row (Row) mode.
  • the message queue cluster tool as a message relay, and this tool can also be used as a stress test tool for playback at selected sites.
  • the “incremental instruction queue” in the material transmission module 202 actually corresponds to the core logic of the entire material transmission process, so it will be described in detail.
  • the middleware that is mainly relied on is Redis (an open source in-memory data structure storage system).
  • the material transmission module 202 includes an instruction receiving sub-module 2021 , a token bucket current limiting sub-module 2022 , a multi-queue processing sub-module 2023 , a unit assembly sub-module 2024 and a result output sub-module 2025 .
  • the command receiving sub-module 2021 is responsible for converting external commands into a form that can be processed inside the material transmission
  • the token bucket current limiting sub-module 2022 is used to manage the number of commands that can be processed by a certain queue at the same time
  • the multi-queue processing sub-module 2023 In order to ensure that the data processing is not lost in order (that is, the order of data in the queue is guaranteed without data loss) and real-time stability, the unit assembly sub-module 2024 uses a multi-threaded method to assemble the material information in parts, and outputs the sub-module through the final result. Module 2025 persists the data to the network disk.
  • the instruction receiving sub-module 2021 is mainly responsible for converting external information (that is, the material modification information determined by the delivery platform module) into an object for internal processing of material transmission.
  • external information that is, the material modification information determined by the delivery platform module
  • the instruction receiving sub-module 2021 also provides a Hyper Text Transfer Protocol (HTTP)/RPC protocol interface, which supports sending instructions by manual triggering to trigger the incremental process.
  • HTTP Hyper Text Transfer Protocol
  • the token bucket current limiting sub-module 2022 is mainly responsible for limiting the number of instructions processed in a certain queue at the same time. Through the configuration center tool, the number of tokens in the token bucket can be dynamically adjusted to ensure the stable operation of the service. In other words, the token bucket current limiting sub-module 2022 is mainly used to limit the system to only process a preset number at the same time (ie number of tokens), for the excess part, you need to wait for the token bucket space.
  • the multi-queue processing sub-module 2023 includes the slow queue slow (equivalent to the aforementioned first preset queue)/standard queue normal (equivalent to the aforementioned second preset queue, also called a normal queue)/flushing queue flush ( It is equivalent to the aforementioned third preset queue, which may also be referred to as a buffer queue)/retry queue retry (equivalent to the aforementioned fourth preset queue) and execution queue running.
  • These different queues perform their respective duties to ensure that the incremental instructions can be executed in a timely manner without losing the order and being stable in real time.
  • the number of tokens in the token bucket of the slow queue is small, and the execution process is the same as that of other queues.
  • the execution speed of the queue is relatively slow.
  • the system will put all the advertiser's instructions in the slow queue; in addition, if a certain instruction may trigger the reassembly of a large number of units, for example, a system crowd is It is tied to 50w units. If the crowd information changes, all units associated with it will be changed. At this time, this instruction is placed in the slow queue for slow execution, which can ensure that the normal queue is smooth and no backlog.
  • the normal and flush queues are actually unordered collections (Redis's set function), which is characterized by the ability to naturally deduplicate unordered.
  • advertisers often modify a unit multiple times in a short period of time, so the feature of deduplication is very important, which can effectively improve work efficiency.
  • Binlog and instruction parsing it will go to the standard queue, but using only one standard queue will lead to the problem of zombie instructions, that is, the standard queue continues to flow into incremental instructions, and a certain instruction may never be popped off the stack theoretically ( Pop). Therefore, it is necessary to periodically flush the standard queue to the flushing queue.
  • When selecting an instruction first determine whether the flushing queue is empty, and then take the standard queue if it is empty.
  • the policy configured by the number of retries may be unlimited retries plus an alarm, which requires manual intervention by an administrator.
  • the execution queue For the execution queue, put the unit ID (equivalent to the aforementioned material identifier) into the execution queue before unit assembly, and remove the unit ID from the execution queue after information assembly and result output to ensure that the unit processing is not lost.
  • the unit assembly sub-module 2024 is mainly responsible for querying the database or adjusting the interface to obtain the latest material data set of the unit according to the unit ID, and splicing all the data in the material data set into the material unit data of the PB data structure.
  • a material data set may be divided into four levels: user/campaign/ad_group/ad (user/plan/unit/creative) according to the level of advertising materials, and further subdivided into smart bidding, crowd targeting , keywords, commodity orientation and other eight modules, the unit assembly module uses a multi-threaded parallel method to query and finally summarize.
  • the previously spliced material unit data (or called unit information, material information) is persisted to the network disk PB file, and the data can be quickly rolled back by retaining the latest 20 small versions .
  • the plurality of preset queues may include a slow queue, a standard queue, a flush queue and a retry queue.
  • the material increment instruction can include the first material increment instruction, the second increment instruction, and the third increment instruction
  • the above material increment instruction is subjected to attribute analysis through the instruction attribute analyzer, and the first material increment is added according to the attribute analysis result.
  • the quantity instruction is stored in the slow queue, the second material increment instruction and the third material increment instruction are stored in the standard queue, and the second material increment instruction is flushed to the flushing queue.
  • the first material increment instruction is taken out from the slow queue through the first execution queue, and the first material increment instruction is executed through the unit assembly sub-module and the result output sub-module, and the corresponding value of the first material increment instruction is output.
  • Target material information take out the second material increment instruction from the flushing queue through the second execution queue, execute the second material increment instruction through the unit assembly sub-module and the result output sub-module, and output the corresponding second material increment instruction target material information.
  • a retry instruction is generated in the retry queue, the retry instruction is taken out from the retry queue by the third execution queue, and the retry instruction is checked by the unit assembly sub-module and the result output sub-module. Execute the trial command (equivalent to re-executing the first material increment command).
  • the multi-queue processing sub-module, the unit assembly sub-module and the result output sub-module complement each other and jointly support the core logic of the material incremental processing method; and the first execution queue, the second execution queue and the third execution queue can Concurrent execution improves task throughput and processing speed.
  • the embodiments of the present application provide a high-throughput, quasi-real-time advertising incremental material transmission solution.
  • good real-time performance and throughput can enable advertisers' operations to be launched in minutes, and settings such as budget, bid, and orientation can take effect quickly; and its core is the multi-queue design logic of the material incremental processing method, which can ensure the system At the same time of stable operation, the layers are distinct and complement each other, which ultimately ensures the rapid delivery of materials.
  • the material increment processing device 30 includes an acquisition unit 301, an analysis unit 302 and a processing unit 303, wherein the acquisition unit 301 is configured to acquire a material increment instruction; wherein, the material increment instruction uses The material data stored at the indicated source location is changed; the parsing unit 302 is configured to perform attribute analysis on the material increment instruction, and determine the target corresponding to the material increment instruction in a plurality of preset queues according to the attribute analysis result Queue; the processing unit 303 is configured to use the target queue to process the material increment instruction to obtain target material information.
  • the acquiring unit 301 is configured to collect log information of the database when a material change event occurs in the database; and filter the log information of the database by using preset keywords , and generate the material increment instruction according to the filtering result.
  • the parsing unit 302 is further configured to determine the first preset queue as the target queue under the condition that the attribute parsing result satisfies the preset filter condition, and to The material increment instruction is stored in the first preset queue; if the attribute analysis result does not meet the preset screening conditions, the second preset queue is determined as the target queue, and the The material increment instruction is stored in the second preset queue; wherein the first preset queue is different from the second preset queue.
  • the material increment instruction includes a first material increment instruction and a second material increment instruction, and the first material increment instruction is stored in the first preset queue, the second material increment instruction is stored in the second preset queue;
  • the processing unit 303 is further configured to use the first preset queue and the second preset queue to perform parallel processing on the first material increment instruction and the second material increment instruction, to obtain The target material information.
  • the processing unit 303 is configured to obtain the material increment instruction from the target queue, and determine a target material identifier according to the material increment instruction;
  • the target material data set is determined from the material data stored in the source location; the data splicing process is performed on the target material data set to obtain the target material information.
  • the parsing unit 302 is further configured so that the plurality of preset queues further include a third preset queue, and starts a timer; when the timing duration of the timer reaches a preset duration, The third preset queue is determined as the target queue, and the material increment instruction stored in the second preset queue is moved to the third preset queue.
  • the processing unit 303 is further configured to obtain the material increment instruction from the first preset queue when the attribute parsing result satisfies a preset filter condition; In the case that the attribute analysis result does not meet the preset screening conditions, determine whether the third preset queue is empty; if the third preset queue is not empty, obtain from the third preset queue the material increment instruction; if the third preset queue is empty, obtain the material increment instruction from the second preset queue.
  • the plurality of preset queues further include a fourth preset queue
  • the processing unit 303 is further configured to, in the case that the processing of the material increment instruction fails, based on the material increment amount instruction, and a retry instruction is generated in the fourth preset queue; according to the retry instruction, the material increment instruction is retried through the fourth preset queue.
  • the processing unit 303 is further configured to generate alarm information based on the material increment instruction in the event that the material increment instruction fails to be processed; wherein the alarm information is used for Notify the manager that there is an abnormality in the material increment instruction.
  • the processing unit 303 is further configured to transmit the target material information to the target location; sort the target material information at the target location, and perform material delivery according to the sorting result.
  • a "unit” may be a part of a circuit, a part of a processor, a part of a program or software, etc., of course, it may also be a module, and it may also be non-modular.
  • each component in this embodiment may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit.
  • the above-mentioned integrated units can be implemented in the form of hardware, or can be implemented in the form of software function modules.
  • the integrated unit is implemented in the form of a software functional module and is not sold or used as an independent product, it can be stored in a computer-readable storage medium.
  • the technical solution of this embodiment is essentially or The part that contributes to the prior art or the whole or part of the technical solution can be embodied in the form of a software product, the computer software product is stored in a storage medium, and includes several instructions for making a computer device (which can be It is a personal computer, a server, or a network device, etc.) or a processor (processor) that executes all or part of the steps of the method described in this embodiment.
  • the aforementioned storage medium includes: U disk, mobile hard disk, read only memory (Read Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disk or optical disk and other media that can store program codes.
  • this embodiment provides a computer storage medium storing a computer program, the computer program implementing the steps of the method in any one of the foregoing embodiments when executed by a plurality of processors.
  • FIG. 7 shows a schematic diagram of a hardware structure of an electronic device 40 provided by an embodiment of the present application.
  • the electronic device 40 may include: a communication interface 401 , a memory 402 and a processor 403 ; various components are coupled together through a bus device 404 .
  • the bus device 404 is used to implement the connection communication between these components.
  • the bus device 404 also includes a power bus, a control bus, and a status signal bus.
  • the various buses are labeled as bus devices 404 in FIG. 7 .
  • the communication interface 401 is used for receiving and sending signals in the process of sending and receiving information with other external network elements;
  • memory 402 for storing computer programs that can run on processor 403;
  • the processor 403 is configured to, when running the computer program, execute:
  • the material increment instruction is used to indicate that the material data stored in the source location is changed;
  • the memory 402 in this embodiment of the present application may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memory.
  • the non-volatile memory may be a read-only memory (Read-Only Memory, ROM), a programmable read-only memory (Programmable ROM, PROM), an erasable programmable read-only memory (Erasable PROM, EPROM), an electrically programmable read-only memory (Erasable PROM, EPROM). Erase programmable read-only memory (Electrically EPROM, EEPROM) or flash memory.
  • Volatile memory may be Random Access Memory (RAM), which acts as an external cache.
  • RAM Static RAM
  • DRAM Dynamic RAM
  • SDRAM Double Data Rate Synchronous Dynamic Random Access Memory
  • Double Data Rate SDRAM DDRSDRAM
  • Enhanced Synchronous Dynamic Random Access Memory Enhanced SDRAM, ESDRAM
  • Synchronous link DRAM Synchronous link DRAM, SLDRAM
  • Direct Rambus RAM Direct Rambus RAM
  • the processor 403 may be an integrated circuit chip with signal processing capability. In the implementation process, each step of the above-mentioned method can be completed by an integrated logic circuit of hardware in the processor 403 or an instruction in the form of software.
  • the above-mentioned processor 403 can be a general-purpose processor, a digital signal processor (Digital Signal Processor, DSP), an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field programmable gate array (Field Programmable Gate Array, FPGA) or other Programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
  • DSP Digital Signal Processor
  • ASIC Application Specific Integrated Circuit
  • FPGA Field Programmable Gate Array
  • a general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
  • the steps of the method disclosed in conjunction with the embodiments of the present application may be directly embodied as executed by a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor.
  • the software modules may be located in random access memory, flash memory, read-only memory, programmable read-only memory or electrically erasable programmable memory, registers and other storage media mature in the art.
  • the storage medium is located in the memory 402, and the processor 403 reads the information in the memory 402, and completes the steps of the above method in combination with its hardware.
  • the embodiments described herein may be implemented in hardware, software, firmware, middleware, microcode, or a combination thereof.
  • the processing unit can be implemented in one or more Application Specific Integrated Circuits (ASIC), Digital Signal Processing (DSP), Digital Signal Processing Device (DSP Device, DSPD), programmable Logic Devices (Programmable Logic Device, PLD), Field-Programmable Gate Array (Field-Programmable Gate Array, FPGA), General Purpose Processors, Controllers, Microcontrollers, Microprocessors, Others for performing the functions described herein electronic unit or a combination thereof.
  • ASIC Application Specific Integrated Circuits
  • DSP Digital Signal Processing
  • DSP Device Digital Signal Processing Device
  • DSPD Digital Signal Processing Device
  • PLD programmable Logic Devices
  • Field-Programmable Gate Array Field-Programmable Gate Array
  • FPGA Field-Programmable Gate Array
  • the techniques described herein may be implemented through modules (eg, procedures, functions, etc.) that perform the functions described herein.
  • Software codes may be stored in memory and executed by a processor.
  • the memory can be implemented in the processor or external to the processor.
  • the processor 403 is further configured to execute the steps of the method described in any one of the preceding embodiments when running the computer program.
  • FIG. 8 shows a schematic composition structure diagram of another electronic device 40 provided by the embodiments of the present application.
  • the electronic device 40 includes at least the material increment processing device 30 described in any one of the foregoing embodiments.
  • the attribute analysis result of the material increment instruction can be obtained, and then Determine the corresponding target queue from multiple preset queues, and use the target queue to process material incremental instructions in real time, which can not only improve the real-time performance and throughput of material incremental processing, but also improve the processing of material incremental instructions speed, thereby shortening the time for material changes to take effect.
  • the embodiments of the present application provide a material increment processing method, device, electronic device and computer storage medium, by acquiring a material increment instruction, wherein the material increment instruction is used to indicate that the material data stored in the source location is changed; Perform attribute analysis on the material increment instruction, and determine a target queue corresponding to the material increment instruction in a plurality of preset queues according to the attribute analysis result; use the target queue to process the material increment instruction, and obtain Target material information.
  • the corresponding target queue is determined from multiple preset queues, so that the material increment instruction can be processed in real time by using the target queue, which can not only improve the real-time performance and throughput of material increment processing It can also improve the processing speed of material increment instructions, thereby shortening the time for material changes to take effect.

Abstract

Provided are a material increment processing method and apparatus, a device, and a storage medium. The method comprises: obtaining a material increment instruction (S101), the material increment instruction being used for indicating that material data stored in a source location is changed; performing attribute analysis on the material increment instruction, and determining, from among multiple preset queues according to the attribute analysis result, a target queue corresponding to the material increment instruction (S102); and using the target queue to process the material increment instruction to obtain target material information (S103). In this way, according to the attribute analysis result of the material increment instruction, the corresponding target queue is determined from among multiple preset queues, and the material increment instruction can be processed in real time by using the target queue, such that not only can the real-time performance and throughput of material incremental processing be improved, but the speed of processing the material incremental instruction can be increased, thereby shortening the time for the material change to take effect.

Description

一种物料增量处理方法、装置、电子设备和计算机存储介质A material incremental processing method, device, electronic device and computer storage medium
相关申请的交叉引用CROSS-REFERENCE TO RELATED APPLICATIONS
本申请基于申请号为202110351985.2、申请日为2021年03月31日的中国专利申请提出,并要求该中国专利申请的优先权,该中国专利申请的全部内容在此引入本申请作为参考。This application is based on the Chinese patent application with the application number of 202110351985.2 and the filing date of March 31, 2021, and claims the priority of the Chinese patent application. The entire content of the Chinese patent application is incorporated herein by reference.
技术领域technical field
本申请涉及数据处理技术领域,尤其涉及一种物料增量处理方法、装置、电子设备和计算机存储介质。The present application relates to the technical field of data processing, and in particular, to a material increment processing method, device, electronic device and computer storage medium.
背景技术Background technique
在计算机领域,经常需要用户上传某一具体事项的资料(一般称为物料),然后由系统根据所上传的物料执行对应的计划。例如,在广告投放系统中,用户需要在投放平台中上传广告物料,此时投放平台会将广告物料存储在数据库中,然后由物料传输模块将广告物料传输到指定位置(一般为网盘),进而由广告系统获取广告物料进行广告投放。也就是说,广告物料需要由数据库传输至指定位置,才能够实现广告投放。In the computer field, users are often required to upload the data of a specific item (generally referred to as materials), and then the system executes the corresponding plan according to the uploaded materials. For example, in the advertising delivery system, users need to upload advertising materials on the delivery platform. At this time, the delivery platform will store the advertising materials in the database, and then the material transmission module will transfer the advertising materials to the specified location (usually a network disk), Then, the advertising system obtains advertising materials for advertising delivery. That is to say, the advertising materials need to be transferred from the database to the designated location before the advertisement can be delivered.
然而,在实际应用中,当用户修改广告物料时,这时候通常希望变更内容能够尽快生效。但是,由于目前的物料增量处理过程的实时性较差且任务吞吐量较小,从而导致物料变更到生效的时间较长。However, in practical applications, when the user modifies the advertising material, it is usually hoped that the changed content will take effect as soon as possible. However, due to the poor real-time performance and small task throughput of the current material incremental processing process, it takes a long time for material changes to take effect.
发明内容SUMMARY OF THE INVENTION
本申请提供了一种物料增量处理方法、装置、电子设备和计算机存储介质,不仅可以提高物料增量处理的实时性和吞吐量,还可以提高处理速度,进而能够缩短物料变更到生效的时间。The present application provides a material incremental processing method, device, electronic equipment and computer storage medium, which can not only improve the real-time performance and throughput of material incremental processing, but also improve the processing speed, thereby shortening the time for material change to take effect. .
本申请的技术方案是这样实现的:The technical solution of the present application is realized as follows:
第一方面,本申请实施例提供了一种物料增量处理方法,该方法包括:In a first aspect, an embodiment of the present application provides a method for processing material increments, the method comprising:
获取物料增量指令;其中,所述物料增量指令用于指示源位置存储的物料数据发生变更;Obtain a material increment instruction; wherein, the material increment instruction is used to indicate that the material data stored in the source location is changed;
对所述物料增量指令进行属性解析,根据属性解析结果在多个预设队列中确定所述物料增量指令对应的目标队列;Perform attribute analysis on the material increment instruction, and determine a target queue corresponding to the material increment instruction in a plurality of preset queues according to the attribute analysis result;
利用所述目标队列对所述物料增量指令进行处理,得到目标物料信息。Use the target queue to process the material increment instruction to obtain target material information.
第二方面,本申请实施例提供了一种物料增量处理装置,该物料增量处理装置包括获取单元、解析单元和处理单元;其中,In a second aspect, an embodiment of the present application provides a material increment processing device, and the material increment processing device includes an acquisition unit, an analysis unit, and a processing unit; wherein,
获取单元,被配置为获取物料增量指令;其中,所述物料增量指令用于指示源位置存储的物料数据发生变更;an acquiring unit, configured to acquire a material increment instruction; wherein, the material increment instruction is used to indicate that the material data stored in the source location is changed;
解析单元,被配置为对所述物料增量指令进行属性解析,根据属性解析 结果在多个预设队列中确定所述物料增量指令对应的目标队列;an analysis unit, configured to perform attribute analysis on the material increment instruction, and determine a target queue corresponding to the material increment instruction in a plurality of preset queues according to the attribute analysis result;
处理单元,被配置为利用所述目标队列对所述物料增量指令进行处理,得到目标物料信息。The processing unit is configured to process the material increment instruction by using the target queue to obtain target material information.
第三方面,本申请实施例提供了一种电子设备,该电子设备包括存储器和处理器;其中,In a third aspect, an embodiment of the present application provides an electronic device, the electronic device includes a memory and a processor; wherein,
所述存储器,用于存储能够在所述处理器上运行的计算机程序;the memory for storing a computer program executable on the processor;
所述处理器,用于在运行所述计算机程序时,执行如第一方面所述方法的步骤。The processor is configured to execute the steps of the method according to the first aspect when running the computer program.
第四方面,本申请实施例提供了一种计算机存储介质,该计算机存储介质存储有计算机程序,该计算机程序被多个处理器执行时实现如第一方面所述方法的步骤。In a fourth aspect, an embodiment of the present application provides a computer storage medium, where the computer storage medium stores a computer program, and when the computer program is executed by a plurality of processors, implements the steps of the method described in the first aspect.
本申请实施例提供了一种物料增量处理方法、装置、电子设备和计算机存储介质,通过获取物料增量指令;其中,所述物料增量指令用于指示源位置存储的物料数据发生变更;对所述物料增量指令进行属性解析,根据属性解析结果在多个预设队列中确定所述物料增量指令对应的目标队列;利用所述目标队列对所述物料增量指令进行处理,得到目标物料信息。这样,根据物料增量指令的属性解析结果,从多个预设队列中确定出对应的目标队列,从而利用该目标队列实时处理物料增量指令,不仅可以提高物料增量处理的实时性和吞吐量,还可以提高对物料增量指令的处理速度,进而缩短了物料变更到生效的时间。The embodiments of the present application provide a material increment processing method, device, electronic device and computer storage medium, by acquiring a material increment instruction, wherein the material increment instruction is used to indicate that the material data stored in the source location is changed; Perform attribute analysis on the material increment instruction, and determine a target queue corresponding to the material increment instruction in a plurality of preset queues according to the attribute analysis result; use the target queue to process the material increment instruction, and obtain Target material information. In this way, according to the attribute analysis result of the material increment instruction, the corresponding target queue is determined from multiple preset queues, so that the material increment instruction can be processed in real time by using the target queue, which can not only improve the real-time performance and throughput of material increment processing It can also improve the processing speed of material increment instructions, thereby shortening the time for material changes to take effect.
附图说明Description of drawings
图1为相关技术提供的一种物料增量处理方法的流程示意图;1 is a schematic flowchart of a material incremental processing method provided by the related art;
图2为本申请实施例提供的一种物料增量处理方法的流程示意图;FIG. 2 is a schematic flowchart of a material increment processing method provided by an embodiment of the present application;
图3为本申请实施例提供的一种物料增量处理方法的应用场景示意图一;3 is a schematic diagram 1 of an application scenario of a material increment processing method provided by an embodiment of the present application;
图4为本申请实施例提供的一种物料增量处理方法的应用场景示意图二;FIG. 4 is a schematic diagram 2 of an application scenario of a material increment processing method provided by an embodiment of the present application;
图5为本申请实施例提供的一种物料增量处理方法的应用场景示意图三;FIG. 5 is a schematic diagram 3 of an application scenario of a material increment processing method provided by an embodiment of the present application;
图6为本申请实施例提供的一种物料增量处理装置的结构示意图;6 is a schematic structural diagram of a material increment processing device provided by an embodiment of the present application;
图7为本申请实施例提供的一种电子设备的硬件结构示意图;7 is a schematic diagram of a hardware structure of an electronic device provided by an embodiment of the present application;
图8为本申请实施例提供的一种电子设备的组成结构示意图。FIG. 8 is a schematic diagram of the composition and structure of an electronic device according to an embodiment of the present application.
具体实施方式Detailed ways
为了能够更加详尽地了解本申请实施例的特点与技术内容,下面结合附图对本申请实施例的实现进行详细阐述,所附附图仅供参考说明之用,并非用来限定本申请实施例。In order to have a more detailed understanding of the features and technical contents of the embodiments of the present application, the implementation of the embodiments of the present application will be described in detail below with reference to the accompanying drawings.
除非另有定义,本文所使用的所有的技术和科学术语与属于本申请的技术领域的技术人员通常理解的含义相同。本文中所使用的术语只是为了描述本申请实施例的目的,不是旨在限制本申请。Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the technical field to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of the present application, and are not intended to limit the present application.
在以下的描述中,涉及到“一些实施例”,其描述了所有可能实施例的子集,但是可以理解,“一些实施例”可以是所有可能实施例的相同子集或不同子集,并且可以在不冲突的情况下相互结合。还需要指出,本申请实施例所涉及的术语“第一\第二\第三”仅仅是是区别类似的对象,不代表针对对象的特定排序,可以理解地,“第一\第二\第三”在允许的情况下可以互换特定的顺序或先后次序,以使这里描述的本申请实施例能够以除了在这里图示或描述的以外的顺序实施。In the following description, reference is made to "some embodiments" which describe a subset of all possible embodiments, but it is understood that "some embodiments" can be the same or a different subset of all possible embodiments, and Can be combined with each other without conflict. It should also be pointed out that the term "first\second\third" involved in the embodiments of the present application is only to distinguish similar objects, and does not represent a specific ordering of objects. It is understood that "first\second\third" "Three" may be interchanged where permitted in a specific order or sequence, so that the embodiments of the present application described herein can be implemented in sequences other than those illustrated or described herein.
对本申请实施例进行进一步详细说明之前,先对本申请实施例中涉及的名词和术语进行说明,本申请实施例中涉及的名词和术语适用于如下的解释:Before the embodiments of the present application are described in further detail, the nouns and terms involved in the embodiments of the present application will be described first. The nouns and terms involved in the embodiments of the present application are applicable to the following explanations:
广告主:投放广告的用户。Advertiser: The user who places the ad.
广告物料:广告内展现的内容。具体地,广告物料的基本形式是文字、图片、flash类型(一种文件类型)。Advertising material: The content displayed within the advertisement. Specifically, the basic forms of advertising materials are text, picture, and flash type (a file type).
远程过程调用(Remote Procedure Call,RPC):一种通过网络从远程计算机上请求服务,而不需要了解底层网络技术的协议。Remote Procedure Call (RPC): A protocol for requesting services from a remote computer over a network without requiring knowledge of the underlying network technology.
一种数据结构,可以称为Protocol Buffer,简称为PB;具体是指一种语言无关、平台无关、可扩展的序列化结构数据的方法。A data structure that can be called Protocol Buffer, or PB for short; specifically, it refers to a language-independent, platform-independent, and extensible method of serializing structured data.
可以理解,广告投放系统是广告主上传广告物料、设置投放方式的平台,也称为投放平台(Platform)。在这里,投放平台一般对应着特定的数据库(称为物料库,例如MySQL),用于存储广告主所上传的广告物料。在这种架构下,当投放平台检测到物料变更后,需要将广告物料信息转化为以广告单元为单位的PB数据传输给召回系统(Retrieval),由召回系统根据PB数据构建内存倒排,进入竞价队列,竞价成功后展现给用户。其中,投放平台与召回系统约定的数据交互方式是网络文件系统(Network File System,NFS)。在这里,网络文件系统也称为网盘。It can be understood that the advertising delivery system is a platform for advertisers to upload advertising materials and set delivery methods, also known as a delivery platform (Platform). Here, the delivery platform generally corresponds to a specific database (called a material library, such as MySQL) for storing the advertising materials uploaded by the advertiser. Under this structure, when the delivery platform detects the material change, it needs to convert the advertising material information into PB data in units of advertising units and transmit it to the recall system (Retrieval). Bidding queue, displayed to users after successful bidding. Among them, the data interaction method agreed between the delivery platform and the recall system is the Network File System (NFS). Here, the network file system is also called a network disk.
在实际应用中,广告主的所有操作都需要准实时的下发至召回系统,比如上传了广告图片、暂停了广告计划,期望分钟级生效,几分钟后的用户在浏览对应广告位(如某应用通栏)时就可能会展示对应的广告。为了达到这种效果,需要物料传输服务有着很强的实时性以及较大的吞吐量。In practical applications, all operations of advertisers need to be sent to the recall system in quasi-real time, such as uploading an advertisement image, pausing the advertisement plan, and expecting it to take effect at the minute level. After a few minutes, the user is browsing the corresponding advertisement space (such as a certain advertisement space). App banners) may display corresponding ads. In order to achieve this effect, the material transmission service needs to have strong real-time performance and large throughput.
针对广告主的修改操作,在相关技术中,需要通过轮询变更事件实现修改后的物料传输过程。具体原理如下:在投放平台模块中的数据库(MySQL)中创建一个任务队列(task_queue)表,当投放平台(Platform)监控到广告主的任一操作,都在其中添加一条变更记录,其中变更的维度可能是计划/单元/创意等;然后,物料传输服务根据上一次处理完的偏移量(即确定未执行的变更记录)以及本次需要处理的窗口大小(即任务吞吐量)获取到本次需要处理的变更指令,查询物料库获取修改后的物料数据,将修改后的物料数据进行拼接,得到该广告单元对应的物料单元数据(物料单元数据也可称为物料信息,一般用PB数据格式表示)后持久化到网盘。For the modification operation of the advertiser, in the related art, the modified material transmission process needs to be realized by polling the change event. The specific principle is as follows: Create a task queue (task_queue) table in the database (MySQL) in the delivery platform module. When the delivery platform (Platform) monitors any operation of the advertiser, it will add a change record in it. The dimensions may be plans/units/creatives, etc.; then, the material transfer service obtains this value based on the offset that was processed last time (that is, to determine the unexecuted change record) and the window size that needs to be processed this time (that is, the task throughput). The next change instruction that needs to be processed, query the material library to obtain the modified material data, splicing the modified material data, and obtain the material unit data corresponding to the advertising unit (material unit data can also be called material information, generally PB data is used format representation) and persisted to the network disk.
在实际执行过程中,对于轮询变更事件的物料传输方法,每一次写变更事件的操作需要耦合在Platform的流程里,写task_queue表的过程和物料数 据变更的过程通过数据库事务的方式保证原子性。物料传输服务需要定时拉取变更记录,根据变更记录反查物料信息拼接成广告物料数据后写入网盘。In the actual execution process, for the material transmission method of polling change events, each operation of writing change events needs to be coupled in the Platform process. The process of writing the task_queue table and the process of changing material data ensure atomicity through database transactions. . The material transmission service needs to periodically pull the change records, and then reversely check the material information according to the change records, splicing it into advertising material data, and then writing it to the network disk.
以广告主的“修改计划预算”操作为例,参见图1,其示出了相关技术提供的一种物料增量处理方法的应用场景示意图。如图1所示,该应用场景包括投放平台模块、物料传输模块和召回倒排模块(Retrieval),在task_queue表中,可以包括标识字段(Auto_pk)、类型字段(Task_type)、内容字段(Task_rfid)和创建时间字段(Created time)。Taking an advertiser's "modify plan budget" operation as an example, see FIG. 1 , which shows a schematic diagram of an application scenario of a material increment processing method provided by the related art. As shown in Figure 1, the application scenario includes a delivery platform module, a material transfer module, and a recall inversion module (Retrieval). In the task_queue table, it can include an identification field (Auto_pk), a type field (Task_type), and a content field (Task_rfid) and the Created time field.
此时,物料传输的过程如下:投放平台模块需要先校验输入参数的有效性(即入参有效性检验);其次,按照输入参数对计划表进行修改,以及对task_queue表进行写入,特别地,对计划表进行修改(该步骤具体体现为修改预算物料campaign字段)和对task_queue表进行写入需要放到一个事务中保证原子性;然后,记录操作日志到日志配置工具(Elastic Search,ES)供广告主查看;最后,物料传输模块定时拉取变更记录,根据变更记录反查物料表取出发生变更的广告单元的物料进行重新拼接,得到该广告单元对应的物料信息,并将该物料信息写入网盘,供召回倒排模块使用。At this time, the process of material transmission is as follows: the platform module needs to first verify the validity of the input parameters (that is, the validity of the input parameters); secondly, the schedule table is modified according to the input parameters, and the task_queue table is written, especially On the other hand, modifying the plan table (this step is embodied in modifying the budget material campaign field) and writing to the task_queue table need to be placed in a transaction to ensure atomicity; then, record the operation log to the log configuration tool (Elastic Search, ES ) for the advertiser to view; finally, the material transfer module periodically pulls the change record, retrieves the material of the changed advertising unit according to the material table of the change record, and re-splices it, obtains the material information corresponding to the advertising unit, and stores the material information Write to the network disk for recalling the inverted module.
然而,在采用上述方法实现物料传输时,对于投放平台模块来说,task_queue表的记录和正常广告主操作强耦合到了一起,物料传输对于变更记录的感知也依赖定时拉取task_queue表的频率,在这种情况下,拉取task_queue表的时间周期阈值和拉取task_queue表中修改记录的数量均不好控制,导致可能存在一些缺陷,例如,投放逻辑强耦合,所有物料相关操作都要重新写task_queue表;以及根据变更记录拼接广告物料数据需要顺序执行,吞吐量低;另外,由于定时轮询实时性差,导致物料变更到生效时间较长。However, when the above method is used to realize material transmission, for the delivery platform module, the records of the task_queue table are strongly coupled with the normal advertiser operations, and the perception of the change records of material transmission also depends on the frequency of regularly pulling the task_queue table. In this case, it is difficult to control the time period threshold for pulling the task_queue table and the number of modified records in the pulling task_queue table, which may lead to some defects. For example, the delivery logic is strongly coupled, and all material-related operations must rewrite the task_queue Tables; and splicing advertising material data according to the change records need to be executed sequentially, and the throughput is low; in addition, due to the poor real-time performance of regular polling, it takes a long time for material changes to take effect.
基于此,本申请实施例提供了一种物料增量处理方法,该方法的基本思想为:获取物料增量指令;其中,所述物料增量指令用于指示源位置存储的物料数据发生变更;对所述物料增量指令进行属性解析,根据属性解析结果在多个预设队列中确定所述物料增量指令对应的目标队列;利用所述目标队列对所述物料增量指令进行处理,得到目标物料信息。这样,根据物料增量指令的属性解析结果,从多个预设队列中确定出对应的目标队列,从而利用该目标队列实时处理物料增量指令,不仅可以提高物料增量处理的实时性和吞吐量,还可以提高对物料增量指令的处理速度,进而缩短了物料变更到生效的时间。Based on this, an embodiment of the present application provides a material increment processing method, the basic idea of which is: acquiring a material increment instruction; wherein the material increment instruction is used to indicate that the material data stored in the source location is changed; Perform attribute analysis on the material increment instruction, and determine a target queue corresponding to the material increment instruction in a plurality of preset queues according to the attribute analysis result; use the target queue to process the material increment instruction, and obtain Target material information. In this way, according to the attribute analysis result of the material increment instruction, the corresponding target queue is determined from multiple preset queues, so that the material increment instruction can be processed in real time by using the target queue, which can not only improve the real-time performance and throughput of material increment processing It can also improve the processing speed of material increment instructions, thereby shortening the time for material changes to take effect.
下面将结合附图对本申请实施例进行详细说明。本申请实施例中的方法可以由电子设备来执行。在一些实施例中,电子设备可以实施为终端,也可以实施为服务器,本申请实施例不做限制。The embodiments of the present application will be described in detail below with reference to the accompanying drawings. The methods in the embodiments of the present application may be executed by an electronic device. In some embodiments, the electronic device may be implemented as a terminal, and may also be implemented as a server, which is not limited in this embodiment of the present application.
在本申请实施例中,参见图2,其示出了本申请实施例提供的一种物料增量处理方法的流程示意图。如图2所示,该方法可以包括:In the embodiment of the present application, referring to FIG. 2 , it shows a schematic flowchart of a material increment processing method provided by the embodiment of the present application. As shown in Figure 2, the method may include:
S101:获取物料增量指令。S101: Obtain a material increment instruction.
需要说明的是,本申请实施例可以应用于电商物料投放领域、广告物料投放领域等。应理解,在信息发生变更的情况中,需要将修改后的信息从某 一位置传递到另一位置时,均可采用本申请实施所提供的方法。It should be noted that the embodiments of the present application can be applied to the field of e-commerce material delivery, the field of advertising material delivery, and the like. It should be understood that, in the case where the information is changed, when the modified information needs to be transmitted from one location to another location, the method provided by the implementation of the present application can be adopted.
本申请实施例均以广告物料投放场景为例进行后续说明。The embodiments of the present application all take the advertisement material delivery scenario as an example for subsequent description.
在实际应用中,广告物料投放场景中一般包括投放平台模块、物料传输模块和召回倒排模块。首先,对于广告主侧,需要经过投放平台模块上传、修改广告物料;其次,投放平台模块将所接受到的广告物料在源位置(如数据库)中进行存储;再次,物料传输模块根据数据库确定出发生修改的广告单元,并重新拼接成该广告单元的新物料信息;最后,物料传输模块将该广告单元的新物料信息传输到目标位置(如网络文件存储系统),等待后续进行广告投放。In practical applications, the advertising material delivery scenario generally includes a delivery platform module, a material transmission module, and a recall inversion module. First, for the advertiser side, it is necessary to upload and modify the advertising materials through the delivery platform module; secondly, the delivery platform module stores the received advertising materials in the source location (such as a database); thirdly, the material transmission module determines according to the database. The modified advertising unit is re-spliced into the new material information of the advertising unit; finally, the material transmission module transmits the new material information of the advertising unit to the target location (such as a network file storage system), waiting for subsequent advertising.
为了完成以上流程,需要确定物料增量指令。在这里,物料增量指令用于指示源位置处的物料数据发生变更,源位置是指物料投放用户(例如广告主)一侧的数据存放位置。In order to complete the above process, it is necessary to determine the material increment instruction. Here, the material increment instruction is used to indicate that the material data at the source location is changed, and the source location refers to the data storage location on the side of the material delivery user (such as an advertiser).
在本申请的一些实施例中,以源位置为数据库为例,所述确定至少一个物料增量指令,可以包括:在所述数据库发生物料变更事件的情况下,采集所述数据库的日志信息;利用预设关键词对所述数据库的日志信息进行过滤,根据过滤结果生成所述物料增量指令。In some embodiments of the present application, taking the source location as a database as an example, the determining at least one material increment instruction may include: collecting log information of the database when a material change event occurs in the database; The log information of the database is filtered by using preset keywords, and the material increment instruction is generated according to the filtering result.
需要说明的是,在源位置是数据库的情况下,可以利用预设关键词对该数据库的日志信息进行过滤,从而生成物料增量指令。在这里,预设关键词是根据应用场景预先配置的,用于提取数据库日志的某一字段值,以获得发生变更的数据位置,进而根据发生变更的数据位置生成物料增量指令。It should be noted that, in the case where the source location is a database, the log information of the database can be filtered by using a preset keyword, thereby generating a material increment instruction. Here, the preset keyword is pre-configured according to the application scenario, and is used to extract a field value of the database log to obtain the changed data location, and then generate the material increment instruction according to the changed data location.
在本申请的一些实施例中,在所述数据库发生物料变更事件的情况下,采集所述数据库的日志信息(如二进制日志)。在这里,可以利用数据库的自带工具对数据库进行检测,当该数据库发生物料变更事件时,获取该数据库的二进制日志(相当于日志信息);然后,根据预设关键词对数据库的日志进行过滤和提取,从而生成物料增量指令。在这里,物料变更事件不仅包括修改已有的物料数据,还包括写入新的物料数据。In some embodiments of the present application, when a material change event occurs in the database, log information (such as a binary log) of the database is collected. Here, you can use the built-in tools of the database to detect the database. When a material change event occurs in the database, the binary log of the database (equivalent to log information) is obtained; then, the log of the database is filtered according to the preset keywords. and extraction to generate material increment instructions. Here, the material change event includes not only modifying the existing material data, but also writing new material data.
在相关技术中,还需要在数据库中创建一个task_queue表,当投放平台模块监控到广告主的任一操作,都在其中添加一条变更记录,然后物料传输模块根据上一次处理完的偏移量(即确定上一次已处理的变更记录)以及本次需要处理的窗口大小(即确定本次需要处理的变更记录数量),获取到本次需要处理的物料增量指令,从而进行后续操作。In the related art, it is also necessary to create a task_queue table in the database. When the delivery platform module monitors any operation of the advertiser, a change record is added in it, and then the material transmission module is processed according to the last offset ( That is, determine the last processed change record) and the window size to be processed this time (that is, determine the number of change records to be processed this time), and obtain the material increment instruction that needs to be processed this time, so as to carry out subsequent operations.
也就是说,在相关技术中,物料投放逻辑与广告主强耦合,所有物料相关操作都要记得重写task_queue表,效率低下;而本申请实施例通过数据库自带工具监控修改事件,利用数据库的二进制日志来获取物料增量指令,操作简单,效率高,不再需要task_queue表。That is to say, in the related art, the material delivery logic is strongly coupled with the advertiser, and all material-related operations must remember to rewrite the task_queue table, which is inefficient. However, in the embodiment of the present application, the database's own tools are used to monitor modification events, and use the database's own tools to monitor modification events. The binary log is used to obtain material increment instructions. The operation is simple and efficient, and the task_queue table is no longer required.
这样,通过以上机制得到物料增量指令,以备后续对物料增量指令进行处理。In this way, the material increment instruction is obtained through the above mechanism for subsequent processing of the material increment instruction.
S102:对所述物料增量指令进行属性解析,根据属性解析结果在多个预设队列中确定所述物料增量指令对应的目标队列。S102: Perform attribute analysis on the material increment instruction, and determine a target queue corresponding to the material increment instruction from a plurality of preset queues according to the attribute analysis result.
需要说明的是,在相关信息中,在获取到物料增量指令后,一般仅采用单个队列执行,任务吞吐量小且实时性差。因此,本申请实施例采用多队列处理模式,可以根据物料增量指令的属性,将其分配给多个预设队列中的目标队列。在这里,多个预设队列可以通过不同的进程分别执行,提高任务吞吐量和处理速度。It should be noted that, in the relevant information, after obtaining the material increment instruction, generally only a single queue is used for execution, and the task throughput is small and the real-time performance is poor. Therefore, the embodiment of the present application adopts a multi-queue processing mode, and according to the attributes of the material increment instruction, it can be allocated to the target queues among the multiple preset queues. Here, multiple preset queues can be executed separately by different processes to improve task throughput and processing speed.
应理解,物料增量指令可以指示一个广告物料修改的具体指令,也可以包括分别指示多个广告物料修改的多个具体指令。换句话说,对于本申请实施例中的物料投放方法,如果存在多个具体指令,会将这些具体指令按照属性解析结果分配给不同的预设队列,从而提高吞吐量和实时性。It should be understood that the material increment instruction may indicate a specific instruction for modifying one advertising material, or may include multiple specific instructions for respectively instructing the modification of multiple advertising materials. In other words, for the material delivery method in the embodiment of the present application, if there are multiple specific instructions, the specific instructions will be allocated to different preset queues according to the attribute analysis result, thereby improving throughput and real-time performance.
在本申请的一些实施例中,所述多个预设队列可以包括第一预设队列和第二预设队列,所述根据属性解析结果在多个预设队列中确定目标队列,可以包括:在所述属性解析结果满足预设筛选条件的情况下,将所述第一预设队列确定为所述目标队列,将所述物料增量指令存储至所述第一预设队列;在所述属性解析结果不满足预设筛选条件的情况下,将所述第二预设队列确定为所述目标队列,并将所述物料增量指令存储至所述第二预设队列;其中,所述第一预设队列与所述第二预设队列不同。In some embodiments of the present application, the multiple preset queues may include a first preset queue and a second preset queue, and determining the target queue from the multiple preset queues according to the attribute analysis result may include: In the case that the attribute analysis result satisfies the preset screening condition, the first preset queue is determined as the target queue, and the material increment instruction is stored in the first preset queue; In the case that the attribute analysis result does not meet the preset screening conditions, the second preset queue is determined as the target queue, and the material increment instruction is stored in the second preset queue; wherein, the The first preset queue is different from the second preset queue.
需要说明的是,针对物料增量指令的属性解析结果,如果属性解析结果满足预设筛选条件,将物料增量指令分配给第一预设队列;如果属性解析结果不满足预设筛选条件,则将物料增量指令分配给第二预设队列。在这里,第一预设队列用于存储一些执行速度较低或者优先性较低的指令(即符合预设筛选条件的物料增量指令),也可以称为慢队列,第二预设队列用于存储其他的普通指令(即不符合预设筛选条件的物料增量指令),也可以称为标准队列。由于其中包含物料增量指令的不同,慢队列的指令执行速度整体慢于标准队列。It should be noted that, for the attribute analysis result of the material increment instruction, if the attribute analysis result satisfies the preset filter conditions, the material increment instruction is allocated to the first preset queue; if the attribute analysis result does not meet the preset filter conditions, then Allocate the material increment instruction to the second preset queue. Here, the first preset queue is used to store some instructions with low execution speed or low priority (that is, material increment instructions that meet the preset screening conditions), which can also be called the slow queue, and the second preset queue is used for It is used to store other common instructions (that is, material increment instructions that do not meet the preset screening conditions), which can also be called standard queues. Due to the difference in the material increment instructions included, the execution speed of the slow queue is slower than that of the standard queue.
换句话说,多个预设队列可以包括慢队列和标准队列,对于小部分特殊的物料增量指令,例如修改内容多、执行时间长、广告主的信用分较低等,就将这部分物料增量指令放入慢队列执行;对于大部分普通的物料增量指令,则放入标准队列。在这里,预设筛选条件可以根据实际应用场景进行确定。In other words, multiple preset queues can include slow queues and standard queues. For a small number of special material increment instructions, such as many modifications, long execution time, and low credit score of advertisers, this part of the material will be Incremental instructions are put into the slow queue for execution; for most common material incremental instructions, they are put into the standard queue. Here, the preset filter conditions can be determined according to actual application scenarios.
需要说明的是,对于第一预设队列和第二预设队列,还具有令牌桶机制,一般来说,第一预设队列的令牌桶容量小于第二预设队列的令牌桶容量。在这里,令牌桶的原理是:通过一个恒定的速度往桶里放入令牌,如果请求需要被处理,则需要先从桶里获取一个令牌,当桶里没有令牌可取时,则拒绝服务。换句话说,令牌桶的容量代表了队列的最大任务数量。通过调节令牌桶容量的大小,可以控制第一预设队列和第二预设队列中的最大任务数量,避免系统故障。It should be noted that, for the first preset queue and the second preset queue, there is also a token bucket mechanism. Generally speaking, the token bucket capacity of the first preset queue is smaller than the token bucket capacity of the second preset queue. . Here, the principle of the token bucket is: put the token into the bucket at a constant speed, if the request needs to be processed, you need to get a token from the bucket first, when there is no token in the bucket, then Denial of service. In other words, the capacity of the token bucket represents the maximum number of tasks in the queue. By adjusting the size of the token bucket capacity, the maximum number of tasks in the first preset queue and the second preset queue can be controlled to avoid system failure.
这样,根据物料增量指令的解析结果,可以在多个预设队列中确定出对应的目标队列,能够针对性的对物料增量指令进行处理,提高物料传输的效率。In this way, according to the analysis result of the material increment instruction, the corresponding target queue can be determined in multiple preset queues, and the material increment instruction can be processed in a targeted manner, thereby improving the efficiency of material transmission.
S103:基于所述源位置存储的物料数据,通过所述目标队列对所述物料 增量指令进行处理,得到目标物料信息。S103: Based on the material data stored in the source location, process the material increment instruction through the target queue to obtain target material information.
需要说明的是,对于目标队列,根据物料增量指令从源位置中获取相应的物料数据进行处理,从而得到目标物料信息。It should be noted that, for the target queue, the corresponding material data is obtained from the source location according to the material increment instruction for processing, so as to obtain the target material information.
需要说明的是,所述物料增量指令可以包括第一物料增量指令和第二物料增量指令,且所述第一物料增量指令被存储至所述第一预设队列,所述第二物料增量指令被存储至所述第二预设队列。因此,在本申请的一些实施例中,所述利用所述目标队列对所述物料增量指令进行处理,得到目标物料信息,可以包括:利用所述第一预设队列和所述第二预设队列对所述第一物料增量指令和所述第二物料增量指令进行并行处理,得到所述目标物料信息。It should be noted that the material increment instruction may include a first material increment instruction and a second material increment instruction, and the first material increment instruction is stored in the first preset queue, and the first material increment instruction is stored in the first preset queue. Two material increment instructions are stored in the second preset queue. Therefore, in some embodiments of the present application, using the target queue to process the material increment instruction to obtain target material information may include: using the first preset queue and the second preset queue A queue is set to process the first material increment instruction and the second material increment instruction in parallel to obtain the target material information.
需要说明的是,如果物料增量指令包括第一物料增量指令和第二物料增量指令,而且经过属性解析后,第一物料增量指令被存储至第一预设队列,第二物料增量指令被存储至第二预设队列,那么可以通过两个具体进程并行执行第一预设队列和第二预设队列,从而获得第一物料增量指令的物料信息和第二物料增量指令的物料信息。It should be noted that if the material increment instruction includes the first material increment instruction and the second material increment instruction, and after attribute analysis, the first material increment instruction is stored in the first preset queue, and the second material increment instruction is stored in the first preset queue. If the quantity instruction is stored in the second preset queue, the first preset queue and the second preset queue can be executed in parallel through two specific processes, so as to obtain the material information of the first material increment instruction and the second material increment instruction material information.
这样,通过并发的多队列模式可以保证物料增量指令能够得到高效率的执行,而且慢队列、标准队列的分类可以规避某一任务堵塞,从而物料增量指令生效的实时性高,而且多个预设队列也提高了任务带宽,扩大了任务吞吐量。In this way, the concurrent multi-queue mode can ensure that the material increment command can be executed efficiently, and the classification of slow queues and standard queues can avoid the blockage of a certain task, so that the material increment command takes effect in high real-time, and multiple Preset queues also increase task bandwidth and expand task throughput.
在本申请的一些实施例中,所述基于所述通过所述目标队列对所述物料增量指令进行处理,得到目标物料信息,可以包括:从所述目标队列获取所述物料增量指令,根据所述物料增量指令确定目标物料标识;根据所述物料标识,从所述源位置存储的物料数据中确定目标物料数据集合;对所述目标物料数据集合进行数据拼接处理,得到所述目标物料信息。In some embodiments of the present application, the obtaining target material information based on the processing of the material increment instruction through the target queue may include: acquiring the material increment instruction from the target queue, Determine the target material identifier according to the material increment instruction; determine the target material data set from the material data stored in the source location according to the material identifier; perform data splicing processing on the target material data set to obtain the target Material information.
需要说明的是,物料数据通过以广告单元的形式存储在源位置,即源位置存储有多个物料标识以及所述多个物料标识各自的物料数据集合。在这里,一个物料标识代表一个具体的广告计划,或者说一个物料标识代表一个广告单元。It should be noted that the material data is stored in the source location in the form of an advertisement unit, that is, the source location stores multiple material identifiers and respective material data sets of the multiple material identifiers. Here, a material ID represents a specific advertising plan, or a material ID represents an advertising unit.
因此,目标物料信息的获得过程包括以下步骤:首先,从所述目标队列取出物料增量指令,根据所述物料增量指令确定发生修改的目标物料标识;然后,根据目标物料标识,从所述源位置存储的物料数据中确定该物料标识对应的目标物料数据集合;最后,将目标物料数据集合中的数据进行拼接处理,从而得到目标物料信息。Therefore, the acquisition process of the target material information includes the following steps: first, take out the material increment instruction from the target queue, and determine the modified target material identifier according to the material increment instruction; then, according to the target material identifier, from the The target material data set corresponding to the material identifier is determined in the material data stored in the source location; finally, the data in the target material data set is spliced to obtain target material information.
在本申请的一种应用场景中,一个广告所对应的物料数据可以分为多个层级,例如用户(user)数据、计划(campaign)数据、单元(ad_group)数据和创意(ad)数据,在此称之为一个广告单元。换句话说,对于数据库来说,其中存储有多个广告单元各自的数据,一个广告单元的数据包括了user/campaign/ad_group/ad四种不同层级的数据。此时,针对每个广告都会有独立的物料标识(Identity Document,ID),物料增量指令中携带发生修改的物料ID,而不会记录具体的修改信息。In one application scenario of the present application, the material data corresponding to an advertisement can be divided into multiple levels, such as user (user) data, plan (campaign) data, unit (ad_group) data, and creative (ad) data. This is called an ad unit. In other words, for the database, the respective data of multiple ad units are stored, and the data of one ad unit includes data of four different levels of user/campaign/ad_group/ad. At this time, there will be an independent material identification (Identity Document, ID) for each advertisement, and the material ID of the modified material will be carried in the material increment instruction, but the specific modification information will not be recorded.
还需要说明的是,根据前述内容,在广告物料领域,物料增量指令具体指示的是发生修改的某一物料单元。在实际应用场景中,广告主可能会在短时间内对一个物料单元进行反复修改,在这种情况下,为了避免冗余操作,可以将第一预设队列和第二预设队列设计成无序集合的形式,从而避免重复操作。例如,物料传输模块从数据库的日志中确定物料单元335发生了修改,生成了(物料增量指令:物料单元335);并且,将(物料增量指令:物料单元335)分配给了第二预设队列,如果在(物料增量指令:物料单元335)的修改被处理之前,物料传输模块从数据库的日志中又一次确定了物料单元335被二次修改,又一次生成了(物料增量指令:物料单元335)。但是,由于第二预设队列是无序集合,新的物料增量指令并不会再次被放入第二预设队列。另一方面,当(物料增量指令:物料单元335)被执行时,需要从数据库中获取最新的物料数据进行拼接,其结果已经涵盖了两次修改。It should also be noted that, according to the foregoing content, in the field of advertising materials, the material increment instruction specifically indicates a certain material unit that has been modified. In practical application scenarios, advertisers may repeatedly modify a material unit in a short period of time. In this case, in order to avoid redundant operations, the first preset queue and the second preset queue can be designed without The form of an ordered set, thus avoiding repeated operations. For example, the material transmission module determines from the log of the database that the material unit 335 has been modified, and generates (material increment instruction: material unit 335); and assigns (material increment instruction: material unit 335) to the second pre-order Set up a queue, if before the modification of (material increment instruction: material unit 335) is processed, the material transfer module determines from the database log again that material unit 335 has been modified twice, and once again generates (material increment instruction : material unit 335). However, since the second preset queue is an unordered set, the new material increment instruction will not be put into the second preset queue again. On the other hand, when (material increment instruction: material unit 335) is executed, the latest material data needs to be acquired from the database for splicing, and the result has already covered two modifications.
所以,通过将第二预设队列定义为无序集合,可以天然进行去重,避免冗余操作。但是,无序集合也存在一个弊端,就是由于执行随机性的特性,当新物料增量指令源源不断的流入,有可能某一个旧物料增量指令永远无法被刷出来处理。因此,可以利用冲刷队列机制规避这一弊端。Therefore, by defining the second preset queue as an unordered set, deduplication can be performed naturally and redundant operations can be avoided. However, there is also a disadvantage of unordered collections, that is, due to the randomness of execution, when new material increment instructions flow in continuously, it is possible that an old material increment instruction will never be flushed out for processing. Therefore, this drawback can be avoided by using the flush queue mechanism.
在本申请的一些实施例中,所述多个预设队列还包括第三预设队列,该方法还可以包括:开启定时器;在所述定时器的计时时长达到预设时长时,将所述第二预设队列中存储的物料增量指令移动至所述第三预设队列。In some embodiments of the present application, the plurality of preset queues further include a third preset queue, and the method may further include: starting a timer; The material increment instruction stored in the second preset queue is moved to the third preset queue.
需要说明的是,所述多个预设队列还包括第三预设队列,第三预设队列是指第二预设队列的冲刷队列。在本申请实施例中,可以根据预设设置的预设时长,将第二预设队列中存储的物料增量指令移动至第三预设队列。It should be noted that the plurality of preset queues further include a third preset queue, and the third preset queue refers to a flushing queue of the second preset queue. In the embodiment of the present application, the material increment instruction stored in the second preset queue may be moved to the third preset queue according to a preset preset duration.
本申请实施例中,在进行属性解析后,普通的物料增量指令被放入第二预设队列;但是,每隔一段时间(需要根据实际应用场景进行确定,例如10秒),将第二预设队列中所有未处理的物料增量指令移动至第三预设队列。相应地,每次处理物料增量指令时,都优先处理第三预设队列,从而避免某一物料增量指令长时间得不到处理的弊端。在这里,第三预设队列同样也是无序集合。In the embodiment of the present application, after the attribute analysis is performed, the common material increment instruction is put into the second preset queue; All unprocessed material increment instructions in the preset queue are moved to the third preset queue. Correspondingly, each time a material increment instruction is processed, the third preset queue is preferentially processed, thereby avoiding the disadvantage that a certain material increment instruction cannot be processed for a long time. Here, the third preset queue is also an unordered set.
在本申请的一些实施例中,所述从所述目标队列获取所述物料增量指令,可以包括:在所述属性解析结果满足预设筛选条件的情况下,从所述第一预设队列中获取所述物料增量指令;在所述属性解析结果不满足预设筛选条件的情况下,判断所述第三预设队列是否为空;若所述第三预设队列为非空,则从所述第三预设队列中获取所述物料增量指令;若所述第三预设队列为空,则从所述第二预设队列中获取所述物料增量指令。In some embodiments of the present application, the obtaining the material increment instruction from the target queue may include: in the case that the attribute analysis result satisfies a preset screening condition, obtaining the material increment instruction from the first preset queue Obtain the material increment instruction from ; if the attribute analysis result does not meet the preset screening conditions, determine whether the third preset queue is empty; if the third preset queue is not empty, then The material increment instruction is acquired from the third preset queue; if the third preset queue is empty, the material increment instruction is acquired from the second preset queue.
需要说明的是,对于第一预设队列,可以依次将其中的物料增量指令取出执行。对于第二预设队列和第三预设队列,由于第三预设队列实际上是为了避免第二预设队列中的指令长时间得不到执行,因此第三预设队列是优先于第二预设队列执行的。换句话说,在第三预设队列为非空的状态下,需要优先执行第三预设队列中的指令;在第三预设队列为空的状态下,再执行第 二预设队列中的物料增量指令。It should be noted that, for the first preset queue, the material increment instructions in the first preset queue can be fetched and executed in sequence. For the second preset queue and the third preset queue, since the third preset queue is actually to prevent the instructions in the second preset queue from not being executed for a long time, the third preset queue takes precedence over the second preset queue. The default queue is executed. In other words, when the third preset queue is not empty, the instructions in the third preset queue need to be executed first; when the third preset queue is empty, the instructions in the second preset queue are executed. Material increment instruction.
还需要说明的是,对于第一预设队列、第二预设队列或者第三预设队列的物料增量指令,都有可能因为程序故障、逻辑问题或者物理故障导致执行失败。因此,在本申请的一些实施例中,所述多个预设队列还可以包括第四预设队列,在所述物料增量指令处理失败的情况下,该方法还可以包括:基于所述物料增量指令,在所述第四预设队列中生成重试指令;根据所述重试指令,通过所述第四预设队列对所述物料增量指令进行重试处理。It should also be noted that, for the material increment instruction of the first preset queue, the second preset queue or the third preset queue, execution may fail due to program failure, logical problem or physical failure. Therefore, in some embodiments of the present application, the plurality of preset queues may further include a fourth preset queue, and in the case that the processing of the material increment instruction fails, the method may further include: based on the material Incremental instruction, a retry instruction is generated in the fourth preset queue; according to the retry instruction, the material increment instruction is retried through the fourth preset queue.
需要说明的是,在物料增量指令处理失败的情况下,会在第四预设队列相应地生成一条重试指令,这样,处理失败的物料增量指令会在第四预设队列中再次执行,避免阻塞某一队列。应理解,第一预设队列、第二预设队列/第三预设队列、第四预设队列是通过三个进程(第二预设队列和第三预设队列共用一个进程)并发进行的。It should be noted that in the event that the processing of the material increment instruction fails, a retry instruction will be generated in the fourth preset queue accordingly, so that the failed material increment instruction will be executed again in the fourth preset queue. , to avoid blocking a queue. It should be understood that the first preset queue, the second preset queue/third preset queue, and the fourth preset queue are performed concurrently through three processes (the second preset queue and the third preset queue share one process). .
在本申请的一些实施例中,在所述物料增量指令处理失败的情况下,该方法还可以包括:基于所述物料增量指令,生成告警信息;其中,所述告警信息用于向管理人员提示所述物料增量指令存在异常。In some embodiments of the present application, in the event that the material increment instruction fails to be processed, the method may further include: generating alarm information based on the material increment instruction; wherein the alarm information is used to inform the management The personnel prompts that the material increment instruction is abnormal.
需要说明的是,在物料增量指令处理失败的情况下,还可以生成告警信息以便于提示该物料增量指令处于异常状态,以提醒管理人员进行处理。除此之外,如果第四预设队列中的物料增量指令再一次执行失败,可以采用无限重试加报警(即告警)的处理策略。It should be noted that, in the case that the processing of the material increment instruction fails, alarm information can also be generated so as to prompt that the material increment instruction is in an abnormal state, so as to remind the management personnel to handle it. In addition, if the material increment instruction in the fourth preset queue fails to be executed again, the processing strategy of infinite retry and alarm (ie, alarm) may be adopted.
在本申请的一些实施例中,该方法还包括:将所述目标物料信息传输到目标位置;对所述目标位置的目标物料信息进行排序,并根据排序结果进行物料投放。In some embodiments of the present application, the method further includes: transmitting the target material information to a target location; sorting the target material information at the target location, and performing material delivery according to the sorting result.
需要说明的是,通过对个预设队列(第一预设队列、第二预设队列、第三预设队列和第四预设队列)的处理,能够得到目标物料信息,将目标物料信息传输到目标位置(一般为分布式网络文件系统),然后召回倒排模块从目标位置获取目标物料信息进入排序步骤,从而后续进行物料投放。It should be noted that, by processing the preset queues (the first preset queue, the second preset queue, the third preset queue, and the fourth preset queue), the target material information can be obtained, and the target material information can be transmitted. Go to the target location (usually a distributed network file system), and then recall the inverted module to obtain the target material information from the target location and enter the sorting step, so as to carry out subsequent material delivery.
可以理解的是,通过以上处理,将物料从源位置传递到目标位置,提高了物料传输的实时性和吞吐量。It can be understood that, through the above processing, the material is transferred from the source position to the target position, which improves the real-time performance and throughput of material transmission.
本申请实施例提供了一种物料增量处理方法,通过获取物料增量指令;其中,所述物料增量指令用于指示源位置存储的物料数据发生变更;对所述物料增量指令进行属性解析,根据属性解析结果在多个预设队列中确定所述物料增量指令对应的目标队列;利用所述目标队列对所述物料增量指令进行处理,得到目标物料信息。这样,根据物料增量指令的属性解析结果,从多个预设队列中确定出对应的目标队列,从而利用该目标队列实时处理物料增量指令,不仅可以提高物料增量处理的实时性和吞吐量,还可以提高对物料增量指令的处理速度,进而缩短了物料变更到生效的时间。The embodiment of the present application provides a material increment processing method, by acquiring a material increment instruction; wherein, the material increment instruction is used to indicate that the material data stored in the source location is changed; attribute the material increment instruction parsing, determining a target queue corresponding to the material increment instruction in a plurality of preset queues according to the attribute parsing result; using the target queue to process the material increment instruction to obtain target material information. In this way, according to the attribute analysis result of the material increment instruction, the corresponding target queue is determined from multiple preset queues, so that the material increment instruction can be processed in real time by using the target queue, which can not only improve the real-time performance and throughput of material increment processing It can also improve the processing speed of material increment instructions, thereby shortening the time for material changes to take effect.
在本申请的一些实施例中,参见图3,其示出了本申请实施例提供的一种物料增量处理方法的应用场景示意图。如图3所示,该应用场景包括投放平台模块201、物料传输模块202和召回倒排模块203,且投放平台模块包括数 据库2011。In some embodiments of the present application, referring to FIG. 3 , it shows a schematic diagram of an application scenario of a material increment processing method provided by an embodiment of the present application. As shown in FIG. 3 , the application scenario includes a delivery platform module 201 , a material transmission module 202 and a recall inversion module 203 , and the delivery platform module includes a database 2011 .
可以理解的是,本申请实施例提供的物料增量处理方法聚焦于投放平台模块201、物料传输模块202之间的交互以及内部进程。It can be understood that, the material increment processing method provided in the embodiment of the present application focuses on the interaction between the delivery platform module 201 and the material transmission module 202 and internal processes.
基于该应用场景,以广告主修改计划预算为例,物料增量处理的过程如下:Based on this application scenario, taking the advertiser modifying the planned budget as an example, the process of incremental material processing is as follows:
首先,投放平台模块201接收到广告主的修改指令,针对该修改指令进行入参有效性校验、修改计划表和记录操作日志的步骤;在这里,修改计划表是指根据广告主的操作修改数据库2011中的物料数据,记录操作日志是用于向广告主呈现相应的修改记录。First, the delivery platform module 201 receives the modification instruction of the advertiser, and for the modification instruction, performs the steps of parameter validity check, modification plan table and recording operation log; here, modifying the plan table refers to modifying the plan table according to the operation of the advertiser The material data in the database 2011 and the recording operation log are used to present the corresponding modification records to the advertiser.
其次,在检测到数据库2011发生修改事件后,获取数据库2011的二进制日志(Binlog),通过配置的监听关键字(相当于前述的预设关键词)对Binlog进行过滤,确定物料增量指令,并将物料增量指令通过消息队列(Message Queue,MQ)的方式传递到物料传输模块202的增量指令队列(相当于前述的多个预设队列)。Secondly, after detecting the modification event of the database 2011, obtain the binary log (Binlog) of the database 2011, filter the Binlog through the configured listening keyword (equivalent to the aforementioned preset keyword), determine the material increment instruction, and The material increment instruction is transmitted to the increment instruction queue of the material transmission module 202 by means of a message queue (Message Queue, MQ) (equivalent to the aforementioned multiple preset queues).
然后,在物料传输模块202中,根据增量指令队列中的物料增量指令,反查数据库中的物料表拼接得到PB数据结构的目标物料信息(或称为物料单元数据),并将物料单元数据写入网盘。Then, in the material transmission module 202, according to the material increment instruction in the increment instruction queue, the material table in the database is reversely checked to obtain the target material information (or material unit data) of the PB data structure, and the material unit is Data is written to the network disk.
最后,召回倒排模块203从网盘中取出物料单元数据(相当于前述的目标物料信息),进入具体的排序投放流程。Finally, the recall and inversion module 203 takes out the material unit data (equivalent to the aforementioned target material information) from the network disk, and enters a specific sorting and placing process.
换句话说,本申请实施例提供的物料增量处理方法的核心主要是信息交互方式的升级,以使得各个模块的职责更加清晰,形成自我闭环;还可以优化整体地应用架构,缩短物料上线(广告修改生效)时间。对于投放平台模块而言,每一次需要触发物料增量的操作都不需要单独写task_queue表,广告物料数据落到数据库后,通过采集数据库级别的二进制日志(Binlog)就可以得到数据库表的变化情况,配置需要检测的表/字段变化(相当于监听关键词)进行过滤。应理解,该过程需要将数据库的Binlog模式调整成行(Row)模式。最后,使用消息队列集群工具作为消息中转,该工具还可以作为选择位点回放时的压力测试工具。In other words, the core of the material increment processing method provided by the embodiment of the present application is mainly to upgrade the information interaction mode, so that the responsibilities of each module are clearer and a self-closed loop is formed; the overall application architecture can also be optimized, and the material online ( Ad modifications take effect) time. For the delivery platform module, there is no need to write the task_queue table separately for each operation that needs to trigger the material increment. After the advertising material data falls into the database, the changes of the database table can be obtained by collecting the binary log (Binlog) at the database level. , configure the table/field changes to be detected (equivalent to monitoring keywords) for filtering. It should be understood that this process needs to adjust the Binlog mode of the database to a row (Row) mode. Finally, use the message queue cluster tool as a message relay, and this tool can also be used as a stress test tool for playback at selected sites.
从以上可以看出,在图3中,物料传输模块202中的“增量指令队列”其实对应着整个物料传输流程的核心逻辑,因此对其进行详细介绍。对于增量指令队列,主要依赖的中间件是Redis(一个开源的内存中的数据结构存储系统)。As can be seen from the above, in FIG. 3 , the “incremental instruction queue” in the material transmission module 202 actually corresponds to the core logic of the entire material transmission process, so it will be described in detail. For the incremental instruction queue, the middleware that is mainly relied on is Redis (an open source in-memory data structure storage system).
在本申请的一些实施例中,参见图4,其示出了本申请实施例提供的另一种物料增量处理方法的应用场景示意图。如图4所示,物料传输模块202包括指令接收子模块2021、令牌桶限流子模块2022、多队列处理子模块2023、单元装配子模块2024和结果输出子模块2025。其中,指令接收子模块2021负责将外部的指令转化为物料传输内部可以处理的形式,令牌桶限流子模块2022用于管理同一时刻某一队列可以处理的指令数量,多队列处理子模块2023用于保证数据处理保序不丢(即保证队列中数据的顺序,不发生数据丢 失)、实时稳定,单元装配子模块2024采用多线程的方式分部分组装物料信息,并通过最后的结果输出子模块2025将数据持久化到网盘。In some embodiments of the present application, referring to FIG. 4 , it shows a schematic diagram of an application scenario of another material increment processing method provided by an embodiment of the present application. As shown in FIG. 4 , the material transmission module 202 includes an instruction receiving sub-module 2021 , a token bucket current limiting sub-module 2022 , a multi-queue processing sub-module 2023 , a unit assembly sub-module 2024 and a result output sub-module 2025 . Among them, the command receiving sub-module 2021 is responsible for converting external commands into a form that can be processed inside the material transmission, the token bucket current limiting sub-module 2022 is used to manage the number of commands that can be processed by a certain queue at the same time, and the multi-queue processing sub-module 2023 In order to ensure that the data processing is not lost in order (that is, the order of data in the queue is guaranteed without data loss) and real-time stability, the unit assembly sub-module 2024 uses a multi-threaded method to assemble the material information in parts, and outputs the sub-module through the final result. Module 2025 persists the data to the network disk.
对于以上各个模块,说明如下:For each of the above modules, the descriptions are as follows:
针对指令接收子模块2021,主要负责将外部信息(即投放平台模块所确定的物料修改信息)转化成物料传输内部处理的对象。除了接收数据库Binlog形成的物料增量指令外,还提供了超文本传输协议(Hyper Text Transfer Protocol,HTTP)/RPC协议的接口,支持通过手动触发的方式发送指令,触发增量流程。The instruction receiving sub-module 2021 is mainly responsible for converting external information (that is, the material modification information determined by the delivery platform module) into an object for internal processing of material transmission. In addition to receiving the material incremental instructions formed by the database Binlog, it also provides a Hyper Text Transfer Protocol (HTTP)/RPC protocol interface, which supports sending instructions by manual triggering to trigger the incremental process.
针对令牌桶限流子模块2022,主要负责限制同一时刻某一队列的指令处理数量。通过配置中心工具能够动态调整令牌桶中的令牌数量,保证服务的稳定运行,换句话说,令牌桶限流子模块2022主要用于限制系统同一时间内只能处理预设数量(即令牌数量)的任务,对于超出部分,则需要等待令牌桶空间。The token bucket current limiting sub-module 2022 is mainly responsible for limiting the number of instructions processed in a certain queue at the same time. Through the configuration center tool, the number of tokens in the token bucket can be dynamically adjusted to ensure the stable operation of the service. In other words, the token bucket current limiting sub-module 2022 is mainly used to limit the system to only process a preset number at the same time (ie number of tokens), for the excess part, you need to wait for the token bucket space.
针对多队列处理子模块2023,包括慢队列slow(相当于前述的第一预设队列)/标准队列normal(相当于前述的第二预设队列,也可称为普通队列)/冲刷队列flush(相当于前述的第三预设队列,也可称为缓冲队列)/重试队列retry(相当于前述的第四预设队列)和执行队列running这几个部分。这些不同的队列各司其职,保证增量指令在执行过程中能够保序不丢、实时稳定。For the multi-queue processing sub-module 2023, it includes the slow queue slow (equivalent to the aforementioned first preset queue)/standard queue normal (equivalent to the aforementioned second preset queue, also called a normal queue)/flushing queue flush ( It is equivalent to the aforementioned third preset queue, which may also be referred to as a buffer queue)/retry queue retry (equivalent to the aforementioned fourth preset queue) and execution queue running. These different queues perform their respective duties to ensure that the incremental instructions can be executed in a timely manner without losing the order and being stable in real time.
本申请实施例中,对于慢队列来说,慢队列的令牌桶中的令牌个数较少,执行流程与其他队列无异,顾名思义该队列的执行速度较慢。对于一些业务场景,比如广告主信用分较低,系统会给这个广告主的所有指令放到慢队列中;另外,如果某个指令可能会触发大量单元重新装配的情况,比如,一个系统人群被绑到了50w个单元上,如果这个人群信息发生了变化,会导致与其关联的所有单元都要变化,此时把这个指令放到慢队列缓慢执行,可以保证正常队列顺畅无积压。In the embodiment of the present application, for the slow queue, the number of tokens in the token bucket of the slow queue is small, and the execution process is the same as that of other queues. As the name implies, the execution speed of the queue is relatively slow. For some business scenarios, such as the advertiser's low credit score, the system will put all the advertiser's instructions in the slow queue; in addition, if a certain instruction may trigger the reassembly of a large number of units, for example, a system crowd is It is tied to 50w units. If the crowd information changes, all units associated with it will be changed. At this time, this instruction is placed in the slow queue for slow execution, which can ensure that the normal queue is smooth and no backlog.
对于标准队列-冲刷队列来说,normal和flush两个队列其实是无序集合(Redis的set函数),特点是无序可以天然去重。在这里,业务上广告主经常会短时间内多次修改一个单元,所以去重的特性非常重要,能够有效地提高工作效率。对于正常的Binlog和指令解析都会走到标准队列,但是只用一个标准队列会导致僵尸指令的问题,即标准队列持续不断的流入增量指令,某个指令理论上可能永远不会被出栈(Pop)。所以需要定时将标准队列刷到冲刷队列,在选取指令时先确定冲刷队列是否为空,如果为空时再取标准队列。For the standard queue-flush queue, the normal and flush queues are actually unordered collections (Redis's set function), which is characterized by the ability to naturally deduplicate unordered. Here, advertisers often modify a unit multiple times in a short period of time, so the feature of deduplication is very important, which can effectively improve work efficiency. For normal Binlog and instruction parsing, it will go to the standard queue, but using only one standard queue will lead to the problem of zombie instructions, that is, the standard queue continues to flow into incremental instructions, and a certain instruction may never be popped off the stack theoretically ( Pop). Therefore, it is necessary to periodically flush the standard queue to the flushing queue. When selecting an instruction, first determine whether the flushing queue is empty, and then take the standard queue if it is empty.
对于重试队列来说,由于系统抖动或者逻辑异常,很有可能出现装配单元失败的情况,这个时候会触发报警,并形成一条重试指令放到重试队列。在本申请的一些实施例中,重试次数所配置的策略可以是无限次重试加报警,需要管理人员进行人工介入处理。For the retry queue, it is very likely that the assembly unit fails due to system jitter or logical abnormality. At this time, an alarm will be triggered, and a retry command will be formed and placed in the retry queue. In some embodiments of the present application, the policy configured by the number of retries may be unlimited retries plus an alarm, which requires manual intervention by an administrator.
对于执行队列来说,在单元装配前将单元ID(相当于前述的物料标识)放入执行队列,在经历过信息装配和结果输出后将单元ID移出执行队列,保证单元处理不丢。For the execution queue, put the unit ID (equivalent to the aforementioned material identifier) into the execution queue before unit assembly, and remove the unit ID from the execution queue after information assembly and result output to ensure that the unit processing is not lost.
针对单元装配子模块2024,主要负责根据单元ID查询数据库或者调接口获取单元的最新物料数据集合,将该物料数据集合中的所有数据拼接成PB数据结构的物料单元数据。在本申请的一些实施例中,一个物料数据集合可以根据广告物料层级分为user/campaign/ad_group/ad(用户/计划/单元/创意)四个层级,并进一步细分为智能出价、人群定向、关键词、商品定向等八个模块,单元装配模块使用多线程并行的方式查询并最终汇总。The unit assembly sub-module 2024 is mainly responsible for querying the database or adjusting the interface to obtain the latest material data set of the unit according to the unit ID, and splicing all the data in the material data set into the material unit data of the PB data structure. In some embodiments of the present application, a material data set may be divided into four levels: user/campaign/ad_group/ad (user/plan/unit/creative) according to the level of advertising materials, and further subdivided into smart bidding, crowd targeting , keywords, commodity orientation and other eight modules, the unit assembly module uses a multi-threaded parallel method to query and finally summarize.
针对结果输出子模块2025,将前面拼接好的物料单元数据(或称为单元信息、物料信息)持久化到网盘PB文件中,通过保留最近20个小版本的方式,保证数据可以快速回滚。For the result output sub-module 2025, the previously spliced material unit data (or called unit information, material information) is persisted to the network disk PB file, and the data can be quickly rolled back by retaining the latest 20 small versions .
在本申请的一些实施例中,参见图5,其示出了本申请实施例提供的又一种物料增量处理方法的应用场景示意图。如图5所示,多个预设队列可以包括慢队列、标准队列、冲刷队列和重试队列。假设物料增量指令可以包括第一物料增量指令、第二增量指令、第三增量指令,通过指令属性解析器对以上物料增量指令进行属性解析,根据属性解析结果将第一物料增量指令存储到慢队列,将第二物料增量指令和第三物料增量指令存储到标准队列,且第二物料增量指令被冲刷到了冲刷队列。此时,通过第一执行队列从慢队列中取出第一物料增量指令,并通过单元装配子模块和结果输出子模块对第一物料增量指令进行执行,输出第一物料增量指令对应的目标物料信息;通过第二执行队列从冲刷队列中取出第二物料增量指令,并通过单元装配子模块和结果输出子模块对第二物料增量指令进行执行,输出第二物料增量指令对应的目标物料信息。In some embodiments of the present application, referring to FIG. 5 , it shows a schematic diagram of an application scenario of another material increment processing method provided by an embodiment of the present application. As shown in FIG. 5 , the plurality of preset queues may include a slow queue, a standard queue, a flush queue and a retry queue. Assuming that the material increment instruction can include the first material increment instruction, the second increment instruction, and the third increment instruction, the above material increment instruction is subjected to attribute analysis through the instruction attribute analyzer, and the first material increment is added according to the attribute analysis result. The quantity instruction is stored in the slow queue, the second material increment instruction and the third material increment instruction are stored in the standard queue, and the second material increment instruction is flushed to the flushing queue. At this time, the first material increment instruction is taken out from the slow queue through the first execution queue, and the first material increment instruction is executed through the unit assembly sub-module and the result output sub-module, and the corresponding value of the first material increment instruction is output. Target material information; take out the second material increment instruction from the flushing queue through the second execution queue, execute the second material increment instruction through the unit assembly sub-module and the result output sub-module, and output the corresponding second material increment instruction target material information.
在冲刷队列为空时,从标准队列中取出第三物料增量指令,并通过单元装配子模块和结果输出子模块对第三物料增量指令进行执行,输出第三物料增量指令对应的目标物料信息;When the flushing queue is empty, take out the third material increment instruction from the standard queue, and execute the third material increment instruction through the unit assembly sub-module and the result output sub-module, and output the target corresponding to the third material increment instruction material information;
另外,假设第一物料增量指令执行失败,则在重试队列中生成重试指令,由第三执行队列从重试队列中取出重试指令,并通过单元装配子模块和结果输出子模块对重试指令进行执行(相当于重新执行第一物料增量指令)。In addition, assuming that the execution of the first material increment instruction fails, a retry instruction is generated in the retry queue, the retry instruction is taken out from the retry queue by the third execution queue, and the retry instruction is checked by the unit assembly sub-module and the result output sub-module. Execute the trial command (equivalent to re-executing the first material increment command).
从以上可以看出,多队列处理子模块、单元装配子模块和结果输出子模块相辅相成,共同支撑物料增量处理方法的核心逻辑;而且第一执行队列、第二执行队列和第三执行队列能够并发执行,提高了任务吞吐量和处理速度。It can be seen from the above that the multi-queue processing sub-module, the unit assembly sub-module and the result output sub-module complement each other and jointly support the core logic of the material incremental processing method; and the first execution queue, the second execution queue and the third execution queue can Concurrent execution improves task throughput and processing speed.
简言之,本申请实施例提供了一个高吞吐、准实时的广告增量物料传输方案。其中,良好的实时性和吞吐量可以使得广告主的操作能够实现分钟级上线,预算、出价、定向等等设置快速生效;而且其核心是物料增量处理方法的多队列设计逻辑,能够保证系统稳定运行的同时层级分明,相辅相成,最终保证物料快速下发。In short, the embodiments of the present application provide a high-throughput, quasi-real-time advertising incremental material transmission solution. Among them, good real-time performance and throughput can enable advertisers' operations to be launched in minutes, and settings such as budget, bid, and orientation can take effect quickly; and its core is the multi-queue design logic of the material incremental processing method, which can ensure the system At the same time of stable operation, the layers are distinct and complement each other, which ultimately ensures the rapid delivery of materials.
可以理解的是,通过本申请实施例提供的流程,投放平台模块和物料传输模块的职责更清晰,而且这种方式对其他业务类型的增量信息传输的复用性较强,在各项阈值的配置上也实现了很好的灵活易用性。It can be understood that the responsibilities of the delivery platform module and the material transmission module are clearer through the processes provided in the embodiments of this application, and this method has strong reusability for incremental information transmission of other business types. The configuration also achieves good flexibility and ease of use.
在本申请的一些实施例中,参见图6,其示出了本申请实施例提供的一种 物料增量处理装置30的组成结构示意图。如图6所示,该物料增量处理装置30包括获取单元301、解析单元302和处理单元303,其中,获取单元301,被配置为获取物料增量指令;其中,所述物料增量指令用于指示源位置存储的物料数据发生变更;解析单元302,被配置为对所述物料增量指令进行属性解析,根据属性解析结果在多个预设队列中确定所述物料增量指令对应的目标队列;处理单元303,被配置为利用所述目标队列对所述物料增量指令进行处理,得到目标物料信息。In some embodiments of the present application, referring to FIG. 6 , it shows a schematic diagram of the composition and structure of a material increment processing device 30 provided in an embodiment of the present application. As shown in FIG. 6, the material increment processing device 30 includes an acquisition unit 301, an analysis unit 302 and a processing unit 303, wherein the acquisition unit 301 is configured to acquire a material increment instruction; wherein, the material increment instruction uses The material data stored at the indicated source location is changed; the parsing unit 302 is configured to perform attribute analysis on the material increment instruction, and determine the target corresponding to the material increment instruction in a plurality of preset queues according to the attribute analysis result Queue; the processing unit 303 is configured to use the target queue to process the material increment instruction to obtain target material information.
在本申请的一些实施例中,获取单元301,被配置为在所述数据库发生物料变更事件的情况下,采集所述数据库的日志信息;利用预设关键词对所述数据库的日志信息进行过滤,根据过滤结果生成所述物料增量指令。In some embodiments of the present application, the acquiring unit 301 is configured to collect log information of the database when a material change event occurs in the database; and filter the log information of the database by using preset keywords , and generate the material increment instruction according to the filtering result.
在本申请的一些实施例中,解析单元302,还被配置为在所述属性解析结果满足预设筛选条件的情况下,将所述第一预设队列确定为所述目标队列,并将所述物料增量指令存储至所述第一预设队列;在所述属性解析结果不满足预设筛选条件的情况下,将所述第二预设队列确定为所述目标队列,并将所述物料增量指令存储至所述第二预设队列;其中,所述第一预设队列与所述第二预设队列不同。In some embodiments of the present application, the parsing unit 302 is further configured to determine the first preset queue as the target queue under the condition that the attribute parsing result satisfies the preset filter condition, and to The material increment instruction is stored in the first preset queue; if the attribute analysis result does not meet the preset screening conditions, the second preset queue is determined as the target queue, and the The material increment instruction is stored in the second preset queue; wherein the first preset queue is different from the second preset queue.
在本申请的一些实施例中,所述物料增量指令包括第一物料增量指令和第二物料增量指令,且所述第一物料增量指令被存储至所述第一预设队列,所述第二物料增量指令被存储至所述第二预设队列;In some embodiments of the present application, the material increment instruction includes a first material increment instruction and a second material increment instruction, and the first material increment instruction is stored in the first preset queue, the second material increment instruction is stored in the second preset queue;
相应地,处理单元303,还被配置为利用所述第一预设队列和所述第二预设队列对所述第一物料增量指令和所述第二物料增量指令进行并行处理,得到所述目标物料信息。Correspondingly, the processing unit 303 is further configured to use the first preset queue and the second preset queue to perform parallel processing on the first material increment instruction and the second material increment instruction, to obtain The target material information.
在本申请的一些实施例中,处理单元303,被配置为从所述目标队列获取所述物料增量指令,根据所述物料增量指令确定目标物料标识;根据所述目标物料标识,从所述源位置存储的物料数据中确定目标物料数据集合;对所述目标物料数据集合进行数据拼接处理,得到所述目标物料信息。In some embodiments of the present application, the processing unit 303 is configured to obtain the material increment instruction from the target queue, and determine a target material identifier according to the material increment instruction; The target material data set is determined from the material data stored in the source location; the data splicing process is performed on the target material data set to obtain the target material information.
在本申请的一些实施例中,解析单元302,还被配置为所述多个预设队列还包括第三预设队列,开启定时器;在所述定时器的计时时长达到预设时长时,将所述第三预设队列确定为所述目标队列,并将所述第二预设队列中存储的物料增量指令移动至所述第三预设队列。In some embodiments of the present application, the parsing unit 302 is further configured so that the plurality of preset queues further include a third preset queue, and starts a timer; when the timing duration of the timer reaches a preset duration, The third preset queue is determined as the target queue, and the material increment instruction stored in the second preset queue is moved to the third preset queue.
在本申请的一些实施例中,处理单元303,还被配置为在所述属性解析结果满足预设筛选条件的情况下,从所述第一预设队列中获取所述物料增量指令;在所述属性解析结果不满足预设筛选条件的情况下,判断所述第三预设队列是否为空;若所述第三预设队列为非空,则从所述第三预设队列中获取所述物料增量指令;若所述第三预设队列为空,则从所述第二预设队列中获取所述物料增量指令。In some embodiments of the present application, the processing unit 303 is further configured to obtain the material increment instruction from the first preset queue when the attribute parsing result satisfies a preset filter condition; In the case that the attribute analysis result does not meet the preset screening conditions, determine whether the third preset queue is empty; if the third preset queue is not empty, obtain from the third preset queue the material increment instruction; if the third preset queue is empty, obtain the material increment instruction from the second preset queue.
在本申请的一些实施例中,所述多个预设队列还包括第四预设队列,处理单元303,还被配置为在所述物料增量指令处理失败的情况下,基于所述物料增量指令,在所述第四预设队列中生成重试指令;根据所述重试指令,通 过所述第四预设队列对所述物料增量指令进行重试处理。In some embodiments of the present application, the plurality of preset queues further include a fourth preset queue, and the processing unit 303 is further configured to, in the case that the processing of the material increment instruction fails, based on the material increment amount instruction, and a retry instruction is generated in the fourth preset queue; according to the retry instruction, the material increment instruction is retried through the fourth preset queue.
在本申请的一些实施例中,处理单元303,还被配置为在所述物料增量指令处理失败的情况下,基于所述物料增量指令,生成告警信息;其中,所述告警信息用于向管理人员提示所述物料增量指令存在异常。In some embodiments of the present application, the processing unit 303 is further configured to generate alarm information based on the material increment instruction in the event that the material increment instruction fails to be processed; wherein the alarm information is used for Notify the manager that there is an abnormality in the material increment instruction.
在本申请的一些实施例中,处理单元303,还被配置为将所述目标物料信息传输到目标位置;对所述目标位置的目标物料信息进行排序,并根据排序结果进行物料投放。In some embodiments of the present application, the processing unit 303 is further configured to transmit the target material information to the target location; sort the target material information at the target location, and perform material delivery according to the sorting result.
可以理解地,在本实施例中,“单元”可以是部分电路、部分处理器、部分程序或软件等等,当然也可以是模块,还可以是非模块化的。而且在本实施例中的各组成部分可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。It can be understood that, in this embodiment, a "unit" may be a part of a circuit, a part of a processor, a part of a program or software, etc., of course, it may also be a module, and it may also be non-modular. Moreover, each component in this embodiment may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit. The above-mentioned integrated units can be implemented in the form of hardware, or can be implemented in the form of software function modules.
所述集成的单元如果以软件功能模块的形式实现并非作为独立的产品进行销售或使用时,可以存储在一个计算机可读取存储介质中,基于这样的理解,本实施例的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)或processor(处理器)执行本实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(Read Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。If the integrated unit is implemented in the form of a software functional module and is not sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this embodiment is essentially or The part that contributes to the prior art or the whole or part of the technical solution can be embodied in the form of a software product, the computer software product is stored in a storage medium, and includes several instructions for making a computer device (which can be It is a personal computer, a server, or a network device, etc.) or a processor (processor) that executes all or part of the steps of the method described in this embodiment. The aforementioned storage medium includes: U disk, mobile hard disk, read only memory (Read Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disk or optical disk and other media that can store program codes.
因此,本实施例提供了一种计算机存储介质,该计算机存储介质存储有计算机程序,所述计算机程序被多个处理器执行时实现前述实施例中任一项所述的方法的步骤。Therefore, this embodiment provides a computer storage medium storing a computer program, the computer program implementing the steps of the method in any one of the foregoing embodiments when executed by a plurality of processors.
基于上述的一种物料增量处理装置30的组成以及计算机存储介质,参见图7,其示出了本申请实施例提供的一种电子设备40的硬件结构示意图。如图7所示,所述电子设备40可以包括:通信接口401、存储器402和处理器403;各个组件通过总线设备404耦合在一起。可理解,总线设备404用于实现这些组件之间的连接通信。总线设备404除包括数据总线之外,还包括电源总线、控制总线和状态信号总线。但是为了清楚说明起见,在图7中将各种总线都标为总线设备404。其中,通信接口401,用于在与其他外部网元之间进行收发信息过程中,信号的接收和发送;Based on the composition of the above-mentioned material increment processing device 30 and the computer storage medium, see FIG. 7 , which shows a schematic diagram of a hardware structure of an electronic device 40 provided by an embodiment of the present application. As shown in FIG. 7 , the electronic device 40 may include: a communication interface 401 , a memory 402 and a processor 403 ; various components are coupled together through a bus device 404 . It can be understood that the bus device 404 is used to implement the connection communication between these components. In addition to the data bus, the bus device 404 also includes a power bus, a control bus, and a status signal bus. However, for clarity of illustration, the various buses are labeled as bus devices 404 in FIG. 7 . Among them, the communication interface 401 is used for receiving and sending signals in the process of sending and receiving information with other external network elements;
存储器402,用于存储能够在处理器403上运行的计算机程序; memory 402 for storing computer programs that can run on processor 403;
处理器403,用于在运行所述计算机程序时,执行:The processor 403 is configured to, when running the computer program, execute:
获取物料增量指令;其中,所述物料增量指令用于指示源位置存储的物料数据发生变更;Obtain a material increment instruction; wherein, the material increment instruction is used to indicate that the material data stored in the source location is changed;
对所述物料增量指令进行属性解析,根据属性解析结果在多个预设队列中确定所述物料增量指令对应的目标队列;Perform attribute analysis on the material increment instruction, and determine a target queue corresponding to the material increment instruction in a plurality of preset queues according to the attribute analysis result;
利用所述目标队列对所述物料增量指令进行处理,得到目标物料信息。Use the target queue to process the material increment instruction to obtain target material information.
可以理解,本申请实施例中的存储器402可以是易失性存储器或非易失性存储器,或可包括易失性和非易失性存储器两者。其中,非易失性存储器可以是只读存储器(Read-Only Memory,ROM)、可编程只读存储器(Programmable ROM,PROM)、可擦除可编程只读存储器(Erasable PROM,EPROM)、电可擦除可编程只读存储器(Electrically EPROM,EEPROM)或闪存。易失性存储器可以是随机存取存储器(Random Access Memory,RAM),其用作外部高速缓存。通过示例性但不是限制性说明,许多形式的RAM可用,例如静态随机存取存储器(Static RAM,SRAM)、动态随机存取存储器(Dynamic RAM,DRAM)、同步动态随机存取存储器(Synchronous DRAM,SDRAM)、双倍数据速率同步动态随机存取存储器(Double Data Rate SDRAM,DDRSDRAM)、增强型同步动态随机存取存储器(Enhanced SDRAM,ESDRAM)、同步链动态随机存取存储器(Synchronous link DRAM,SLDRAM)和直接内存总线随机存取存储器(Direct Rambus RAM,DRRAM)。本申请描述的设备和方法的存储器402旨在包括但不限于这些和任意其它适合类型的存储器。It can be understood that the memory 402 in this embodiment of the present application may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memory. Among them, the non-volatile memory may be a read-only memory (Read-Only Memory, ROM), a programmable read-only memory (Programmable ROM, PROM), an erasable programmable read-only memory (Erasable PROM, EPROM), an electrically programmable read-only memory (Erasable PROM, EPROM). Erase programmable read-only memory (Electrically EPROM, EEPROM) or flash memory. Volatile memory may be Random Access Memory (RAM), which acts as an external cache. By way of example and not limitation, many forms of RAM are available, such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM, SDRAM), Double Data Rate Synchronous Dynamic Random Access Memory (Double Data Rate SDRAM, DDRSDRAM), Enhanced Synchronous Dynamic Random Access Memory (Enhanced SDRAM, ESDRAM), Synchronous link DRAM (Synchronous link DRAM, SLDRAM) ) and direct memory bus random access memory (Direct Rambus RAM, DRRAM). The memory 402 of the apparatus and methods described herein is intended to include, but not be limited to, these and any other suitable types of memory.
而处理器403可能是一种集成电路芯片,具有信号的处理能力。在实现过程中,上述方法的各步骤可以通过处理器403中的硬件的集成逻辑电路或者软件形式的指令完成。上述的处理器403可以是通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现场可编程门阵列(Field Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。可以实现或者执行本申请实施例中的公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。结合本申请实施例所公开的方法的步骤可以直接体现为硬件译码处理器执行完成,或者用译码处理器中的硬件及软件模块组合执行完成。软件模块可以位于随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质中。该存储介质位于存储器402,处理器403读取存储器402中的信息,结合其硬件完成上述方法的步骤。The processor 403 may be an integrated circuit chip with signal processing capability. In the implementation process, each step of the above-mentioned method can be completed by an integrated logic circuit of hardware in the processor 403 or an instruction in the form of software. The above-mentioned processor 403 can be a general-purpose processor, a digital signal processor (Digital Signal Processor, DSP), an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field programmable gate array (Field Programmable Gate Array, FPGA) or other Programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. The methods, steps, and logic block diagrams disclosed in the embodiments of this application can be implemented or executed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of the method disclosed in conjunction with the embodiments of the present application may be directly embodied as executed by a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software modules may be located in random access memory, flash memory, read-only memory, programmable read-only memory or electrically erasable programmable memory, registers and other storage media mature in the art. The storage medium is located in the memory 402, and the processor 403 reads the information in the memory 402, and completes the steps of the above method in combination with its hardware.
可以理解的是,本申请描述的这些实施例可以用硬件、软件、固件、中间件、微码或其组合来实现。对于硬件实现,处理单元可以实现在一个或多个专用集成电路(Application Specific Integrated Circuits,ASIC)、数字信号处理器(Digital Signal Processing,DSP)、数字信号处理设备(DSP Device,DSPD)、可编程逻辑设备(Programmable Logic Device,PLD)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)、通用处理器、控制器、微控制器、微处理器、用于执行本申请所述功能的其它电子单元或其组合中。It will be appreciated that the embodiments described herein may be implemented in hardware, software, firmware, middleware, microcode, or a combination thereof. For hardware implementation, the processing unit can be implemented in one or more Application Specific Integrated Circuits (ASIC), Digital Signal Processing (DSP), Digital Signal Processing Device (DSP Device, DSPD), programmable Logic Devices (Programmable Logic Device, PLD), Field-Programmable Gate Array (Field-Programmable Gate Array, FPGA), General Purpose Processors, Controllers, Microcontrollers, Microprocessors, Others for performing the functions described herein electronic unit or a combination thereof.
对于软件实现,可通过执行本申请所述功能的模块(例如过程、函数等)来实现本申请所述的技术。软件代码可存储在存储器中并通过处理器执行。存储器可以在处理器中或在处理器外部实现。For a software implementation, the techniques described herein may be implemented through modules (eg, procedures, functions, etc.) that perform the functions described herein. Software codes may be stored in memory and executed by a processor. The memory can be implemented in the processor or external to the processor.
在本申请的一些实施例中,处理器403还被配置为在运行所述计算机程 序时,执行前述实施例中任一项所述的方法的步骤。In some embodiments of the present application, the processor 403 is further configured to execute the steps of the method described in any one of the preceding embodiments when running the computer program.
在本申请的一些实施例中,基于上述物料增量处理装置30的组成示意图,参见图8,其示出了本申请实施例提供的另一种电子设备40的组成结构示意图。如图8所示,该电子设备40至少包括前述实施例中任一项所述的物料增量处理装置30。In some embodiments of the present application, based on the schematic composition diagram of the above-mentioned material increment processing device 30 , see FIG. 8 , which shows a schematic composition structure diagram of another electronic device 40 provided by the embodiments of the present application. As shown in FIG. 8 , the electronic device 40 includes at least the material increment processing device 30 described in any one of the foregoing embodiments.
对于电子设备40而言,由于其包括有前述实施例中任一项所述的物料增量处理装置30,这样,通过物料增量处理装置30,可以得到物料增量指令的属性解析结果,然后从多个预设队列中确定出对应的目标队列,从而利用该目标队列实时处理物料增量指令,不仅可以提高物料增量处理的实时性和吞吐量,还可以提高对物料增量指令的处理速度,进而缩短了物料变更到生效的时间。For the electronic device 40, since it includes the material increment processing device 30 described in any one of the foregoing embodiments, through the material increment processing device 30, the attribute analysis result of the material increment instruction can be obtained, and then Determine the corresponding target queue from multiple preset queues, and use the target queue to process material incremental instructions in real time, which can not only improve the real-time performance and throughput of material incremental processing, but also improve the processing of material incremental instructions speed, thereby shortening the time for material changes to take effect.
以上所述,仅为本申请的较佳实施例而已,并非用于限定本申请的保护范围。The above descriptions are only preferred embodiments of the present application, and are not intended to limit the protection scope of the present application.
需要说明的是,在本申请中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者装置不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者装置所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者装置中还存在另外的相同要素。It should be noted that, in this application, the terms "comprising", "comprising" or any other variation thereof are intended to encompass non-exclusive inclusion, such that a process, method, article or device comprising a series of elements includes not only those elements , but also other elements not expressly listed or inherent to such a process, method, article or apparatus. Without further limitation, an element qualified by the phrase "comprising a..." does not preclude the presence of additional identical elements in a process, method, article or apparatus that includes the element.
上述本申请实施例序号仅仅为了描述,不代表实施例的优劣。The above-mentioned serial numbers of the embodiments of the present application are only for description, and do not represent the advantages or disadvantages of the embodiments.
本申请所提供的几个方法实施例中所揭露的方法,在不冲突的情况下可以任意组合,得到新的方法实施例。The methods disclosed in the several method embodiments provided in this application can be arbitrarily combined under the condition of no conflict to obtain new method embodiments.
本申请所提供的几个产品实施例中所揭露的特征,在不冲突的情况下可以任意组合,得到新的产品实施例。The features disclosed in the several product embodiments provided in this application can be combined arbitrarily without conflict to obtain a new product embodiment.
本申请所提供的几个方法或设备实施例中所揭露的特征,在不冲突的情况下可以任意组合,得到新的方法实施例或设备实施例。The features disclosed in several method or device embodiments provided in this application can be combined arbitrarily without conflict to obtain new method embodiments or device embodiments.
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。The above are only specific embodiments of the present application, but the protection scope of the present application is not limited to this. should be covered within the scope of protection of this application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
工业实用性Industrial Applicability
本申请实施例提供了一种物料增量处理方法、装置、电子设备和计算机存储介质,通过获取物料增量指令;其中,所述物料增量指令用于指示源位置存储的物料数据发生变更;对所述物料增量指令进行属性解析,根据属性解析结果在多个预设队列中确定所述物料增量指令对应的目标队列;利用所 述目标队列对所述物料增量指令进行处理,得到目标物料信息。这样,根据物料增量指令的属性解析结果,从多个预设队列中确定出对应的目标队列,从而利用该目标队列实时处理物料增量指令,不仅可以提高物料增量处理的实时性和吞吐量,还可以提高对物料增量指令的处理速度,进而缩短了物料变更到生效的时间。The embodiments of the present application provide a material increment processing method, device, electronic device and computer storage medium, by acquiring a material increment instruction, wherein the material increment instruction is used to indicate that the material data stored in the source location is changed; Perform attribute analysis on the material increment instruction, and determine a target queue corresponding to the material increment instruction in a plurality of preset queues according to the attribute analysis result; use the target queue to process the material increment instruction, and obtain Target material information. In this way, according to the attribute analysis result of the material increment instruction, the corresponding target queue is determined from multiple preset queues, so that the material increment instruction can be processed in real time by using the target queue, which can not only improve the real-time performance and throughput of material increment processing It can also improve the processing speed of material increment instructions, thereby shortening the time for material changes to take effect.

Claims (13)

  1. 一种物料增量处理方法,所述方法包括:A material increment processing method, the method comprises:
    获取物料增量指令;其中,所述物料增量指令用于指示源位置存储的物料数据发生变更;Obtain a material increment instruction; wherein, the material increment instruction is used to indicate that the material data stored in the source location is changed;
    对所述物料增量指令进行属性解析,根据属性解析结果在多个预设队列中确定所述物料增量指令对应的目标队列;Perform attribute analysis on the material increment instruction, and determine a target queue corresponding to the material increment instruction in a plurality of preset queues according to the attribute analysis result;
    利用所述目标队列对所述物料增量指令进行处理,得到目标物料信息。Use the target queue to process the material increment instruction to obtain target material information.
  2. 根据权利要求1所述的物料增量处理方法,其中,所述源位置为数据库,所述获取物料增量指令,包括:The material increment processing method according to claim 1, wherein the source location is a database, and the acquiring a material increment instruction comprises:
    在所述数据库发生物料变更事件的情况下,采集所述数据库的日志信息;Collect log information of the database when a material change event occurs in the database;
    利用预设关键词对所述数据库的日志信息进行过滤,根据过滤结果生成所述物料增量指令。The log information of the database is filtered by using preset keywords, and the material increment instruction is generated according to the filtering result.
  3. 根据权利要求1所述的物料增量处理方法,其中,所述多个预设队列包括第一预设队列和第二预设队列,所述根据属性解析结果在多个预设队列中确定所述物料增量指令对应的目标队列,包括:The material increment processing method according to claim 1, wherein the multiple preset queues include a first preset queue and a second preset queue, and the predetermined queue is determined according to the attribute analysis result among the multiple preset queues. The target queue corresponding to the above material increment instruction, including:
    在所述属性解析结果满足预设筛选条件的情况下,将所述第一预设队列确定为所述目标队列,并将所述物料增量指令存储至所述第一预设队列;In the case that the attribute analysis result satisfies the preset screening condition, the first preset queue is determined as the target queue, and the material increment instruction is stored in the first preset queue;
    在所述属性解析结果不满足预设筛选条件的情况下,将所述第二预设队列确定为所述目标队列,并将所述物料增量指令存储至所述第二预设队列;In the case that the attribute analysis result does not meet the preset screening conditions, determining the second preset queue as the target queue, and storing the material increment instruction in the second preset queue;
    其中,所述第一预设队列与所述第二预设队列不同。Wherein, the first preset queue is different from the second preset queue.
  4. 根据权利要求3所述的物料增量处理方法,其中,所述物料增量指令包括第一物料增量指令和第二物料增量指令,且所述第一物料增量指令被存储至所述第一预设队列,所述第二物料增量指令被存储至所述第二预设队列;The material increment processing method according to claim 3, wherein the material increment instruction comprises a first material increment instruction and a second material increment instruction, and the first material increment instruction is stored in the a first preset queue, the second material increment instruction is stored in the second preset queue;
    相应地,所述利用所述目标队列对所述物料增量指令进行处理,得到目标物料信息,包括:Correspondingly, using the target queue to process the material increment instruction to obtain target material information, including:
    利用所述第一预设队列和所述第二预设队列对所述第一物料增量指令和所述第二物料增量指令进行并行处理,得到所述目标物料信息。The first material increment instruction and the second material increment instruction are processed in parallel by using the first preset queue and the second preset queue to obtain the target material information.
  5. 根据权利要求3所述的物料增量处理方法,其中,所述利用所述目标队列对所述物料增量指令进行处理,得到目标物料信息,包括:The material increment processing method according to claim 3, wherein the processing of the material increment instruction by using the target queue to obtain target material information comprises:
    从所述目标队列获取所述物料增量指令,根据所述物料增量指令确定目标物料标识;Obtain the material increment instruction from the target queue, and determine the target material identifier according to the material increment instruction;
    根据所述目标物料标识,从所述源位置存储的物料数据中确定目标物料数据集合;According to the target material identifier, determine the target material data set from the material data stored in the source location;
    对所述目标物料数据集合进行数据拼接处理,得到所述目标物料信息。Perform data splicing processing on the target material data set to obtain the target material information.
  6. 根据权利要求5所述的物料增量处理方法,其中,所述多个预设队列还包括第三预设队列,所述方法还包括:The material increment processing method according to claim 5, wherein the plurality of preset queues further comprises a third preset queue, and the method further comprises:
    开启定时器;start the timer;
    在所述定时器的计时时长达到预设时长时,将所述第三预设队列确定为所述目标队列,并将所述第二预设队列中存储的物料增量指令移动至所述第三预设队列。When the timing duration of the timer reaches a preset duration, the third preset queue is determined as the target queue, and the material increment instruction stored in the second preset queue is moved to the second preset queue. Three preset queues.
  7. 根据权利要求6所述的物料增量处理方法,其中,所述从所述目标队列获取所述物料增量指令,包括:The material increment processing method according to claim 6, wherein the acquiring the material increment instruction from the target queue comprises:
    在所述属性解析结果满足预设筛选条件的情况下,从所述第一预设队列中获取所述物料增量指令;Obtain the material increment instruction from the first preset queue under the condition that the attribute analysis result satisfies the preset screening condition;
    在所述属性解析结果不满足预设筛选条件的情况下,判断所述第三预设队列是否为空;In the case that the attribute analysis result does not meet the preset screening conditions, determine whether the third preset queue is empty;
    若所述第三预设队列为非空,则从所述第三预设队列中获取所述物料增量指令;If the third preset queue is not empty, acquiring the material increment instruction from the third preset queue;
    若所述第三预设队列为空,则从所述第二预设队列中获取所述物料增量指令。If the third preset queue is empty, the material increment instruction is acquired from the second preset queue.
  8. 根据权利要求1所述的物料增量处理方法,其中,所述多个预设队列 还包括第四预设队列,在所述物料增量指令处理失败的情况下,所述方法还包括:The material increment processing method according to claim 1, wherein the plurality of preset queues further include a fourth preset queue, and in the case that the processing of the material increment instruction fails, the method further comprises:
    基于所述物料增量指令,在所述第四预设队列中生成重试指令;generating a retry instruction in the fourth preset queue based on the material increment instruction;
    根据所述重试指令,通过所述第四预设队列对所述物料增量指令进行重试处理。According to the retry instruction, retry processing is performed on the material increment instruction through the fourth preset queue.
  9. 根据权利要求8所述的物料增量处理方法,其中,在所述物料增量指令处理失败的情况下,所述方法还包括:The material increment processing method according to claim 8, wherein, in the case that the material increment instruction processing fails, the method further comprises:
    基于所述物料增量指令,生成告警信息;其中,所述告警信息用于向管理人员提示所述物料增量指令存在异常。Based on the material increment instruction, alarm information is generated; wherein, the alarm information is used to prompt a manager that there is an abnormality in the material increment instruction.
  10. 根据权利要求1至9任一项所述的物料增量处理方法,其中,所述方法还包括:The material increment processing method according to any one of claims 1 to 9, wherein the method further comprises:
    将所述目标物料信息传输到目标位置;transmitting the target material information to the target location;
    对所述目标位置的目标物料信息进行排序,并根据排序结果进行物料投放。The target material information of the target location is sorted, and material delivery is performed according to the sorting result.
  11. 一种物料增量处理装置,所述物料增量处理装置包括获取单元、解析单元和处理单元;其中,A material incremental processing device, the material incremental processing device includes an acquisition unit, an analysis unit and a processing unit; wherein,
    所述获取单元,被配置为获取物料增量指令;其中,所述物料增量指令用于指示源位置存储的物料数据发生变更;The acquiring unit is configured to acquire a material increment instruction; wherein, the material increment instruction is used to indicate that the material data stored in the source location is changed;
    所述解析单元,被配置为对所述物料增量指令进行属性解析,根据属性解析结果在多个预设队列中确定所述物料增量指令对应的目标队列;The analyzing unit is configured to perform attribute analysis on the material increment instruction, and determine a target queue corresponding to the material increment instruction in a plurality of preset queues according to the attribute analysis result;
    所述处理单元,被配置为利用所述目标队列对所述物料增量指令进行处理,得到目标物料信息。The processing unit is configured to process the material increment instruction by using the target queue to obtain target material information.
  12. 一种电子设备,所述电子设备包括存储器和处理器;其中,An electronic device comprising a memory and a processor; wherein,
    所述存储器,用于存储能够在所述处理器上运行的计算机程序;the memory for storing a computer program executable on the processor;
    所述处理器,用于在运行所述计算机程序时,执行如权利要求1至10任一项所述方法的步骤。The processor is configured to execute the steps of the method according to any one of claims 1 to 10 when running the computer program.
  13. 一种计算机存储介质,所述计算机存储介质存储有计算机程序,所述计算机程序被处理器执行时实现如权利要求1至10任一项所述方法的步骤。A computer storage medium storing a computer program, the computer program implementing the steps of the method according to any one of claims 1 to 10 when the computer program is executed by a processor.
PCT/CN2021/140584 2021-03-31 2021-12-22 Material incremental processing method and apparatus, electronic device, and computer storage medium WO2022206054A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110351985.2A CN113095874A (en) 2021-03-31 2021-03-31 Material increment processing method, device, equipment and storage medium
CN202110351985.2 2021-03-31

Publications (1)

Publication Number Publication Date
WO2022206054A1 true WO2022206054A1 (en) 2022-10-06

Family

ID=76672575

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/140584 WO2022206054A1 (en) 2021-03-31 2021-12-22 Material incremental processing method and apparatus, electronic device, and computer storage medium

Country Status (2)

Country Link
CN (1) CN113095874A (en)
WO (1) WO2022206054A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113095874A (en) * 2021-03-31 2021-07-09 北京沃东天骏信息技术有限公司 Material increment processing method, device, equipment and storage medium

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050021567A1 (en) * 2003-06-30 2005-01-27 Holenstein Paul J. Method for ensuring referential integrity in multi-threaded replication engines
CN107783975A (en) * 2016-08-24 2018-03-09 北京京东尚科信息技术有限公司 The method and apparatus of distributed data base synchronization process
CN110765091A (en) * 2019-09-09 2020-02-07 上海陆家嘴国际金融资产交易市场股份有限公司 Account checking method and system
CN110795440A (en) * 2019-09-05 2020-02-14 连连银通电子支付有限公司 Method and device for updating index
CN111985944A (en) * 2019-05-21 2020-11-24 北京沃东天骏信息技术有限公司 Method, device and equipment for processing material data and storage medium
CN112182001A (en) * 2020-09-27 2021-01-05 浪潮云信息技术股份公司 Method, apparatus and medium for incremental synchronization of database to dynamic ES index library
CN112307037A (en) * 2019-07-26 2021-02-02 北京京东振世信息技术有限公司 Data synchronization method and device
CN113095874A (en) * 2021-03-31 2021-07-09 北京沃东天骏信息技术有限公司 Material increment processing method, device, equipment and storage medium

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110895534A (en) * 2018-08-24 2020-03-20 北京京东尚科信息技术有限公司 Data splicing method, device, medium and electronic equipment
US10579449B1 (en) * 2018-11-02 2020-03-03 Dell Products, L.P. Message queue architectures framework converter
CN111209251A (en) * 2019-12-27 2020-05-29 山大地纬软件股份有限公司 Data increment synchronization system and method for data archiving system
CN112527899A (en) * 2020-12-03 2021-03-19 北京百度网讯科技有限公司 Data synchronization method, device, equipment and storage medium

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050021567A1 (en) * 2003-06-30 2005-01-27 Holenstein Paul J. Method for ensuring referential integrity in multi-threaded replication engines
CN107783975A (en) * 2016-08-24 2018-03-09 北京京东尚科信息技术有限公司 The method and apparatus of distributed data base synchronization process
CN111985944A (en) * 2019-05-21 2020-11-24 北京沃东天骏信息技术有限公司 Method, device and equipment for processing material data and storage medium
CN112307037A (en) * 2019-07-26 2021-02-02 北京京东振世信息技术有限公司 Data synchronization method and device
CN110795440A (en) * 2019-09-05 2020-02-14 连连银通电子支付有限公司 Method and device for updating index
CN110765091A (en) * 2019-09-09 2020-02-07 上海陆家嘴国际金融资产交易市场股份有限公司 Account checking method and system
CN112182001A (en) * 2020-09-27 2021-01-05 浪潮云信息技术股份公司 Method, apparatus and medium for incremental synchronization of database to dynamic ES index library
CN113095874A (en) * 2021-03-31 2021-07-09 北京沃东天骏信息技术有限公司 Material increment processing method, device, equipment and storage medium

Also Published As

Publication number Publication date
CN113095874A (en) 2021-07-09

Similar Documents

Publication Publication Date Title
CN110741342B (en) Blockchain transaction commit ordering
US9558465B1 (en) Annotations-based generic load generator engine
CN107729139B (en) Method and device for concurrently acquiring resources
US8762408B2 (en) Optimizing software applications
US7315863B2 (en) Method and apparatus for automatic notification of database events
CN101416209A (en) Policy based message aggregation framework
US10354208B2 (en) System and method for defining run books
CN110753084B (en) Uplink data reading method, cache server and computer readable storage medium
US9971563B2 (en) Systems and methods for low interference logging and diagnostics
US20190138375A1 (en) Optimization of message oriented middleware monitoring in heterogenenous computing environments
CN112650728A (en) Interface information storage method and device, server and distributed service system
WO2022206054A1 (en) Material incremental processing method and apparatus, electronic device, and computer storage medium
CN115622906A (en) Application log capturing system and method
US20220171791A1 (en) Replicating large statements with low latency
US20110238781A1 (en) Automated transfer of bulk data including workload management operating statistics
US20210089372A1 (en) Extensible alerts platform
US11243979B1 (en) Asynchronous propagation of database events
CN110019045B (en) Log floor method and device
US10210574B2 (en) Content management checklist object
US11841827B2 (en) Facilitating generation of data model summaries
US9753682B2 (en) Information processing apparatus, information processing method, and computer-readable storage medium
US9037559B2 (en) File system queue
CN113220730A (en) Service data processing system
US20140188530A1 (en) Provision of customer attributes to an organization
Mántaras et al. Optimizing the BizTalk Platform

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21934690

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21934690

Country of ref document: EP

Kind code of ref document: A1