Coroutine-driven multi-strategy APP behavior collection event reporting system

The coroutine-driven multi-strategy APP behavior collection event reporting system solves the problem of data loss when a large amount of user behavior data is generated centrally, and realizes efficient data collection, asynchronous processing and intelligent disaster recovery, ensuring the integrity and accuracy of data analysis.

CN120915416AInactive Publication Date: 2025-11-07SHANGHAI JIAJIAN SOFTWARE CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510919197.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-04
Publication Date
2025-11-07
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

When existing technologies generate large amounts of user behavior data in a short period of time, data loss can easily occur, affecting the integrity and accuracy of data analysis.

Method used

The coroutine-driven multi-strategy APP behavior collection and event reporting system includes a system configuration module, an event coroutine module, an event upload module, and a collection and retransmission module. Through coroutine unit processing and retransmission mechanisms, it ensures the integrity and accuracy of the data.

Benefits of technology

It reduced data loss rate, lowered resource consumption, and improved the completeness and accuracy of data analysis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120915416A_ABST
    Figure CN120915416A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of computer application, in particular to a coroutine-driven multi-strategy APP behavior collection event reporting system. Comprising a management center, and the management center is in communication connection with a system configuration module, an event coroutine module, an event uploading module and a collection retransmission module. The method comprises the following steps: collecting equipment information data and user identity information, initializing the collected equipment information data and the user identity information, obtaining configuration data, and establishing a start burying point through the configuration data; establishing a communication link according to the starting burying point; analyzing the obtained use behavior of the APP user to obtain an APP behavior collection sub-event; processing the APP behavior collection sub-event through a coroutine unit to obtain a sub-event data packet, uploading the sub-event data packet, and generating a data uploading completion signal and a data uploading failure signal; and retransmitting the sub-event data packet through the data uploading completion signal and the data uploading failure signal. The data loss rate can be reduced.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of computer application, and particularly relates to a coroutine-driven multi-strategy APP behavior collection event reporting system. BACKGROUND

[0002] With the rapid development of mobile internet technology, mobile applications (App) are widely used in the fields of finance, social networking, e-commerce, education, etc. The number of users and their behaviors are becoming increasingly complex. In order to achieve the business goals of precise marketing, risk control, recommendation engine optimization, etc., the real-time collection and uploading of user behavior data by the client has become a basic technical link. Common behavior data collection solutions on the market, such as Firebase, AppsFlyer, Facebook Analytics, etc.

[0003] Kotlin, as a modern programming language, provides lightweight, structured, and non-blocking concurrent processing capabilities through its coroutine mechanism. Kotlin Channel, as a concurrent and secure communication mechanism, is naturally suitable for event transmission between multiple coroutines. By combining the two, a new high-performance behavior data processing architecture driven by asynchronous coroutines can be built, which can efficiently collect, asynchronously process, flexibly report, and intelligently recover data while maintaining code simplicity and performance stability.

[0004] In the prior art, there are the following main technical limitations: In actual use, when a large number of user behavior data is generated and written into the Channel pipeline channel at the same time within a short period of time, if the number of events exceeds the system's preset processing capacity threshold, or the current available memory of the device reaches the set upper limit, in order to ensure the stable operation of the system and prevent memory overflow, the system will automatically trigger a data recovery mechanism. This mechanism usually cleans up data in chronological order, preferentially discarding the oldest events that have not been processed to release cache space.

[0005] However, while this strategy ensures the continuous availability of the system to some extent, it inevitably leads to the failure of some historical event data to enter the processing flow, resulting in data loss. This data loss phenomenon is more pronounced when key behavior nodes are triggered or network fluctuations temporarily prevent uploading, which may affect the integrity and accuracy of the data analysis results. This is a problem that needs to be solved. SUMMARY

[0006] The present application aims to solve the problems in the background art by providing a coroutine-driven multi-strategy APP behavior collection event reporting system.

[0007] The technical scheme of the present application: a coroutine-driven multi-strategy APP behavior collection event reporting system, comprising a management center, the management center being in communication connection with a system configuration module, an event coroutine module, an event uploading module and a collection retransmission module:

[0008] The system configuration module is used for collecting device information data and user identity information, initializing the device information data and the user identity information, and obtaining configuration data, and through the configuration data, enabling a buried point is established.

[0009] The event coroutine module is used for establishing a communication link according to the enabled buried point, analyzing the use behavior of the obtained APP user, and obtaining an APP behavior collection sub-event.

[0010] The event uploading module is used for processing the APP behavior collection sub-event through a coroutine unit, obtaining a sub-event data packet, uploading the sub-event data packet, and generating a data uploading completion signal and a data uploading failure signal.

[0011] The collection retransmission module is used for retransmitting the sub-event data packet through the data uploading completion signal and the data uploading failure signal.

[0012] Preferably, the process of collecting device information data and user identity information and initializing the device information data and the user identity information comprises:

[0013] Collecting device information data and user identity information.

[0014] The device information data includes a device identification code, a running control parameter and a server parameter; the device identification code is used to distinguish different device reported data sources; the running control parameter includes a reporting strategy type, a maximum cache capacity, a network state and running environment information; the server parameter includes a server domain name and an authentication parameter; the user identity information includes a user name, a user permission and a user level.

[0015] Initializing the device information data and the user identity information to obtain device initialization data and user initialization data.

[0016] Preferably, the process of obtaining configuration data and establishing an enabled buried point through the configuration data comprises:

[0017] A communication link is established with a configuration center server through a remote network interface.

[0018] The remote network interface obtains configuration data of the center server through the communication link; the configuration data includes business configuration data, log configuration data, reporting configuration data and other control data.

[0019] A plurality of enabling burials are established by configuration data, device initialization data and user initialization data; the enabling burials include initialization burials, business code burials, history cache burials, traceless burials and dynamically issued injection burials.

[0020] Preferably, according to the enabling burials, a communication link is established, the use behavior of the APP user is analyzed, and the process of obtaining the APP behavior collection sub-events is as follows:

[0021] A communication link is established, and an asynchronous data transmission mechanism exists in the communication link, which is established between the enabling burials and is provided with a plurality of coroutine units; the coroutine units are used for executing tasks in the system; the coroutine units include primary coroutine units, secondary coroutine units and tertiary coroutine units.

[0022] The use behavior of the APP user is obtained, the use behavior of the APP user is collected, the APP behavior collection event of the user is obtained, and the APP behavior collection event is provided with an event identifier; the APP behavior collection event is divided into a plurality of sub-events, the APP behavior collection sub-events are obtained, the event identifier in the APP behavior collection event is also divided into a plurality of sub-event identifiers, and the sub-event identifiers are respectively placed in the APP behavior collection sub-events according to the order of the APP behavior collection sub-events in the APP behavior collection event.

[0023] Preferably, the process of processing the APP behavior collection sub-events by the coroutine units to obtain the sub-event data packets includes:

[0024] A queue mode and a processing mode are set; all the APP behavior collection sub-events related to the APP behavior collection event of the user are placed in a cache pool, an event reporting level is obtained according to a preset reporting principle in the central server, all the APP behavior collection sub-events are classified by the level, each APP behavior collection sub-event is re-distributed to the primary coroutine unit, the secondary coroutine unit and the tertiary coroutine unit through the event reporting level, the user's personalized demand is obtained, the processing priority of the primary coroutine unit, the secondary coroutine unit and the tertiary coroutine unit can be re-planned according to the user's personalized demand, and a processing multi-strategy is obtained; each APP behavior collection sub-event is processed through the processing multi-strategy to obtain a sub-event data packet.

[0025] Preferably, the process of uploading the sub-event data packet to generate a data upload completion signal and a data upload failure signal includes:

[0026] The sub-event data packet is sent to each corresponding consumer through a communication link, and when the consumer receives the sub-event data packet, the sub-event data packet is uploaded to a remote network interface, and the sub-event data packet is uploaded to the configuration center server by the remote network interface through the communication link, and if the configuration center server receives the uploaded sub-event data packet, a data upload completion signal is sent to the consumer; if the configuration center server does not receive the uploaded sub-event data packet, a data upload failure signal is sent to the consumer.

[0027] Preferably, the retransmission process of the sub-event data packet through the data upload completion signal and the data upload failure signal includes:

[0028] When the consumer receives the data upload completion signal, the consumer performs a deletion operation on the related data in the cache pool or the transmission queue;

[0029] When the consumer receives the data upload failure signal, a data upload failure waiting time is set, and the consumer waits for the data upload failure waiting time, and then re-uploads the sub-event data packet to the configuration center server by the remote network interface through the communication link;

[0030] If the configuration center server receives the uploaded sub-event data packet, a data retransmission completion signal is sent to the consumer; if the configuration center server still does not receive the uploaded sub-event data packet, the sub-event data packet is analyzed.

[0031] Preferably, if the configuration center server still does not receive the uploaded sub-event data packet, the process of analyzing the sub-event data packet includes:

[0032] If the configuration center server still does not receive the uploaded sub-event data packet, the number of retransmission failures is recorded; a retransmission number threshold is set, and if the number of retransmission failures is greater than or equal to the retransmission number threshold, the corresponding sub-event data packet is reloaded into the cache pool after the sub-event data packet is re-uploaded to the configuration center server through the remote network interface and still fails to upload; a re-upload unit is provided in the cache pool, and a specified retransmission time and a specified retransmission number are provided in the re-upload unit; when the waiting retransmission time of the sub-event data packet re-entering the cache pool is greater than or equal to the specified retransmission time, and the number of re-stored sub-event data packets in the cache pool is greater than or equal to the specified retransmission number, the corresponding sub-event data packet in the cache pool is re-uploaded.

[0033] Compared with the prior art, the above-mentioned technical solution of the present invention has the following beneficial technical effects: It collects device information data and user identity information, initializes the collected device information data and user identity information, obtains configuration data, and establishes activation tracking points through the configuration data; it establishes a communication link based on the activation tracking points; it analyzes the usage behavior of the acquired APP users to obtain APP behavior collection sub-events; it processes the APP behavior collection sub-events through a coroutine unit to obtain sub-event data packets, uploads the sub-event data packets, and generates data upload completion signals and data upload failure signals; it retransmits the sub-event data packets based on the data upload completion signals and data upload failure signals; it reduces data loss rate; it lowers resource occupancy rate; and it improves the completeness and accuracy of data analysis. Attached Figure Description

[0034] Figure 1 This is a schematic diagram of one embodiment of the present invention. Detailed Implementation

[0035] like Figure 1 As shown, the present invention proposes a coroutine-driven multi-strategy APP behavior collection and event reporting system, which includes a management center. The management center is communicatively connected to a system configuration module, an event coroutine module, an event upload module, and a collection and retransmission module.

[0036] The system configuration module is used to collect device information data and user identity information, initialize the collected device information data and user identity information, obtain configuration data, and establish and enable the tracking points through the configuration data;

[0037] The event coroutine module is used to establish a communication link based on the enabled tracking points; analyze the usage behavior of the acquired APP users, and obtain APP behavior collection sub-events;

[0038] The event upload module is used to process the sub-events collected by the APP behavior through the coroutine unit, obtain the sub-event data packet, upload the sub-event data packet, and generate a data upload completion signal and a data upload failure signal.

[0039] The retransmission module is used to retransmit sub-event data packets based on data upload completion and data upload failure signals.

[0040] It should be further explained that, in the specific implementation process, the process of collecting device information data and user identity information, initializing the collected device information data and user identity information, obtaining configuration data, and establishing and enabling the data tracking point using the configuration data is as follows:

[0041] Collect device information data and user identity information;

[0042] The device information data includes a device identification code, a running control parameter, and a server parameter; the device identification code is used to distinguish data sources reported by different devices; the running control parameter includes a reporting strategy type, a maximum cache capacity, a network state, and running environment information; the server parameter includes a server domain name and an authentication parameter; the user identity information includes but is not limited to a user name, a user permission, and a user level, etc.

[0043] The device information data and the user identity information are initialized to obtain device initialization data and user initialization data;

[0044] A communication link is established with the configuration center server through a remote network interface;

[0045] The remote network interface obtains configuration data of the center server through the communication link; the configuration data includes business configuration data, log configuration data, reporting configuration data, and other control data;

[0046] A plurality of enabled buries are established through the configuration data, the device initialization data, and the user initialization data; the enabled buries include but are not limited to an initialization bury, a business code bury, a history cache bury, a traceless bury, and a dynamically issued injection bury;

[0047] It should be noted that the initialization bury is used to save the startup duration, module initialization failure, and other information when the system starts, so as to facilitate troubleshooting of system faults; the business code bury is used to collect user behavior paths related to business functions; the history cache bury is used to cache the buries that are not timely reported during the last system running; the traceless bury refers to automatic burying, which is injected into the system in the form of a plug-in; the dynamically issued injection bury is used to report to the system through visual control of the server.

[0048] It should be further noted that in the specific implementation process, the communication link is established according to the enabled buries; the process of obtaining the APP behavior collection sub-event by analyzing the use behavior of the APP user is as follows:

[0049] The communication link exists in an asynchronous data transmission mechanism, which is established between each enabled bury and is provided with a plurality of coroutine units; the coroutine unit is used for execution of tasks in the system; the coroutine unit includes a primary coroutine unit, a secondary coroutine unit, and a tertiary coroutine unit;

[0050] It should be noted that the coroutine unit is characterized by light weight and less memory leakage; the light weight specifically refers to the fact that multiple coroutines can be run on a single thread, because the coroutine supports suspension, which does not block the thread running the coroutine, and suspension saves memory compared to blocking, and supports multiple parallel operations; the less memory leakage specifically refers to the fact that structured concurrency is used to run multiple operations in a range; structured concurrency refers to allowing coroutines to run in a safer and more structured manner; it can ensure that the coroutine lifecycle is closely related to the scope, and this mode can help avoid memory leaks and ensure that all child coroutines are properly canceled when the parent scope is canceled;

[0051] Obtain the use behavior of the APP user, collect the use behavior of the APP user, obtain the APP behavior collection event of the user, and set an event identifier in the APP behavior collection event; divide the APP behavior collection event into a plurality of sub-events, obtain the APP behavior collection sub-event, and the event identifier in the APP behavior collection event is also divided into a plurality of sub-event identifiers, and the sub-event identifiers are respectively placed in the APP behavior collection sub-event according to the order of the APP behavior collection sub-event in the APP behavior collection event.

[0052] It should be further explained that in the specific implementation process, the APP behavior collection sub-event is processed by the coroutine unit to obtain a sub-event data packet, and the process of uploading the sub-event data packet to generate a data upload completion signal and a data upload failure signal is as follows:

[0053] The APP behavior collection sub-event is processed by the coroutine unit to obtain a sub-event data packet;

[0054] Further, the process of processing the APP behavior collection sub-event by the coroutine unit is as follows: setting a queue mode and a processing mode; the queue mode refers to the fact that the APP behavior collection sub-event follows the first-in, first-out principle when executing tasks in the coroutine unit; the processing mode refers to the fact that the APP behavior collection sub-event is processed in order according to the order of the sub-event identifier in the APP behavior collection sub-event; all APP behavior collection sub-events related to the APP behavior collection event of the user are placed in a cache pool, and an event reporting level is obtained according to a preset reporting principle in the central server; all APP behavior collection sub-events are classified by level, and each APP behavior collection sub-event is re-assigned to a first-level coroutine unit, a second-level coroutine unit, and a third-level coroutine unit through the event reporting level, the user's personalized demand is obtained, the processing priority of the first-level coroutine unit, the second-level coroutine unit, and the third-level coroutine unit can be re-planned according to the user's personalized demand, and a processing multiple strategy is obtained; each APP behavior collection sub-event is processed through the processing multiple strategy to obtain a sub-event data packet;

[0055] The sub-event data packet is sent to each corresponding consumer through a communication link, and when the consumer receives the sub-event data packet, the sub-event data packet is uploaded to a remote network interface, and the sub-event data packet is uploaded to the configuration center server by the remote network interface through the communication link, and if the configuration center server receives the uploaded sub-event data packet, a data upload completion signal is sent to the consumer; if the configuration center server does not receive the uploaded sub-event data packet, a data upload failure signal is sent to the consumer.

[0056] It should be further pointed out that, in the specific implementation process, the retransmission process of the sub-event data packet through the data upload completion signal and the data upload failure signal is as follows:

[0057] When the consumer receives the data upload completion signal, the consumer performs a deletion operation on the related data in the cache pool or the transmission queue;

[0058] When the consumer receives the data upload failure signal, a data upload failure waiting time is set, and the consumer waits for the data upload failure waiting time, and then re-uploads the sub-event data packet to the configuration center server by the remote network interface through the communication link;

[0059] If the configuration center server receives the uploaded sub-event data packet, a data retransmission completion signal is sent to the consumer, and when the consumer receives the data retransmission completion signal, the consumer performs a deletion operation on the related data in the cache pool or the transmission queue;

[0060] If the configuration center server still does not receive the uploaded sub-event data packet, the number of retransmission failures is recorded; a retransmission number threshold is set, and if the number of retransmission failures is greater than or equal to the retransmission number threshold, the sub-event data packet is re-uploaded to the configuration center server by the remote network interface through the communication link, and still fails to upload, the corresponding sub-event data packet is re-placed into the cache pool; a re-upload unit is provided in the cache pool, and a specified retransmission time and a specified retransmission number are provided in the re-upload unit; when the waiting retransmission time of the sub-event data packet re-entering the cache pool is greater than or equal to the specified retransmission time, and the number of re-stored sub-event data packets in the cache pool is greater than or equal to the specified retransmission number, the corresponding sub-event data packet in the cache pool is re-uploaded; when the waiting retransmission time of the sub-event data packet re-entering the cache pool is less than the specified retransmission time, or the number of re-stored sub-event data packets in the cache pool is less than the specified retransmission number, the corresponding sub-event data packet in the cache pool continues to wait for uploading.

[0061] The embodiments of the application are described in detail above in combination with the drawings, but the application is not limited thereto, and various changes can be made within the knowledge of those skilled in the art without departing from the purpose of the application.

Claims

1. A coroutine-driven multi-strategy APP behavior collection event reporting system comprising a management center, characterized in that, The management center is communicatively connected with a system configuration module, an event coroutine module, an event uploading module and a collection retransmission module. The system configuration module is configured to collect device information data and user identity information, initialize the device information data and the user identity information, and obtain configuration data, and establish an enabled trace point through the configuration data. The event coroutine module is configured to establish a communication link according to the enabled trace point. The use behavior of the APP user is analyzed to obtain an APP behavior collection sub-event. The event uploading module is configured to process the APP behavior collection sub-event through a coroutine unit, obtain a sub-event data packet, upload the sub-event data packet, and generate a data uploading completion signal and a data uploading failure signal. The collection retransmission module is configured to retransmit the sub-event data packet through the data uploading completion signal and the data uploading failure signal. 2.The coroutine-driven multi-strategy APP behavior collection event reporting system according to claim 1, wherein, The process of collecting device information data and user identity information and initializing the device information data and the user identity information includes: collecting device information data and user identity information; The device information data includes a device identification code, a running control parameter and a server parameter; the device identification code is used to distinguish different device data sources; the running control parameter includes a reporting strategy type, a maximum cache capacity, a network state and a running environment information; the server parameter includes a server domain name and an authentication parameter; the user identity information includes a user name, a user permission and a user level; initializing the device information data and the user identity information to obtain device initialization data and user initialization data. 3.The coroutine-driven multi-strategy APP behavior collection event reporting system according to claim 2, characterized in that, The process of obtaining configuration data and establishing an enabled trace point through the configuration data includes: establishing a communication link with a configuration center server through a remote network interface; the remote network interface obtains configuration data of the center server through the communication link; the configuration data includes business configuration data, log configuration data, reporting configuration data and other control data; a plurality of enabled trace points are established through the configuration data, the device initialization data and the user initialization data; the enabled trace points include an initialization trace point, a business code trace point, a history cache trace point, a traceless trace point and a dynamically issued injection trace point.

4. The coroutine-driven multi-strategy APP behavior collection event reporting system according to claim 3, characterized in that, The process of establishing a communication link according to the enabled trace point, analyzing the use behavior of the APP user and obtaining an APP behavior collection sub-event includes: establishing a communication link, the communication link has an asynchronous data transmission mechanism, and a plurality of coroutine units are arranged between the enabled trace points; the coroutine units are used for executing tasks in the system; the coroutine units include a primary coroutine unit, a secondary coroutine unit and a tertiary coroutine unit. The use behavior of the APP user is collected to obtain an APP behavior collection event of the user, and the APP behavior collection event is provided with an event identifier; The APP behavior collection event is divided into a plurality of sub-events, to obtain APP behavior collection sub-events, and the event identifiers in the APP behavior collection event are also divided into a plurality of sub-event identifiers, and the sub-event identifiers are respectively placed in the APP behavior collection sub-events according to the order of the APP behavior collection sub-events in the APP behavior collection event.

5. The coroutine-driven multi-strategy APP behavior collection event reporting system according to claim 4, characterized in that, The process of processing the APP behavior collection sub-events by the coroutine unit to obtain the sub-event data packet includes: setting a queue mode and a processing mode; placing all APP behavior collection sub-events related to the APP behavior collection event of the user in a cache pool, and obtaining an event reporting level according to a preset reporting principle in the central server; dividing all APP behavior collection sub-events into levels, and respectively reassigning each APP behavior collection sub-event to a first-level coroutine unit, a second-level coroutine unit, and a third-level coroutine unit through the event reporting level, obtaining user personalized requirements, and re-planning the processing priorities of the first-level coroutine unit, the second-level coroutine unit, and the third-level coroutine unit according to the user personalized requirements to obtain a processing multi-strategy; and processing each APP behavior collection sub-event through the processing multi-strategy to obtain a sub-event data packet.

6. The coroutine-driven multi-strategy APP behavior collection event reporting system according to claim 5, characterized in that, The process of uploading the sub-event data packet to generate a data upload completion signal and a data upload failure signal includes: sending the sub-event data packet to each corresponding consumer through a communication link, when the consumer receives the sub-event data packet, uploading the sub-event data packet to a remote network interface, and uploading the sub-event data packet from the remote network interface to the configuration center server through the communication link, if the configuration center server receives the uploaded sub-event data packet, sending a data upload completion signal to the consumer; if the configuration center server does not receive the uploaded sub-event data packet, sending a data upload failure signal to the consumer.

7. The coroutine-driven multi-strategy APP behavior collection event reporting system according to claim 6, characterized in that, The process of retransmitting the sub-event data packet through the data upload completion signal and the data upload failure signal includes: when the consumer receives the data upload completion signal, the consumer performs a deletion operation on the related data in the cache pool or the transmission queue; when the consumer receives the data upload failure signal, setting a data upload failure waiting time, and after the consumer waits for the data upload failure waiting time, re-uploading the sub-event data packet from the remote network interface to the configuration center server through the communication link; if the configuration center server receives the uploaded sub-event data packet, sending a data retransmission completion signal to the consumer; if the configuration center server still does not receive the uploaded sub-event data packet, analyzing the sub-event data packet.

8. The coroutine-driven multi-strategy APP behavior collection event reporting system according to claim 7, characterized in that, The process of analyzing the sub-event data packet if the configuration center server still does not receive the uploaded sub-event data packet includes: If the configuration center server still does not receive the uploaded sub-event data packet, the number of upload failure retransmissions is recorded; a retransmission number threshold is set, if the number of failure retransmissions is greater than or equal to the retransmission number threshold, and the uploading of the sub-event data packet through the remote network interface by the communication link to the configuration center server still fails, the corresponding sub-event data packet is reloaded into the cache pool; a reupload unit is set in the cache pool, and a specified retransmission time and a specified retransmission number are set in the reupload unit; when the waiting retransmission time of the sub-event data packet reentering the cache pool is greater than or equal to the specified retransmission time, and the number of the reloaded sub-event data packets in the cache pool is greater than or equal to the specified retransmission number, the corresponding sub-event data packet in the cache pool is uploaded again.

Citation Information

Cited By

  • SOME / IP network service state monitoring system and method

    CN122339999A