Tax form intelligent asynchronous processing and real-time query method based on dynamic partition

Optimizing tax form processing through dynamic partitioning policies and asynchronous task queues solves data latency and security privacy issues, and realizes efficient and secure tax data processing and query.

CN120492470APending Publication Date: 2025-08-15广州泓财科技有限公司

Patent Information

Application Number
CN202510596874.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-09
Publication Date
2025-08-15

AI Technical Summary

Technical Problem

The existing tax form processing technology has problems such as data delay, insufficient data quality, incomplete security and privacy protection, and low data interaction efficiency, especially in the low timeliness of data transmission across systems and departments, which affects the efficiency of taxpayers' payment.

Method used

The intelligent asynchronous processing method of tax forms based on dynamic partitioning is adopted, and a unique request identification code is generated by analyzing the tax form feature fields. The dynamic partitioning strategy is used to generate sub-identification and combination identifiers, and a dynamic partitioning database is built, and multi-dimensional query is realized through asynchronous task queues and dynamic priority adjustments.

Benefits of technology

It improves the rationality and efficiency of data storage, reduces data latency, improves data interaction efficiency and accuracy, ensures data security and privacy, and comprehensively improves the intelligence level and work efficiency of tax form processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120492470A_ABST
    Figure CN120492470A_ABST
Patent Text Reader

Abstract

The invention discloses a dynamic partition-based tax form intelligent asynchronous processing and real-time query method, which comprises the following steps of: in response to multiple groups of tax form data, analyzing a characteristic field numerical value to generate a unique request identification code; carrying out numerical processing on the feature field to generate a dynamic partition sub-identifier, and aggregating to generate a dynamic partition combination identifier; matching a target data partition corresponding to the dynamic partition combination identifier through a constructed dynamic partition mapping table, and importing structured form data to form a dynamic partition database; constructing an asynchronous task key value pair, writing the asynchronous task key value pair into an asynchronous message queue, regularly scanning the asynchronous message queue, and when a to-be-processed task is detected, identifying whether the task queue contains a priority mark or not, and dynamically adjusting the execution priority of the task queue; and implementing multi-dimensional tax data query from the dynamic partition database based on real-time query conditions and the optimized task queue. The tedious and low-efficiency manual operation is avoided, and the processing efficiency of the form and the tax data is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of tax data processing, and in particular to a method for intelligent asynchronous processing and real-time query of tax forms based on dynamic partitioning. Background Art

[0002] In the current tax field, with the continuous advancement of digital transformation, tax form processing faces many challenges. From the perspective of data collection, some key data is missing, such as the difficulty in obtaining third-party data. In terms of data interaction, offline data transmission is delayed and relies on the subjective initiative of the data transmission department. In addition, the data business rules of various departments are inconsistent. After the tax department obtains the data, it takes a lot of time to clean, organize and process it. System data interaction is also delayed. Due to the limitations of system computing power, verification and conversion rules, the timeliness of cross-system and cross-departmental transmission of some tax and fee data is not high, resulting in taxpayers and payers running around and long waiting times. Data release is also delayed. During the collection period, the information system faces the challenges of high traffic and high concurrency. The time for system function upgrades and large-scale data import is limited, affecting data use.

[0003] In addition, existing tax form processing technology also has deficiencies in data quality. Data numerical errors, invalidations, and logical errors often occur. For example, taxpayers and payers submit inaccurate and non-standard data, some data are not updated in a timely manner, and imperfect system verification rules lead to the successful declaration of illogical data. Its security and privacy protection is imperfect, and there is a risk of staff arbitrarily tampering with data, leaking data, and data leakage caused by personnel turnover in external software companies. Summary of the Invention

[0004] In order to solve at least one of the above-mentioned technical problems, the present invention provides a method for intelligent asynchronous processing and real-time query of tax forms based on dynamic partitioning.

[0005] In a first aspect, the present invention provides a method for intelligent asynchronous processing and real-time query of tax forms based on dynamic partitioning, the method comprising: In response to multiple sets of tax form data submitted by users, parsing and extracting characteristic field value sets for dynamic partitioning in each tax form, and dynamically generating a unique request identification code for each set of tax forms; Based on the preset dynamic partitioning strategy, the characteristic field value set is calculated and processed to generate a dynamic partition sub-identifier. Multiple dynamic partition sub-identifiers of the same source tax form are aggregated to generate a dynamic partition combination identifier. Matching the target data partition corresponding to the dynamic partition combination identifier through a pre-built dynamic partition mapping table, importing the structured form data into the target data partition, completing the distributed storage of multiple sets of tax form data, and forming a dynamic partition database; Construct an asynchronous task key-value pair based on the unique request identifier and structured form data, write it into the asynchronous message queue, and scan the asynchronous message queue regularly according to the preset time period to detect the form asynchronous processing tasks to be executed; When a pending task is detected, it identifies whether the tax form data in the task queue contains a priority tag and dynamically adjusts the execution priority of the task queue; based on the real-time query conditions entered by the user and the optimized task queue, it implements multi-dimensional tax data query from the dynamic partitioned database.

[0006] Preferably, the step of calculating and processing the characteristic field value set based on a preset dynamic partitioning strategy to generate a dynamic partition sub-identifier includes: Divide the characteristic fields in tax forms into three categories: core partition fields, auxiliary partition fields, and dynamic correction fields, and configure dynamic weight coefficients for each field category; An improved consistent hashing algorithm is used for the core partition field to generate the first hash value, and a dynamic modulus hash is used for the auxiliary partition field to generate the second hash value. A dynamic correction factor is introduced for the dynamic correction field to monitor the storage load of each partition in real time. A hybrid calculation is performed based on the first Hash value and the second Hash value to generate an initial identifier, and the initial identifier is corrected using a dynamic correction factor to generate a dynamic partition sub-identifier.

[0007] Preferably, after executing the multi-dimensional tax data query from the dynamic partition database, the method further includes: Generate query logs and read abnormal query frequencies in the query logs; Determine whether the abnormal query frequency exceeds the preset abnormal frequency threshold. When it exceeds the abnormal frequency threshold, regroup the three types of feature fields and update the splitting rules.

[0008] Preferably, matching the target data partition corresponding to the dynamic partition combination identifier through a pre-built dynamic partition mapping table includes: A double-layer hash structure is used to construct a mapping table, including the construction of a primary index and a secondary index; The primary index uses the first 16 bits of the dynamic partition combination identifier as the key and locates the physical server cluster through the cuckoo hash algorithm. The secondary index uses the last 16 bits of the combination identifier as the value and adopts an improved skip list structure to store metadata for specific data partitions. A three-stage matching process is determined, including an exact matching stage, a fuzzy matching stage, and a dynamic creation stage, and the dynamic partition mapping table is matched to the target data partition corresponding to the dynamic partition combination identifier through the three-stage matching process.

[0009] Preferably, the method further comprises: The load status of each target data partition is monitored in real time. When a target data partition is identified as overloaded, a migratable partition is matched for the overloaded target data partition, and the data of the overloaded target data partition is automatically migrated to the migratable partition.

[0010] Preferably, the method further comprises: An event-driven preheating mechanism is set up, including automatically executing a preheating task when a query request triggers a target event; the target event includes query requests exceeding a preset number of requests, or the query time being within a preset time period; the preheating task adopts a staged preheating mode.

[0011] In a second aspect, the present invention further provides a tax form intelligent asynchronous processing and real-time query system based on dynamic partitioning, the system comprising: a characteristic field extraction unit for parsing and extracting characteristic field value sets for dynamic partitioning from multiple sets of tax form data submitted by users, and dynamically generating a unique request identification code for each set of tax form data; An identifier combination unit, configured to calculate and process a characteristic field value set based on a preset dynamic partitioning strategy to generate a dynamic partition sub-identifier, and to aggregate multiple dynamic partition sub-identifiers of the same source tax form to generate a dynamic partition combination identifier; A database construction unit is configured to match a target data partition corresponding to the dynamic partition combination identifier using a pre-constructed dynamic partition mapping table, import the structured form data into the target data partition, and form a dynamic partition database after completing the distributed storage of multiple sets of tax form data; An asynchronous task detection unit is used to construct an asynchronous task key-value pair based on the unique request identification code and structured form data, write the key-value pair into the asynchronous message queue, scan the asynchronous message queue regularly according to a preset time period, and detect the form asynchronous processing task to be executed; The tax data query unit is used to identify whether the tax form data in the task queue contains a priority tag when a pending task is detected, and dynamically adjust the execution priority of the task queue; based on the real-time query conditions entered by the user and the optimized task queue, it implements multi-dimensional tax data queries from the dynamic partitioned database.

[0012] In a third aspect, the present invention also provides an electronic device comprising a processor and a memory, wherein the memory is used to store computer program code, and the computer program code comprises computer instructions. When the processor executes the computer instructions, the electronic device executes the method as described in the first aspect above and any possible implementation thereof.

[0013] In a fourth aspect, the present invention also provides a computer-readable storage medium, in which a computer program is stored. The computer program includes program instructions, and when the program instructions are executed by a processor of an electronic device, the processor executes the method as described in the first aspect above and any possible implementation method thereof.

[0014] Compared with the prior art, the present invention has the following beneficial effects: The intelligent asynchronous processing and real-time query method for tax forms based on dynamic partitioning provided by the present invention effectively solves many of the aforementioned technical problems. This method parses and extracts the characteristic field value set used for dynamic partitioning in tax forms, generates a unique request identification code, utilizes a preset dynamic partitioning strategy to generate dynamic partition sub-identifiers and combined identifiers, and implements distributed storage with the help of a dynamic partition mapping table to construct a dynamic partitioned database. This method solves the problems of rationality and efficiency in data storage, improves data interaction efficiency, and reduces data latency. By constructing asynchronous task key-value pairs and writing them into an intelligent asynchronous message queue, as well as performing scheduled scanning and dynamically adjusting task priorities, form processing efficiency is improved, avoiding the tedious and inefficient manual operation. Multi-dimensional queries are performed from the dynamic partitioned database based on real-time query conditions input by users, improving the convenience and accuracy of data application. Furthermore, the structured processing and distributed storage of data throughout the process ensure data security and privacy to a certain extent, effectively solving the problems of data quality, data application, security and privacy in the prior art, and comprehensively improving the intelligent level and work efficiency of tax form processing.

[0015] It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the background technology, the drawings required for use in the embodiments of the present invention or the background technology will be described below.

[0017] The accompanying drawings herein are incorporated into and constitute a part of the specification. These drawings illustrate embodiments consistent with the present disclosure and, together with the specification, are used to explain the technical solutions of the present disclosure.

[0018] Figure 1 A flowchart of a method for intelligent asynchronous processing and real-time query of tax forms based on dynamic partitioning provided by an embodiment of the present invention; Figure 2 for Figure 1 Schematic diagram of the process of the sub-steps of S20 in the step; Figure 3A schematic diagram of the structure of a tax form intelligent asynchronous processing and real-time query system based on dynamic partitioning provided by an embodiment of the present invention; Figure 4 A schematic diagram of the hardware structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0019] In order to enable those skilled in the art to better understand the solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings of the embodiments of the present invention. Obviously, the embodiments described are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts shall fall within the scope of protection of the present invention.

[0020] References herein to "embodiments" mean that a particular feature, structure, or characteristic described in connection with the embodiments may be included in at least one embodiment of the present invention. The appearance of this phrase in various places in the specification does not necessarily refer to the same embodiment, nor does it constitute a separate or alternative embodiment that is mutually exclusive of other embodiments. It is understood, both explicitly and implicitly, by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0021] See also Figure 1 , Figure 1 The present invention provides a method for intelligent asynchronous processing and real-time query of tax forms based on dynamic partitioning. Figure 1 As shown, the method includes: S10. In response to multiple sets of tax form data submitted by the user, parse and extract characteristic field value sets for dynamic partitioning in each tax form, and dynamically generate a unique request identification code for each set of tax forms; Build a receiving interface to receive multiple sets of tax form data submitted by users. This data can be submitted through web forms, file uploads, and other methods. Use a parsing tool to parse the tax forms and identify the individual fields. Based on pre-set rules, extract characteristic fields from the parsed forms for dynamic partitioning, such as taxpayer type, tax region, and tax period. Extract the values of these fields to form a characteristic field value set. Use a UUID (Universally Unique Identifier) algorithm to generate a unique request identifier for each set of tax forms, ensuring uniqueness within the system.

[0022] S20. Calculate and process the characteristic field value set based on a preset dynamic partitioning strategy to generate a dynamic partition sub-identifier, and aggregate multiple dynamic partition sub-identifiers of the same source tax form to generate a dynamic partition combination identifier; See also Figure 2 Preferably, in one embodiment, the calculation and processing of the characteristic field value set based on the preset dynamic partitioning strategy to generate the dynamic partition sub-identifier includes: S201. Divide the characteristic fields in the tax form into three categories, including core partition fields, auxiliary partition fields, and dynamic modification fields, and configure a dynamic weight coefficient for each field category; The characteristic fields in the tax form are pre-divided into three categories: Core partition fields (such as enterprise type code, region code, preferably with a weight of 60%) Auxiliary partition fields (such as declaration period, industry classification code, weight is preferably set to 30%) Dynamically modify fields (such as historical filing frequency, form complexity score, with the weight preferably set to 10%) Furthermore, a dynamic weight coefficient is configured for each field category, and the data distribution characteristics of the past three months are statistically analyzed through a sliding window algorithm. For example, the weight ratio can be automatically adjusted once a week.

[0023] S202. Use an improved consistent hashing algorithm for the core partition field to generate a first hash value, and use a dynamic modulus hashing algorithm for the auxiliary partition field to generate a second hash value; introduce a dynamic correction factor for the dynamic correction field to monitor the storage load of each partition in real time; An improved consistent hashing algorithm is used for the core partition field to generate a first hash value H1, such as mapping the enterprise type code to a 128-bit hash; Use dynamic modulus hashing on the auxiliary partition field to generate the second hash value H2. H2 is the percentage obtained by multiplying the industry code by the dynamic prime number table (current month), and then multiplying it by the partition cardinality. A dynamic correction factor λ (0.9≤λ≤1.1) is introduced to monitor the storage load of each partition in real time.

[0024] S203: Perform a hybrid calculation based on the first Hash value and the second Hash value to generate an initial identifier, and use a dynamic correction factor to correct the initial identifier to generate a dynamic partition sub-identifier.

[0025] Perform a mixed calculation: Sub-ID = truncate (last 16 bits of H1) rotate (middle 24 bits of H2, current week number) Superposition dynamic correction: Final sub-ID = (sub-ID × λ) >> 8. 32-bit valid value is retained.

[0026] For example, when a manufacturing enterprise (type code B13) declares in East China (code 06): Base hash H1: 7A9E (hash fragment of B13) Dynamic hash H2: 3D8F (calculated by 06 and the current month's prime number 31) Correction factor λ: 0.98 (the current partition load is high) The final sub-identifier is 7A9E3D8F, which is corrected to 6C2D after λ. This is the final dynamic partition sub-identifier.

[0027] Finally, multiple dynamic partition sub-identifiers from the same tax form are aggregated to generate a dynamic partition composite identifier. This aggregation can be done using methods such as string concatenation.

[0028] In this embodiment, through differentiated processing of three types of fields, the stability of the core business logic is guaranteed while taking into account the adaptability to business changes; by introducing the λ factor to achieve self-balancing of partition capacity, the data skew problem is reduced compared to traditional static hashing; by mixing the innovative combination of consistent hashing and dynamic modulus, the horizontal expansion capability is improved while ensuring data relevance.

[0029] S30. Matching the target data partition corresponding to the dynamic partition combination identifier using a pre-built dynamic partition mapping table, importing the structured form data into the target data partition, completing the distributed storage of multiple sets of tax form data, and forming a dynamic partition database; Preferably, matching the target data partition corresponding to the dynamic partition combination identifier through a pre-built dynamic partition mapping table includes: A double-layer hash structure is used to construct a mapping table, including the construction of a primary index and a secondary index; The primary index uses the first 16 bits of the dynamic partition combination identifier as the key and locates the physical server cluster through the cuckoo hash algorithm. The secondary index uses the last 16 bits of the combination identifier as the value and adopts an improved skip list structure to store metadata for specific data partitions. A three-stage matching process is determined, including an exact matching stage, a fuzzy matching stage, and a dynamic creation stage, and the dynamic partition mapping table is matched to the target data partition corresponding to the dynamic partition combination identifier through the three-stage matching process.

[0030] In this embodiment, constructing a mapping table with a double-layer hash structure includes: Level 1 index: Uses the first 16 bits of the dynamic partition combination identifier as the key and locates the physical server cluster using the Cuckoo Hash algorithm. Secondary index: uses the last 16 bits of the composite identifier as the value and adopts an improved skip table structure to store metadata of specific data partitions (including partition status, storage capacity, and access latency); Determine the three-stage matching process: Exact matching stage: Directly matching the complete combination identifier in the mapping table cache layer, with a hit rate of up to 85%; Fuzzy matching stage: When exact matching fails, the region code and company type in the identifier are extracted as a composite key, and candidate partitions with a similarity greater than 90% are retrieved using locality-sensitive hashing. Dynamic creation phase: If there is no suitable partition, the automatic expansion and contraction mechanism is triggered to create a new partition, for example, if five consecutive matching failures are detected.

[0031] Preferably, in one embodiment, Embed a dynamic scoring matrix in the mapping table, which is updated every 30 minutes: Capacity factor (40% weight): (1 - current partition data volume / maximum capacity) × 100; Popularity factor (35% weight): log(number of queries in the last hour + 1) × 20; Health factor (25% weight): (1 - number of failures / 10) × 100; Target partition selection formula: Final score = Σ(factor value × weight) + urgent task bonus; select the partition with the smallest hash remainder among the top three final scores.

[0032] Furthermore, the structured form data is imported into the target data partition. Database operations can be used to insert the data into the corresponding table. Using a distributed storage system, multiple sets of tax form data are stored on different nodes, improving data reliability and availability.

[0033] The above method uses a dynamic partition mapping table to accurately store data in the corresponding target data partition, improving data storage efficiency. By using a distributed storage system, data reliability and availability are improved, avoiding single points of failure.

[0034] S40: construct an asynchronous task key-value pair based on the unique request identification code and the structured form data, write the key-value pair into the asynchronous message queue, and periodically scan the asynchronous message queue according to a preset time period to detect the form asynchronous processing task to be executed; Using the unique request identifier as the key and the structured form data as the value, we construct an asynchronous task key-value pair. We use the message queue system to write these asynchronous task key-value pairs to the message queue. We use the scheduled task framework to periodically scan the asynchronous message queue at a preset interval to detect pending asynchronous form processing tasks. By using the asynchronous message queue, we make form processing tasks asynchronous, improving the system's concurrent processing capabilities. We also periodically scan the message queue at a preset interval to ensure that pending tasks are processed promptly.

[0035] S50. When a pending task is detected, identify whether the tax form data in the task queue contains a priority tag and dynamically adjust the execution priority of the task queue; based on the real-time query conditions input by the user and the optimized task queue, implement multi-dimensional tax data query from the dynamic partitioned database.

[0036] When processing pending tasks, the tax form data is checked for a priority tag. A field can be added to the form data to indicate the priority. Based on the priority tag, the execution priority of the task queue is dynamically adjusted. For example, high-priority tasks can be moved to the front of the queue for priority processing. Based on real-time query criteria entered by users, multi-dimensional tax data queries are performed from the dynamic partitioned database. Queries can be performed using SQL queries or the database query API. By dynamically adjusting the execution priority of the task queue, high-priority tasks are processed promptly, improving system responsiveness. Based on real-time query criteria entered by users, multi-dimensional tax data queries are performed from the dynamic partitioned database to meet users' real-time query needs.

[0037] In summary, the method provided in this embodiment parses and extracts the characteristic field value set used for dynamic partitioning in the tax form, generates a unique request identification code, uses a preset dynamic partitioning strategy to generate a dynamic partition sub-identifier and a combined identifier, and uses a dynamic partition mapping table to achieve distributed storage to build a dynamic partition database, thereby solving the rationality and efficiency of data storage, improving data interaction efficiency, and reducing data latency. By constructing asynchronous task key-value pairs and writing them into an intelligent asynchronous message queue, as well as performing scheduled scanning and dynamically adjusting task priorities, the efficiency of form processing is improved, and the tedious and inefficient manual operations are avoided. Multi-dimensional queries are performed from the dynamic partition database based on real-time query conditions input by the user, which improves the convenience and accuracy of data application. At the same time, the structured processing and distributed storage of data throughout the process ensure the security and privacy of the data to a certain extent, effectively solving the problems of data quality, data application, security and privacy in the existing technology, and comprehensively improving the intelligence level and work efficiency of tax form processing.

[0038] In one embodiment, after performing multi-dimensional tax data query from the dynamic partition database, the method further includes: Generate query logs and read abnormal query frequencies in the query logs; Determine whether the abnormal query frequency exceeds the preset abnormal frequency threshold. When it exceeds the abnormal frequency threshold, regroup the three types of feature fields and update the splitting rules.

[0039] Specifically, after completing a multi-dimensional tax data query operation from a dynamically partitioned database, the system automatically generates a query log. The log should record key query information, such as the query initiation timestamp; the user ID initiating the query (e.g., taxpayer ID, tax officer account number, etc.); query conditions, including the involved feature fields and their values; query success and any error messages. The query log then reads the frequency of abnormal queries. The query log is read periodically (e.g., daily, hourly, etc.) to calculate the frequency of abnormal queries. Abnormal queries can be defined as queries that fail or take an excessively long time to complete. The specific steps are as follows: Open the query log file, parse the log records line by line, determine whether they are abnormal queries, count the number of abnormal queries, and calculate the abnormal query frequency based on the statistical period. Furthermore, determine whether the abnormal query frequency exceeds a preset abnormal frequency threshold and compare the calculated abnormal query frequency with the preset abnormal frequency threshold. This threshold can be set based on historical system data and business requirements, for example, 5%. If the abnormal query frequency exceeds the preset threshold, it indicates that the current dynamic partitioning strategy may no longer be suitable for the data query pattern and requires adjustment. The specific steps are as follows: Determine three types of feature fields: These three types of feature fields can be feature fields used for dynamic partitioning, such as taxpayer type, tax region, tax period, etc.

[0040] Recombining feature fields: Combine these three types of feature fields in different ways. For example, if the original combination is (taxpayer type, tax area), you can now try (tax area, tax period) and other combinations.

[0041] Update splitting rules: Update the splitting rules of dynamic partitions based on the recombined feature fields, such as recalculating the generation rules of dynamic partition sub-identifiers and combined identifiers.

[0042] In this embodiment, by generating query logs and monitoring abnormal query frequencies, system problems such as irrational data partitioning and query logic errors can be promptly identified. When the abnormal query frequency exceeds a threshold, the partitioning strategy is promptly adjusted to prevent system performance degradation or crashes caused by query issues, thereby improving system stability. Based on query log feedback, feature fields are recombined and splitting rules are updated to make the dynamic partitioning strategy more consistent with actual query patterns. This reduces unnecessary cross-partition queries, improves query efficiency, shortens query response time, and enhances the user experience.

[0043] In one embodiment, the method further comprises: The load status of each target data partition is monitored in real time. When a target data partition is identified as overloaded, a migratable partition is matched for the overloaded target data partition, and the data of the overloaded target data partition is automatically migrated to the migratable partition.

[0044] Real-time monitoring of the load status of each target data partition, including: Select load metrics: Determine the metrics used to measure the data partition load, such as CPU usage, disk I / O rate, memory usage, number of query requests, etc. These metrics can reflect the workload of the data partition from different aspects.

[0045] Set the monitoring cycle: According to the actual situation and performance requirements of the system, set an appropriate monitoring cycle, such as monitoring every 5 minutes or 10 minutes.

[0046] Deploy monitoring tools: Use the system's built-in monitoring tools or third-party monitoring software to collect and record the load indicators of each target data partition in real time.

[0047] Identify if a target data partition is overloaded. This involves setting overload thresholds for each load metric based on the system's hardware resources and performance requirements. For example, if CPU utilization exceeds 80% or the number of query requests exceeds 1000 per minute, the data partition is considered overloaded. Real-time load metrics are compared with the set overload thresholds. If one or more load metrics for a target data partition exceed the thresholds, the partition is considered overloaded. Determine the conditions that partitions must meet for migration, such as sufficient remaining storage space and low load. Traverse all target data partitions and select those that meet the migration criteria. Develop an appropriate data migration strategy based on data characteristics and business needs, such as migrating data based on chronological order or data volume. Finally, use tools provided by the database management system or write scripts to migrate data from the overloaded target data partition to the migratable partition. During the migration process, ensure data integrity and consistency, and record relevant information such as migration time and data volume.

[0048] Through real-time monitoring and data migration, the above-mentioned embodiments can promptly detect and resolve data partition overload issues, avoiding performance issues such as slow system response and query timeouts caused by overload, thereby improving the processing capacity and response speed of the entire system. Migrating data from overloaded partitions to portable partitions can make the loads of various data partitions more balanced, fully utilize the system's hardware resources, avoid situations where some partition resources are idle while others are under-utilized, improve resource utilization, enhance system reliability and stability, and ensure the normal operation of tax services. At the same time, it can reduce the waiting time for users when querying tax data, avoid query failures due to system failures, and thus improve the user experience.

[0049] In one embodiment, the method further comprises: An event-driven preheating mechanism is set up, including automatically executing a preheating task when a query request triggers a target event; the target event includes query requests exceeding a preset number of requests, or the query time being within a preset time period; the preheating task adopts a staged preheating mode.

[0050] In this embodiment, target event monitoring rules are set, including determining a reasonable preset number of requests based on the system's historical query data, performance indicators, and business needs. For example, the number of query requests per hour reaching 1,000 is set as a trigger threshold. The peak and trough periods of system usage are analyzed to determine the preset time period. For example, from 9 a.m. to 5 p.m. three days before the monthly tax filing deadline is usually the peak period for query demand, and this time period can be set as the preset time period. A monitoring module is deployed in the system to monitor the number and time of query requests in real time. The module can regularly count the number of query requests (such as every minute) and record the current time to determine whether the target event is triggered.

[0051] Then, define a phased warm-up mode, including dividing the warm-up task into multiple stages according to the characteristics and needs of the system. For example, it can be divided into a data loading stage, a cache warm-up stage, and an index optimization stage. Determine specific tasks for each stage. For example, in the data loading stage, load commonly used tax data from the storage device into the memory; in the cache warm-up stage, store frequently queried data in the cache; in the index optimization stage, create or update indexes for commonly used query fields. Determine the execution order and time interval for each stage. For example, execute the data loading stage first, wait for 5 minutes before executing the cache warm-up stage, and then wait for 3 minutes before executing the index optimization stage. When the monitoring module detects that the target event is triggered, it automatically starts the warm-up task and executes the tasks of each stage in sequence according to the phased warm-up mode.

[0052] In this way, by automatically executing warm-up tasks during peak query request periods or when the number of requests reaches a certain threshold, frequently used data is loaded into memory, cached, and indexes optimized. This can significantly reduce the data reading and processing time for subsequent queries, thereby improving the system's response speed and enabling users to obtain query results more quickly. The phased warm-up mode can perform targeted data preparation and optimization based on the actual system conditions, avoiding excessive system resource usage caused by loading too much data at one time. Fast response speeds and stable system performance can reduce user waiting time during the query process, thereby improving the user's experience with the system. The warm-up task can prepare frequently used data and indexes in advance, avoiding the system from temporarily loading and processing large amounts of data when query requests arrive in large numbers, thereby improving system resource utilization and reducing system operating costs.

[0053] See also Figure 3 In one embodiment, the present invention further provides a tax form intelligent asynchronous processing and real-time query system based on dynamic partitioning, the system comprising: The characteristic field extraction unit 100 is used to parse and extract characteristic field value sets for dynamic partitioning in response to multiple sets of tax form data submitted by users, and dynamically generate a unique request identification code for each set of tax forms; The identifier combination unit 200 is used to calculate and process the characteristic field value set based on a preset dynamic partitioning strategy to generate a dynamic partition sub-identifier, and to aggregate multiple dynamic partition sub-identifiers of the same source tax form to generate a dynamic partition combination identifier; The database construction unit 300 is configured to match the target data partition corresponding to the dynamic partition combination identifier using a pre-built dynamic partition mapping table, import the structured form data into the target data partition, and form a dynamic partition database after completing the distributed storage of multiple sets of tax form data; The asynchronous task detection unit 400 is used to construct an asynchronous task key-value pair based on the unique request identification code and the structured form data, write the key-value pair into the asynchronous message queue, and periodically scan the asynchronous message queue according to a preset time period to detect the form asynchronous processing task to be executed; The tax data query unit 500 is used to identify whether the tax form data in the task queue contains a priority tag when a pending task is detected, and dynamically adjust the execution priority of the task queue; based on the real-time query conditions input by the user and the optimized task queue, implement multi-dimensional tax data query from the dynamic partitioned database.

[0054] It can be understood that the functions or modules included in the system provided in this embodiment can be used to execute the method described in the above method embodiment. Its specific implementation can refer to the description of the above method embodiment. For the sake of brevity, it will not be repeated here.

[0055] The present invention also provides an electronic device, including a processor and a memory, wherein the memory is used to store computer program code, and the computer program code includes computer instructions. When the processor executes the computer instructions, the electronic device executes a method as described in any one of the possible implementation modes.

[0056] The present invention also provides a computer-readable storage medium, in which a computer program is stored. The computer program includes program instructions. When the program instructions are executed by a processor of an electronic device, the processor executes a method as described in any one of the possible implementation methods described above.

[0057] See also Figure 4 , Figure 4 A schematic diagram of the hardware structure of an electronic device provided by an embodiment of the present invention.

[0058] The electronic device 2 includes a processor 21, a memory 22, an input device 23, and an output device 24. The processor 21, memory 22, input device 23, and output device 24 are coupled via a connector, which may include various interfaces, transmission lines, or buses, etc., although this is not limited in the present embodiment. It should be understood that in various embodiments of the present invention, coupling refers to interconnection in a specific manner, including direct connection or indirect connection through other devices, such as various interfaces, transmission lines, buses, etc.

[0059] The processor 21 may be one or more graphics processing units (GPUs). If the processor 21 is a GPU, the GPU may be a single-core GPU or a multi-core GPU. Alternatively, the processor 21 may be a processor group consisting of multiple GPUs, with the multiple processors coupled to each other via one or more buses. Alternatively, the processor may be another type of processor, and this is not limited in this embodiment of the present invention.

[0060] The memory 22 can be used to store computer program instructions and various computer program codes, including program codes for executing the embodiments of the present invention. Optionally, the memory includes, but is not limited to, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), or compact disc read-only memory (CD-ROM), and is used for related instructions and data.

[0061] The input device 23 is used to input data and / or signals, and the output device 24 is used to output data and / or signals. The input device 23 and the output device 24 can be independent devices or an integrated device.

[0062] It is understandable that in the embodiment of the present invention, the memory 22 is not only used to store relevant instructions, and the embodiment of the present invention does not limit the specific data stored in the memory.

[0063] It is understandable that Figure 4 Only a simplified design of an electronic device is shown. In actual applications, the electronic device may further include other necessary components, including but not limited to any number of input / output devices, processors, memories, etc., and all video analysis devices that can implement the embodiments of the present invention are within the scope of protection of the present invention.

[0064] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present invention.

Claims

1. A method for intelligent asynchronous processing and real-time query of tax forms based on dynamic partitioning, characterized in that: The method comprises: In response to multiple sets of tax form data submitted by users, parsing and extracting characteristic field value sets for dynamic partitioning in each tax form, and dynamically generating a unique request identification code for each set of tax forms; Based on the preset dynamic partitioning strategy, the characteristic field value set is calculated and processed to generate a dynamic partition sub-identifier. Multiple dynamic partition sub-identifiers of the same source tax form are aggregated to generate a dynamic partition combination identifier. Matching the target data partition corresponding to the dynamic partition combination identifier through a pre-built dynamic partition mapping table, importing the structured form data into the target data partition, completing the distributed storage of multiple sets of tax form data, and forming a dynamic partition database; Construct an asynchronous task key-value pair based on the unique request identifier and structured form data, write it into the asynchronous message queue, and scan the asynchronous message queue regularly according to the preset time period to detect the form asynchronous processing tasks to be executed; When a pending task is detected, it identifies whether the tax form data in the task queue contains a priority tag and dynamically adjusts the execution priority of the task queue; based on the real-time query conditions entered by the user and the optimized task queue, it implements multi-dimensional tax data query from the dynamic partitioned database.

2. The method for intelligent asynchronous processing and real-time query of tax forms based on dynamic partitioning according to claim 1 is characterized in that: The step of calculating and processing the characteristic field value set based on the preset dynamic partitioning strategy to generate a dynamic partition sub-identifier includes: Divide the characteristic fields in tax forms into three categories: core partition fields, auxiliary partition fields, and dynamic correction fields, and configure dynamic weight coefficients for each field category; An improved consistent hashing algorithm is used for the core partition field to generate the first hash value, and a dynamic modulus hash is used for the auxiliary partition field to generate the second hash value. A dynamic correction factor is introduced for the dynamic correction field to monitor the storage load of each partition in real time. A hybrid calculation is performed based on the first Hash value and the second Hash value to generate an initial identifier, and the initial identifier is corrected using a dynamic correction factor to generate a dynamic partition sub-identifier.

3. The method for intelligent asynchronous processing and real-time query of tax forms based on dynamic partitioning according to claim 2 is characterized in that: After implementing the multi-dimensional tax data query from the dynamic partition database, the method further includes: Generate query logs and read abnormal query frequencies in the query logs; Determine whether the abnormal query frequency exceeds the preset abnormal frequency threshold. When it exceeds the abnormal frequency threshold, regroup the three types of feature fields and update the splitting rules.

4. The method for intelligent asynchronous processing and real-time query of tax forms based on dynamic partitioning according to claim 1 is characterized in that: The matching of the target data partition corresponding to the dynamic partition combination identifier by using a pre-built dynamic partition mapping table includes: A double-layer hash structure is used to construct a mapping table, including the construction of a primary index and a secondary index; The primary index uses the first 16 bits of the dynamic partition combination identifier as the key and locates the physical server cluster through the cuckoo hash algorithm. The secondary index uses the last 16 bits of the combination identifier as the value and adopts an improved skip list structure to store metadata for specific data partitions. A three-stage matching process is determined, including an exact matching stage, a fuzzy matching stage, and a dynamic creation stage, and the dynamic partition mapping table is matched to the target data partition corresponding to the dynamic partition combination identifier through the three-stage matching process.

5. The method for intelligent asynchronous processing and real-time query of tax forms based on dynamic partitioning according to claim 1 is characterized in that: The method further comprises: The load status of each target data partition is monitored in real time. When a target data partition is identified as overloaded, a migratable partition is matched for the overloaded target data partition, and the data of the overloaded target data partition is automatically migrated to the migratable partition.

6. The method for intelligent asynchronous processing and real-time query of tax forms based on dynamic partitioning according to claim 1 is characterized in that: The method further comprises: An event-driven preheating mechanism is set up, including automatically executing a preheating task when a query request triggers a target event; the target event includes query requests exceeding a preset number of requests, or the query time being within a preset time period; the preheating task adopts a staged preheating mode.

7. A tax form intelligent asynchronous processing and real-time query system based on dynamic partitioning, characterized by: The system comprises: a characteristic field extraction unit for parsing and extracting characteristic field value sets for dynamic partitioning from multiple sets of tax form data submitted by users, and dynamically generating a unique request identification code for each set of tax form data; An identifier combination unit, configured to calculate and process a characteristic field value set based on a preset dynamic partitioning strategy to generate a dynamic partition sub-identifier, and to aggregate multiple dynamic partition sub-identifiers of the same source tax form to generate a dynamic partition combination identifier; A database construction unit is configured to match a target data partition corresponding to the dynamic partition combination identifier using a pre-constructed dynamic partition mapping table, import the structured form data into the target data partition, and form a dynamic partition database after completing the distributed storage of multiple sets of tax form data; An asynchronous task detection unit is used to construct an asynchronous task key-value pair based on the unique request identification code and structured form data, write the key-value pair into the asynchronous message queue, scan the asynchronous message queue regularly according to a preset time period, and detect the form asynchronous processing task to be executed; The tax data query unit is used to identify whether the tax form data in the task queue contains a priority tag when a pending task is detected, and dynamically adjust the execution priority of the task queue; based on the real-time query conditions entered by the user and the optimized task queue, it implements multi-dimensional tax data queries from the dynamic partitioned database.

8. An electronic device, characterized in that: include: A processor and a memory, wherein the memory is used to store computer program code, wherein the computer program code includes computer instructions. When the processor executes the computer instructions, the electronic device executes the method for intelligent asynchronous processing and real-time query of tax forms based on dynamic partitioning as described in any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, which includes program instructions. When the program instructions are executed by a processor of an electronic device, the processor executes the intelligent asynchronous processing and real-time query method of tax forms based on dynamic partitioning as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • A tax-related data acquisition system based on an asynchronous message mechanism

    CN109815292A

  • Real-time monitoring method and system based on streaming computing

    CN115396494A

  • Distributed object read-write performance improving method based on multi-thread technology

    CN117707771A

  • Real-time data caching method and system for real-time database

    CN118964414A

  • Data hierarchical storage and query processing method and device, equipment and medium

    CN119415568A

Cited By

  • Industrial manufacturing real-time stream processing method, equipment and medium

    CN121029441A

  • Data processing method and device for high-concurrency scene of charging service, equipment, storage medium and program product

    CN121388228A