Data processing method and device, server and storage medium

By copying and aggregating the settlement data to be processed, the update of the advertiser's amount is ensured as a transaction operation, which solves the problem of low reliability in the advertising settlement recovery process in the existing technology, and achieves efficient settlement processing and data recovery.

CN112433886BActive Publication Date: 2024-08-23XIAMEN MEITUZHIJIA TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202011337620.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-11-24
Publication Date
2024-08-23
Estimated Expiration
2040-11-24

AI Technical Summary

Technical Problem

In the existing technology, the account database update operation caused by batch processing of exposure logs during the advertising settlement recovery process is not a transaction operation, resulting in partial success and partial failure, resulting in low reliability of settlement processing and prone to repeated billing or missed billing problems. .

Method used

By copying and processing the settlement data to be processed, the copied settlement data in the preset format is obtained, and aggregation and settlement processing are performed on it to ensure that each advertiser's amount update is treated as a transaction operation to avoid data interference and repeated processing.

Benefits of technology

It improves the reliability of settlement processing, avoids repeated billing and missed billing, and ensures the accuracy of data recovery points and resource utilization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112433886B
    Figure CN112433886B
Patent Text Reader

Abstract

The data processing method and device, server and storage medium provided in the embodiments of the present application relate to the field of data processing technology. The data processing method includes: first, in response to a settlement processing signal, obtaining settlement data to be processed; second, copying the settlement data to be processed to obtain copied settlement data in a preset format; then, performing settlement processing on the copied settlement data to obtain a settlement processing result. Through the above settings, settlement processing can be performed on the copied copied settlement data in a preset format, which improves the problem of low reliability of settlement processing caused by the fact that the update operation directly performed according to the original settlement data may result in partial success and partial failure in the prior art.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and in particular to a data processing method and device, a server, and a storage medium. Background Art

[0002] The inventors have found through research that in the existing settlement recovery technology, since the update operation is directly performed based on the original settlement data, there may be partial success and partial failure results, thus there is a problem of low reliability of settlement processing. Summary of the invention

[0003] In view of this, the purpose of the present application is to provide a data processing method and device, a server and a storage medium to improve the problems existing in the prior art.

[0004] To achieve the above purpose, the embodiment of the present application adopts the following technical solution:

[0005] In a first aspect, the present invention provides a data processing method, comprising:

[0006] Responding to the settlement processing signal, acquiring settlement data to be processed;

[0007] Copying the settlement data to be processed to obtain copied settlement data in a preset format;

[0008] Settlement processing is performed on the copied settlement data to obtain a settlement processing result.

[0009] In an optional implementation manner, the copied settlement data includes a plurality of logs, and the step of performing settlement processing on the copied settlement data to obtain a settlement processing result includes:

[0010] Aggregate the multiple logs;

[0011] Settlement processing is performed on the replicated settlement data after aggregation processing to obtain a settlement processing result.

[0012] In an optional implementation manner, the log includes a settlement entity, and the step of aggregating the multiple logs includes:

[0013] Get the settlement entity of each log;

[0014] Aggregate the multiple logs according to the settlement entity.

[0015] In an optional implementation manner, the step of performing settlement processing on the aggregated replicated settlement data to obtain a settlement processing result includes:

[0016] For each settlement entity, obtain the preset processing information of the settlement entity;

[0017] The copied settlement data belonging to the settlement subject is subjected to settlement processing according to the preset processing information of the settlement subject to obtain a settlement processing result.

[0018] In an optional implementation manner, the data processing method further includes:

[0019] The copied settlement data after settlement processing is stored.

[0020] In an optional implementation manner, the data processing method further includes:

[0021] Determining whether the settlement processing result includes the result of each log;

[0022] If not, the pending settlement data is obtained, and settlement processing is performed on the pending settlement data to obtain a new settlement processing result.

[0023] In an optional implementation manner, the data processing method further includes:

[0024] Determining whether the settlement processing result is repeated;

[0025] If so, the pending settlement data is obtained, and settlement processing is performed on the pending settlement data to obtain a new settlement processing result.

[0026] In a second aspect, the present invention provides a data processing device, comprising:

[0027] A data acquisition module, used for acquiring settlement data to be processed in response to a settlement processing signal;

[0028] A copy processing module, used for copying the settlement data to be processed to obtain copied settlement data in a preset format;

[0029] The settlement processing module is used to perform settlement processing on the copied settlement data to obtain a settlement processing result.

[0030] In a third aspect, the present invention provides a server, comprising a memory and a processor, wherein the processor is used to execute an executable computer program stored in the memory to implement the data processing method described in any one of the aforementioned embodiments.

[0031] In a fourth aspect, the present invention provides a storage medium having a computer program stored thereon, which, when executed, implements the steps of the data processing method described in any one of the aforementioned embodiments.

[0032] The data processing method and device, server and storage medium provided in the embodiments of the present application copy and process the settlement data to be processed to obtain copied settlement data in a preset format, perform settlement processing on the copied settlement data, and obtain a settlement processing result, thereby realizing settlement processing on the copied copied settlement data in the preset format, thereby improving the problem of low reliability of settlement processing in the prior art, which may result in partial success and partial failure when performing update operations directly based on the original settlement data. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0034] Figure 1 A structural block diagram of a data processing system provided in an embodiment of the present application.

[0035] Figure 2 A flowchart of a data processing method provided in an embodiment of the present application.

[0036] Figure 3 Another flowchart of the data processing method provided in an embodiment of the present application.

[0037] Figure 4 Another flowchart of the data processing method provided in an embodiment of the present application.

[0038] Figure 5 Another flowchart of the data processing method provided in an embodiment of the present application.

[0039] Figure 6 Another flowchart of the data processing method provided in an embodiment of the present application.

[0040] Figure 7 Another flowchart of the data processing method provided in an embodiment of the present application.

[0041] Figure 8 Another flowchart of the data processing method provided in an embodiment of the present application.

[0042] Fig. 9 This is a structural block diagram of a data processing device provided in an embodiment of the present application.

[0043] Icons: 10 - data processing system; 100 - server; 200 - terminal device; 900 - data processing device; 910 - data acquisition module; 920 - copy processing module; 930 - settlement processing module. DETAILED DESCRIPTION

[0044] The settlement module of the advertising engine is responsible for the settlement function of exposure logs, and currently the real-time settlement mode is mostly adopted. At present, the common advertising system log volume is generally in the hundreds of millions to tens of billions per day. Batch processing is used to settle logs, which is a common way to improve settlement performance and reduce resource consumption. After the advertising exposure log is transmitted back from the terminal, it is generally stored in a message queue. The exposure log will carry the advertising ID or advertiser ID as the identification information to distinguish the exposure, which is also the basis for settlement. When batch processing, it is first aggregated according to the advertising ID or advertiser ID, and then settled according to the ID. Therefore, only when a batch of logs has completed the deduction of the corresponding advertiser amount information, can the settlement of this batch of logs be confirmed to be completed, that is, the settlement of each batch of logs is regarded as a transaction operation during batch processing. In practice, there are many ways to store advertiser amount information. Generally, relational databases or KV databases are used to store advertiser amount information for easy query and update operations. Taking KV databases as an example, it is difficult to update multiple account amount information as a transaction operation, so we can only ensure that as many account amounts as possible are updated successfully. Once a restart occurs, and only some advertiser settlement information is successfully updated during the restart, the latest position of the log queue before the restart will be obtained from the database after the restart. However, since the update operation before the restart is not a transaction operation, only some of the accounts involved in the last batch are successfully updated, and it is difficult to find the correct data recovery point. In order to ensure the correctness of the settlement data, the advertising settlement information and advertising report service are required to compare the settlement information and correct the amount information.

[0045] According to the existing advertising settlement recovery technology, since the account database update operation caused by the batch exposure log is not a transaction operation, it may result in partial success and partial failure. Therefore, it is difficult for the database to give the correct data recovery point. Once it is necessary to find the data recovery point and re-billing, there will be problems of repeated deductions or missed deductions.

[0046] Take an example to illustrate the problems encountered when restoring settlement data: for example, batch processing 10 advertising exposure logs, these 10 logs belong to 3 advertisers: owner1, owner2, owner3, the exposure logs are stored in the message queue in the following order [owner1, owner2, owner3, owner3, owner1, owner1, owner2, owner2, owner2, owner1], these 10 exposure logs are numbered in the message queue as order = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], during settlement, first aggregate the 10 exposure logs by owner, the result is as follows:<owner1,total_pv=4,total_cost=cost1*total_pv> ,<owner2,total_pv=4,total_cost=cost2*total_pv> ,<owner3,total_pv=2,total_cost=cost3*total_pv> , then deduct the fees from the corresponding account, and finally submit the account balance information after the deduction, and update the location of the last log of successful settlement of each account. Assuming that an accident occurs in the step of submitting the account balance (for example, a restart operation occurs), then there will be a problem that some account balances are successfully updated and some are not successfully updated. Taking the above 10 exposure logs as an example, assuming that after the owner3 account is successfully updated, an accident occurs before the corresponding accounts of owner1 and owner2 are successfully updated, then after the restart, the settlement data recovery module will compare the log positions of the last settlement of owner1, owner2, and owner3 to obtain the starting position of the restarted log settlement. There are two options: one is to select the latest position of the last settlement as the starting position of the log settlement for this restart, that is, start the log settlement from the position of order=5, and the exposure log will be lost. In the last settlement before the restart, the settlement information of the owner1 log of order=1 and the owner2 log of order=2 was not successfully updated, so owner1 missed the billing of the log of order=1, and owner2 missed the billing of the log of order=2; the second is to select the starting position of the last settlement as the restart position of the log settlement for this restart, that is, start the log settlement from order=1, and the situation of repeated billing will occur. Therefore, currently advertising settlement and advertising reporting services are compared with each other to make up for the problem of duplicate billing or log loss. However, since advertising reporting services are generally non-real-time offline data statistics, the correction work caused by restart requires delayed comparison. The adverse effect is that some accounts may have over-investment (log loss requires more engine exposure) or over-deduction (log duplicate billing).

[0047] In order to improve at least one of the above technical problems raised by the present application, the embodiments of the present application provide a data processing method and device, a server and a storage medium. The technical solution of the present application is described below through possible implementation methods.

[0048] The defects existing in the above solutions are the results obtained by the inventor after practice and careful research. Therefore, the discovery process of the above problems and the solutions proposed in this application for the above problems should be the contributions made by the inventor to this application during the application process.

[0049] To make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme in the embodiments of the present application will be described in detail below in conjunction with the drawings in the embodiments of the present application. It should be understood that the drawings in the present application only serve the purpose of explanation and description and are not used to limit the scope of protection of the present application. In addition, it should be understood that the schematic drawings are not drawn in real proportion. The flowchart used in this application shows the operations implemented according to some embodiments of the present application. It should be understood that the operations of the flowchart can be implemented out of sequence, and the steps without logical context can be reversed in order or implemented simultaneously. In addition, those skilled in the art, under the guidance of the content of the present application, can add one or more other operations to the flowchart, or remove one or more operations from the flowchart.

[0050] In addition, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. The components of the embodiments of the present application described and shown in the drawings here can be arranged and designed in various configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.

[0051] In order to enable those skilled in the art to use the content of the present application, the following implementation methods are provided. For those skilled in the art, the general principles defined herein can be applied to other embodiments and application scenarios without departing from the spirit and scope of the present application. The application of the system or method of the present application may include a web page, a browser plug-in, a client terminal, a customization system, an internal analysis system, or an artificial intelligence robot, etc., or any combination thereof.

[0052] It should be noted that the term "comprising" will be used in the embodiments of the present application to indicate the existence of the features declared thereafter, but does not exclude the addition of other features.

[0053] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.

[0054] Figure 1 This is a structural block diagram of the data processing system 10 provided in the embodiment of the present application, which provides a possible implementation of the data processing system 10, see Figure 1 The data processing system 10 may include one or more of a server 100 and a terminal device 200 .

[0055] The server 100 is connected to the terminal device 200 for communication, so as to obtain the data (which may include the settlement data to be processed) sent by the terminal device 200 for processing, and obtain the settlement processing result.

[0056] For the server 100, it should be noted that, in some embodiments, the server 100 can be a single server device or a server group. The server group can be centralized or distributed (for example, the server 100 can be a distributed system). In some embodiments, the server 100 can be local or remote relative to the terminal device 200. For example, the server 100 can access information and / or data stored in the terminal device 200 via a network. As another example, the server 100 can be directly connected to the terminal device 200 to access the stored information and / or data. In some embodiments, the server 100 can be implemented on a cloud platform. As an example only, the cloud platform can include a private cloud, a public cloud, a hybrid cloud, an elastic cloud, a community cloud, a distributed cloud, an inter-cloud, a multi-cloud, etc., or any combination thereof. In some embodiments, the server 100 can be implemented on the terminal device 200.

[0057] In some embodiments, the server 100 may include a processor. The processor may process the information and / or data sent by the terminal device 200 to perform one or more functions described in the present application. In some embodiments, the processor may include one or more processing cores (e.g., a single-core processor (S) or a multi-core processor (S)). By way of example only, the processor may include a central processing unit (CPU), an application-specific integrated circuit (ASIC), an application-specific instruction set processor (ASIP), a graphics processing unit (GPU), a physical processing unit (PPU), a digital signal processor (DSP), a field programmable gate array (FPGA), a programmable logic device (PLD), a controller, a microcontroller unit, a reduced instruction set computer (RISC) or a microprocessor, or any combination thereof.

[0058] The network can be used for the exchange of information and / or data. In some embodiments, one or more components (e.g., server 100 and terminal device 200) in data processing system 10 can send information and / or data to other components. For example, server 100 can obtain data from terminal device 200 via network. In some embodiments, the network can be any type of wired or wireless network, or a combination thereof. As an example only, the network can include a wired network, a wireless network, an optical fiber network, a telecommunication network, an intranet, the Internet, a local area network (LAN), a wide area network (WAN), a wireless local area network (WLAN), a metropolitan area network (MAN), a wide area network (WAN), a public switched telephone network (PSTN), a Bluetooth network, a ZigBee network, or a near field communication (NFC) network, etc., or any combination thereof.

[0059] In some embodiments, the network may include one or more network access points. For example, the network may include a wired or wireless network access point, such as a base station and / or a network switching node, through which one or more components of the data processing system 10 may connect to the network to exchange data and / or information.

[0060] The server 100 may include a database, which may store data and / or instructions. In some embodiments, the database may store data obtained from the terminal device 200. In some embodiments, the database may store data and / or instructions of the exemplary method described in the present application. In some embodiments, the database may include a large capacity memory, a removable memory, a volatile read-write memory, or a read-only memory (ROM), etc., or any combination thereof. As an example, the large capacity memory may include a disk, an optical disk, a solid-state drive, etc.; the removable memory may include a flash drive, a floppy disk, an optical disk, a memory card, a zip disk, a tape, etc.; the volatile read-write memory may include a random access memory (RAM); the RAM may include a dynamic RAM (DRAM), a double data rate synchronous dynamic RAM (DDR SDRAM); a static RAM (SRAM), a thyristor RAM (T-RAM), and a zero capacitor RAM (Zero-RAM), etc. As an example, ROM may include mask ROM (Mask Read-Only Memory, MROM), programmable ROM (Programmable Read-Only Memory, PROM), erasable programmable ROM (Programmable Erasable Read-only Memory, PEROM), electrically erasable programmable ROM (Electrically Erasable Programmable read only memory, EEPROM), CD-ROM (CD-ROM), and digital universal disk ROM, etc. In some embodiments, the database can be implemented on a cloud platform. As an example only, the cloud platform can include a private cloud, a public cloud, a hybrid cloud, a community cloud, a distributed cloud, a cross-cloud, a multi-cloud, an elastic cloud, or other similar, or any combination thereof.

[0061] In some embodiments, the database may be connected to a network to communicate with one or more components in the data processing system 10 (e.g., server 100 and terminal device 200). One or more components in the data processing system 10 may access data or instructions stored in the database via the network. In some embodiments, the database may be directly connected to one or more components in the data processing system 10 (e.g., server 100 and terminal device 200). Alternatively, in some embodiments, the database may also be part of the server 100. In some embodiments, one or more components in the data processing system 10 (e.g., server 100 and terminal device 200) may have access to the database.

[0062] Figure 2 A flowchart of a data processing method provided in an embodiment of the present application is shown, which can be applied to Figure 1 The server 100 shown in FIG. Figure 1 It should be understood that in other embodiments, the order of some steps in the data processing method of this embodiment can be interchanged according to actual needs, or some steps can be omitted or deleted. Figure 2 The process of the data processing method shown is described in detail.

[0063] Step S210, in response to the settlement processing signal, obtaining settlement data to be processed.

[0064] Step S220, copying the settlement data to be processed to obtain copied settlement data in a preset format.

[0065] Step S230, performing settlement processing on the copied settlement data to obtain a settlement processing result.

[0066] The above method copies the settlement data to be processed to obtain copied settlement data in a preset format, performs settlement processing on the copied settlement data, and obtains a settlement processing result, thereby realizing settlement processing on the copied settlement data in the preset format. This improves the problem of low reliability of settlement processing in the prior art, which may result in partial success and partial failure when performing update operations directly based on the original settlement data.

[0067] Regarding step S210, it should be noted that the specific structure of the settlement data to be processed is not limited and can be set according to actual application requirements. For example, in an alternative example, the settlement data to be processed can be data in a preset format, and the settlement data to be processed is directly copied. For another example, in another alternative example, the settlement data to be processed can be data in a non-preset format, and the settlement data to be processed can be converted into a preset format before being copied.

[0068] Optionally, the method for obtaining the pending settlement data is not limited and can be set according to actual application requirements. For example, in an alternative example, the server 100 can obtain the pending settlement data sent by the terminal device 200. For another example, in another alternative example, the server 100 can store the pending settlement data.

[0069] Among them, the data structure of the settlement data may include the settlement data version, update time, billing position in the log queue, settlement subject (which may include advertisers), historical recharge total, historical deduction total and other data.

[0070] In detail, the data structure of the current settlement data can be identified by the following code:

[0071] "current_version":{

[0072] "current_version_time":"yyyy-mm-dd-HH-MM"

[0073] };

[0074] This can be explained through the following table:

[0075]

[0076]

[0077] Furthermore, the data structure of a specific version of settlement data that exists in all advertiser settlement data can be identified by the following code:

[0078] "version_yyyy-mm-dd-HH-MM":{

[0079] "last_version_time":"yyy-mm-dd-HH-MM"

[0080] };

[0081] This can be explained through the following table:

[0082]

[0083] Furthermore, the data structure of the current consumption position of the log queue can be identified by the following code:

[0084]

[0085]

[0086] This can be explained through the following table:

[0087]

[0088] Furthermore, the data structure of settlement data of a specific version number of an advertiser can be identified by the following code:

[0089]

[0090] Each of the above data structures contains the amount information of a certain version of the advertiser, and carries the settlement information of the previous version, which can be explained by the content in the following table:

[0091]

[0092] For example, suppose there are three advertisers, owner1, owner2, and owner3. The last updated settlement version number was completed at 20:10 on 2019-10-30. This version is stored in centralized storage. Based on the above data structure, the following information can be written:

[0093]

[0094]

[0095] First, according to the current_version field in the initial state of the settlement data, the version number of the current settlement data can be obtained as 2019-10-30-20-10. Then, according to this version number, the queue information queue_2019-10-30-20-10 content is obtained, and the position of the queue name 0 is obtained as 1000. At the same time, the settlement data of the advertiser owner1 ad_owner_id_owner1_2019-10-30-20-10 is obtained as [deposit=20, deduction=10], the settlement data of owner2 ad_owner_id_owner2_2019-10-30-20-10 is obtained as [deposit=100, deduction=5], and the settlement data of owner3 ad_owner_id_owner3_2019-10-30-20-10 is obtained as [deposit=300, deduction=15].

[0096] It should be noted that the advertiser settlement data uses version numbers to distinguish each version of the data. You can get the latest version of the data based on current_version. There is a last_version_time field, which is similar to a chain storage structure. You can use the last_version_time field to trace back the settlement information of each advertiser at each point in time, which is helpful for tracing the settlement history of the advertiser and facilitating multi-dimensional data monitoring.

[0097] As for step S220, it should be noted that the settlement data in the embodiment of the present application is processed in a data isolation manner, that is, before deducting fees from the advertiser, the settlement data of the advertiser's latest unsubmitted version is first copied, and then the settlement processing is performed on the copied settlement data, and a new version number is set after success. The advantages are: the data isolation method can completely avoid data interference, that is, the submitted and unsubmitted versions, the setting of the version number can allow multiple versions of the same advertising account to exist, and whether to submit data can be determined based on the transaction execution result. If the settlement operation is successful, the new version can be submitted, and if the settlement operation fails, the new version can be discarded. Strict physical isolation is achieved between the new and old versions, and different operations can be performed in parallel on the new and old versions, which can improve throughput and resource utilization, that is, data persistence, data query and data settlement can run in parallel, data persistence and data query are IO operations, and data settlement is CPU operation. By using CPU and IO operations in parallel, multiple transactions can be executed in parallel.

[0098] Regarding step S230, it should be noted that the steps of performing settlement processing are not limited and can be set according to actual application requirements. For example, in an alternative example, the copied settlement data includes multiple logs, and step S230 may include the step of performing aggregation processing. Figure 2 On the basis of Figure 3 For a flow chart of another data processing method provided in an embodiment of the present application, see Figure 3 , step S230 may include:

[0099] Step S231, performing aggregation processing on multiple logs.

[0100] Step S232, performing settlement processing on the replicated settlement data after aggregation processing to obtain a settlement processing result.

[0101] It should be noted that the aggregation processing step can be before the copy processing operation, first the settlement data to be processed is aggregated and then copied to obtain the copied settlement data; the aggregation processing step can be after the copy processing operation, first the settlement data to be processed is copied to obtain the copied settlement data, and then the copied settlement data is aggregated.

[0102] Regarding step S231, it should be noted that the step of performing the aggregation processing is not limited and can be set according to actual application requirements. For example, in an alternative example, the log includes a settlement subject, and step S231 may include a step of performing the aggregation processing according to the settlement subject. Figure 3 On the basis of Figure 4 For a flow chart of another data processing method provided in an embodiment of the present application, see Figure 4 , step S231 may include:

[0103] Step S2311, obtain the settlement entity of each log.

[0104] Step S2312: Aggregate multiple logs according to the settlement entity.

[0105] In detail, 10 advertising exposure logs are obtained in batches starting from the queue name 0, belonging to three advertisers: owner1, owner2, owner3. The exposure logs are stored in the message queue in the following order [owner1, owner2, owner3, owner3, owner1, owner1, owner2, owner2, owner2, owner1], and the exposure logs are numbered in the message queue queue1 as order = [1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009, 1010]. Then, the 10 exposure logs are aggregated according to owner and the corresponding queue information is recorded. The results are as follows: [owner1, cost = 40, queue1, max_order = 1010], [owner2, cost = 80, queue1, max_order = 1009], [owner3, cost = 60, queue1, max_order = 1004].

[0106] Regarding step S232, it should be noted that the step of performing the settlement processing is not limited and can be set according to actual application requirements. For example, in an alternative example, step S232 may include a step of performing the settlement processing according to the preset processing information. Figure 3 On the basis of Figure 5 For a flow chart of another data processing method provided in an embodiment of the present application, see Figure 5 , step S232 may include:

[0107] Step S2321, for each settlement entity, obtain the preset processing information of the settlement entity.

[0108] Step S2322: Perform settlement processing on the copied settlement data belonging to the settlement entity according to the preset processing information of the settlement entity to obtain a settlement processing result.

[0109] In detail, the preset processing information represents the deduction of each advertiser. The deduction of advertiser owner1 can be 10, the deduction of advertiser owner,2 can be 20, and the deduction of advertiser owner3 can be 30. When all advertisers are updated, the version number of the advertiser information can be upgraded as follows:

[0110] "version_2019-10-30-20-20":{

[0111] "last_version_time":"2019-10-30-20-10";

[0112] };

[0113] Also set the overall version number:

[0114] "current_version":{

[0115] "current_version_time":"2019-10-30-20-20"

[0116] }

[0117] That is to say, the settlement process uses batch processing of exposure logs, that is, batch acquisition of logs from the exposure log message queue, and then after aggregation, deduction of fees from the corresponding advertisers. Each time a batch of logs is acquired from the message queue, until the deduction of fees for all advertisers involved in this batch of logs is completed, this is a transaction operation. The reason why it cannot be split is that only when the logs acquired in this batch are billed and the advertiser deduction is completed, these logs can be considered to be truly settled. At the same time, the latest position of each advertiser's log in the log queue must also be updated. Only by comparing the latest positions of all advertisers in the log queue can the settlement service consume the latest position of the queue. Therefore, either the advertisers involved in this batch of logs are deducted successfully at the same time and the log queue information is updated successfully, or no advertiser is updated, so as to avoid the failure of an advertiser to update, resulting in missed billing or repeated billing of some logs in the log queue. If the settlement is successful, the advertiser data and transaction ID updated in this settlement are stored in the transaction queue to be submitted, that is, the submission of the updated advertiser data is atomic and indivisible.

[0118] It should be noted that, after step S230, the data processing method provided in the embodiment of the present application may further include a step of storing data. Figure 2 On the basis of Figure 6For a flow chart of another data processing method provided in an embodiment of the present application, see Figure 6 , the data processing method may further include:

[0119] Step S240, storing the copied settlement data after settlement processing.

[0120] In detail, the processed data structure in the memory can be persisted to the centralized storage. The difference between the settlement transaction submission (i.e., data storage) and the general database transaction submission in the present embodiment is that the general database transaction submission refers to persisting only the uncommitted data to the disk, while the present embodiment of the application regards the entire data structure as a whole and persists it to the centralized memory, which can ensure that each successfully persisted data structure is a complete settlement data snapshot, and each successfully persisted data structure can be used as a recovery point for settlement data recovery.

[0121] Among them, the settlement data persistence (storage) process is: the persistence module included in the server 100 will perform data persistence work at regular intervals. First, it obtains the pending transactions from the pending transaction queue (the copied settlement data after settlement processing). Each transaction contains four data structures: first, the data update version of multiple advertisers at a certain point in time; second, the data update version of the queue at a certain point in time; third, the version number information of the overall data; fourth, the version number information of the current version.

[0122] Furthermore, the persistence step is also divided into four steps: the first step is to persist multiple advertiser data update versions to the centralized memory; the second step is to persist the queue update version data to the centralized memory; the third step is to persist the overall version number data to the centralized memory; the fourth step is to persist the current version data to the centralized memory.

[0123] The above persistence steps are a transaction process. If any step fails, it means that the transaction execution has failed and you can exit the subsequent persistence process midway. Even if a failure occurs, it will not affect the existing data because the version content is determined based on the current version current_version when the data is restored.

[0124] It should be noted that, after step S230, the data processing method provided in the embodiment of the present application may further include a step of processing the missed deduction situation. Figure 2 On the basis of Figure 7 For a flow chart of another data processing method provided in an embodiment of the present application, see Figure 7 , the data processing method may further include:

[0125] Step S250, determining whether the settlement processing result includes the result of each log.

[0126] In the embodiment of the present application, when the settlement processing result includes the result of each log, it is determined that the settlement processing is correct; when the settlement processing result does not include the result of each log, it is determined that the settlement processing is wrong, and step S260 is executed.

[0127] Step S260, obtaining the settlement data to be processed, performing settlement processing on the settlement data to be processed, and obtaining a new settlement processing result.

[0128] In detail, when the advertising settlement service is restarted, the last successfully updated version can be found according to current_version to obtain the overall data version number, and then the settlement data under the version number can be obtained according to the version number. At the same time, the data of all advertisers under the version number can be obtained according to the version number. When these data are obtained, the loading of all advertiser account information and exposure log queue information is completed. Even if a certain version of a data fails to be submitted when the above transaction is submitted, it is only the newly added version information that fails to be submitted, which will not affect the existing version information, and as long as the current_version is not destroyed, the complete settlement snapshot information can be obtained according to the version number.

[0129] It should be noted that, after step S230, the data processing method provided in the embodiment of the present application may further include a step of processing repeated deductions. Figure 2 On the basis of Figure 8 For a flow chart of another data processing method provided in an embodiment of the present application, see Figure 8 , the data processing method may further include:

[0130] Step S270, determining whether the settlement processing result is repeated.

[0131] In the embodiment of the present application, when it is determined that the settlement processing results are not repeated, it is determined that the settlement processing is correct; when it is determined that the settlement processing results are repeated, it is determined that the settlement processing is wrong, and step S280 is executed.

[0132] Step S280, obtaining the settlement data to be processed, performing settlement processing on the settlement data to be processed, and obtaining a new settlement processing result.

[0133] In detail, the specific steps of step S280 can refer to the specific description of step S260 above, which will not be repeated here.

[0134] Combination Fig. 9The embodiment of the present application further provides a data processing device 900, and the functions implemented by the data processing device 900 correspond to the steps performed by the above method. The data processing device 900 can be understood as the processor of the above server 100, or can be understood as a component independent of the above server 100 or the processor that implements the functions of the present application under the control of the server 100. The data processing device 900 may include a data acquisition module 910, a replication processing module 920, and a settlement processing module 930.

[0135] The data acquisition module 910 is used to obtain the settlement data to be processed in response to the settlement processing signal. In the embodiment of the present application, the data acquisition module 910 can be used to execute Figure 2 As shown in step S210, the relevant contents of the data acquisition module 910 can refer to the above description of step S210.

[0136] The copy processing module 920 is used to copy the settlement data to be processed to obtain the copied settlement data in a preset format. Figure 2 As shown in step S220, the relevant contents of the replication processing module 920 can refer to the above description of step S220.

[0137] The settlement processing module 930 is used to perform settlement processing on the copied settlement data to obtain a settlement processing result. In the embodiment of the present application, the settlement processing module 930 can be used to execute Figure 2 As shown in step S230, the relevant contents of the settlement processing module 930 can refer to the description of step S230 above.

[0138] In addition, an embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned data processing method are executed.

[0139] To sum up, the computer program product of the data processing method provided in the embodiment of the present application includes a computer-readable storage medium storing program code. The instructions included in the program code can be used to execute the steps of the data processing method in the above method embodiment. For details, please refer to the above method embodiment, which will not be repeated here.

[0140] The data processing method and device, server 100 and storage medium provided in the embodiments of the present application copy and process the settlement data to be processed to obtain copied settlement data in a preset format, perform settlement processing on the copied settlement data, and obtain a settlement processing result, thereby realizing settlement processing on the copied copied settlement data in the preset format, thereby improving the problem of low reliability of settlement processing in the prior art, which may result in partial success and partial failure when performing update operations directly based on the original settlement data.

[0141] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic, for example, the flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to the embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and a module, a program segment or a part of a code contains one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or the flowchart, and the combination of boxes in the block diagram and / or the flowchart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.

[0142] In addition, the functional modules in the various embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.

[0143] If the function is implemented in the form of a software function module and 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 the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server 100, or network device, etc.) to perform all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc., which can store program code.

[0144] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "includes a ..." does not exclude the presence of other identical elements in the process, method, article or device including the element.

[0145] The above are only preferred embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims

1. A data processing method, characterized in that: include: In response to the settlement processing signal, obtaining settlement data to be processed; Copying the settlement data to be processed to obtain copied settlement data in a preset format; The replicated settlement data includes a plurality of logs, and the logs include a settlement subject; Performing settlement processing on the copied settlement data to obtain a settlement processing result; Get pending transactions from the pending transaction queue; The pending transaction queue stores the copied settlement data after settlement processing; The transaction to be submitted includes four data structures: data update versions of multiple settlement entities, data update versions of log queues, version number information of overall data, and version number information of the current version; Persisting the updated data versions of the multiple settlement entities, the updated data versions of the log queue, the version number information of the overall data, and the version number information of the current version in a centralized memory in sequence; The method further comprises: Determine whether the settlement processing result includes the result of each settlement entity; if not, obtain the settlement data to be processed, perform settlement processing on the settlement data to be processed, and obtain a new settlement processing result; or, determine whether the settlement processing result is repeated; if so, obtain the settlement data to be processed, perform settlement processing on the settlement data to be processed, and obtain a new settlement processing result; Among them, the step of performing settlement processing on the pending settlement data to obtain a new settlement processing result includes: searching for the last successfully updated version according to the current_version field in the data update versions of the persisted multiple settlement entities, and obtaining the overall data version number in the version number information of the persisted overall data; obtaining the settlement data of the overall data version number from the pending settlement data according to the overall data version number, and obtaining the data of all settlement entities under the overall data version number according to the overall data version number, so as to perform settlement processing to obtain a new settlement processing result.

2. The data processing method according to claim 1, characterized in that: The step of performing settlement processing on the copied settlement data to obtain a settlement processing result comprises: Aggregate the multiple logs; Settlement processing is performed on the replicated settlement data after aggregation processing to obtain a settlement processing result.

3. The data processing method according to claim 2, characterized in that The step of aggregating the multiple logs includes: Get the settlement entity of each log; Aggregate the multiple logs according to the settlement entity.

4. The data processing method according to claim 3, characterized in that: The step of performing settlement processing on the aggregated replicated settlement data to obtain a settlement processing result includes: For each settlement entity, obtain the preset processing information of the settlement entity; The copied settlement data belonging to the settlement subject is subjected to settlement processing according to the preset processing information of the settlement subject to obtain a settlement processing result.

5. A data processing device, characterized in that: include: A data acquisition module, used for acquiring settlement data to be processed in response to a settlement processing signal; A copy processing module, used for copying the settlement data to be processed to obtain copied settlement data in a preset format; the copied settlement data includes a plurality of logs, and the logs include a settlement subject; A settlement processing module, used to: perform settlement processing on the copied settlement data to obtain a settlement processing result; Get pending transactions from the pending transaction queue; The pending transaction queue stores the copied settlement data after settlement processing; The transaction to be submitted includes four data structures: data update versions of multiple settlement entities, data update versions of log queues, version number information of overall data, and version number information of the current version; the data update versions of the multiple settlement entities, the data update versions of the log queues, the version number information of the overall data, and the version number information of the current version are sequentially persisted to the centralized memory; The settlement processing module is further used for: Determine whether the settlement processing result includes the result of each settlement entity; if not, obtain the settlement data to be processed, perform settlement processing on the settlement data to be processed, and obtain a new settlement processing result; or, determine whether the settlement processing result is repeated; if so, obtain the settlement data to be processed, perform settlement processing on the settlement data to be processed, and obtain a new settlement processing result; Among them, the step of performing settlement processing on the pending settlement data to obtain a new settlement processing result includes: searching for the last successfully updated version according to the current_version field in the data update versions of the persisted multiple settlement entities, and obtaining the overall data version number in the version number information of the persisted overall data; obtaining the settlement data of the overall data version number from the pending settlement data according to the overall data version number, and obtaining the data of all settlement entities under the overall data version number according to the overall data version number, so as to perform settlement processing to obtain a new settlement processing result.

6. A server, characterized in that: It comprises a memory and a processor, wherein the processor is used to execute an executable computer program stored in the memory to implement the data processing method according to any one of claims 1 to 4.

7. A storage medium, characterized in that: A computer program is stored thereon, and when the program is executed, the steps of the data processing method described in any one of claims 1 to 4 are implemented.