Package data packet management method, apparatus and device, and readable medium
By obtaining and monitoring the status information of the package data packet and managing it when receiving event notifications, the problem of inconvenience in package data packet management is solved, and efficient and timely packet management is achieved.
Patent Information
- Application Number
- CN202411794116.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-06
- Publication Date
- 2025-03-21
AI Technical Summary
The existing technology is difficult to effectively manage a large number of package data packets, resulting in inconvenience in management.
By obtaining the status information of multiple package packets, determine the data packets that meet the preset conditions, and set up status monitoring events. When an event trigger notification is received, the packet identification is added to the packet management queue and business management is performed based on the identification stored in the queue.
It realizes automatic monitoring and timely management of package data packets, improves the timeliness and efficiency of data packet management, and can better handle a large number of package data packets.
Smart Images

Figure CN119676678A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of data processing, and in particular to a method, device, equipment and readable medium for managing package data packets. Background Art
[0002] A package data packet is a communication service package provided by an operator to users, which includes a certain amount of data usage rights and other possible service items.
[0003] Among them, package data packages usually include the following aspects: (1) Data traffic: After purchasing a package, users can obtain a certain amount of mobile data traffic, which is used to access the Internet on mobile devices or use other applications that require network connection. (2) Other service items: In addition to data traffic, package data packages may also include free call time, number of text messages, etc., depending on the operator and package type. (3) Billing method: The cost of package data packages is usually included in the user's monthly rent, and users do not need to pay extra for data traffic and other service items in the package. The portion exceeding the package may be charged separately according to the operator's tariff standards.
[0004] It can be seen that the types and quantities of package data packets are diverse, and how to manage a large number of package data packets has become a technical problem that needs to be solved urgently. Summary of the invention
[0005] To this end, the present disclosure provides a method, device, equipment and readable medium for managing package data packets to solve the problem of inconvenient package data packet management.
[0006] In order to achieve the above-mentioned object, the present disclosure provides a first aspect of a method for managing a package data packet, the method for managing a package data packet comprising:
[0007] Respectively obtain status information of a plurality of package data packets, determine a plurality of package data packets whose status information meets a preset condition as a first data packet, and set a status monitoring event for the first data packet;
[0008] When receiving an event trigger notification of the status monitoring event, adding a data packet identifier of a first data packet corresponding to the event trigger notification to a data packet management queue;
[0009] According to the multiple data packet identifiers stored in the data packet management queue, service management is performed on the multiple first data packets corresponding to the multiple data packet identifiers.
[0010] In an optional implementation, the preset condition includes: the time interval between the package end time of the package data packet and the current time is less than a first preset interval threshold, and / or the remaining data volume of the package data packet is less than a first preset quantity threshold;
[0011] Furthermore, the status monitoring event is used to monitor whether the time interval between the package end time and the current time of the package data packet is less than a second preset interval threshold, and / or to monitor whether the remaining data volume of the package data packet is less than a second preset quantity threshold;
[0012] The first preset interval threshold is greater than the second preset interval threshold, and the first preset quantity threshold is greater than the second preset quantity threshold.
[0013] In an optional implementation, performing service management on a plurality of first data packets corresponding to the plurality of data packet identifiers stored in the data packet management queue includes:
[0014] Grouping a plurality of data packet identifiers stored in the data packet management queue to obtain a plurality of data packet identifier groups;
[0015] The plurality of data packet identification groups are processed in parallel by a plurality of data packet management threads.
[0016] In an optional implementation manner, the performing service management on the multiple first data packets corresponding to the multiple data packet identifiers includes:
[0017] For the first data packet corresponding to the data packet identifier that failed in the i-th time period, perform activation processing in the (i+1)th time period to generate a second data packet corresponding to the data packet identifier that failed in the i-th time period;
[0018] The second data packet is a package data packet within the i+1th time period, and the second data packet is stored in the service database; wherein i is a natural number.
[0019] In an optional implementation manner, the performing service management on the multiple first data packets corresponding to the multiple data packet identifiers further includes:
[0020] For a first data packet corresponding to a data packet identifier that is invalid within an i-th time period, the first data packet is deleted from the business database, and the first data packet is transferred to a cold storage database.
[0021] In an optional implementation, performing service management on a plurality of first data packets corresponding to the plurality of data packet identifiers stored in the data packet management queue includes:
[0022] In response to receiving a query request for any data packet identifier, obtaining data packet query information corresponding to the any data packet identifier, and caching the data packet query information into a preset cache space.
[0023] A second aspect of the present disclosure provides a device for managing a package data packet, the device comprising:
[0024] a setting module, adapted to respectively obtain status information of a plurality of package data packets, determine a plurality of package data packets whose status information meets a preset condition as a first data packet, and set a status monitoring event for the first data packet;
[0025] an adding module adapted to add the data packet identifier of the first data packet corresponding to the event triggering notification to the data packet management queue when receiving the event triggering notification of the status monitoring event;
[0026] The management module is adapted to perform service management on a plurality of first data packets corresponding to the plurality of data packet identifiers stored in the data packet management queue.
[0027] A third aspect of the present disclosure provides an electronic device, including:
[0028] one or more processors;
[0029] A memory having one or more programs stored thereon, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the above-mentioned method for managing package data packets;
[0030] One or more I / O interfaces are connected between the processor and the memory and are configured to implement information interaction between the processor and the memory.
[0031] A fourth aspect of the present disclosure provides a computer-readable medium having a computer program stored thereon, which implements the above-mentioned method for managing package data packets when the program is executed by a processor.
[0032] The present disclosure also provides a computer program product, including a computer-readable code, or a non-volatile computer-readable storage medium carrying the computer-readable code. When the computer-readable code runs in a processor of an electronic device, the processor in the electronic device executes the above method.
[0033] The present disclosure has the following advantages:
[0034] In the management method of the package data packet provided in the embodiment of the present disclosure, first, the status information of multiple package data packets is obtained respectively, multiple package data packets whose status information meets the preset conditions are determined as the first data packet, and the status monitoring event is set for the first data packet. Correspondingly, in the case of receiving the event trigger notification of the status monitoring event, the data packet identifier of the first data packet corresponding to the event trigger notification is added to the data packet management queue. Then, according to the multiple data packet identifiers stored in the data packet management queue, the multiple first data packets corresponding to the multiple data packet identifiers are business managed. It can be seen that this method can automatically monitor the real-time status of the package data packet according to the status monitoring event, so that the package data packet that needs to perform the management operation is added to the data packet management queue in time, and the timeliness and timeliness of the data packet management are improved by means of the event notification method. In addition, by managing the package data packets that meet the preset conditions and receive the event trigger notification separately, it is helpful to improve the management efficiency of a large number of package data packets. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] The accompanying drawings are used to provide further understanding of the present disclosure and constitute a part of the specification. They are used to explain the present disclosure together with the following detailed description, but do not constitute a limitation of the present disclosure.
[0036] Figure 1 A flowchart of a method for managing package data packets provided in an embodiment of the present disclosure;
[0037] Figure 2 A schematic diagram showing an activation process in the related art is shown;
[0038] Figure 3 A flowchart of a method for managing package data packets provided for a specific example of the present disclosure;
[0039] Figure 4 A schematic diagram of a package data package management device provided in an embodiment of the present disclosure;
[0040] Figure 5 A schematic diagram of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0041] The specific implementation of the present disclosure is described in detail below in conjunction with the accompanying drawings. It should be understood that the specific implementation described herein is only used to illustrate and explain the present disclosure, and is not used to limit the present disclosure.
[0042] As used in this disclosure, the term "and / or" includes any and all combinations of one or more of the associated listed items.
[0043] The terms used in the present disclosure are only used to describe specific embodiments and are not intended to limit the present disclosure.As used in the present disclosure, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
[0044] When the terms “comprising” and / or “made of…” are used in the present disclosure, it specifies the existence of the stated features, integers, steps, operations, elements and / or components, but does not exclude the existence or addition of one or more other features, integers, steps, operations, elements, components and / or groups thereof.
[0045] The embodiments described in the present disclosure may be described with reference to plan views and / or cross-sectional views by way of ideal schematic diagrams of the present disclosure. Therefore, the exemplary illustrations may be modified according to manufacturing techniques and / or tolerances.
[0046] Unless otherwise defined, all terms (including technical and scientific terms) used in this disclosure have the same meaning as those commonly understood by those of ordinary skill in the art. It will also be understood that terms such as those defined in commonly used dictionaries should be interpreted as having a meaning consistent with their meaning in the context of the relevant art and this disclosure, and will not be interpreted as having an idealized or overly formal meaning unless explicitly defined in this disclosure.
[0047] In a first aspect, an embodiment of the present disclosure provides a method for managing package data packets. Figure 1 A flowchart of a method for managing package data packets provided in an embodiment of the present disclosure, referring to Figure 1 , the management method of the package data packet includes:
[0048] Step S110: respectively obtaining status information of a plurality of package data packets, determining a plurality of package data packets whose status information meets a preset condition as a first data packet, and setting a status monitoring event for the first data packet.
[0049] The package data packet includes various types of data packets corresponding to various service packages. The present application does not limit the specific number and type of package data packets. The status information of the package data packet is used to characterize the real-time status of the package data packet, and the real-time status is used to describe the remaining number of packages, the remaining proportion of packages, and other information of the package data packet.
[0050] The preset condition is used to characterize the effective state of the package data packet. For example, the preset condition can be used to characterize when the package data packet will expire. Specifically, the multiple package data packets whose status information meets the preset condition can refer to: determining the package data packets that will expire within a preset period of time according to the status information.
[0051] In an optional implementation, the preset conditions may include: the time interval between the package end time of the package data packet and the current time is less than a first preset interval threshold, and / or the remaining data volume of the package data packet is less than a first preset quantity threshold. Among them, for a package data packet that expires at a scheduled time, if the time interval between the package end time of the package data packet and the current time is less than the first preset interval threshold, it means that the package data packet will expire after a preset time. For a package data packet that expires quantitatively, if the remaining data volume of the package data packet is less than the first preset quantity threshold, it means that the package data packet will expire after continuing to be used for a set number of times. In short, the preset conditions can quickly identify the package data packet that is about to expire.
[0052] In order to improve the management efficiency of the package data packet, in this step, a state monitoring event is further set for the first data packet. The state monitoring time is used to monitor the service status of the corresponding first data packet. For example, the state monitoring event can be used to monitor whether the package end time of the package data packet has arrived, and / or to monitor whether the remaining data volume of the package data packet is zero. Among them, if the package end time of the package data packet is monitored to arrive, it means that the package data packet will be invalid; similarly, if the remaining data volume of the package data packet is monitored to be zero, it also means that the package data packet will be invalid. It can be seen that by setting the state monitoring event, the real-time status of the package data packet can be determined more timely and accurately.
[0053] Preferably, in order to reserve sufficient management time, the status monitoring event is used to monitor whether the time interval between the package end time and the current time of the package data packet is less than the second preset interval threshold, and / or to monitor whether the remaining data volume of the package data packet is less than the second preset quantity threshold; wherein the first preset interval threshold is greater than the second preset interval threshold, and the first preset quantity threshold is greater than the second preset quantity threshold. It can be seen that by setting thresholds with different values for the preset conditions and the status monitoring event respectively, the status monitoring event can be set in advance for the package data packet that is about to expire, and the package data packet that is about to expire can be obtained in time through the status monitoring event to perform corresponding management operations.
[0054] Step S120: when an event triggering notification of a status monitoring event is received, the data packet identifier of the first data packet corresponding to the event triggering notification is added to the data packet management queue.
[0055] Among them, the event trigger notification of the status monitoring event is used to characterize that the monitoring target corresponding to the status monitoring event has been achieved, thereby triggering the corresponding event trigger notification. For example, when the status monitoring event is used to monitor whether the time interval between the package end time and the current time of the package data packet is less than the second preset interval threshold, it means that the time interval between the package end time and the current time of the first data packet is less than the second preset interval threshold (i.e., it will expire immediately). Specifically, the second preset interval threshold and the second preset quantity threshold can be dynamically determined according to the processing delay of the management operation. By reasonably setting the second preset interval threshold and the second preset quantity threshold, the timeliness of the management operation can be improved.
[0056] In addition, the second preset interval threshold and the second preset quantity threshold can also be dynamically configured according to business peak periods and / or business off-peak periods, so that the processing time of subsequent business management operations avoids business peak periods and / or the processing time of subsequent business management operations falls into business off-peak periods.
[0057] Furthermore, in order to reduce the impact on business peak hours, assuming that the original multiple package data packets are stored in the first storage space, the data packet management queue can be set in a second storage space different from the first storage space. Accordingly, the data content corresponding to the first data packet can be transferred from the first storage space to the second storage space to reduce the I / O and CPU resource usage of the database.
[0058] Step S130: performing service management on a plurality of first data packets corresponding to the plurality of data packet identifiers according to the plurality of data packet identifiers stored in the data packet management queue.
[0059] Among them, the data packet management queue is used to store the data packet identifier of the first data packet corresponding to the event trigger notification. According to the data packet identifier, a service management operation is performed on multiple first data packets corresponding to multiple data packet identifiers. Among them, the operation type of the service management operation may include: invalidation processing, effectiveness processing, change processing, etc. of the package data packet. This application does not limit the specific operation type of the service management operation.
[0060] It can be seen that this method can automatically monitor the real-time status of package data packets according to status monitoring events, so as to timely add package data packets that need to perform management operations to the data packet management queue, and improve the timeliness and timeliness of data packet management by means of event notification. In addition, by separately managing package data packets that meet preset conditions and receive event trigger notifications, it helps to improve the management efficiency of a large number of package data packets.
[0061] In addition, those skilled in the art may also make various modifications and variations to the above implementations:
[0062] In an optional implementation, when performing service management on multiple first data packets corresponding to multiple data packet identifiers according to multiple data packet identifiers stored in a data packet management queue, it can be implemented in the following manner: First, the multiple data packet identifiers stored in the data packet management queue are grouped to obtain multiple data packet identifier groups. For example, the service type, operator type, billing type and other related information to which the corresponding package data packet belongs can be determined according to the data packet identifier, so that multiple package data packets belonging to the same type can be divided into the same group according to the type characteristics, thereby obtaining multiple data packet identifier groups corresponding to multiple types. Then, multiple data packet identifier groups are processed in parallel through multiple data packet management threads. Specifically, each data packet management thread is responsible for processing at least one data packet identifier group, and the management efficiency of the data packet can be greatly improved by multi-threaded parallel processing.
[0063] In an optional implementation, when performing business management on multiple first data packets corresponding to multiple data packet identifiers, it can be achieved in the following manner: for the first data packet corresponding to the data packet identifier that expired in the i-th time period, perform activation processing in the i+1-th time period to generate a second data packet corresponding to the data packet identifier that expired in the i-th time period; wherein the second data packet is a package data packet in the i+1-th time period, and the second data packet is stored in the business database. Wherein, i is a natural number, and the forensics of i changes dynamically over time. In this way, activation processing can be automatically performed on the data packet that took effect in the previous time period, so that the corresponding activation data packet is generated in the next time period, thereby ensuring the normal use of the paid package data packet in the next time period.
[0064] In an optional implementation, when performing business management on multiple first data packets corresponding to multiple data packet identifiers, it can also be implemented in the following manner: for the first data packet corresponding to the data packet identifier that has expired in the i-th time period, the first data packet is deleted from the business database, and the first data packet is transferred to the cold storage database. The business database may refer to the database in the first storage space mentioned above. By transferring the expired data packets to the cold storage database, the storage overhead of the business database can be reduced. The cold storage database is mainly used to store historical data with low access frequency to reduce storage costs.
[0065] In an optional implementation, when performing service management on multiple first data packets corresponding to multiple data packet identifiers according to multiple data packet identifiers stored in a data packet management queue, it can be implemented in the following manner: in response to receiving a query request for any data packet identifier, obtaining data packet query information corresponding to any data packet identifier, and caching the data packet query information into a preset cache space. By caching the already queried data packet query information into the preset cache space, the processing efficiency of subsequent queries can be improved, thereby optimizing the query performance.
[0066] For ease of understanding, an example is used below to introduce the implementation of the above embodiment. First, some concepts involved in this example are explained:
[0067] Package: As a communication service plan, it is specifically manifested as a form of data traffic packaging. For example, a 12-month package that provides 1G of data traffic per month is a precise response and satisfaction to user needs.
[0068] Sub-package: refers to the specific description and definition of a single billing or service period in the main package. It records in detail the entire service process from the beginning to the end of the period, including but not limited to the allocation and usage of traffic and the status at the end of the period. It is an important supplement and refinement to the service details of the main package.
[0069] Construction: refers to the performance process according to the design plan of the package, which includes a series of operations such as the effectiveness or expiration of the package, changes in IoT strategies, etc.
[0070] In related technologies, the construction system usually adopts the following two processing strategies for packages that may become invalid at any time or need to be activated in the next cycle after reaching the traffic limit in advance in the current cycle:
[0071] (1) For sub-packages that reach the traffic limit ahead of schedule in the current cycle, the system will make a special record and trigger its activation process through a preset timer task at the beginning of the next cycle.
[0072] (2) For sub-packages that have not reached the traffic limit at the end of the cycle, the system also relies on scheduled tasks to automatically activate them in the new cycle.
[0073] In the above two activation processes, technologies such as table partitioning and multi-threading can also be introduced to improve performance. However, with the continuous expansion of business scale, the current system has managed tens of millions of main packages and hundreds of millions of sub-packages, resulting in a significant increase in the system's data processing time when processing package expiration and activation operations, which can no longer effectively meet current business needs.
[0074] Figure 2A schematic diagram of the activation process in the related art is shown, Figure 2 As shown, for scheduled tasks, two triggering modes can be set: triggering every 5 minutes, or triggering every 10 minutes. Correspondingly, for scheduled tasks triggered every 5 minutes, the package data packet corresponding to this type of scheduled task may reach the set data volume in advance and become invalid (that is, this type of task is usually the task corresponding to the data packet that has expired quantitatively). The instantaneous data of this type of quantitatively invalidated tasks is expected to be less than 300,000, and can be monitored by polling to obtain data. For scheduled tasks triggered every 10 minutes, the package data packet corresponding to this type of scheduled task will expire at a fixed expiration time (that is, this type of task is usually the task corresponding to the data packet that has expired periodically). The instantaneous data of this type of timed invalidated tasks is expected to be more than 3 million, and can be divided into 8 threads to poll to obtain data. Each thread can, for example, execute 8 tables, so as to monitor in a multi-threaded parallel manner. Figure 2 In the MQ, delivery means delivering the notification message triggered by the scheduled task to MQ (Message Queue), thereby ensuring reliable transmission of messages in the business system. In specific implementation, two types of scheduled tasks can be used to identify a single sub-packet (i.e., sub-packet) that has failed to be processed, thereby activating a new sub-packet.
[0075] It can be seen that the above-mentioned methods in the related art have at least the following defects:
[0076] (1) Database traffic is too concentrated. During peak hours, the database needs to withstand a large number of query and write operations.
[0077] (2) Low processing efficiency: With the rapid increase in the number of main packages and sub-packages, the amount of data that the system needs to process has become extremely large. The time spent on traversing and checking the status of each sub-package by the scheduled task has increased significantly, resulting in longer processing time for the package to become invalid and effective, affecting the overall performance of the system and user experience.
[0078] (3) Poor real-time performance: The scheduled task approach means that the system can only check and process the status of the sub-package at a preset time point. If the sub-package expires or reaches the traffic limit before the scheduled task is executed, the user may face the risk of service interruption or traffic overage. Therefore, scheduled tasks have the defect of being inflexible.
[0079] In summary, the above method has obvious defects in the management of large-scale package packages, and it is necessary to seek more efficient, real-time and flexible technical solutions to meet business needs.
[0080] To solve the above problems, this example proposes a comprehensive method to optimize construction efficiency, especially for the scenario where package packages are invalidated on the 1st of each month. It aims to complete the invalidation and re-validation of all package packages efficiently and on time, ensuring the normal operation and efficient management of the construction system.
[0081] The key points of this example include the following:
[0082] (1) Peak-shifting processing: Before the peak time, the data that is about to expire (for example, multiple package data packets whose status information meets the preset conditions mentioned above) are checked and written to other storage spaces to reduce the I / O and CPU resource usage of the database. For example, the sub-package data is regularly copied to independent storage, and detailed information such as sub-package data and sub-table indexes are recorded.
[0083] (2) Distributed processing and load balancing: Expand the capacity of MQ queues, distribute package processing tasks (for example, a status monitoring event mentioned above can correspond to a processing task) to multiple servers or processing nodes, and use distributed computing resources for parallel processing. Dynamically adjust computing resources at peak times. Generally, the number of queues can be a multiple of the number of application machines.
[0084] (3) Introducing a caching mechanism: For data that is frequently queried but infrequently updated (such as basic information about meal packages, construction rules, etc.), a caching mechanism can be introduced to reduce the number of database accesses, thereby improving database access efficiency.
[0085] (4) Optimize data storage and query: Based on the characteristics of package data, we can design a reasonable database table structure and index, optimize query statements, and reduce unnecessary data scanning and calculations. For example, we can adopt the following self-developed strategy: only the current sub-packages are stored in the business database, expired sub-packages are transferred to cold storage, and sub-packages in the future are not generated. This self-developed strategy can significantly reduce storage space usage and improve storage efficiency.
[0086] (5) Introduce event-driven: Generate expiration events (i.e., the status monitoring events mentioned above) for sub-package data that is about to expire, set the execution time of the event, and automatically handle it in a timely manner when it expires.
[0087] (6) Self-developed invalid sub-packet processing algorithm: The sub-table index and message sequence are calculated based on the hash code of the IC ID. At the same time, the ordered messages are grouped according to the IC ID, and multi-threaded processing is started based on the number of groups. Due to business sequence requirements, a single card is executed sequentially in a single thread.
[0088] Figure 3 A schematic diagram of the processing flow of this example is shown, as shown in Figure 3As shown, the management method of this example is implemented in the following ways:
[0089] First, the management system scans the job in advance, which can be understood as a task or an operation. For example, a job can be triggered every 10 minutes to obtain the status information of the package data packet. Among them, the package data packets that have reached the quantity in advance (i.e., the data packets that have expired) and the package data packets that have expired (i.e., the data packets that have expired at a fixed time) can be identified. Among them, for the package data packets that have reached the quantity in advance, data can be obtained by polling with a single thread; for the package data packets that have expired, 8 threads can be used to poll and obtain data, and each thread can execute 8 tables. Accordingly, the identified package data packets that are about to expire are written into the pending subtable. The pending subtable is an implementation method of the data packet management queue mentioned above, which is specifically used to record various information such as the expiration time, subtable index, and processing status of the data packet or subpacket.
[0090] Then, configure an expiration processing event (i.e., a specific form of the status monitoring event mentioned above) for each package data packet or sub-packet that is about to expire and is recorded in the pending subtable. Specifically, multiple threads can be started to monitor events for data packets or sub-packets that are about to expire, so that when an expiration processing event is detected, the trigger time is calculated through a multi-threaded delivery method, and the data packet corresponding to the expiration processing event is delivered to the delay MQ. Among them, the delay MQ is a message queue for orderly storing data packets or sub-packets to be processed. In addition, after the data packet or sub-packet expires, it is transferred to the failure processing MQ. Among them, the failure processing MQ is a message queue for storing data packets or sub-packets to be expired. Batch consumption can be used to pull data in batches from the failure processing MQ, and group them by ICC ID, and sort them by expiration time within the group. Multi-threaded processing can be used outside the group, and sequential execution can be performed within the group. Invalid sub-packets are processed by multi-threading, and new sub-packets are activated.
[0091] In summary, this example has at least the following technical effects:
[0092] (1) Peak-shifting processing: By shifting the query business and processing business, the utilization of database resources is greatly reduced, while improving the database's processing capacity and efficiency.
[0093] (2) Self-developed processing strategy: This strategy effectively reduces the system's resource consumption and operating costs, reduces unnecessary data scanning and calculations, improves data access speed and processing efficiency, and thus reduces the system's energy consumption and hardware costs.
[0094] (3) Combining event-driven and real-time processing: This example introduces the event-driven mechanism into the processing of the package in the construction system, realizing the transformation from traditional scheduled task processing to event-based real-time processing. This innovative processing method can respond to the status changes of the package immediately, such as when the traffic reaches the upper limit or the cycle ends, thereby greatly improving the processing efficiency and real-time performance.
[0095] (4) Self-developed invalid sub-packet processing algorithm: This algorithm ensures the orderliness of the business and improves the efficiency of parallel processing.
[0096] In summary, this example has at least the following improvements:
[0097] (1) Event-driven and real-time response mechanism: This is one of the core innovations of this example. By introducing the event-driven mechanism, the system can perceive the status changes of the package in real time (such as traffic usage reaching the preset threshold, the end of the package period, etc.) and immediately trigger the corresponding processing flow. This mechanism avoids the delay and resource waste of traditional timed task processing methods, and significantly improves processing efficiency and real-time performance.
[0098] (2) Self-developed processing strategies and processing algorithms: This example reduces the storage capacity and data of business data while meeting the requirements of business order, combining asynchrony with multithreading to greatly improve processing performance.
[0099] (3) Comprehensive optimization technology: This example comprehensively applies a variety of optimization technologies, including the cache mechanism, which reduces the number of database accesses and improves data access speed; data storage and query optimization speeds up data retrieval by designing a reasonable database table structure and index; and peak shifting processes a large amount of data in advance, improving the throughput of business data. The synergy of these optimization technologies enables the system to process package packages more efficiently and accurately.
[0100] In a second aspect, an embodiment of the present disclosure provides a device for managing package data packets. Figure 4 A schematic diagram of a package data package management device provided by an embodiment of the present disclosure is shown, referring to Figure 4 The management device 400 of the package data packet includes:
[0101] The setting module 41 is adapted to respectively obtain status information of a plurality of package data packets, determine a plurality of package data packets whose status information meets a preset condition as a first data packet, and set a status monitoring event for the first data packet;
[0102] An adding module 42, adapted to add the data packet identifier of the first data packet corresponding to the event triggering notification to the data packet management queue when receiving the event triggering notification of the status monitoring event;
[0103] The management module 43 is adapted to perform service management on a plurality of first data packets corresponding to the plurality of data packet identifiers stored in the data packet management queue.
[0104] In an optional implementation, the preset condition includes: the time interval between the package end time of the package data packet and the current time is less than a first preset interval threshold, and / or the remaining data volume of the package data packet is less than a first preset quantity threshold;
[0105] Furthermore, the status monitoring event is used to monitor whether the time interval between the package end time and the current time of the package data packet is less than a second preset interval threshold, and / or to monitor whether the remaining data volume of the package data packet is less than a second preset quantity threshold;
[0106] The first preset interval threshold is greater than the second preset interval threshold, and the first preset quantity threshold is greater than the second preset quantity threshold.
[0107] In an optional implementation, the management module is specifically adapted to:
[0108] Grouping a plurality of data packet identifiers stored in the data packet management queue to obtain a plurality of data packet identifier groups;
[0109] The plurality of data packet identification groups are processed in parallel by a plurality of data packet management threads.
[0110] In an optional implementation, the management module is specifically adapted to:
[0111] For the first data packet corresponding to the data packet identifier that failed in the i-th time period, perform activation processing in the (i+1)th time period to generate a second data packet corresponding to the data packet identifier that failed in the i-th time period;
[0112] The second data packet is a package data packet within the i+1th time period, and the second data packet is stored in the service database; wherein i is a natural number.
[0113] In an optional implementation, the management module is specifically adapted to:
[0114] For a first data packet corresponding to a data packet identifier that is invalid within an i-th time period, the first data packet is deleted from the business database, and the first data packet is transferred to a cold storage database.
[0115] In an optional implementation, the management module is specifically adapted to:
[0116] In response to receiving a query request for any data packet identifier, obtaining data packet query information corresponding to the any data packet identifier, and caching the data packet query information into a preset cache space.
[0117] The functions or modules included in the device provided in the embodiments of the present disclosure can be used to execute the method described in the embodiments of the first aspect disclosed above. The specific implementation and technical effects thereof can be referred to the description of the method embodiments above, and will not be repeated here for the sake of brevity.
[0118] It should be noted that all modules involved in this embodiment are logic modules. In practical applications, a logic unit may be a physical unit, or a part of a physical unit, or may be implemented as a combination of multiple physical units. In addition, in order to highlight the innovative part of the present disclosure, this embodiment does not introduce units that are not closely related to solving the technical problems proposed by the present disclosure, but this does not mean that there are no other units in this embodiment.
[0119] Reference Figure 5 , an embodiment of the present disclosure provides an electronic device, comprising:
[0120] One or more processors 601;
[0121] A memory 602, on which one or more programs are stored, when the one or more programs are executed by one or more processors, the one or more processors implement any one of the above-mentioned package data packet management methods;
[0122] One or more I / O interfaces 603 are connected between the processor and the memory and are configured to implement information exchange between the processor and the memory.
[0123] Among them, the processor 601 is a device with data processing capabilities, including but not limited to a central processing unit (CPU); the memory 602 is a device with data storage capabilities, including but not limited to random access memory (RAM, more specifically SDRAM, DDR, etc.), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory (FLASH); the I / O interface (read-write interface) 603 is connected between the processor 601 and the memory 602, and can realize information interaction between the processor 601 and the memory 602, including but not limited to a data bus (Bus), etc.
[0124] In some embodiments, the processor 601 , the memory 602 , and the I / O interface 603 are connected to each other through a bus, and further connected to other components of the computing device.
[0125] The present embodiment also provides a computer-readable medium having a computer program stored thereon. When the program is executed by a processor, the method for managing the package data packets provided in the present embodiment is implemented. To avoid repeated description, the specific steps of the method for managing the package data packets are not repeated here.
[0126] It will be appreciated by those skilled in the art that all or some of the steps, systems, and functional modules / units in the methods disclosed above may be implemented as software, firmware, hardware, and appropriate combinations thereof. In hardware implementations, the division between the functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed by several physical components in cooperation. Some or all physical components may be implemented as software executed by a processor, such as a central processing unit, a digital signal processor, or a microprocessor, or implemented as hardware, or implemented as an integrated circuit, such as an application-specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or non-transitory medium) and a communication medium (or temporary medium). As known to those skilled in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store the desired information and can be accessed by a computer. In addition, it is well known to those skilled in the art that communication media typically contain computer-readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.
[0127] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.
[0128] Those skilled in the art will understand that although some embodiments described herein include certain features included in other embodiments but not other features, the combination of features from different embodiments is meant to be within the scope of the present embodiment and to form different embodiments.
[0129] It is to be understood that the above embodiments are merely exemplary embodiments used to illustrate the principles of the present disclosure, but the present disclosure is not limited thereto. For those of ordinary skill in the art, various modifications and improvements can be made without departing from the spirit and substance of the present disclosure, and these modifications and improvements are also considered to be within the scope of protection of the present disclosure.
Claims
1. A method for managing package data packets, characterized in that: The method comprises: Respectively obtain status information of a plurality of package data packets, determine a plurality of package data packets whose status information meets a preset condition as a first data packet, and set a status monitoring event for the first data packet; When receiving an event trigger notification of the status monitoring event, adding a data packet identifier of a first data packet corresponding to the event trigger notification to a data packet management queue; According to the multiple data packet identifiers stored in the data packet management queue, service management is performed on the multiple first data packets corresponding to the multiple data packet identifiers.
2. The method according to claim 1, characterized in that The preset conditions include: the time interval between the package end time of the package data packet and the current time is less than a first preset interval threshold, and / or the remaining data volume of the package data packet is less than a first preset quantity threshold; Furthermore, the status monitoring event is used to monitor whether the time interval between the package end time and the current time of the package data packet is less than a second preset interval threshold, and / or to monitor whether the remaining data volume of the package data packet is less than a second preset quantity threshold; The first preset interval threshold is greater than the second preset interval threshold, and the first preset quantity threshold is greater than the second preset quantity threshold.
3. The method according to claim 2, characterized in that The performing service management on a plurality of first data packets corresponding to the plurality of data packet identifiers according to the plurality of data packet identifiers stored in the data packet management queue comprises: Grouping a plurality of data packet identifiers stored in the data packet management queue to obtain a plurality of data packet identifier groups; The plurality of data packet identification groups are processed in parallel by a plurality of data packet management threads.
4. The method according to claim 3, characterized in that The performing service management on the multiple first data packets corresponding to the multiple data packet identifiers includes: For the first data packet corresponding to the data packet identifier that failed in the i-th time period, perform activation processing in the (i+1)th time period to generate a second data packet corresponding to the data packet identifier that failed in the i-th time period; The second data packet is a package data packet within the i+1th time period, and the second data packet is stored in the service database; wherein i is a natural number.
5. The method according to claim 4, characterized in that The performing service management on the multiple first data packets corresponding to the multiple data packet identifiers further includes: For a first data packet corresponding to a data packet identifier that is invalid within an i-th time period, the first data packet is deleted from the business database, and the first data packet is transferred to a cold storage database.
6. The method according to any one of claims 1 to 5, characterized in that: The performing service management on a plurality of first data packets corresponding to the plurality of data packet identifiers according to the plurality of data packet identifiers stored in the data packet management queue comprises: In response to receiving a query request for any data packet identifier, obtaining data packet query information corresponding to the any data packet identifier, and caching the data packet query information into a preset cache space.
7. A device for managing package data packets, characterized in that: The device comprises: a setting module, adapted to respectively obtain status information of a plurality of package data packets, determine a plurality of package data packets whose status information meets a preset condition as a first data packet, and set a status monitoring event for the first data packet; an adding module adapted to add the data packet identifier of the first data packet corresponding to the event triggering notification to the data packet management queue when receiving the event triggering notification of the status monitoring event; The management module is adapted to perform service management on a plurality of first data packets corresponding to the plurality of data packet identifiers stored in the data packet management queue.
8. An electronic device, characterized in that: include: one or more processors; A memory having one or more programs stored thereon, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 6; One or more I / O interfaces are connected between the processor and the memory and are configured to implement information interaction between the processor and the memory.
9. A computer readable medium having a computer program stored thereon, wherein the program, when executed by a processor, implements the method according to any one of claims 1 to 6.
10. A computer program product, characterized in that The invention comprises a computer-readable code, or a non-volatile computer-readable storage medium carrying the computer-readable code. When the computer-readable code runs in a processor of an electronic device, the processor in the electronic device executes the method as claimed in any one of claims 1 to 6.