Bill merging method and system based on text generation immutable codes

By generating immutable codes tightly associated with field values ​​within the Spring framework, the problems of chaotic bill merging logic and inefficient cross-service merging are resolved, achieving efficient and accurate bill merging.

CN120874784AInactive Publication Date: 2025-10-31SHANDONG LANGCHAO YUNTOU INFORMATION TECH CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202511384359.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-26
Publication Date
2025-10-31
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Existing bill merging methods lack a unified and standardized coding generation method when field values ​​change, resulting in chaotic merging logic and a high merging error rate, especially inefficient when merging across services in a microservice architecture.

Method used

By defining the fields to be merged in the billing table in the Spring framework, the Java data access layer is used to obtain and format the field values, and the SHA-256 algorithm is used to generate immutable codes to ensure that the codes are closely related to the field values. The codes are regenerated when resource configuration is adjusted, and codes are generated according to unified rules when merging across services.

Benefits of technology

It improves the accuracy and efficiency of bill merging, reduces the adaptation work for cross-service merging, optimizes the time for processing large-scale billing data, and shortens the merging processing time by more than 50%.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120874784A_ABST
    Figure CN120874784A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of data processing, in particular to a bill merging method and system based on text generation immutable codes, and the method comprises the following steps: in a Spring framework, defining fields participating in merging in a bill table by means of a configuration file, specifically including a cloud center, an order code, a resource id and resource configuration, resource configuration is definitely set as a key dynamic field, and configuration information is stored in a micro-service configuration center; connecting a MySQL database by using a Java data access layer, acquiring the defined field value, and performing format unification preprocessing operation on the acquired field value so as to ensure the accuracy of the current value of the resource configuration field; the method has the beneficial effects that the generated codes are based on the field values including the resource configuration, and when fields such as the resource configuration are adjusted, the codes change accordingly, so that the codes can accurately reflect the current field state, and the problem of inaccurate merging time caused by field change is avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data processing technology, specifically to a bill merging method and system based on text-generated immutable codes. Background Technology

[0002] In the current billing management system, with business growth, the number of bills often exceeds 10 million, requiring these bills to be merged. Existing merging methods have several problems: First, directly using field combinations as merge identifiers means that when field values ​​change (e.g., resource configuration adjustments), the identifier also changes, but the lack of a unified and standardized coding generation method leads to chaotic merging logic. Second, using simple coding methods easily results in different bills generating the same code, leading to a high merging error rate with large amounts of data. Third, in a microservice architecture, the billing processing rules of different services are inconsistent, easily causing confusion when merging bills across services.

[0003] For example, in a cloud service platform, when processing tens of millions of bills, if resource configuration fields are directly used for identification, the merged records based on the original identifier become invalid when the resource configuration is adjusted from "2 cores 4G" to "4 cores 8G". However, due to the lack of a standardized encoding method, the new identifier is generated chaotically, affecting the accuracy of the merge. At the same time, different services generate bill codes in different ways, requiring a lot of adaptation work when merging across services, resulting in low efficiency. Summary of the Invention

[0004] The purpose of this invention is to provide a bill merging method and system based on text-generated immutable codes. By generating codes that are closely related to field values ​​(the codes change accordingly when key fields such as resource configuration are adjusted), the accuracy and efficiency of bill merging are improved, especially for processing large amounts of bill data at the level of tens of millions of records; thus solving the problems mentioned in the background art above.

[0005] To achieve the above objectives, the present invention provides the following technical solution: a bill merging method based on text-generated immutable codes, comprising the following steps: a. In the Spring framework, the fields involved in merging in the billing table are defined using configuration files, specifically covering cloud center, order code, resource ID, and resource configuration. Resource configuration is explicitly set as a key dynamic field, and the configuration information is stored in the microservice's configuration center. b. Use the Java data access layer to connect to the MySQL database, obtain the field values ​​defined above, and perform a format-unified preprocessing operation on the obtained field values ​​to ensure the accuracy of the current values ​​of the resource configuration fields; c. Concatenate the processed field values ​​into a string according to a fixed order and a specific delimiter, and generate an immutable code using the SHA-256 algorithm; when the field values ​​involved in the concatenation of resource configuration are adjusted, re-execute the concatenation and encoding generation operation; d. Store the generated codes in the billing table. If the codes of different bills are the same, the bills are merged. When the resource configuration is adjusted, the subsequent bill merging operation is performed based on the newly generated codes. When merging bills across services, each service must generate codes according to unified rules.

[0006] Preferably, in step c, the fixed concatenation order of the field values ​​is cloud center → order code → resource id → resource configuration, and the specific separator used is "|".

[0007] Preferably, when processing large-scale billing data, such as tens of millions of bills, a batch processing approach is adopted, with each batch specifically processing data from one cloud center; at the same time, multi-threading technology and database indexes are used to optimize processing efficiency; and for bills with adjusted resource configurations, priority is given to encoding update processing.

[0008] Preferably, in step b, the preprocessing operations performed on the obtained field values ​​include standardizing the date format and removing extra spaces from the field values.

[0009] Preferably, the microservice's configuration center has the function of updating configuration information in real time. When the settings of the fields or key dynamic fields involved in the merging defined in the configuration file change, they can be updated to the relevant processing modules in a timely manner to ensure that the bill merging method is executed according to the latest configuration information.

[0010] A system for a bill consolidation method based on text-generated immutable encoding includes: Configuration Management Module: Running in the Spring framework environment, it defines the fields involved in merging in the billing table through configuration files, specifically covering cloud center, order code, resource ID, and resource configuration. It explicitly sets resource configuration as a key dynamic field and stores the configuration information in the microservice's configuration center so that all parts of the system can operate based on the unified configuration. Data acquisition and processing module: It uses the Java data access layer to connect to the MySQL database, retrieves the field values ​​defined by the configuration management module, and performs format-unified preprocessing on the retrieved field values ​​to ensure the accuracy of the current values ​​of the resource configuration fields and provide reliable data for subsequent coding generation; Encoding generation module: Concatenates the field values ​​processed by the data acquisition and processing module into a string according to a fixed order and a specific delimiter, and generates an immutable encoding using the SHA-256 algorithm; when the field values ​​involved in the concatenation of resource configurations are adjusted, this module re-executes the concatenation and encoding generation operations to ensure that the encoding is updated as the field values ​​change; Encoding storage and bill merging module: Stores the codes generated by the encoding generation module in the billing table. By comparing the codes of different bills, if the codes are the same, the bills are merged. When resource configuration is adjusted, subsequent bill merging operations are performed based on the newly generated codes. When merging bills across services, ensure that each service generates codes according to unified rules to achieve effective merging of bills across services.

[0011] Preferably, in the encoding generation module, the fixed concatenation order of field values ​​is cloud center → order code → resource id → resource configuration, and the specific separator used is "|".

[0012] Preferably, when processing large-scale billing data, such as tens of millions of bills, the data acquisition and processing module adopts a batch processing approach, with each batch specifically processing data from one cloud center. At the same time, it utilizes multi-threading technology and database indexes to optimize processing efficiency. Furthermore, for bills with adjusted resource configurations, priority is given to encoding updates to improve the overall system processing performance and response speed.

[0013] Preferably, the data acquisition and processing module performs preprocessing operations on field values, including standardizing date formats and removing extra spaces from field values, to ensure that field values ​​from different sources and formats are standardized and consistent before entering the encoding generation stage.

[0014] Preferably, the microservice configuration center in the configuration management module has the function of updating configuration information in real time. When the settings of the fields or key dynamic fields participating in the merging defined in the configuration file change, they can be updated to the relevant modules of the system in a timely manner, ensuring that the system always performs bill merging operations based on the latest configuration information, thereby enhancing the flexibility and adaptability of the system.

[0015] Compared with the prior art, the beneficial effects of the present invention are: This invention proposes a method and system for merging invoices based on text-generated immutable codes. The generated codes are based on field values, including resource configurations. When fields such as resource configurations are adjusted, the codes change accordingly, ensuring that the codes accurately reflect the current field status and avoiding inaccurate merging timing issues caused by field changes. By unifying field and coding rules through the Spring framework, the codes generated by each microservice are consistent, reducing the adaptation work for cross-service merging and improving merging efficiency. For large amounts of data, batch processing and multi-threading are used, combined with database index optimization. The merging processing time for tens of millions of invoices is reduced by more than 50% compared to traditional methods, meeting business processing needs and allowing for efficient code updates for invoices with adjusted resource configurations. Attached Figure Description

[0016] Figure 1 This is a flowchart of the method of the present invention. Detailed Implementation

[0017] To make the objectives, technical solutions, and advantages of the present invention clear and complete, the embodiments of the present invention will be further described in detail below with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are only some, not all, embodiments of the present invention, and are merely illustrative of the embodiments of the present invention. They are not intended to limit the embodiments of the present invention. All other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0018] Example 1: This invention provides a technical solution: a bill merging method based on text-generated immutable codes, comprising the following steps: (1) Field definition and configuration: In the Spring framework, the fields involved in merging in the billing table are defined through configuration files, namely cloud center, order code, resource ID, and resource configuration. These configuration information are stored in the microservice configuration center for each service to obtain uniformly, ensuring that each service uses the same field rules, and clearly defining resource configuration as a key dynamic field, whose changes will trigger code updates.

[0019] (2) Field value acquisition and processing: Connect to the MySQL database through a data access layer written in Java to query and retrieve the above field values ​​from the billing table. Perform simple processing on the retrieved field values, such as standardizing the format (standardizing the date format, removing extra spaces, etc.), to ensure the standardization of the field values. Pay special attention to the current value of the resource configuration field to ensure its accuracy.

[0020] (3) Generate associated codes: The processed field values ​​are concatenated into a string in a fixed order (cloud center → order code → resource id → resource configuration) and separated by a delimiter (such as "|"). Then, the string is encrypted using the SHA-256 algorithm to generate codes closely associated with the field values. When the field values ​​such as resource configuration change, the concatenation and encryption process is re-executed to generate new codes.

[0021] (4) Bill Consolidation: The generated codes are stored in the bill table as the basis for consolidation. When bills need to be consolidated, the codes of different bills are compared, and bills with the same code are consolidated. When resource configuration is adjusted, the codes will change, and subsequent consolidation will be based on the new codes to ensure that the consolidation matches the current field value status. In a microservice architecture, each service generates codes according to the same rules, which facilitates cross-service bill consolidation.

[0022] For tens of millions of bill data entries, a batch processing approach can be adopted, with each cloud center batch as a separate batch. Multi-threading can be used to improve processing speed, while indexes can be created for the coded fields in the database to speed up query speed during merging. For bills with resource configuration adjustments, they can be marked separately and the coded updates can be processed with priority.

[0023] Example 2, based on Example 1, proposes a system for bill merging based on text-generated immutable encoding, including: Configuration Management Module: Running within the Spring framework environment, this module defines the fields involved in merging in the billing table through configuration files. These fields specifically cover cloud center, order code, resource ID, and resource configuration. Resource configuration is explicitly set as a key dynamic field, and the configuration information is stored in the microservice's configuration center so that all parts of the system can operate based on a unified configuration. The microservice configuration center in the configuration management module has the function of real-time updating configuration information. When the settings of the fields involved in merging or key dynamic fields defined in the configuration file change, it can promptly synchronize and update the relevant modules of the system, ensuring that the system always performs bill merging operations based on the latest configuration information, thereby enhancing the system's flexibility and adaptability.

[0024] The data acquisition and processing module utilizes a Java data access layer to connect to a MySQL database. It retrieves the field values ​​defined by the configuration management module and performs preprocessing to standardize the format of these values, ensuring the accuracy of the current resource configuration field values ​​and providing reliable data for subsequent encoding generation. When processing large-scale billing data, such as tens of millions of bills, the module employs a batch processing approach, with each batch dedicated to processing data from a specific cloud center. Simultaneously, it leverages multithreading and database indexes to optimize processing efficiency. Furthermore, for bills with adjusted resource configurations, encoding updates are prioritized to improve overall system performance and response speed. The preprocessing operations performed on field values ​​include standardizing date formats and removing redundant spaces, ensuring consistency and uniformity across different sources and formats before entering the encoding generation stage.

[0025] Encoding Generation Module: This module concatenates the field values ​​processed by the data acquisition and processing module into a string according to a fixed order and a specific delimiter, and generates an immutable encoding using the SHA-256 algorithm. When the field values ​​involved in the resource configuration concatenation are adjusted, this module re-executes the concatenation and encoding generation operations to ensure that the encoding updates as the field values ​​change. The fixed concatenation order of the field values ​​is Cloud Center → Order Code → Resource ID → Resource Configuration, and the specific delimiter used is "|".

[0026] Encoding storage and bill merging module: Stores the codes generated by the encoding generation module in the billing table. By comparing the codes of different bills, if the codes are the same, the bills are merged. When resource configuration is adjusted, subsequent bill merging operations are performed based on the newly generated codes. When merging bills across services, ensure that each service generates codes according to unified rules to achieve effective merging of bills across services.

[0027] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.

Claims

1. A bill merging method based on text-generated immutable codes, characterized in that: Includes the following steps: a. In the Spring framework, the fields involved in merging in the billing table are defined using configuration files, specifically covering cloud center, order code, resource ID, and resource configuration. Resource configuration is explicitly set as a key dynamic field, and the configuration information is stored in the microservice's configuration center. b. Use the Java data access layer to connect to the MySQL database, obtain the field values ​​defined above, and perform a format-unified preprocessing operation on the obtained field values ​​to ensure the accuracy of the current values ​​of the resource configuration fields; c. Concatenate the processed field values ​​into a string according to a fixed order and a specific delimiter, and generate an immutable code using the SHA-256 algorithm; when the field values ​​involved in the concatenation of resource configuration are adjusted, re-execute the concatenation and encoding generation operation; d. Store the generated codes in the billing table. If the codes of different bills are the same, the bills are merged. When the resource configuration is adjusted, the subsequent bill merging operation is performed based on the newly generated codes. When merging bills across services, each service must generate codes according to unified rules.

2. The bill merging method based on text-generated immutable encoding according to claim 1, characterized in that: In step c, the fixed concatenation order of field values ​​is cloud center → order code → resource id → resource configuration, and the specific separator used is "|".

3. The bill merging method based on text-generated immutable encoding according to claim 2, characterized in that: When processing large-scale billing data, such as tens of millions of bills, a batch processing approach is adopted, with each batch dedicated to processing data from a single cloud center. At the same time, multi-threading technology and database indexes are used to optimize processing efficiency. Furthermore, for bills with adjusted resource configurations, priority is given to updating the encoding.

4. The bill merging method based on text-generated immutable encoding according to claim 3, characterized in that: In step b, the preprocessing operations performed on the obtained field values ​​include standardizing the date format and removing extra spaces from the field values.

5. The bill merging method based on text-generated immutable encoding according to claim 4, characterized in that: The configuration center of the microservice has the function of updating configuration information in real time. When the settings of the fields or key dynamic fields involved in the merging defined in the configuration file change, it can be updated to the relevant processing modules in a timely manner to ensure that the bill merging method is executed according to the latest configuration information.

6. A bill merging system based on text-generated immutable codes, characterized in that: The method described in claim 5 includes: Configuration Management Module: Running in the Spring framework environment, it defines the fields involved in merging in the billing table through configuration files, specifically covering cloud center, order code, resource ID, and resource configuration. It explicitly sets resource configuration as a key dynamic field and stores the configuration information in the microservice's configuration center so that all parts of the system can operate based on the unified configuration. Data acquisition and processing module: It uses the Java data access layer to connect to the MySQL database, retrieves the field values ​​defined by the configuration management module, and performs format-unified preprocessing on the retrieved field values ​​to ensure the accuracy of the current values ​​of the resource configuration fields and provide reliable data for subsequent coding generation; Encoding generation module: Concatenates the field values ​​processed by the data acquisition and processing module into a string according to a fixed order and a specific delimiter, and generates an immutable encoding using the SHA-256 algorithm; when the field values ​​involved in the concatenation of resource configurations are adjusted, this module re-executes the concatenation and encoding generation operations to ensure that the encoding is updated as the field values ​​change; Encoding storage and bill merging module: Stores the codes generated by the encoding generation module in the billing table. By comparing the codes of different bills, if the codes are the same, the bills are merged. When resource configuration is adjusted, subsequent bill merging operations are performed based on the newly generated codes. When merging bills across services, ensure that each service generates codes according to unified rules to achieve effective merging of bills across services.

7. A bill merging system based on text-generated immutable encoding according to claim 6, characterized in that: In the encoding generation module, the fixed concatenation order of field values ​​is cloud center → order code → resource id → resource configuration, and the specific separator used is "|".

8. A bill merging system based on text-generated immutable encoding according to claim 7, characterized in that: When processing large-scale billing data, such as tens of millions of bills, the data acquisition and processing module adopts a batch processing approach, with each batch specifically processing data from one cloud center. At the same time, it utilizes multi-threading technology and database indexes to optimize processing efficiency. Furthermore, for bills with adjusted resource configurations, priority is given to encoding updates to improve the overall system processing performance and response speed.

9. A bill merging system based on text-generated immutable encoding according to claim 8, characterized in that: The data acquisition and processing module performs preprocessing operations on field values, including standardizing date formats and removing extra spaces from field values, to ensure that field values ​​from different sources and formats are standardized and consistent before entering the encoding generation stage.

10. A bill merging system based on text-generated immutable encoding according to claim 9, characterized in that: The microservice configuration center in the configuration management module has the function of updating configuration information in real time. When the settings of the fields or key dynamic fields participating in the merging defined in the configuration file change, it can be updated to the relevant modules of the system in a timely manner, ensuring that the system always performs bill merging operations based on the latest configuration information, thereby enhancing the system's flexibility and adaptability.

Citation Information

Patent Citations

  • Fund flow duplicate removal method and device, equipment and storage medium

    CN115774709A

  • Logistics charging engine system and method

    CN120125129A

  • Contract number generation method and device with multiple parallel pipeline serial numbers, medium and equipment

    CN120297233A

  • Logistics information tamper-proofing system based on block chain

    CN120528583A

  • Method and apparatus for generating phone bill

    WO2010060317A1