Marketing activity-based data processing method and device, equipment and storage medium
Patent Information
- Application Number
- CN202511544120.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-27
- Publication Date
- 2026-01-30
AI Technical Summary
In offline environments, it is difficult to accurately reproduce the progress of marketing campaigns, resulting in low system development efficiency and difficulty in problem localization. Existing technologies lack full lifecycle records of budget status and cannot guarantee that the operation sequence is consistent with the production environment.
By acquiring mirror log messages and communication messages in the online environment, replay processing is performed in the offline environment to generate replay results to restore the operation progress of the marketing campaign. Sequence information is used to ensure timing consistency, and mirror log messages are generated to characterize the operation progress of the marketing campaign.
It improves the precision of marketing data processing and the accuracy of system testing, reduces the deviation between offline and online environments, and is conducive to the improvement of marketing activities.
Smart Images

Figure CN121437031A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of communication, and in particular to a data processing method and device based on a marketing activity, an equipment and a storage medium. BACKGROUND
[0002] In a marketing activity budget management and a financial transaction system, and other scenarios that need to check and adjust a budget in real time, an enterprise needs to monitor a budget consumption of a marketing scheme in real time to ensure that the budget is not overspent.
[0003] When transaction data of a production environment needs to be played back offline to verify system logic, the running progress of the marketing activity needs to be accurately restored. Therefore, how to accurately process data of the marketing activity in an offline environment to restore the running progress of the marketing activity is a technical problem that needs to be solved at present. SUMMARY
[0004] Embodiments of the present application provide a data processing method and device based on a marketing activity, an equipment and a storage medium to improve the processing accuracy of marketing data.
[0005] In a first aspect, embodiments of the present application provide a data processing method based on a marketing activity, comprising:
[0006] acquiring mirror log messages and communication messages of the marketing activity within a preset time period; wherein the communication messages represent transaction messages generated in response to operation requests for the marketing activity in a preset online environment; and the mirror log messages represent running progress of the marketing activity after responding to the operation requests for the marketing activity in the preset online environment;
[0007] According to the acquired mirror log messages, replay processing is performed on each communication message in a preset offline environment to obtain a replay result of the marketing activity; wherein the replay result represents changes in the running progress of the marketing activity in the preset offline environment.
[0008] In a second aspect, embodiments of the present application provide a data processing device based on a marketing activity, comprising:
[0009] a message acquisition unit configured to acquire mirror log messages and communication messages of the marketing activity within a preset time period; wherein the communication messages represent transaction messages generated in response to operation requests for the marketing activity in a preset online environment; and the mirror log messages represent running progress of the marketing activity after responding to the operation requests for the marketing activity in the preset online environment;
[0010] The message replay unit is configured to replay each communication message in a preset offline environment according to the obtained mirror log messages, and obtain a replay result of the marketing activity, wherein the replay result represents a change in the running progress of the marketing activity in the preset offline environment.
[0011] In a third aspect, an electronic device is provided, including: a memory, a processor;
[0012] The memory stores computer execution instructions.
[0013] The processor executes the computer execution instructions stored in the memory, so that the processor executes the embodiments of the first aspect.
[0014] In a fourth aspect, a computer readable storage medium is provided, and the computer readable storage medium stores computer execution instructions. When the processor executes the computer execution instructions, the computer execution instructions are used to implement the embodiments of the first aspect.
[0015] In a fifth aspect, a computer program product is provided, and the computer program product includes a computer program. When the processor executes the computer program, the computer program implements the embodiments of the first aspect.
[0016] The embodiments of the present application provide a data processing method, device and equipment based on a marketing activity and a storage medium. The marketing activity is started in a preset online environment, and a user can send an operation request to the marketing activity to perform a transaction. For each operation request, a communication message can be generated to represent the transaction. For each operation request, a mirror log message can be generated to represent the running progress of the marketing activity, thereby improving the orderliness in the marketing cycle of the marketing activity. When it is necessary to restore the marketing progress in an offline environment, mirror log messages and communication messages in a period of time can be obtained. According to the mirror log messages, the communication messages are played back in order to obtain the dynamic change of the marketing activity in the period of time. Through the restoration of the mirror log messages, the time sequence consistency of the online and offline environments can be ensured, the deviation between the replay result and the progress in the online environment can be reduced, the processing accuracy of the marketing data can be improved, and the improvement of the marketing activity is facilitated. BRIEF DESCRIPTION OF DRAWINGS
[0017] The accompanying drawings, which are incorporated herein and form part of the specification, illustrate embodiments consistent with the present application and, together with the description, further serve to explain the principles of the application.
[0018] Figure 1 A flowchart of a data processing method based on a marketing activity is provided for the embodiments of the present application.
[0019] Figure 2 A flowchart of a data processing method based on a marketing activity provided for an embodiment of the present application is shown in FIG. 1.
[0020] Figure 3 A flowchart of a data processing method based on a marketing activity provided for an embodiment of the present application is shown in FIG. 1.
[0021] Figure 4 A schematic diagram of first structure data provided for an embodiment of the present application is shown in FIG. 3.
[0022] Figure 5 A schematic diagram of a data processing device based on a marketing activity provided for an embodiment of the present application is shown in FIG. 4.
[0023] Figure 6 A schematic diagram of an electronic device provided for an embodiment of the present application is shown in FIG. 5.
[0024] The above-described embodiments of the present application have been shown by the accompanying drawings, and will be described in more detail hereinafter. The accompanying drawings and the written description are not intended to limit the scope of the present application in any way, but to explain the concept of the present application to those skilled in the art by reference to a particular embodiment. DETAILED DESCRIPTION
[0025] The exemplary embodiments will be described in detail herein below with reference to the accompanying drawings. In the following description, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments are not representative of all embodiments consistent with the present application. Rather, they are merely examples of devices and methods consistent with some aspects of the present application.
[0026] The present application can be applied to scenarios such as marketing activity budget management and financial transaction systems that require budget checking and dynamic adjustment. For example, in the scenario of marketing activity budget management, in large-scale promotional activities, enterprises need to monitor the budget consumption of marketing plans in real time to ensure that the budget is not overspent. When it is necessary to replay the transaction data of the production environment offline to verify the system logic, it is necessary to accurately restore the initial value, final value and dynamic change process of the budget. For example, in the use scenario of a financial transaction system, in real-time transactions, it is necessary to dynamically adjust key data such as account balance and transaction limit, and verify the correctness of the transaction processing logic through offline playback.
[0027] In the above scenarios, the dynamic adjustment of the budget or transaction limit, the timing consistency of multiple concurrent operations, and the accuracy of offline playback are all core requirements. Currently, it is difficult to meet these requirements during offline playback, resulting in low system development efficiency and difficulty in problem positioning.
[0028] Currently, offline playback is mainly achieved in the following ways:
[0029] The first step, data collection and desensitization. Extract the communication message (such as transaction request, response data) from the production environment, and perform desensitization to protect sensitive information.
[0030] The second step, timestamp sequence simulation. In the development environment, send the request in the order of the timestamp of the desensitized message, simulate the transaction process of the production environment.
[0031] The third step, state verification. By comparing the final state (such as budget cumulative value) of the production environment and the development environment, verify the correctness of the system logic.
[0032] However, the above method lacks full life cycle recording of the budget state, cannot handle dynamic adjustment of the budget upper limit, and cannot guarantee that the operation time sequence in the playback process is consistent with the production environment, resulting in result deviation.
[0033] The application provides a data processing method and device based on a marketing activity, equipment and storage medium, applied to the field of communication, in order to improve the restoration accuracy of the marketing activity in the offline environment, which is beneficial to improve the marketing activity.
[0034] It should be noted that the data in the embodiment is not for a specific user, and cannot reflect the personal information of a specific user. It should be noted that the data in the embodiment comes from a public data set.
[0035] In the technical scheme of the application, the collection, storage, use, processing, transmission, provision and disclosure of user personal information comply with relevant laws and regulations and do not violate public order and good customs.
[0036] In order to enable the reader to understand the implementation principle of the present disclosure more deeply, the following embodiments will be further refined.
[0037] Figure 1 A flowchart of a data processing method based on a marketing activity according to an embodiment of the application is provided. The method can be executed by a data processing device based on a marketing activity. As shown in the figure, Figure 1 The method comprises the following steps:
[0038] S101, acquiring mirror log messages and communication messages of the marketing activity in a preset time period; wherein the communication message represents a transaction message generated in response to an operation request for the marketing activity in a preset online environment; the mirror log message represents the running progress of the marketing activity after responding to the operation request for the marketing activity in the preset online environment.
[0039] Exemplarily, after developing the marketing activity, the developer can put the marketing activity online in the preset application program for users to participate in the marketing activity. The user can be a consumer or an initiator of the marketing activity, and the environment in which the user participates in the marketing activity is a production environment, that is, an online environment. The marketing activity can be a promotion activity for promoting consumption, for example, it can be an activity of 10 yuan off for every 100 yuan. When the user participates in the marketing activity, the user can initiate an operation request for the marketing activity. For example, the operation request can be that the user requests to complete a transaction, so as to complete the deduction; or the user can request to cancel the transaction in the process of the transaction, and not to deduct.
[0040] By responding to the operation request, a communication message corresponding to the operation request can be generated in real time. Each operation request can correspond to a communication message. The communication message represents a transaction message generated in response to the operation request for the marketing activity in the preset online environment. The communication message can include the user's identifier, the transaction item category, the time, the location, etc.
[0041] Each operation request can also correspond to a mirror log message. The mirror log message represents the progress of the marketing activity in response to the operation request for the marketing activity in the preset online environment. The mirror log message can include a budget upper limit value, a budget cumulative value, a budget remaining value, etc. of the marketing activity. Each marketing activity can be preset with a budget upper limit value representing the maximum value of the amount of money allowed to be consumed by the marketing activity. For example, for the activity of 10 yuan off for every 100 yuan, the budget upper limit value is 1000, that is, when the total amount of the discount reaches 1000, the activity will no longer provide discounts, that is, if 100 transactions are completed for the activity, the consumers of subsequent transactions cannot enjoy the discount of the activity. The budget cumulative value refers to how much budget has been consumed by the time the current transaction is completed. For example, after the current transaction is completed, 10 yuan of budget is consumed, and 100 yuan of budget has been consumed since the start of the activity, so the budget cumulative value is 100. The budget remaining value refers to how much budget is left to support the progress of the marketing activity. For example, the budget upper limit value is 1000, and the budget cumulative value is 100, so the budget remaining value can be the difference between the budget upper limit value and the budget cumulative value, that is, 900.
[0042] After responding to the operation request for the marketing activity, the upper limit of the budget and the current accumulated value of the budget of the marketing activity can be obtained. According to the operation request and the current accumulated value of the budget, the accumulated value of the budget after the operation request is completed is determined, so as to obtain the mirror log message corresponding to the operation request. For example, before the operation request is completed, the current accumulated value of the budget is 90, the operation request is a request for consumers to shop, and the amount of goods sold is 110. Based on the activity of 100 minus 10, the new accumulated value of the budget is 90 plus 10, that is, 100. That is, for each operation request, the accumulated value of the budget can be updated in real time, and used to generate the mirror log message of the next operation request. Through the mirror log message, the progress of the marketing activity can be determined, for example, how many transactions can be performed in the marketing activity.
[0043] When it is necessary to update or upgrade the marketing system where the marketing activity is located, the system needs to be developed and tested in an offline environment. In order to avoid the impact of system update on the marketing activity, the operation in the online environment needs to be restored in the offline environment, so as to determine whether the operation results in the offline environment are consistent with the operation results in the online environment. In order to improve the accuracy of the test, the messages generated in the online environment need to be obtained. In this embodiment, a time period can be set in advance, and the communication messages and mirror log messages generated in the time period can be obtained. If there are multiple marketing activities, the communication messages and mirror log messages of each marketing activity can be obtained.
[0044] S102, according to the obtained mirror log messages, replay processing is performed on each communication message in a preset offline environment to obtain a replay result of the marketing activity; wherein the replay result represents the change of the running progress of the marketing activity in the preset offline environment.
[0045] Exemplarily, each communication message can include a communication message primary key, which is unique identification information of the communication message. When generating the mirror log message corresponding to the operation request, the communication message primary key of the communication message corresponding to the operation request can be added to the mirror log message. The mirror log message can also include serial number information, which can represent the generation order of the mirror log message. The communication messages can be sorted according to the time in the communication message, so that the communication messages are replayed in turn. The communication messages corresponding to the mirror log messages can also be sorted according to the serial number information of the mirror log messages, so that the communication messages are replayed in turn. The communication messages are input to the marketing system in the offline environment to obtain the accumulated value of the budget corresponding to the communication messages in the offline environment. According to the accumulated values of the budget fed back by all the communication messages, the replay result of the marketing activity can be obtained, that is, the replay result can represent the dynamic change of the running progress of the marketing activity in the preset offline environment.
[0046] The feedback budget cumulative value can also be compared with the budget cumulative value in the mirror log message corresponding to the communication message to determine whether they are consistent. If they are consistent, it is considered that the marketing system test is correct; if they are not consistent, it is considered that the marketing system has a problem, which can prompt the developer to check.
[0047] The embodiment of the application provides a data processing method based on a marketing activity. In a preset online environment, a marketing activity is started, and a user can send an operation request for the marketing activity to perform a transaction. For each operation request, a communication message can be generated to represent the transaction. For each operation request, a mirror log message can also be generated to represent the running progress of the marketing activity, thereby improving the orderliness in the marketing cycle of the marketing activity. When it is necessary to restore the marketing progress in an offline environment, the mirror log message and the communication message in a period of time can be obtained, the communication message is played back in order according to the mirror log message, and the dynamic change of the marketing activity in the period of time is obtained. Through the restoration of the mirror log message, the time sequence consistency of the online and offline environments can be ensured, the deviation between the replay result and the progress in the online environment is reduced, the processing accuracy of the marketing data is improved, and the improvement of the marketing activity is facilitated.
[0048] Figure 2 A flowchart of a data processing method based on a marketing activity provided by the embodiment of the application is shown in FIG. 1. Figure 2 The embodiment of the application provides a data processing method based on a marketing activity. In a preset online environment, a marketing activity is started, and a user can send an operation request for the marketing activity to perform a transaction. For each operation request, a communication message can be generated to represent the transaction. For each operation request, a mirror log message can also be generated to represent the running progress of the marketing activity, thereby improving the orderliness in the marketing cycle of the marketing activity. When it is necessary to restore the marketing progress in an offline environment, the mirror log message and the communication message in a period of time can be obtained, the communication message is played back in order according to the mirror log message, and the dynamic change of the marketing activity in the period of time is obtained. Through the restoration of the mirror log message, the time sequence consistency of the online and offline environments can be ensured, the deviation between the replay result and the progress in the online environment is reduced, the processing accuracy of the marketing data is improved, and the improvement of the marketing activity is facilitated.
[0049] S201, based on an operation request for a marketing activity in a preset online environment, determining serial number information of the marketing activity; wherein the serial number information represents the number of operations on the marketing activity.
[0050] For example, a user participates in a marketing activity in a preset online environment, that is, a production environment, and sends an operation request for the marketing activity. The marketing system responds to the operation request, performs the operation requested by the user, and generates a communication message. The communication message can be generated in the production environment.
[0051] After responding to the operation request for the marketing activity in the production environment, the serial number information of the marketing activity can also be determined, and the serial number information represents the number of operations on the marketing activity. For example, the value of the serial number information is increased by one each time an operation request is responded to.
[0052] In this embodiment, based on the operation request for the marketing activity, the serial number information of the marketing activity is determined, including: in response to the operation request for the marketing activity, obtaining the initial serial number of the marketing activity; wherein the initial serial number represents the serial number information of the marketing activity before responding to the operation request; and performing monotonic increasing processing on the initial serial number of the marketing activity to obtain the current serial number information of the marketing activity under the operation request.
[0053] Specifically, when responding to the operation request for the marketing activity, the initial serial number of the marketing activity can be obtained, and the initial serial number refers to the serial number information of the marketing activity before responding to the operation request, i.e. the serial number information of the marketing activity after the last operation request. For the first operation request of the marketing activity, a default serial number can be obtained, for example, the default serial number is 0.
[0054] The initial serial number of the marketing activity is processed by monotonic increasing to obtain the serial number information of the marketing activity under the current operation request, i.e. the initial serial number is updated to obtain the current serial number information. For example, if the initial serial number is 0, the serial number information corresponding to the current operation request is 1. The current serial number information is also the initial serial number of the next operation request.
[0055] The beneficial effects of such setting are that each time the operation request is responded to, the monotonic increasing serial number information can be updated, the time sequence is marked by the serial number information, the subsequent operation time sequence is traceable, the time sequence consistency of online and offline environments is ensured, the accuracy of data processing is improved, and accurate testing of the marketing system is facilitated.
[0056] S202, generating the mirror log message corresponding to the operation request according to the serial number information of the marketing activity.
[0057] Illustratively, after obtaining the updated serial number information corresponding to the operation request, the mirror log message corresponding to the operation request can be generated according to the serial number information. For example, a template of the mirror log message can be preset, and the serial number information can be added to the corresponding position in the template to obtain the mirror log message. According to the serial number information, the time sequence of the mirror log message can be confirmed, so that the dynamic change of the budget during the marketing activity is determined.
[0058] In this embodiment, according to the serial number information of the marketing activity, the mirror log message corresponding to the operation request is generated, including: determining the operation type corresponding to the operation request; wherein the operation type includes at least one of completing a transaction, canceling a transaction, and changing the upper limit value of the budget of the marketing activity; and generating the mirror log message corresponding to the operation request according to the operation type corresponding to the operation request and the serial number information of the marketing activity.
[0059] Specifically, the user can issue different types of operation requests, and after responding to the operation request, the operation type corresponding to the operation request can be determined. For example, the operation type can be contained in the operation request, or the operation type can be read from the operation request. In this embodiment, the operation type can include a type of completing a transaction, a type of canceling a transaction, a type of changing a budget upper limit value of a marketing activity, and the like. The type of completing a transaction can be that a consumer requests to complete a transaction by deducting a current transaction; the type of canceling a transaction can be that a consumer requests to cancel the deduction and return to a step before the deduction; and the type of changing the budget upper limit value of the marketing activity can be that an initiator of the marketing activity changes the original budget upper limit value, for example, the original budget upper limit value of the marketing activity is quickly reached, and in order to maintain the holding time of the marketing activity, the preset upper limit value can be requested to be increased.
[0060] Different operation types can correspond to different generation logics of the mirror log message, and the corresponding generation logic is determined according to the operation type of the operation request. According to the determined generation logic, the mirror log message corresponding to the operation request is obtained. For example, the generation logic can represent a template of the mirror log message, and the serial number information is added to the corresponding template according to the determined generation logic to obtain a complete mirror log message. Each operation type corresponds to its own type identifier, and the type identifier and the serial number information can also be added to the mirror log message, that is, the mirror log message containing the monotonic serial number and the operation type is generated. For example, for the type of completing a transaction, the type identifier can be “increase”; for the type of canceling a transaction, the type identifier can be “return”; and for the type of changing the budget upper limit value of the marketing activity, the type identifier can be “upper limit”.
[0061] The beneficial effect of such a setting is that different mirror log messages can be generated for different operation types, and the mirror log message is associated with the serial number information, which improves the generation accuracy and timing of the mirror log message, and further improves the subsequent data processing accuracy.
[0062] In this embodiment, the operation type includes completing a transaction, and the mirror log message corresponding to the operation request is generated according to the operation type of the operation request and the serial number information of the marketing activity, including: if the operation type of the operation request is completing a transaction, the budget upper limit value of the marketing activity, the initial budget cumulative value, and the current discount value are obtained; wherein the initial budget cumulative value represents the budget amount consumed by the marketing activity from the start to the execution of the operation request, the current discount value represents the budget amount consumed in the operation request, and the budget upper limit value represents the maximum value of the amount allowed to be consumed in the marketing activity; and the mirror log message corresponding to the operation request is generated according to the budget upper limit value of the marketing activity, the initial budget cumulative value, the current discount value, and the serial number information.
[0063] Specifically, each marketing activity is preset with a budget upper limit value representing a maximum value of an amount allowed to be consumed in the marketing activity. For the operation type of completing a transaction, the budget upper limit value of the marketing activity can be acquired when the mirror log message is generated. In addition, the initial budget cumulative value, the current discount value, and the serial number information of the marketing activity corresponding to the operation request can also be acquired. The budget cumulative value represents the budget amount consumed by the marketing activity from the start to the current time, and the initial budget cumulative value is the budget amount consumed by the marketing activity before the operation request is executed. The current discount value represents the budget amount consumed in the operation request. For example, for a marketing activity of full 100 yuan minus 10 yuan, when the user completes a transaction of 100 yuan, the current discount value is 10.
[0064] According to the current budget upper limit value, the initial budget cumulative value, the current discount value, and the serial number information of the marketing activity corresponding to the operation request, the mirror log message corresponding to the operation request is generated. That is, the budget upper limit value, the initial budget cumulative value, the current discount value, and the serial number information can be included in the mirror log message.
[0065] The beneficial effect of such a setting is that the operation type of completing a transaction is a positive transaction, and for the positive transaction, the discount amount of the current transaction, the initial cumulative value, and the preset upper limit value can be acquired, and these data are included in the mirror log message to generate the mirror log message for the current transaction, thereby improving the determination accuracy of the mirror log message.
[0066] In this embodiment, the mirror log message corresponding to the operation request is generated according to the budget upper limit value, the initial budget cumulative value, the current discount value, and the serial number information of the marketing activity, including: determining the sum of the initial budget cumulative value and the current discount value; if the sum is less than or equal to the budget upper limit value, acquiring the identification information of the marketing activity and the identification information of the communication message corresponding to the operation request; and generating the mirror log message corresponding to the operation request according to the operation type, the identification information of the marketing activity, the identification information of the communication message corresponding to the operation request, the serial number information, and the initial budget cumulative value.
[0067] Specifically, if the operation type is completing a transaction, the initial budget cumulative value, that is, the budget cumulative value after the last operation request, can be acquired. In this embodiment, the initial budget cumulative value can be referred to as an initial cumulative value. When the operation request is responded for the first time, the initial cumulative value is 0.
[0068] For the operation request of completing transaction, a sum value of a current initial accumulated value and a current discount value is determined. It is judged whether the sum value is less than or equal to the upper limit value of the budget. If yes, the budget accumulated value can be updated according to the current discount value and the initial accumulated value, so as to obtain the initial accumulated value of the next operation request. In addition, the identification information of the marketing activity and the identification information of the communication message corresponding to the operation request can also be obtained. That is, each marketing activity corresponds to unique identification information, i.e. the scheme number of the marketing activity; and each communication message also corresponds to unique identification information, i.e. the communication message primary key.
[0069] According to the operation type, the identification information of the marketing activity, the identification information of the communication message corresponding to the operation request, the serial number information, and the initial budget accumulated value, the mirror log message corresponding to the operation request is generated. That is, the operation type, the identification information of the marketing activity, the identification information of the communication message corresponding to the operation request, the serial number information, and the initial budget accumulated value can be represented in the mirror log message. The operation type can be represented by a budget consumption flag. For the type of completing transaction, the budget consumption flag is "increase". For example, the budget consumption flag "increase", the communication message primary key of the current transaction, the marketing activity scheme number, the initial accumulated value before updating, and the upper limit value of the budget can be assembled into JSON format information, and output as the mirror log message.
[0070] If the sum value is greater than the upper limit value of the budget, the budget accumulated value does not need to be updated, and the monotonic serial number information does not need to be modified. That is, if the upper limit value of the budget is exceeded, the mirror log message does not need to be assembled and output.
[0071] The beneficial effects of such setting are that for the type of completing transaction, the mirror log message is generated by the corresponding message generation strategy, the information in the message is avoided to be omitted, and the accuracy of data processing is improved.
[0072] In the embodiment, the operation type includes canceling transaction. According to the operation type of the operation request and the serial number information of the marketing activity, the mirror log message corresponding to the operation request is generated, including: if the operation type of the operation request is canceling transaction, the identification information of the marketing activity and the identification information of the communication message corresponding to the operation request are obtained; according to the operation type, the identification information of the marketing activity, the identification information of the communication message corresponding to the operation request, and the serial number information, the mirror log message corresponding to the operation request is generated.
[0073] Specifically, for the operation type of canceling transaction, when the mirror log message is generated, the identification information of the marketing activity and the identification information of the communication message corresponding to the operation request can be obtained, i.e. the scheme number of the marketing activity and the corresponding communication message primary key.
[0074] The canceling transaction is a reverse transaction, which is usually after a forward transaction, for example, a user first makes a transaction and then makes a refund. If it is determined that the user makes a reverse transaction, the budget cumulative value of the original transaction needs to be rolled back. The budget cumulative value of the original transaction is the cumulative value obtained by the user completing the transaction on the basis of the initial cumulative value and the current discount value on the machine. Now the user cancels the transaction, and the budget cumulative value needs to be reduced by the current discount value in the last operation request, that is, the budget cumulative value is rolled back.
[0075] According to the operation type, the identification information of the marketing activity, the identification information of the communication message corresponding to the operation request, and the serial number information, the mirror log message corresponding to the operation request is generated. That is, the mirror log message can represent the operation type, the identification information of the marketing activity, the identification information of the communication message corresponding to the operation request, and the serial number information. The operation type can be represented by the budget consumption flag. For the type of canceling transaction, the budget consumption flag is “rollback”. For example, the budget consumption flag “rollback”, the communication message primary key of the current transaction, the marketing activity scheme number, and the monotonic serial number can be assembled into JSON format information, and output as a mirror log message. At this time, the fields of the initial cumulative value and the budget upper limit value are empty, so additional operations are not needed to obtain the initial cumulative value and the budget upper limit value before rollback.
[0076] The beneficial effect of such setting is that for the type of canceling transaction, the mirror log message is generated by the corresponding message generation strategy, which is targeted to avoid information omission and redundancy in the message, and improves the accuracy of data processing.
[0077] In this embodiment, the operation type includes changing the budget upper limit value of the marketing activity; according to the operation type of the operation request and the serial number information of the marketing activity, the mirror log message corresponding to the operation request is generated, including: if the operation type of the operation request is to change the budget upper limit value of the marketing activity, the identification information of the marketing activity is obtained; according to the operation type, the identification information of the marketing activity, the serial number information, and the changed budget upper limit value, the mirror log message corresponding to the operation request is generated.
[0078] Specifically, for the operation type of changing the budget upper limit value of the marketing activity, the identification information of the marketing activity can be obtained when generating the mirror log message, that is, the scheme number of the marketing activity is obtained. Since the budget upper limit value is changed, the changed budget upper limit value can also be obtained.
[0079] According to the operation type, the identification information of the marketing activity, the serial number information, and the changed budget upper limit value, a mirror log message corresponding to the operation request is generated. That is, the mirror log message can represent the operation type, the identification information of the marketing activity, the serial number information, and the changed budget upper limit value. The operation type can be represented by a budget consumption flag. For the type of changing the budget upper limit value of the marketing activity, the budget consumption flag is "upper limit". For example, the budget consumption flag "upper limit", the marketing activity plan number, the monotonic serial number, and the changed budget upper limit value can be assembled into JSON format information, and output as a mirror log message. The operation of changing the budget upper limit value is requested by the initiator of the marketing activity, not the transaction operation performed by the consumer, so there is no corresponding communication message primary key and no initial cumulative value. That is, in the mirror log message of changing the upper limit value, the communication message primary key and the initial cumulative value are empty.
[0080] The beneficial effect of such a setting is that for the type of changing the budget upper limit value, the mirror log message is generated by the corresponding message generation strategy, which is targeted to avoid information omission and redundancy in the message, and improves the accuracy of data processing.
[0081] S203, acquire mirror log messages and communication messages of the marketing activity in a preset time period; wherein the communication message represents a transaction message generated in response to an operation request for the marketing activity in a preset online environment; and the mirror log message represents the running progress of the marketing activity after the operation request for the marketing activity in the preset online environment.
[0082] By way of example, this step can refer to step S101 described above, and will not be described again.
[0083] S204, according to each mirror log message acquired, replay processing is performed on each communication message in a preset offline environment to obtain a replay result of the marketing activity; wherein the replay result represents the change of the running progress of the marketing activity in the preset offline environment.
[0084] By way of example, this step can refer to step S102 described above, and will not be described again.
[0085] The embodiment of the present application provides a data processing method based on a marketing activity, a marketing activity is started in a preset online environment, a user can send an operation request to the marketing activity to perform a transaction. For each operation request, a communication message can be generated to represent the transaction. A mirror log message can also be generated for each operation request, and the mirror log message can represent the running progress of the marketing activity, thereby improving the orderliness in the marketing cycle of the marketing activity. When it is necessary to restore the marketing progress in an offline environment, the mirror log message and the communication message in a period of time can be acquired, the communication message is played back in order according to the mirror log message, and the dynamic change of the marketing activity in the period of time is obtained. The restoration through the mirror log message can ensure the time sequence consistency of the online and offline, reduce the deviation of the replay result and the progress in the online environment, improve the processing accuracy of the marketing data, and is beneficial to the improvement of the marketing activity.
[0086] Figure 3 A flowchart of a data processing method based on a marketing activity provided by the embodiment of the present application is shown in FIG. 1. Figure 3 The embodiment of the present application provides a data processing method based on a marketing activity, a marketing activity is started in a preset online environment, a user can send an operation request to the marketing activity to perform a transaction. For each operation request, a communication message can be generated to represent the transaction. A mirror log message can also be generated for each operation request, and the mirror log message can represent the running progress of the marketing activity, thereby improving the orderliness in the marketing cycle of the marketing activity. When it is necessary to restore the marketing progress in an offline environment, the mirror log message and the communication message in a period of time can be acquired, the communication message is played back in order according to the mirror log message, and the dynamic change of the marketing activity in the period of time is obtained. The restoration through the mirror log message can ensure the time sequence consistency of the online and offline, reduce the deviation of the replay result and the progress in the online environment, improve the processing accuracy of the marketing data, and is beneficial to the improvement of the marketing activity.
[0087] S301, acquiring a mirror log message and a communication message of the marketing activity in a preset time period; wherein the communication message represents a transaction message generated in response to an operation request to the marketing activity in a preset online environment; and the mirror log message represents the running progress of the marketing activity in response to the operation request to the marketing activity in the preset online environment.
[0088] The embodiment of the present application provides a data processing method based on a marketing activity, a marketing activity is started in a preset online environment, a user can send an operation request to the marketing activity to perform a transaction. For each operation request, a communication message can be generated to represent the transaction. A mirror log message can also be generated for each operation request, and the mirror log message can represent the running progress of the marketing activity, thereby improving the orderliness in the marketing cycle of the marketing activity. When it is necessary to restore the marketing progress in an offline environment, the mirror log message and the communication message in a period of time can be acquired, the communication message is played back in order according to the mirror log message, and the dynamic change of the marketing activity in the period of time is obtained. The restoration through the mirror log message can ensure the time sequence consistency of the online and offline, reduce the deviation of the replay result and the progress in the online environment, improve the processing accuracy of the marketing data, and is beneficial to the improvement of the marketing activity.
[0089] S302, generating first structure data according to each mirror log message in the preset time period; wherein the first structure data is in the form of an ordered tree, the first structure data includes a plurality of nodes, and the nodes correspond one by one to the mirror log messages in the preset time period.
[0090] The embodiment of the present application provides a data processing method based on a marketing activity, a marketing activity is started in a preset online environment, a user can send an operation request to the marketing activity to perform a transaction. For each operation request, a communication message can be generated to represent the transaction. A mirror log message can also be generated for each operation request, and the mirror log message can represent the running progress of the marketing activity, thereby improving the orderliness in the marketing cycle of the marketing activity. When it is necessary to restore the marketing progress in an offline environment, the mirror log message and the communication message in a period of time can be acquired, the communication message is played back in order according to the mirror log message, and the dynamic change of the marketing activity in the period of time is obtained. The restoration through the mirror log message can ensure the time sequence consistency of the online and offline, reduce the deviation of the replay result and the progress in the online environment, improve the processing accuracy of the marketing data, and is beneficial to the improvement of the marketing activity.
[0091] The mirror log message contains identification information of the marketing activity. The identification information of the marketing activity is obtained from the mirror log message, and the mirror log messages belonging to the same marketing activity are determined. The mirror log messages are taken as multiple nodes to form an ordered tree. For example, the mirror log messages can be taken as nodes in sequence according to the generation time of the mirror log messages. According to the order of the generation time, the nodes corresponding to the mirror log messages can be arranged from top to bottom and from left to right, so as to generate the ordered tree.
[0092] In this embodiment, the first structure data is generated according to each mirror log message in a preset time period, including: obtaining serial number information from each mirror log message in the preset time period; and performing node sorting processing of the ordered tree according to the serial number information of each mirror log message to obtain the first structure data.
[0093] Specifically, the information necessarily contained in the mirror log message is serial number information, which is a monotonically increasing serial number and can represent the order of the operation request corresponding to the mirror log message. Therefore, the arrangement order of the mirror log message as a node in the ordered tree can be determined according to the serial number information.
[0094] For each mirror log message belonging to the same marketing activity in a preset time period, serial number information is obtained from the mirror log message. According to the serial number information of each mirror log message, the mirror log messages are sorted, and each mirror log message corresponds to a node, that is, the nodes in the ordered tree are sorted to obtain the first structure data, that is, the ordered tree. Figure 4 The first structure data is shown in the schematic diagram. Figure 4 The first structure data includes five nodes, and the numbers in each node represent the serial number information in the mirror log message.
[0095] Each marketing activity can correspond to a first structure data, and the marketing activity and the corresponding first structure data can be associated and stored as a KV (Key-Value, key-value pair) structure. The identification information of the marketing activity can be taken as K, and the first structure data can be taken as V. After obtaining a new mirror log message, the identification information of the marketing activity can be obtained from the mirror log message, and it is determined whether the KV structure corresponding to the identification information exists. If the KV structure exists, the mirror log message is taken as a new node of the ordered tree in the KV structure; if the KV structure does not exist, a new ordered tree is created, and the ordered tree and the identification information of the marketing activity are established as a KV structure. The mirror log message is the first node in the ordered tree.
[0096] In the embodiment, when the node ordering processing of the ordered tree is performed, the operation type in each mirror log message can also be determined, that is, the budget consumption flag is determined. According to the sequence number information and the operation table type of each mirror log message, the first structure data is determined. If the operation type of the mirror log message is to complete a transaction or to change the upper limit value of the budget of a marketing activity, that is, if the budget consumption flag is “increase” or “upper limit”, according to the time sequence information, the mirror log message is put into the ordered tree corresponding to the marketing activity; if the operation type of the mirror log message is to cancel a transaction, that is, if the budget consumption flag is “backtracking”, the mirror log message is discarded, that is, the mirror log message is not put into the ordered tree corresponding to the marketing activity, so as to ensure the ordered change of the budget cumulative value in the ordered tree.
[0097] The beneficial effect of such a setting is that the ordered tree is constructed according to the sequence order, the complete change chain of the budget cumulative value is restored, the strict time sequence within a single activity is ensured, and the accuracy of subsequent data processing is improved.
[0098] S303, for each communication message in a preset time period, determine, from each mirror log message in the preset time period, a mirror log message corresponding to the communication message.
[0099] For example, the primary key in the communication message is the identification information of the communication message, and each communication message has its own identification information. For operation requests with operation types of completing a transaction and canceling a transaction, the mirror log message contains the identification information of the corresponding communication message. For each communication message in a preset time period, the matching relationship between the communication message and the mirror log message in the preset period can be determined according to the identification information of the communication message and the identification information of the communication message contained in the mirror log message. That is, for each communication message in a preset time period, a mirror log message corresponding to the communication message can be determined from each mirror log message in the preset time period.
[0100] In the embodiment, the mirror log message includes a first identification, a second identification, and sequence number information, the first identification represents the identification information of the marketing activity to which the mirror log message corresponds, and the second identification represents the identification information of the communication message corresponding to the operation request when the mirror log message is generated; for each communication message in a preset time period, a mirror log message corresponding to the communication message is determined from each mirror log message in the preset time period, including: for each mirror log message in the preset time period, the second identification is parsed from the mirror log message; for each communication message in the preset time period, the identification information of the communication message is determined; if the identification information of the communication message is consistent with the second identification in the mirror log message, the mirror log message is determined as the mirror log message corresponding to the communication message.
[0101] Specifically, for each mirror log message, the first identifier, the second identifier, and the sequence number information can be contained. The first identifier is the identifier information of the marketing activity when the mirror log message is generated, and the second identifier is the identifier information of the corresponding communication message when the mirror log message is generated. For the operation request of the operation type of changing the upper limit value of the budget of the marketing activity, the second identifier in the mirror log message can be a null field.
[0102] For each marketing activity, for each mirror log message in a preset time period, the second identifier is parsed from the mirror log message. For each communication message in the preset time period, the identifier information of the communication message is parsed from the communication message. The identifier information of each communication message is compared with the second identifier of each mirror log message. If the identifier information of a communication message is consistent with the second identifier in a mirror log message, it is determined that the communication message and the mirror log message have a matching relationship, that is, the mirror log message is determined as the mirror log message corresponding to the communication message.
[0103] In this embodiment, before matching the communication message and the mirror log message, the mirror log messages in the preset time period can be screened first, and the screened mirror log messages are matched with the communication message. For example, it can be determined whether the mirror log message is discarded, and whether the budget consumption flag is not equal to "upper limit". If so, the mirror log message is matched; if the mirror log message is discarded, or the budget consumption flag is equal to "upper limit", the mirror log message is not matched.
[0104] The beneficial effect of such a setting is that the association between the mirror log message and the communication message is determined, which facilitates the sequential playback of the communication message according to the time sequence between the mirror log messages, realizes the accurate restoration of the operation request, and improves the test accuracy of the marketing system.
[0105] S304, determining the second structure data corresponding to the communication message according to the communication message and the mirror log message corresponding to the communication message; wherein the second structure data is in the form of key-value pair, the key represents the identifier information of the communication message, and the value represents the communication message and the corresponding mirror log message.
[0106] Exemplarily, each communication message can correspond to generate a second structured data in the form of a key-value pair. The key in the second structured data is the identification information of the communication message, and the value in the second structured data represents the message information of the communication message and the information in the corresponding mirror log message. For example, a key-value pair structure can be generated according to the communication message, the identification information of the communication message is determined as the Key, and the specific message information of the communication message is determined as part of the Value. After the association relationship between the communication message and the mirror log message is determined, the corresponding mirror log message is added to the Value of the communication message to obtain the complete second structured data.
[0107] In this embodiment, the second structured data corresponding to the communication message is determined according to the communication message and the mirror log message corresponding to the communication message, including: for each communication message in a preset time period, generating a first structured data according to the identification information of the communication message and the first identification and serial number information in the mirror log message corresponding to the communication message; wherein the key of the first structured data includes the identification information of the communication message, and the value of the first structured data includes the communication message, the first identification, and the serial number information.
[0108] Specifically, for each communication message in a preset time period, the mirror log message associated with the communication message is determined, and the first identification and serial number information are obtained from the mirror log message. The identification information of the communication message is taken as the key of the first structured data, and the specific message information of the communication message, the first identification of the mirror log message, and the serial number information are taken as the value of the first structured data, that is, the first structured data is obtained.
[0109] The beneficial effect of such setting is that for the first structured data of the communication message, the key is the transaction primary key of the communication message, and the value includes the communication message information, the marketing activity scheme number and the monotonic serial number. The communication message and the mirror log message are closely associated, which facilitates subsequent ordered playback of the communication message and improves the playback accuracy.
[0110] S305, according to the first structured data and each second structured data, sequentially performing playback processing on each communication message to obtain a playback result of the marketing activity.
[0111] Exemplarily, for each marketing activity, a first structured data and a plurality of second structured data can be obtained, for each node in the first structured data, according to the matching relationship between the mirror log message and the communication message, the second structured data corresponding to the node is determined. According to the node order in the first structured data, the communication messages in the second structured data are sequentially played back. The playback situation of all communication messages is combined to obtain the playback result of the marketing activity.
[0112] In this embodiment, each communication message is sequentially replayed according to the first structure data and each second structure data to obtain a replay result of the marketing activity, including: traversing the nodes in the first structure data, determining the second structure data corresponding to the currently traversed node; replaying the communication message in the second structure data corresponding to the currently traversed node to obtain feedback information corresponding to the second structure data corresponding to the currently traversed node; wherein the feedback information represents information obtained after the communication message is traded in the preset offline environment; if it is determined that the first structure data is traversed to the preset node, the replay result of the marketing activity is determined according to the feedback information corresponding to each second structure data.
[0113] Specifically, the first structure data is in the form of an ordered tree, starting from the root node of the ordered tree, traversing each node, and determining the currently traversed node in real time. Each node represents a mirror log message, that is, each node corresponds to a second structure data. The second structure data corresponding to the currently traversed node is determined.
[0114] Each second structure data contains a communication message. Each time a node is traversed, the communication message in the second structure data corresponding to the currently traversed node is replayed, that is, the communication message can be sent to the marketing system in the offline environment, and the marketing system processes the communication message to obtain feedback information corresponding to the communication message. The feedback information represents information obtained after the communication message is traded in the preset offline environment. In this embodiment, the process of the marketing system processing the communication message is not specifically limited.
[0115] A node is preset in the first structure data, and when the preset node is traversed, the traversal can be stopped, that is, the replay process is completed, and at this time, the replay result of the marketing activity in the offline environment is obtained according to the obtained feedback information. For example, the replay result can include each feedback information. The preset node can be the last node, that is, when the last node is traversed, the communication message corresponding to the last node is not replayed.
[0116] In this embodiment, for each marketing activity, when the ordered tree corresponding to the marketing activity is traversed, the initial cumulative value of the first node in the ordered tree and the upper limit of the budget can be obtained as the playback initial cumulative value and the playback initial upper limit of the budget of the marketing activity, respectively. The playback initial cumulative value is the first budget cumulative value when replaying, and generally, the playback initial cumulative value is 0. The playback initial upper limit of the budget is the initially preset upper limit of the budget in the marketing activity.
[0117] If there are multiple marketing activities, each marketing activity corresponds to its own ordered tree. When replaying, the communication messages of each marketing activity can be initiated concurrently. For the ordered tree of a single marketing activity, the communication messages are initiated serially one by one.
[0118] Before traversal, the corresponding second structure data can be checked for each node in the ordered tree. For example, the corresponding second structure data can be determined according to the communication message primary key in the node. If the marketing activity identification information and the sequence number information of the second structure data are empty, the marketing activity identification information and the sequence number information in the mirror log message of the node are put into the corresponding second structure. If the sequence number information in the mirror log message of the node is less than the sequence number information in the second structure data, the marketing activity identification information and the sequence number information in the mirror log message are updated to the second structure. If the sequence number information in the mirror log message information of the node is greater than or equal to the sequence number information in the second structure data, the second structure data is not updated. Since a user can participate in multiple marketing activities at the same time, but there is only one sequence number information in each communication message, the sequence number information in the communication message can only be the same as the sequence number information in the mirror log message of one marketing activity, i.e., different from the sequence number information in the mirror log message of another marketing activity.
[0119] When traversing, if the budget consumption flag is "increase" or "backtracking", the corresponding second structure data is queried according to the communication message primary key in the node, and it is judged whether the marketing activity identification information and the sequence number information in the second structure data are equal to the marketing activity identification information and the sequence number information in the node. If they are equal, the communication message can be sent, and after receiving the response feedback, the next message in the ordered tree is sent. If they are not equal, the communication message is skipped, and the next message in the ordered tree is sent.
[0120] If the budget consumption flag is "upper limit", the budget upper limit value of the marketing activity scheme number in the replay environment is updated and modified according to the marketing activity scheme number and the budget upper limit value of the mirror time sequence information.
[0121] The last message of each ordered tree is not sent, i.e., the second-to-last message of the ordered tree is terminated. Because when traversing the ordered tree, the initial cumulative value in the last node of each ordered tree is obtained, which is the expected budget final state value. The budget final state value is compared with the budget cumulative value after the completion of the second-to-last transaction. If they are the same, it means that the marketing system has no problem. If there is a difference, the budget cumulative value of each communication message feedback and the initial cumulative value of the next node corresponding to the node of the communication message are compared in order according to the sequence of the sequence number information, and the specific transaction that introduces the difference is accurately obtained.
[0122] The advantage of this setup is that by traversing the ordered tree and replaying each communication message in sequence, the timing of message replay in the offline environment is ensured, the accuracy of replay is improved, and thus the testing accuracy of the marketing system in the offline environment is improved.
[0123] This application provides a data processing method based on marketing activities. A marketing activity is launched in a preset online environment, where users can issue operation requests to conduct transactions. For each operation request, a communication message can be generated to represent the transaction status. A mirror log message can also be generated for each operation request, representing the progress of the marketing activity and improving the orderliness of the marketing cycle. When it is necessary to reconstruct the marketing progress in an offline environment, mirror log messages and communication messages over a period of time can be obtained. Based on the mirror log messages, the communication messages are replayed in an orderly manner to obtain the dynamic changes of the marketing activity during that period. Reconstruction using mirror log messages ensures consistency between online and offline timing, reduces the deviation between the replay results and the progress in the online environment, improves the accuracy of marketing data processing, and facilitates subsequent improvements to the marketing activity.
[0124] Figure 5 A schematic diagram of the structure of a data processing device based on marketing activities provided in this application embodiment is shown below. Figure 5 As shown, the data processing device 50 based on marketing activities provided in this embodiment includes:
[0125] The message acquisition unit 501 is used to acquire mirror log messages and communication messages of a marketing activity within a preset time period; wherein, the communication messages represent the transaction messages generated in response to the operation request of the marketing activity in a preset online environment; and the mirror log messages represent the progress of the marketing activity after responding to the operation request of the marketing activity in a preset online environment.
[0126] The message replay unit 502 is used to replay each communication message in a preset offline environment based on the acquired mirror log messages to obtain the replay result of the marketing activity; wherein, the replay result represents the changes in the progress of the marketing activity in the preset offline environment.
[0127] One possible implementation also includes:
[0128] The sequence number determination unit is used to determine the sequence number information of the marketing activity based on the operation requests of the marketing activity in a preset online environment before obtaining the mirror log messages and communication messages of the marketing activity within a preset time period; wherein, the sequence number information represents the number of operations performed on the marketing activity;
[0129] The message generation unit is configured to generate the mirror log message corresponding to the operation request according to the sequence number information of the marketing activity.
[0130] In a possible implementation, the sequence number determination unit is specifically configured to:
[0131] In response to the operation request for the marketing activity, obtain an initial sequence number of the marketing activity; the initial sequence number represents the sequence number information of the marketing activity before the operation request is responded to;
[0132] Perform monotonic increment processing on the initial sequence number of the marketing activity to obtain the current sequence number information of the marketing activity under the operation request.
[0133] In a possible implementation, the message generation unit includes:
[0134] The type determination module is configured to determine an operation type corresponding to the operation request; the operation type includes at least one of completing a transaction, canceling a transaction, and changing a budget upper limit value of the marketing activity;
[0135] The message generation module is configured to generate the mirror log message corresponding to the operation request according to the operation type corresponding to the operation request and the sequence number information of the marketing activity.
[0136] In a possible implementation, the operation type includes completing a transaction; and the message generation module is specifically configured to:
[0137] If the operation type of the operation request is completing a transaction, obtain a budget upper limit value of the marketing activity, an initial budget cumulative value, and a current discount value; the initial budget cumulative value represents a budget amount consumed by the marketing activity from starting to executing the operation request, the current discount value represents a budget amount consumed in the operation request, and the budget upper limit value represents a maximum value of an amount allowed to be consumed in the marketing activity;
[0138] Generate the mirror log message corresponding to the operation request according to the budget upper limit value of the marketing activity, the initial budget cumulative value, the current discount value, and the sequence number information.
[0139] In a possible implementation, the message generation module is specifically configured to:
[0140] Determine a sum value of the initial budget cumulative value and the current discount value;
[0141] If the sum value is less than or equal to the budget upper limit value, obtain identification information of the marketing activity and identification information of a communication message corresponding to the operation request;
[0142] Generate the mirror log message corresponding to the operation request according to the operation type, the identification information of the marketing activity, the identification information of the communication message corresponding to the operation request, the sequence number information, and the initial budget cumulative value.
[0143] In a possible implementation, the operation type includes canceling a transaction; the message generation module is specifically configured to:
[0144] If the operation type of the operation request is to cancel a transaction, the identification information of the marketing activity and the identification information of the communication message corresponding to the operation request are obtained;
[0145] According to the operation type, the identification information of the marketing activity, the identification information of the communication message corresponding to the operation request, and the serial number information, the mirror log message corresponding to the operation request is generated.
[0146] In a possible implementation, the operation type includes changing the budget upper limit value of the marketing activity; the message generation module is specifically configured to:
[0147] If the operation type of the operation request is to change the budget upper limit value of the marketing activity, the identification information of the marketing activity is obtained;
[0148] According to the operation type, the identification information of the marketing activity, the serial number information, and the changed budget upper limit value, the mirror log message corresponding to the operation request is generated.
[0149] In a possible implementation, the message replay unit 502 includes:
[0150] The first generation module is configured to generate first structure data according to each mirror log message in a preset time period; the first structure data is in the form of an ordered tree, and the first structure data includes a plurality of nodes, and each node corresponds to a mirror log message in the preset time period;
[0151] The message determination module is configured to, for each communication message in the preset time period, determine, from each mirror log message in the preset time period, a mirror log message corresponding to the communication message;
[0152] The second generation module is configured to determine second structure data corresponding to the communication message according to the communication message and the mirror log message corresponding to the communication message; the second structure data is in the form of a key-value pair, the key represents the identification information of the communication message, and the value represents the communication message and the corresponding mirror log message;
[0153] The message replay module is configured to sequentially perform replay processing on each communication message according to the first structure data and each second structure data to obtain a replay result of the marketing activity.
[0154] In a possible implementation, the first generation module is specifically configured to:
[0155] For each mirror log message in the preset time period, the serial number information is obtained from the mirror log message;
[0156] According to the sequence number information of each mirror log message, node sorting processing of the ordered tree is performed to obtain the first structure data.
[0157] In a possible implementation, the mirror log message includes first identification, second identification, and sequence number information, the first identification represents identification information of a marketing activity corresponding to the mirror log message, and the second identification represents identification information of a communication message corresponding to an operation request when the mirror log message is generated; the message determination module is specifically configured to:
[0158] For each mirror log message in a preset time period, the second identification is parsed from the mirror log message;
[0159] For each communication message in the preset time period, identification information of the communication message is determined;
[0160] If the identification information of the communication message is consistent with the second identification in the mirror log message, the mirror log message is determined as the mirror log message corresponding to the communication message.
[0161] In a possible implementation, the second generation module is specifically configured to:
[0162] For each communication message in the preset time period, the first structure data is generated according to the identification information of the communication message, and the first identification and the sequence number information in the mirror log message corresponding to the communication message; wherein the key of the first structure data includes the identification information of the communication message, and the value of the first structure data includes the communication message, the first identification, and the sequence number information.
[0163] In a possible implementation, the message replay module is specifically configured to:
[0164] The nodes in the first structure data are traversed to determine the second structure data corresponding to the currently traversed node;
[0165] The communication message in the second structure data corresponding to the currently traversed node is subjected to replay processing to obtain feedback information corresponding to the second structure data corresponding to the currently traversed node; wherein the feedback information represents information obtained after the communication message is subjected to transaction in a preset offline environment;
[0166] If it is determined that the first structure data is traversed to a preset node, the replay result of the marketing activity is determined according to the feedback information corresponding to each second structure data.
[0167] The data processing apparatus based on a marketing activity provided in this embodiment can execute the method provided in the method embodiment, and has similar implementation principles and technical effects, which will not be described here in detail.
[0168] Figure 6 A structural schematic diagram of an electronic device is provided in an embodiment of the present application. As shown in the figure, Figure 6 The electronic device 60 provided in the embodiment includes at least one processor 601 and a memory 602. Optionally, the device 60 further includes a communication component 603. The processor 601, the memory 602 and the communication component 603 are connected through a bus 604.
[0169] In the implementation process, the at least one processor 601 executes the computer execution instructions stored in the memory 602, so that the at least one processor 601 executes the above-mentioned method.
[0170] The specific implementation process of the processor 601 can refer to the method embodiments described above, which have similar implementation principles and technical effects, and will not be described here in detail.
[0171] In the above-mentioned embodiments, it should be understood that the processor can be a central processing unit (CPU), and can also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC) and the like. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor and the like. The steps of the method disclosed in the application can be directly embodied as the execution of the hardware processor, or executed by the combination of hardware and software modules in the processor.
[0172] The memory can include a random access memory (RAM), and can also include a non-volatile memory (NVM), for example, at least one disk memory.
[0173] The bus can be an industry standard architecture (ISA) bus, a peripheral component (PCI) bus or an extended industry standard architecture (EISA) bus and the like. The bus can be divided into an address bus, a data bus, a control bus and the like. For the convenience of representation, the bus in the drawings of the present application does not limit to only one bus or one type of bus.
[0174] The present application also provides a computer program product, including a computer program, which is executed by a processor to implement the above-mentioned method.
[0175] The application further provides a computer readable storage medium, wherein computer execution instructions are stored in the computer readable storage medium, and when a processor executes the computer execution instructions, the method described above is realized.
[0176] The readable storage medium described above can be realized by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk or optical disk. The readable storage medium can be any available medium that can be accessed by a general-purpose or special-purpose computer.
[0177] An exemplary readable storage medium is coupled to the processor, so that the processor can read information from the readable storage medium and write information to the readable storage medium. Of course, the readable storage medium can also be an integral part of the processor. The processor and the readable storage medium can be located in an application specific integrated circuit (ASIC). Of course, the processor and the readable storage medium can also exist as discrete components in the device.
[0178] The division of units is only a logical function division, and when actually implemented, there can be another division mode, for example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the coupling or direct coupling or communication connection between the units shown or discussed can be indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0179] The units described as separate components can or can not be physically separated, and the components shown as units can or can not be physical units, that is, they can be located in one place, or they can be distributed on a plurality of network units. According to actual needs, some or all of the units can be selected to achieve the purpose of the embodiment.
[0180] In addition, the functional units in each embodiment of the application can be integrated in one processing unit, or each unit can be physically present separately, or two or more units can be integrated in one unit.
[0181] If the functions are implemented in the form of software function units and sold or used as independent products, they can be stored in a computer readable storage medium. Based on this understanding, the technical solutions of the present application or the parts of the technical solutions that essentially contribute to the prior art can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a number of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the embodiments of the method of the present application. The aforementioned storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk or an optical disk, and various media that can store program codes.
[0182] It can be understood by those skilled in the art that all or part of the steps of the above-mentioned method embodiments can be completed by program instruction related hardware. The aforementioned program can be stored in a computer readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned storage medium includes: ROM, RAM, magnetic disk or optical disk, and various media that can store program codes.
[0183] Finally, it should be noted that: those skilled in the art will easily think of other embodiments of the present application after considering the specification and practicing the application disclosed herein. The present application is intended to cover any variations, uses or adaptations of the present application that follow the general principles of the present application and include common knowledge or conventional technical means in the art that are not disclosed in the present application, and is not limited to the precise structure described above and shown in the drawings, and various modifications and changes can be made without departing from the scope thereof. The scope of the present application is only limited by the appended claims.
Claims
1. A data processing method based on marketing activities, characterized by, The method comprises the following steps: acquiring mirror log messages and communication messages of the marketing campaign within a preset time period; wherein, the communication messages represent transaction messages generated in response to operation requests for the marketing campaign in a preset online environment; the mirror log messages represent running progress of the marketing campaign after responding to the operation requests for the marketing campaign in the preset online environment; replaying each communication message in a preset offline environment according to each acquired mirror log message to obtain a replay result of the marketing campaign; wherein, the replay result represents changes in the running progress of the marketing campaign in the preset offline environment.
2. The method of claim 1, wherein, Before acquiring the mirror log messages and the communication messages of the marketing campaign within the preset time period, the method further comprises the following steps: determining serial number information of the marketing campaign based on operation requests for the marketing campaign in the preset online environment; wherein, the serial number information represents the number of operations on the marketing campaign; generating mirror log messages corresponding to the operation requests according to the serial number information of the marketing campaign.
3. The method of claim 2, wherein, Determining the serial number information of the marketing campaign based on the operation requests for the marketing campaign comprises the following steps: acquiring an initial serial number of the marketing campaign in response to the operation requests for the marketing campaign; wherein, the initial serial number represents the serial number information of the marketing campaign before responding to the operation requests; performing monotonic increasing processing on the initial serial number of the marketing campaign to obtain current serial number information of the marketing campaign under the operation requests.
4. The method of claim 2, wherein, Generating mirror log messages corresponding to the operation requests according to the serial number information of the marketing campaign comprises the following steps: determining an operation type corresponding to the operation requests; wherein, the operation type comprises at least one of completing a transaction, canceling a transaction, and changing a budget upper limit value of the marketing campaign; generating mirror log messages corresponding to the operation requests according to the operation type corresponding to the operation requests and the serial number information of the marketing campaign.
5. The method of claim 4, wherein, The operation type comprises completing a transaction; generating mirror log messages corresponding to the operation requests according to the operation type corresponding to the operation requests and the serial number information of the marketing campaign comprises the following steps: if the operation type of the operation requests is completing a transaction, acquiring a budget upper limit value of the marketing campaign, an initial budget cumulative value, and a current discount value; wherein, the initial budget cumulative value represents the amount of budget consumed by the marketing campaign from the start to before executing the operation requests, the current discount value represents the amount of budget consumed in the operation requests, and the budget upper limit value represents the maximum value of the amount of budget allowed to be consumed in the marketing campaign; generating mirror log messages corresponding to the operation requests according to the budget upper limit value of the marketing campaign, the initial budget cumulative value, the current discount value, and the serial number information.
6. The method of claim 5, wherein, Generating mirror log messages corresponding to the operation requests according to the budget upper limit value of the marketing campaign, the initial budget cumulative value, the current discount value, and the serial number information comprises the following steps: determining the sum of the initial budget cumulative value and the current discount value; if the sum is less than or equal to the budget upper limit value, acquiring identification information of the marketing campaign and identification information of the communication messages corresponding to the operation requests; According to the operation type, the identification information of the marketing activity, the identification information of the communication message corresponding to the operation request, the serial number information, and the initial budget cumulative value, a mirror log message corresponding to the operation request is generated.
7. The method of claim 4, wherein, The operation type includes canceling a transaction; according to the operation type corresponding to the operation request and the serial number information of the marketing activity, a mirror log message corresponding to the operation request is generated, including: If the operation type of the operation request is to cancel a transaction, the identification information of the marketing activity and the identification information of the communication message corresponding to the operation request are obtained; According to the operation type, the identification information of the marketing activity, the identification information of the communication message corresponding to the operation request, and the serial number information, a mirror log message corresponding to the operation request is generated.
8. The method of claim 4, wherein, The operation type includes changing the budget upper limit value of the marketing activity; According to the operation type corresponding to the operation request and the serial number information of the marketing activity, a mirror log message corresponding to the operation request is generated, including: If the operation type of the operation request is to change the budget upper limit value of the marketing activity, the identification information of the marketing activity is obtained; According to the operation type, the identification information of the marketing activity, the serial number information, and the changed budget upper limit value, a mirror log message corresponding to the operation request is generated.
9. The method of claim 1, wherein, According to the obtained mirror log messages, replay processing is performed on each communication message in a preset offline environment to obtain a replay result of the marketing activity, including: According to the mirror log messages in a preset time period, first structure data is generated; wherein the first structure data is in the form of an ordered tree, and the first structure data includes a plurality of nodes, and the nodes correspond one-to-one to the mirror log messages in the preset time period; For each communication message in the preset time period, the mirror log message corresponding to the communication message is determined from the mirror log messages in the preset time period; According to the communication message and the mirror log message corresponding to the communication message, second structure data corresponding to the communication message is determined; wherein the second structure data is in the form of a key-value pair, the key represents the identification information of the communication message, and the value represents the communication message and the corresponding mirror log message; According to the first structure data and each second structure data, each communication message is sequentially replayed to obtain a replay result of the marketing activity.
10. The method of claim 9, wherein, According to the mirror log messages in a preset time period, first structure data is generated, including: For each mirror log message in the preset time period, serial number information is obtained from the mirror log message; According to the serial number information of each mirror log message, node sorting processing of the ordered tree is performed to obtain the first structure data.
11. The method of claim 9, wherein, The mirror log message includes a first identifier, a second identifier, and sequence number information. The first identifier represents identifier information of a marketing activity corresponding to the mirror log message. The second identifier represents identifier information of a communication message corresponding to an operation request when the mirror log message is generated. For each communication message in the preset time period, a mirror log message corresponding to the communication message is determined from the mirror log messages in the preset time period, including: For each mirror log message in the preset time period, the second identifier is parsed from the mirror log message. For each communication message in the preset time period, the identifier information of the communication message is determined. If the identifier information of the communication message is consistent with the second identifier in the mirror log message, the mirror log message is determined as the mirror log message corresponding to the communication message.
12. The method of claim 11, wherein, According to the communication message and the mirror log message corresponding to the communication message, the second structure data corresponding to the communication message is determined, including: For each communication message in the preset time period, the first structure data is generated according to the identifier information of the communication message, and the first identifier and the sequence number information in the mirror log message corresponding to the communication message. The key of the first structure data includes the identifier information of the communication message, and the value of the first structure data includes the communication message, the first identifier, and the sequence number information.
13. The method of claim 9, wherein, According to the first structure data and each second structure data, each communication message is sequentially replayed to obtain a replay result of the marketing activity, including: Traverse the nodes in the first structure data to determine the second structure data corresponding to the currently traversed node. The communication message in the second structure data corresponding to the currently traversed node is replayed to obtain feedback information corresponding to the second structure data corresponding to the currently traversed node. The feedback information represents information obtained after the communication message is traded in a preset offline environment. If it is determined that the first structure data traverses to a preset node, the replay result of the marketing activity is determined according to the feedback information corresponding to each second structure data.
14. A data processing apparatus based on marketing activities, characterized by, Including: A message acquisition unit is configured to acquire mirror log messages and communication messages of the marketing activity in a preset time period. The communication message represents a transaction message generated in a preset online environment in response to an operation request for the marketing activity. The mirror log message represents the progress of the operation of the marketing activity in response to the operation request for the marketing activity in the preset online environment. A message replay unit is configured to replay each communication message in a preset offline environment according to each acquired mirror log message to obtain a replay result of the marketing activity. The replay result represents the change of the progress of the operation of the marketing activity in the preset offline environment.
15. An electronic device, comprising: Including: A memory and a processor; The memory stores computer execution instructions; The processor executes the computer execution instructions stored in the memory, so that the processor executes the method of any one of claims 1-13.
16. A computer-readable storage medium, characterized in that, The computer readable storage medium stores computer-executable instructions which, when executed by a processor, implement the method of any one of claims 1-13.
17. A computer program product, characterised in that, A computer program which, when executed by a processor, implements the method of any one of claims 1-13.