Tenant-level multi-factor pricing real-time configuration method, system, device and storage medium
By breaking down pricing rules into factors and intervals and using unified column coding across multiple layers, zero-code configuration and real-time pricing for tenant-level multi-factor pricing are achieved, solving the problems of long delivery cycles and network latency in existing technologies and supporting enterprise-level differentiated pricing.
Patent Information
- Application Number
- CN202611339331.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-01
- Publication Date
- 2026-11-24
- Estimated Expiration
- 2046-09-01
AI Technical Summary
Existing technologies cannot achieve enterprise-level differentiated pricing in multi-tenant platforms. Pricing dimensions are fixed in code and table structures, resulting in long delivery cycles. Data storage structures and page quotation tables need to be modified one by one, which cannot meet the requirements of real-time pricing. Centralized pricing on the server side suffers from network latency, and dedicated prices lack structured support.
The pricing rules are broken down into two dimensions: pricing factors and segmented intervals. A unified column code is used to run through the storage layer, table layer, template layer and pricing layer. The quotation data storage column mapping is generated through tenant-level configuration. The terminal performs local real-time pricing and supports segmented calibers based on weight, volume, number of pieces, mileage and number of trays, achieving zero-code activation and real-time configuration.
It achieves zero-code configuration of tenant-level multi-factor pricing, shortens the delivery cycle, ensures consistency across multiple terminals, enables real-time local pricing on terminals, solves the problem of order entry lag caused by network latency, and supports enterprise-level differentiated pricing.
Smart Images

Figure CN122865679B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of multi-tenant software billing, and more specifically, to a method, system, device, and storage medium for real-time configuration of tenant-level multi-factor pricing. Background Technology
[0002] In multi-tenant platforms such as Transportation Management Systems (TMS), a single system needs to serve thousands of logistics companies. These companies have vastly different pricing practices: some charge freight based on weight segments, some charge by volume or pallet count, and some set exclusive prices and billing methods for specific customers and routes. The platform needs to provide each company with a completely different pricing system and billing capabilities on top of a unified system.
[0003] The mainstream solutions for handling freight pricing and calculation in the industry today include the following.
[0004] Option 1: Hard-coded pricing logic. The pricing table's criteria and segmentation methods are predefined by the software vendor in the code and database table structure. Businesses can only enter price figures within a fixed format. Adding new pricing conditions (such as by vehicle type or delivery street) or changing the segmentation method requires modifying the code, table structure, and releasing a new version, with delivery cycles measured in weeks.
[0005] Option 2: General Rule Engine. This option only makes the rate parameters or calculation formulas configurable, while the data storage structure of the quotation form, the page display tables, and the batch import templates still need to be developed and modified one by one. The coverage of "configuration" is limited, and the rule engine is executed on the server side, which cannot solve the problem of real-time order entry.
[0006] Option 3: Customized deployment for large clients. Developing and deploying a separate system for enterprises with specific pricing needs results in resource and maintenance costs that increase exponentially with the number of clients, making it impossible to scale.
[0007] Option 4: Centralized pricing on the server side. Every time the clerk modifies the weight, volume, or consignor / consignee, the terminal needs to send a pricing request to the server. During peak order processing periods, the server is under heavy load, and order entry is noticeably slow when the network is poor. Adjustments to the billing method also require waiting for a new version of the terminal program.
[0008] The shortcomings of existing technologies are mainly reflected in the following five aspects.
[0009] First, the pricing dimensions (what conditions to use for pricing and how to segment the pricing) are fixed in the code and table structure. Enterprise-level adjustments depend on the development schedule, resulting in a long delivery cycle.
[0010] Secondly, if the pricing conditions change, the data storage structure, the page quotation table, the batch import template, and the pricing and data retrieval logic all need to be modified separately, which can easily lead to multiple inconsistencies.
[0011] Third, multiple tenants sharing a single pricing template makes it impossible to achieve enterprise-level differentiation; independent customized deployments result in costs increasing linearly with the number of tenants.
[0012] Fourth, centralized pricing on the server side suffers from network round-trip delays, which cannot meet the real-time requirement of "entering orders and issuing prices simultaneously," and changes to the billing method require terminal version updates.
[0013] Fifth, the exclusive pricing and billing methods for special customers and special lines lack a structured implementation method, relying on code customization or offline manual quotation, and lack conflict verification.
[0014] In view of this, the present invention provides a tenant-level multi-factor pricing real-time configuration method, system, device and storage medium. Summary of the Invention
[0015] To address the problems in existing technologies, the present invention aims to provide a tenant-level multi-factor pricing real-time configuration method, system, device, and storage medium, overcoming the difficulties of existing technologies. It enables pricing dimensions to be configured at the tenant level with zero code activation; a single configuration generates headers, templates, storage, and pricing logic in a linked manner, eliminating inconsistencies; tenant-independent data, real-time local pricing on the terminal, and hot updates of caliber; two-level overwriting of scenario-specific pricing with conflict verification.
[0016] Embodiments of the present invention provide a tenant-level multi-factor pricing real-time configuration method, comprising the following steps: S110. Construct a two-dimensional model of pricing elements, decompose the pricing rules into two dimensions: pricing factors and segmented intervals. The pricing factors include at least conditional factors, segmented factors, backfilling factors, and calculation factors. The segmented intervals support five segmentation methods: by weight, by volume, by number of pieces, by kilometer, and by number of trays. Each segmented interval is associated with at least one rate item. S120. Define a unified column code for each combination of interval and rate item. The format of the unified column code is: interval type identifier_lower limit value_upper limit value_rate item identifier. Establish a forward generation algorithm and a reverse parsing algorithm for the unified column code, so that the unified column code serves as a data structure specification that runs through the storage layer, table layer, template layer and pricing layer. S130. Receive the pricing configuration operation of the platform operator for the target tenant, store the pricing factor, segment interval division point and billing caliber enabled by the target tenant into the tenant's independent database, and use the pricing configuration as the only source to generate the quotation data storage column mapping, quotation table two-layer header, batch import template and pricing data retrieval logic through configuration-driven generation engine. S140. Receive a page access request, parse the page access request to extract the target tenant code, route the read / write request to the corresponding tenant independent database according to the target tenant code, and restore the original data source context after the request ends. S150. The server packages and sends the pricing configuration, quotation data and billing caliber of the target tenant to the billing terminal in one go. The billing terminal performs syntax parsing on the billing caliber to construct an executable calculation function object and caches it. At the same time, it constructs a hash group index for the quotation data according to the customer identifier and the scenario identifier. S160. During the order entry process, the order entry terminal responds to changes in the waybill field and triggers local pricing. First, it determines whether the current waybill falls into a special pricing scenario. If it does, it reads the scenario-level billing caliber. If it does not, it backtracks to read the rule-level general billing caliber. Then, it matches the quotation line according to the condition priority and extracts the rate according to the cargo volume falling into the corresponding segment interval. It calculates the fee according to the extracted rate and billing caliber and fills it back in in real time. No network requests are initiated throughout the process. S170. When switching pages or closing, perform pre-departure processing, prompt or save any unsubmitted data, and release related resources.
[0017] Preferably, step S110 includes: S111. The pricing factors are divided into four categories: conditional factors, segmentation factors, backfilling factors, and calculation factors. The conditional factors are used to define the matching conditions of the quotation line. The segmentation factors are used to define the dimensions on which the cargo volume segmentation is based. The backfilling factors are used to define the fields that need to be backfilled after the pricing is completed. The calculation factors are used to define the parameters that participate in the calculation of the billing formula. S112. Configure five segmentation methods for the segmented intervals: segmentation by weight, segmentation by volume, segmentation by number of pieces, segmentation by kilometer, and segmentation by number of tows. Each segmentation method corresponds to a different interval division method and interval upper and lower limit value type. S113. At least one rate item is attached to each segment interval, and the rate item includes any combination of starting price, first segment price, first price, subsequent price, minimum price, maximum price, surcharge percentage, fixed delivery fee, pallet unit price and adjustment amount.
[0018] Preferably, step S120 includes: S121. Establish the forward generation algorithm for the unified column code: obtain the conventional abbreviation identifier of the interval type, and concatenate it with the lower limit value of the interval, the upper limit value of the interval, and the rate item identifier in sequence with delimiters to generate a unique column code string; S122. Establish the reverse parsing algorithm of the unified column code: divide the column code string according to the delimiter, locate the interval type with the first segment, locate the specific interval by concatenating the first three segments, and locate the rate item with the last segment, so as to realize the unambiguous bidirectional mapping from column code to interval definition and rate item. S123. The unified column code is used as a data structure specification throughout the storage layer, table layer, template layer and pricing layer: in the storage layer, the unified column code is used to locate the access fields of the interval rows; in the table layer, the unified column code is used as the column identifier for rendering and returning the quotation table; in the template layer, the unified column code is used to generate the column header of the import template and perform reverse parsing of the imported data; in the pricing layer, the unified column code is used to locate the rate data of the hit interval.
[0019] Preferably, step S130 includes: S131. Store the pricing factors, segmentation intervals, and billing methods selected by the platform operators for the target tenant into the tenant's dedicated rule configuration table, factor configuration table, interval configuration table, and scenario pricing table, respectively. S132. Using the pricing configuration as the sole source, the configuration-driven generation engine reads the pricing configuration and generates a two-layer header of the quotation table in real time: the upper layer is the basic condition column and the column of each segment interval, and the lower layer is the column of each rate item under each segment interval. The order terminal does not fix any column definition and directly renders the quotation table dynamically according to the header structure issued by the server. S133. The configuration-driven generation engine dynamically generates a batch import spreadsheet template according to the pricing configuration. The template contains a two-layer merged header consistent with the quotation table. During import, the imported columns are reverse parsed back to factor rows and interval rows according to the reverse parsing algorithm of the unified column encoding. It shares the same database entry channel with the page entry. S134. The configuration-driven generation engine automatically establishes a quotation data storage column mapping according to the pricing configuration: the factors enabled by the target tenant are automatically mapped to the corresponding columns of the factor row-wide table according to the configuration dictionary, the columns that are not enabled are left blank, and the rate item values of each interval are stored in the interval row-narrow table according to the unified column code.
[0020] Preferably, step S140 includes: S141. When a request arrives, push the current data source information onto the thread context stack for backup. S142. Locate the corresponding target data source according to the target tenant code. If it is the first access, initialize the connection and cache it as needed. If it is not the first access, reuse the cached connection. S143. If the target data source is already in the current location, the database operation is executed directly to avoid repeated switching. If the target data source is not currently in the current location, the user switches to the target data source and then executes the database operation. S144. After the database operation is completed, regardless of success or failure, the backed-up original data source information is popped from the thread context stack and the original data source context is restored to ensure tenant isolation and thread safety under concurrent calls.
[0021] Preferably, step S150 includes: S151. The server packages the target tenant's pricing configuration, quotation data, scenario list and billing caliber text into a data package and sends it to the billing terminal all at once when the billing page is opened. S152. The billing terminal performs lexical analysis and syntax parsing on the billing caliber text for each fee type, constructs a directly callable calculation function object, and caches the calculation function object in memory according to the fee type. During subsequent pricing, the corresponding calculation function object is directly called to evaluate, avoiding repeated parsing of the caliber text. S153. The order terminal constructs a first-level hash group index for the quotation data according to the customer identifier, and constructs a second-level hash group index according to the scenario identifier within the customer group. When calculating the price, the candidate quotation line set is located with constant time complexity to avoid traversing the entire quotation data.
[0022] Preferably, step S160 includes: S161. During the order entry process, the order entry terminal listens for changes in the waybill fields. When a change in a field affecting pricing is detected, local pricing is automatically triggered. S162. When calculating the price, the current waybill's shipping unit, receiving unit, carrier, originating station, and destination station information are first matched with the set of scenario conditions to determine whether any special pricing scenario is matched. If matched, the scenario-level billing caliber and rebubble conversion caliber of that scenario are read. If not matched, the rule-level general billing caliber and rebubble conversion caliber are read back, forming a two-level overwrite decision chain with scenario-level caliber as the priority and rule-level caliber as the fallback. S163. After determining the billing caliber, traverse the quotation data according to the priority order of the condition factors, match the quotation line that matches the current waybill conditions, and then according to the cargo volume value of the current waybill falling into the corresponding segment interval, and extract the corresponding rate value from the quotation data by the unified column code corresponding to the matched interval and the rate item combination. S164. Substitute the retrieved rate value and the current waybill's cargo quantity parameter into the calculation function object to perform calculation, obtain the pricing result, and immediately fill it back into the corresponding cost field of the waybill. The entire process is completed locally on the order-issuing terminal without initiating any pricing request to the server.
[0023] Embodiments of the present invention also provide a tenant-level multi-factor pricing real-time configuration system for implementing the above-described tenant-level multi-factor pricing real-time configuration method. The tenant-level multi-factor pricing real-time configuration system includes: The element modeling module is used to construct a two-dimensional model of pricing elements, decomposing the pricing rules into two dimensions: pricing factors and segmented intervals. The pricing factors include at least conditional factors, segmented factors, backfilling factors, and calculation factors. The segmented intervals support five segmentation methods: by weight, by volume, by number of pieces, by kilometer, and by number of trays. Each segmented interval is associated with at least one rate item. The coding specification module is used to define a unified column code for each combination of interval and rate item. The format of the unified column code is: interval type identifier_lower limit value_upper limit value_rate item identifier. The module also establishes a forward generation algorithm and a reverse parsing algorithm for the unified column code, so that the unified column code serves as a data structure specification that runs through the storage layer, table layer, template layer and pricing layer. The pricing configuration module is used to receive pricing configuration operations from platform operators for target tenants, store the pricing factors, segment interval division points and billing calibers enabled by the target tenants into the tenant's independent database, and use the pricing configuration as the sole source to generate the quotation data storage column mapping, quotation table two-layer header, batch import template and pricing data retrieval logic through configuration-driven generation engine. The request parsing module is used to receive page access requests, parse the page access requests to extract the target tenant code, route the read and write requests to the corresponding tenant independent database according to the target tenant code, and restore the original data source context after the request ends. The hash index module is used by the server to package and send the pricing configuration, quotation data and billing caliber of the target tenant to the billing terminal at one time. The billing terminal performs syntax parsing on the billing caliber to construct an executable calculation function object and caches it. At the same time, it constructs a hash grouping index on the quotation data according to the customer identifier and the scenario identifier. The scenario management module is used to trigger local pricing in response to changes in the waybill fields during the order entry process. First, it determines whether the current waybill matches the special pricing scenario. If it does, it reads the scenario-level billing caliber. If it does not match, it backtracks to read the rule-level general billing caliber. Then, it matches the quotation line according to the priority of the conditions and extracts the rate according to the cargo volume falling into the corresponding segment interval. It calculates the fee according to the extracted rate and billing caliber and backfills it in real time. No network requests are initiated throughout the process. The resource release module is used to perform pre-exit processing when switching pages or closing, prompting or saving unsubmitted data, and releasing related resources.
[0024] Embodiments of the present invention also provide a tenant-level multi-factor pricing real-time configuration device, comprising: processor; A memory in which executable instructions of the processor are stored; The processor is configured to execute the steps of the above-described tenant-level multi-factor pricing real-time configuration method by executing the executable instructions.
[0025] Embodiments of the present invention also provide a computer-readable storage medium for storing a program that, when executed, implements the steps of the above-described tenant-level multi-factor pricing real-time configuration method.
[0026] The purpose of this invention is to provide a tenant-level multi-factor pricing real-time configuration method, system, device, and storage medium, which enables the pricing dimension itself to be made into a tenant-level configuration item. A single pricing configuration serves as the sole source for generating four-terminal products. Each enterprise holds independent pricing configuration and quotation data, and the pricing capability is pushed down to the local billing terminal for completion. This achieves zero-code configuration of tenant-level pricing rules, multi-terminal consistency assurance, and real-time billing upon order entry. Attached Figure Description
[0027] Other features, objects, and advantages of the invention will become more apparent from the following detailed description of non-limiting embodiments with reference to the accompanying drawings.
[0028] Figure 1 This is a flowchart of the tenant-level multi-factor pricing real-time configuration method of the present invention.
[0029] Figure 2 This is a system architecture diagram for implementing the tenant-level multi-factor pricing real-time configuration method of the present invention.
[0030] Figure 3 This is a schematic diagram of a two-dimensional model of pricing elements for implementing the tenant-level multi-factor pricing real-time configuration method of the present invention.
[0031] Figure 4 This is a flowchart illustrating the configuration linkage generation process for implementing the tenant-level multi-factor pricing real-time configuration method of the present invention.
[0032] Figure 5 This is a flowchart of the local real-time pricing process at the order-issuing end for implementing the tenant-level multi-factor pricing real-time configuration method of the present invention.
[0033] Figure 6 This is a system architecture diagram of the tenant-level multi-factor pricing real-time configuration system of the present invention.
[0034] Figure 7 This is a schematic diagram of the tenant-level multi-factor pricing real-time configuration device of the present invention.
[0035] Figure 8 This is a schematic diagram of the structure of a computer-readable storage medium according to an embodiment of the present invention. Detailed Implementation
[0036] The following specific examples illustrate the implementation methods of this application. Those skilled in the art can easily understand the other advantages and effects of this application from the content disclosed herein. This application can also be implemented or applied through other different specific embodiments, and various details in this application can be modified or changed according to different viewpoints and application systems without departing from the spirit of this application. It should be noted that, unless otherwise specified, the embodiments and features in the embodiments of this application can be combined with each other.
[0037] The embodiments of this application will now be described in detail with reference to the accompanying drawings, so that those skilled in the art can easily implement the application. This application may be embodied in many different forms and is not limited to the embodiments described herein.
[0038] Figure 1 This is a flowchart of the tenant-level multi-factor pricing real-time configuration method of the present invention. For example... Figure 1As shown, the tenant-level multi-factor pricing real-time configuration method of the present invention includes steps S110 to S170. In step S110, the system constructs a two-dimensional model of pricing elements, decomposing the pricing rules into two dimensions: pricing factors and segmented intervals. Pricing factors include at least four types: conditional factors, segmented factors, backfilled factors, and calculated factors. Conditional factors are used to define the matching conditions of the quotation line, such as more than thirty items including departure station, destination station, payment method, goods name, and vehicle type; segmented factors are used to define the dimensions on which the cargo volume is segmented; backfilled factors are used to define the fields that need to be backfilled after pricing is completed; calculated factors are used to define the parameters participating in the calculation of the billing formula. Segmented intervals support five segmentation methods: by weight, by volume, by number of pieces, by kilometer, and by pallet count. Each segmented interval is associated with at least one rate item, which includes starting price, first segment price, first price, subsequent price, minimum price, maximum price, surcharge percentage, fixed delivery fee, pallet count unit price, and adjustment amount, etc. In step S120, the system defines a unified column code for each combination of interval and rate item, in the format: interval type identifier_lower limit_upper limit_rate item identifier. A forward generation algorithm and a reverse parsing algorithm are established, making the unified column code a data structure specification that runs through the storage layer, table layer, template layer, and pricing layer. In step S130, the system receives pricing configuration operations from platform operators for the target tenant, stores the pricing factors enabled by the target tenant, the segmented interval splitting points, and the billing caliber in the tenant's independent database, and uses the pricing configuration as the sole source. The configuration-driven generation engine then generates the quotation data storage column mapping, the two-layer header of the quotation table, the batch import template, and the pricing data retrieval logic. In step S140, the system receives a page access request, parses the request to extract the target tenant code (Tenant Code, i.e., the code used to uniquely identify a tenant in a multi-tenant system), routes the read / write request to the corresponding tenant's independent database according to this code, and restores the original data source context after the request ends. In step S150, the server packages and sends the target tenant's pricing configuration, quotation data, and billing caliber to the order entry terminal in one go. The order entry terminal performs syntax parsing on the billing caliber to construct an executable calculation function object and caches it. At the same time, it builds a hash grouping index (a data structure that uses a hash function to group data by specified key values to accelerate lookup) on the quotation data according to customer identifier and scenario identifier. In step S160, during the order entry process, the order entry terminal triggers local pricing in response to changes in the waybill fields. It first determines whether the current waybill matches a special pricing scenario. If it does, it reads the scenario-level billing caliber. If it does not match, it backtracks to read the rule-level general billing caliber. Then, it matches the quotation line according to the condition priority and extracts the rate according to the cargo volume falling into the corresponding segment interval. It calculates the fee according to the extracted rate and billing caliber and populates it back in real time. No network requests are initiated throughout the process.In step S170, when switching or closing a page, pre-departure processing is performed, prompting or saving any unsubmitted data, and releasing related resources. This invention, by modeling pricing rules into two dimensions—factors and intervals—and using a unified column coding convention across all four terminals, tenant-level configuration storage and routing, and terminal-based local pricing, achieves for the first time a complete closed loop from pricing configuration to real-time pricing in a transportation management system. This shortens the delivery cycle for adding new pricing conditions or changing segmentation methods from approximately two weeks to same-day configuration effectiveness, reducing the delivery cycle by over 90% and achieving zero-code deployment.
[0039] In a preferred embodiment, step S110 is implemented as follows: In step S111, the system divides pricing factors into four categories: conditional factors, segmentation factors, backfilling factors, and calculation factors. Conditional factors define the matching conditions for the quotation line, such as originating station, destination station, payment method, goods name, vehicle type, etc. When the clerk enters the order, the system matches the corresponding quotation line based on the values of these conditions. Segmentation factors define the dimensions used for segmenting cargo volume; for example, when segmenting by weight, the segmentation factor is the chargeable weight; when segmenting by volume, the segmentation factor is the chargeable volume. Backfilling factors define the fields that need to be backfilled after pricing is completed; for example, after pricing is completed, the system backfills the calculated freight amount into the "Freight" field of the waybill. Calculation factors define the parameters involved in the calculation of the billing formula, such as the weight-to-buoyancy conversion ratio and discount coefficient. In step S112, the system configures five segmentation methods for the segmented intervals: segmentation by weight, segmentation by volume, segmentation by number of pieces, segmentation by kilometer, and segmentation by pallet count. Each segmentation method corresponds to a different interval division method and the type of upper and lower limit values for the interval. For example, when segmenting by weight, the upper and lower limits of the interval are weight values (in kilograms); when segmenting by kilometer, the upper and lower limits of the interval are mileage values (in kilometers). In step S113, the system attaches at least one rate item to each segmented interval. The rate item includes any combination of the following: starting price, first segment price, initial price, subsequent price, minimum price, maximum price, surcharge percentage, fixed delivery fee, pallet count unit price, and adjustment amount. For example, a weight interval can simultaneously attach two rate items: starting price and subsequent price. The starting price represents the minimum charge within the interval, and the subsequent price represents the surcharge per unit exceeding the initial weight. The technical advantages of this embodiment are as follows: by finely dividing the pricing factors into four categories, the pricing model can cover the vast majority of billing scenarios in logistics and transportation; by supporting the free combination of five segmentation standards and ten rate items, the system can accommodate the differentiated pricing habits of different logistics companies. One system supports more than eighteen types of fees, more than thirty pricing conditions, and the free combination of five segmentation ranges, fundamentally solving the problem of fixed pricing dimensions in traditional solutions.
[0040] In a preferred embodiment, step S120 is implemented as follows: In step S121, the system establishes a forward generation algorithm for unified column codes: It obtains the agreed-upon abbreviation identifiers for interval types (e.g., "W" for weight segments, "V" for volume segments, "N" for number of pieces segments, "K" for kilometer segments, and "P" for tonnage segments), and concatenates them with the interval lower limit, interval upper limit, and rate item identifier (e.g., "START" for starting price and "CONT" for subsequent price) sequentially using underscores as separators to generate a unique column code string. For example, the starting price for the 0-50 kg weight segment is coded as "W_0_50_START". In step S122, the system establishes a reverse parsing algorithm for unified column codes: It segments the column code string using underscore separators, using the first segment to locate the interval type, the first three segments to locate the specific interval, and the last segment to locate the rate item, achieving an unambiguous bidirectional mapping from column codes to interval definitions and rate items. For example, when parsing "W_0_50_START", the first "W" is positioned as a weight segment, the first three "W_0_50" segments are positioned as the 0 to 50 kg range, and the last "START" segment is positioned as the starting price rate item. In step S123, the system uses a unified column code as a data structure specification throughout the storage layer, table layer, template layer, and pricing layer: In the storage layer, the unified column code is used to locate the access fields of the range rows, and the corresponding rate values are stored in the database table using the column code as the field name; In the table layer, the unified column code is used as the column identifier for rendering and returning the quotation table, and the front-end page dynamically generates table columns based on the column code; In the template layer, the unified column code is used to generate the column headers of the import template and perform reverse parsing of the imported data, and during batch import, the Excel columns are mapped back to the corresponding ranges and rate items based on the column code; In the pricing layer, the unified column code is used to locate the rate data of the hit range, and the pricing engine retrieves the corresponding rate value from the quotation data based on the column code of the hit range and rate item combination. The technical advantage of this embodiment is that: the unified column encoding serves as a data contract jointly followed by all four layers, reducing the number of code modification points for pricing changes from four to zero, thus eliminating inconsistencies across multiple layers. Any change to a configuration takes effect simultaneously across the storage layer, table layer, template layer, and pricing layer. Consistency across multiple layers is guaranteed at the mechanism level by the data structure specification, rather than relying on manual synchronization maintenance.
[0041] In a preferred embodiment, step S130 is implemented as follows: In step S131, the system stores the pricing factors, segmentation points, and billing methods selected by the platform operators for the target tenant into the tenant's dedicated rule configuration table, factor configuration table, segmentation configuration table, and scenario pricing table, respectively. The rule configuration table stores the tenant's overall pricing rules, including rule name, applicable fee type, default billing method, etc.; the factor configuration table stores the list of pricing factors enabled by the tenant; the segmentation configuration table stores the list of segmentation intervals defined by the tenant, including interval type, lower limit value, upper limit value, etc.; the scenario pricing table stores the tenant's defined special pricing scenarios and their corresponding billing methods. In step S132, the system uses the pricing configuration as the sole source, and the configuration-driven generation engine reads the pricing configuration to generate a two-layer header for the quotation table in real time: the upper layer contains basic condition columns and columns for each segmentation interval (e.g., "0-50 kg", "50-200 kg"), and the lower layer contains columns for each rate item under each segmentation interval (e.g., "starting price", "renewal price"). The order processing terminal does not have any fixed column definitions; it dynamically renders the quotation table directly according to the header structure issued by the server. In step S133, the system uses a configuration-driven generation engine to dynamically generate a batch-imported spreadsheet template (e.g., an Excel template) based on the pricing configuration. The template contains a two-layer merged header consistent with the quotation table. During import, the imported columns are parsed back to factor rows and interval rows using a reverse parsing algorithm with unified column encoding, sharing the same data entry channel as page entry. In step S134, the system uses a configuration-driven generation engine to automatically establish a quotation data storage column mapping based on the pricing configuration: it automatically maps the factors enabled by the target tenant to the corresponding columns in the factor row wide table according to the configuration dictionary, leaves the inactive columns blank, and stores the rate item values of each interval in the interval row narrow table according to the unified column encoding. A wide table (WideTable) refers to a database table with a large number of columns, where each row stores complete information about an entity; a narrow table (NarrowTable) refers to a database table with a small number of columns, where data is stored in key-value pairs. The technical advantage of this embodiment is that it uses a single pricing configuration as the sole source to generate four products: storage mapping, table headers, import templates, and pricing logic, thus eliminating inconsistencies across multiple platforms. Operators only need to perform one operation on the configuration side, and the four products are automatically updated synchronously, without the need for separate development and modification.
[0042] In a preferred embodiment, step S140 is implemented as follows: In step S141, when a request arrives, the system pushes the current data source information onto the thread context stack (a stack structure maintained in thread-local variables for saving and restoring the data source context) for backup. The thread context stack is a last-in-first-out (LIFO) data structure used to save and restore the data source context in nested call scenarios. In step S142, the system searches for the corresponding target data source (data source, i.e., database connection configuration, including database address, username, password, and other connection information) according to the target tenant code. If it is the first access, the connection is initialized and cached as needed; if it is not the first access, the cached connection is reused. In step S143, if the system is already in the target data source, database operations are performed directly to avoid repeated switching; if the system is not currently in the target data source, it switches to the target data source and then performs database operations. In step S144, after the database operation is completed, regardless of success or failure, the system pops the backed-up original data source information from the thread context stack and restores the original data source context to ensure tenant isolation and thread safety (i.e., the correctness of shared resource access in a multi-threaded environment) under concurrent calls. The technical effect of this embodiment is that by implementing on-demand switching and automatic recovery of the data source through the thread context stack mechanism, data isolation and thread safety are ensured when thousands of tenants concurrently access the same system instance, ensuring that data between enterprises is invisible and does not interfere with each other. Simultaneously, through the connection caching mechanism, the connection is reused after the first access, reducing the overhead of connection establishment and improving system performance.
[0043] In a preferred embodiment, step S150 is implemented as follows: In step S151, the server packages the target tenant's pricing configuration, quotation data, scenario list, and billing caliber text into a single data package, which is then sent to the billing terminal all at once when the billing page is opened. The data package is organized in JSON (JavaScript Object Notation, a lightweight data exchange format) format and includes configuration metadata, a quotation line list, a scenario list, and caliber expression text. In step S152, the billing terminal performs lexical analysis (breaking the text into meaningful lexical units) and syntax parsing (constructing an abstract syntax tree based on syntax rules) on the billing caliber text for each fee type, constructing directly callable calculation function objects, and caching these calculation function objects in memory according to fee type. During subsequent pricing, the corresponding calculation function object is directly called for evaluation, avoiding repeated parsing of the caliber text. For example, after the billing caliber text "weight × unit price + starting fee" is parsed into an abstract syntax tree, it is compiled into a JavaScript function. During subsequent pricing, this function is directly called with the weight parameter to obtain the result. In step S153, the order terminal constructs a first-level hash grouping index based on the customer identifier for the quotation data, and constructs a second-level hash grouping index based on the scenario identifier within the customer group. During pricing, the candidate quotation line set is located with constant time complexity (O(1) time complexity), avoiding a full traversal of the quotation data. The hash grouping index is a data structure based on a hash table, which achieves fast lookup by mapping key values to buckets in the hash table. The technical effects of this embodiment are: the configuration and quotation data are pre-distributed to the terminal, reducing the single pricing response time from hundreds of milliseconds (including network round trips) of centralized server pricing to less than ten milliseconds; through the hash grouping index, the quotation line is located with constant time complexity during pricing, avoiding the performance overhead caused by a full traversal; through the pre-compilation and caching of the caliber text, repeated parsing during each pricing is avoided, further improving pricing efficiency.
[0044] In a preferred embodiment, step S160 is implemented as follows: In step S161, during the order entry process, the order terminal listens for changes in waybill fields (e.g., changes in the input of weight, volume, shipper, and destination fields). When a change affecting the pricing is detected, local pricing is automatically triggered. In step S162, during pricing, the current waybill's shipping unit, consignee, carrier, originating station, and destination information are first matched with the set of scenario conditions to determine whether any special pricing scenario is matched. A scenario refers to a special pricing situation defined by any combination of business conditions such as shipping unit, consignee, carrier, originating station, and destination. If matched, the scenario-level billing caliber and rebubble conversion caliber are read (rebubble conversion refers to the conversion ratio between weight and volume, used to convert volumetric quantity into chargeable weight). If not matched, the rule-level general billing caliber and rebubble conversion caliber are read back, forming a two-level overwrite decision chain with scenario-level caliber priority and rule-level caliber as a fallback. In step S163, after determining the billing caliber, the system iterates through the quotation data according to the priority order of the conditional factors, matches the quotation rows that match the current waybill conditions, and then places the current waybill's cargo volume value into the corresponding segment interval. The corresponding rate value is then retrieved from the quotation data using the unified column code corresponding to the matched interval and rate item combination. In step S164, the system substitutes the retrieved rate value and the current waybill's cargo volume parameter into the calculation function object to perform calculations, obtains the pricing result, and immediately fills it back into the corresponding fee field of the waybill. The entire process is completed locally on the order-issuing terminal without initiating any pricing requests to the server. The technical effect of this embodiment is that: through a two-level overriding mechanism of scenario-level caliber priority and rule-level caliber fallback, the exclusive prices and exclusive billing calibers for special customers and special routes are structured and provided with a deterministic decision chain to avoid rule conflicts; through local terminal pricing, the number of server requests for pricing during peak order-issuing periods is reduced by about 90%, completely solving the problem of order entry lag caused by network latency, and achieving a real-time experience of "entering orders and issuing prices simultaneously."
[0045] Figure 2 This is a system architecture diagram for implementing the tenant-level multi-factor pricing real-time configuration method of the present invention. Figure 3 This is a schematic diagram of a two-dimensional model of pricing elements for implementing the tenant-level multi-factor pricing real-time configuration method of the present invention. Figure 4 This is a flowchart illustrating the configuration linkage generation process for implementing the tenant-level multi-factor pricing real-time configuration method of the present invention. Figure 5 This is a flowchart illustrating the local real-time pricing process at the order initiation end, implementing the tenant-level multi-factor pricing real-time configuration method of this invention. (Reference) Figures 2 to 5 The following describes in detail the implementation process of a specific embodiment of the present invention. This platform serves thousands of logistics enterprise tenants, each with its own independent pricing system, quotation data, and billing methods. The specific steps include: [1] Building the overall system architecture. For example... Figure 2 As shown, this system consists of three parts. The first part is the operations management terminal, which allows platform operators to maintain pricing factors, segmented ranges, billing standards, and special pricing scenarios for each enterprise according to their needs. The operations management terminal uses a web management interface, allowing operators to access the management backend through a browser and select pricing factors, set segmented range cutoff points, define billing standard text, and configure special pricing scenario condition combinations for each tenant on a visual configuration interface. The second part is the platform server, which includes a pricing configuration center (the sole source) and a configuration-driven generation engine. The pricing configuration center is responsible for storing and managing the pricing configuration data of all tenants; the configuration-driven generation engine includes four sub-components: a quotation table header generation component, an import template generation and parsing component, a quotation data column mapping and database entry component, and a configuration quotation packaging and distribution component. All read and write operations are routed to the enterprise's independent database according to the enterprise code (Tenant Code). The third part is the web-based order entry terminal, which includes a dynamic rendering component for quotation tables, a batch import component for spreadsheets, a pricing engine group, and a real-time pricing calculation and backfilling component for order entry. The web-based invoice entry interface is the terminal interface used by invoice clerks. Invoice clerks access the invoice entry page through a browser, enter waybill information, and view the pricing results in real time.
[0046] [2] Construction of a two-dimensional model of pricing factors. For example... Figure 3 As shown, the system breaks down pricing rules into two dimensions: "pricing factors" and "segmentation intervals." Pricing factors are divided into four categories: conditional factors (over thirty items including origin, destination, payment method, goods name, and vehicle type), segmented factors, backfilled factors, and calculation factors. Conditional factors define the matching conditions for the quotation line; for example, the shipper and destination information entered by the clerk needs to be matched with the conditions in the quotation line. Segmented factors define the dimensions used for segmenting cargo volume; for example, when segmenting by weight, the segmented factor is the chargeable weight. Backfilled factors define the fields that need to be backfilled after pricing; for example, after pricing, the system backfills the calculated freight amount into the "freight" field of the waybill. Calculation factors define the parameters involved in the billing formula calculation, such as the weight-to-volume conversion ratio. Segmentation intervals support five calibers: by weight, by volume, by number of pieces, by kilometer, and by pallet count. Each range can be linked to ten rate items: starting price, initial price, first price, subsequent price, minimum price, maximum price, surcharge percentage, fixed delivery fee, unit price per delivery, and adjustment amount. The combination of factors, ranges, and rate items constitutes the complete pricing rules for a company's specific expense type.
[0047] [3] Implementation of tenant-level configuration storage and enterprise code routing. Operations personnel select factors, interval split points, and billing standards according to enterprise requirements, and store them in the enterprise's dedicated rule configuration table, factor configuration table, interval configuration table, and scenario pricing table, respectively. Interval configurations can be further subdivided to specific customers or specific scenarios. Data source switching adopts a thread context stack mechanism: when a request arrives, the current data source information is first pushed onto the stack for backup, and then the target data source is searched according to the enterprise code (the connection is initialized and cached on demand during the first access for subsequent reuse). If the current location is already in the target data source, execution is performed directly to avoid repeated switching; after the call ends, regardless of success or failure, the original data source context is popped off the stack to restore the original data source context, ensuring tenant isolation and thread safety under concurrent calls, and ensuring that data between enterprises is invisible and does not interfere with each other.
[0048] [4] Definition and application of the unified column encoding convention. For example... Figure 4 As shown, the system defines a unified column code for each "interval × rate item" combination. The forward generation algorithm takes the conventional abbreviation identifier of the interval type (e.g., "W" for weight segmentation) and concatenates it with the interval's lower limit, upper limit, and rate item identifier (e.g., "START" for starting price) sequentially using underscores as separators, generating a column code string in the form of "W_0_50_START". The reverse parsing algorithm, after segmenting by underscore separators, identifies the interval type in the first segment, the specific interval in the concatenation of the first three segments, and the rate item in the last segment, achieving unambiguous bidirectional mapping. This code serves as a data structure specification across all four ends: the storage layer uses it to locate the access fields for interval rows, the table layer uses it as a column identifier for rendering and postback, the template layer uses it to generate and reverse-parse imported columns, and the pricing layer uses it to locate the rate data for the matched interval. Therefore, any change to a configuration takes effect synchronously across all four ends, and multi-end consistency is guaranteed at the mechanism level by the data structure specification, rather than relying on manual synchronization maintenance.
[0049] [5] Configuration-driven quotation data storage and mapping. Quotation data is stored in two tables: "Factor Rows" and "Interval Rows". The Factor Rows are wide tables with reserved full condition columns. The system automatically maps the factors enabled by the enterprise to the corresponding columns according to the configuration dictionary, and leaves the unenabled columns blank. One table structure carries all pricing forms of all enterprises. The Interval Rows store the rate item values of each interval according to the column coding specification. When saving in batches, the number of rows in each batch is automatically calculated according to the upper limit of the database single request parameters (batch size = upper limit of parameters ÷ number of columns in a single row, whichever is greater), ensuring that tens of thousands of quotation rows can be imported without failure. When inserting in batches, the primary key is backfilled to complete the association between the Factor Rows and Interval Rows. For example, if a tenant enables three condition factors: shipper, destination, and payment method, the system automatically maps these three factors to the "shipper", "destination", and "payment method" columns of the Factor Rows wide table, and leaves the other unenabled columns (such as vehicle type, product name, etc.) blank. The tenant defined three weight ranges (0-50, 50-200, 200-500 kg), with each range having two rate items: a starting price and a subsequent price. The system stores the six rate values in a narrow table of range rows according to their corresponding column codes.
[0050] [6] Configuring the generation of the quotation table and import template for the driver. For example... Figure 4 As shown, the server reads the enterprise configuration and generates a two-layer header in real time: the upper layer contains basic condition columns and segment interval columns (such as "0-50 kg", "50-200 kg"), and the lower layer contains the starting price, subsequent price, and other rate columns for each segment. The webpage on the client side does not have any fixed column definitions; it directly renders the quotation table based on the generated header structure. The batch-imported spreadsheet templates are dynamically generated from the same configuration (including multi-layered merged headers). During import, the column coding convention is reverse-parsed back to factor rows and interval rows, sharing the same data entry channel as the page input. Specifically, when an operations staff member adds a "vehicle type" condition factor for a tenant, the configuration-driven generation engine automatically adds a "vehicle type" column to the quotation table, simultaneously adds a "vehicle type" column to the import template, automatically maps the "vehicle type" factor to the "vehicle type" column in the factor row wide table in the storage mapping, and automatically includes "vehicle type" in the priority order of condition matching in the pricing logic. Throughout the process, the operations staff only needs to select the "vehicle type" factor on the configuration side, and the four-terminal output is automatically updated synchronously.
[0051] [7] Implementation of scenario-specific pricing and two-level caliber overriding. Scenario-specific pricing is defined by any combination of shipping unit, receiving unit, carrier, originating station, and destination station. Each scenario can have its own billing caliber and rebubbling conversion caliber. Deduplication check algorithm: When saving, the system reads the scenario condition set configured by the enterprise, traverses existing scenario records under the same rule (excluding its own scenario identifier during modification), and compares the requested value with the record value for each condition in the set: if the requested value is not empty, it must match the record value to continue; conditions with empty requested values are not considered; if all conditions match, it is determined to be a duplicate combination, and saving is rejected with a conflict warning. For example, if a tenant already has the scenario "Shipping unit = Company A AND Destination = Beijing", and the operator tries to save the scenario "Shipping unit = Company A AND Destination = Beijing", the system determines it as a duplicate combination and rejects saving; if they try to save the scenario "Shipping unit = Company A AND Destination = Shanghai", it is determined to be non-duplicate and saving is allowed. Override execution process: When pricing, first read the scenario-level criteria based on the hit scenario identifier. If it is not empty, it will be used first; if it is empty, it will backtrack to read the rule-level general criteria, forming a deterministic two-level decision chain of "general basis and scenario override" to avoid pricing uncertainty caused by rule conflicts.
[0052] [8] The complete process of local real-time pricing on the order-issuing end. For example... Figure 5 As shown, when the order page is opened, the server packages and sends the company's pricing configuration (including billing caliber, multi-product pricing rules, and dynamic rebubbling switch), quotation data, and scenario list all at once. During initialization, each cost calculation engine on the order page performs lexical analysis and syntax parsing on the caliber text, constructing directly callable calculation function objects and caching them. Subsequent pricing directly passes the quantity parameter for evaluation, avoiding repeated parsing. Simultaneously, the quotation data is mapped using hash groups based on customer and scenario identifiers. During pricing, a constant-level overhead is used to locate the candidate quotation line set, avoiding a full traversal. Changes in fields during order entry trigger pricing: first, it checks if a special pricing scenario is matched; then, it matches quotation lines according to condition priority, calculates the rate based on the quantity falling into the corresponding range, applies the caliber to calculate the cost, and immediately backfills it, without initiating any network requests throughout the process.
[0053] [9] Multi-item pricing rules and dynamic rebubbling handling. For waybills with multiple item names, the system supports two cost calculation rules: pricing line by line by item name, i.e., calculating the freight for each item name separately and then summing them up; and summing all item names together in the first line for pricing, i.e., summing the quantities of all item names together and then calculating the freight for all items. The system also supports two summation judgment rules: first, judging the range line by line, i.e., judging which segment range each item name's quantity falls into; and second, summing up the quantities of all item names and then judging which segment range each item name falls into. The rebubbling conversion ratio supports dynamic evaluation based on the scope and can be set according to different scenarios. For example, a waybill contains three item names with weights of 10 kg, 20 kg, and 30 kg respectively. If the rule of "calculating price line by line by product name" and "first determining whether each line falls into the range" is adopted, the system will match the ranges for the three quantities of 10 kg, 20 kg and 30 kg respectively, calculate the fees and then summarize them; if the rule of "summarizing multiple product names into the first line for pricing" and "first summing and then determining the range" is adopted, the system will sum the weights of the three product names to 60 kg and then match the ranges and calculate the fees.
[0054]
[10] Handling of Page Departure and Resource Release. When switching or closing a page, the system performs pre-departure processing, prompting or saving any unsubmitted data and releasing related resources. For example, when an order clerk attempts to close a page or switch to another page without saving the waybill, the system pops up a prompt asking the user if they confirm leaving. If the user selects "Save and Leave," the system automatically saves the current waybill data and releases page resources; if the user selects "Leave Without Saving," the system directly releases page resources. Resource release includes canceling all pending network requests, unbinding all event listeners on the page, and clearing cached pricing engine instances to avoid memory leaks and resource consumption.
[0055]
[11] Ensuring the reliability of batch import and write. When corporate finance personnel import quotation data in batches via spreadsheets, the system automatically calculates the number of rows per batch based on the maximum number of parameters requested by the database at one time. For example, if the maximum number of parameters requested by a database at one time is 1000, and each row of the factor row wide table has 20 columns, then the maximum number of rows per batch is 1000 ÷ 20 = 50 rows. The system splits tens of thousands of rows of quotation data into batches of 50 rows each and submits them one batch at a time, ensuring that the import will not fail on the first attempt. During batch insertion, the system backfills the primary key to complete the association between factor rows and interval rows, ensuring the data consistency between factor rows and interval rows. After the import is completed, the system automatically triggers the configuration-driven generation engine to regenerate the quotation table and import template, ensuring that the page display is consistent with the latest imported data.
[0056]
[12] Implementation of hot update of billing caliber. When a company needs to adjust its billing caliber, the operations staff modifies the caliber text on the operations management terminal and saves it. The next day (or the next effective time configured), when the invoice clerk opens the invoice page, the server sends the updated billing caliber text along with the configuration data to the invoice terminal. The invoice terminal re-executes lexical analysis and syntax parsing on the new caliber text, constructs a new calculation function object, and replaces the old object in the cache. Subsequent pricing automatically uses the new billing caliber for calculation, and no version release is required on the front end or back end throughout the entire process. For example, if a company changes its billing caliber from "weight × unit price" to "weight × unit price + fixed delivery fee", the operations staff modifies the caliber text on the management terminal and saves it. The next day, when the invoice clerk opens the invoice page, the new caliber will be used for pricing.
[0057] Through the complete implementation of the above twelve steps, this invention successfully integrates the differentiated pricing systems of thousands of logistics companies into the same transportation management system. Each tenant has completely independent pricing configurations, quotation data, billing standards, and special pricing scenarios. All pricing operations are completed locally on the order entry terminal, realizing a real-time experience of "entering orders and issuing prices simultaneously".
[0058] Compared with existing technologies, this invention integrates six capabilities—two-dimensional modeling of pricing elements, unified column coding conventions, tenant-level configuration routing, configuration-driven generation, scenario-specific pricing management, and terminal-local pricing—into a complete architecture, achieving significant results: I. Architectural Synergy Gains. Six core capabilities form a closed loop: Two-dimensional modeling and column coding work together to upgrade the pricing structure from "parameter-configurable" to "structure-configurable"; the configuration-driven engine generates storage mapping, headers, import templates, and pricing logic synchronously with a single configuration; tenant routing and terminal pricing realize a distributed architecture of "configuration in the cloud, computation on local".
[0059] II. Deep Business Integration. Unified column coding serves as a data contract across four terminals, ensuring consistency through mechanisms; scenario-specific pricing supports dedicated price structure and conflict verification; billing caliber parsing is pre-processed to terminal initialization, reducing billing response time from hundreds of milliseconds to tens of milliseconds.
[0060] III. Irreplaceable Value in Implementation. Column coding provides lightweight data contracts, enabling fully configurable pricing without a heavy engine; the configuration-driven engine supports multi-tenant parallel operation of different pricing models; local terminal pricing achieves "zero network latency" real-time pricing and supports hot updates of billing standards without the need for re-issuance.
[0061] In summary, this invention achieves zero-code configuration of tenant-level pricing rules, a mechanism to ensure consistency across multiple terminals, real-time local pricing on terminals, and structured management of scenario-specific pricing, significantly improving delivery efficiency, system performance, and maintainability in multi-tenant differentiated pricing scenarios within the transportation management system.
[0062] Figure 6 This is a system architecture diagram of the tenant-level multi-factor pricing real-time configuration system of the present invention. (See diagram below.) Figure 6 As shown, the tenant-level multi-factor pricing real-time configuration system 5 of the present invention includes: The element modeling module 51 is used to construct a two-dimensional model of pricing elements, which decomposes the pricing rules into two dimensions: pricing factors and segmented intervals. The pricing factors include at least conditional factors, segmented factors, backfilling factors, and calculation factors. The segmented intervals support five segmentation methods: by weight, by volume, by number of pieces, by kilometer, and by number of trays. Each segmented interval is associated with at least one rate item.
[0063] The encoding specification module 52 is used to define a unified column code for each combination of interval and rate item. The format of the unified column code is: interval type identifier_lower limit value_upper limit value_rate item identifier. The module also establishes a forward generation algorithm and a reverse parsing algorithm for the unified column code, so that the unified column code serves as a data structure specification that runs through the storage layer, table layer, template layer and pricing layer.
[0064] The pricing configuration module 53 is used to receive pricing configuration operations from platform operators for target tenants, store the pricing factors, segmentation intervals, and billing methods enabled by the target tenants into the tenant's independent database, and use the pricing configuration as the sole source to generate the quotation data storage column mapping, quotation table two-layer header, batch import template, and pricing data retrieval logic through the configuration-driven generation engine.
[0065] The request parsing module 54 is used to receive page access requests, parse the page access requests to extract the target tenant code, route the read and write requests to the corresponding tenant independent database according to the target tenant code, and restore the original data source context after the request ends.
[0066] The hash index module 55 is used by the server to package and send the pricing configuration, quotation data and billing caliber of the target tenant to the billing terminal at one time. The billing terminal performs syntax parsing on the billing caliber to construct an executable calculation function object and caches it. At the same time, it constructs a hash grouping index on the quotation data according to the customer identifier and the scenario identifier.
[0067] The scenario management module 56 is used to trigger local pricing in response to changes in the waybill fields during the order entry process. First, it determines whether the current waybill matches the special pricing scenario. If it does, it reads the scenario-level billing caliber. If it does not match, it backtracks to read the rule-level general billing caliber. Then, it matches the quotation line according to the condition priority and extracts the rate according to the cargo volume falling into the corresponding segment interval. It calculates the fee according to the extracted rate and billing caliber and backfills it in real time. No network requests are initiated throughout the process.
[0068] The resource release module 57 is used to perform pre-exit processing when switching pages or closing, prompting or saving unsubmitted data, and releasing related resources.
[0069] In summary, the tenant-level multi-factor pricing real-time configuration system of the present invention enables the pricing dimension itself to be made into a tenant-level configuration item, and generates four-terminal products in linkage with a single pricing configuration as the sole source. Each enterprise holds independent pricing configuration and quotation data, and the pricing capability is pushed down to the local billing terminal to complete the task. This achieves zero-code configuration of tenant-level pricing rules, multi-terminal consistency guarantee, and real-time billing for order entry.
[0070] This invention also provides a tenant-level multi-factor pricing real-time configuration device, including a processor and a memory storing executable instructions for the processor. The processor is configured to execute steps of a tenant-level multi-factor pricing real-time configuration method via the executable instructions.
[0071] As shown above, the tenant-level multi-factor pricing real-time configuration device of this invention in this embodiment enables the pricing dimension itself to be made into a tenant-level configuration item. A single pricing configuration is used as the sole source to generate four-terminal products. Each enterprise holds independent pricing configuration and quotation data, and the pricing capability is pushed down to the local billing terminal to complete the task. This achieves zero-code configuration of tenant-level pricing rules, multi-terminal consistency guarantee, and real-time billing for order entry.
[0072] Those skilled in the art will understand that various aspects of the present invention can be implemented as systems, methods, or program products. Therefore, various aspects of the present invention can be specifically implemented in the following forms: a completely hardware implementation, a completely software implementation (including firmware, microcode, etc.), or a combination of hardware and software aspects, collectively referred to herein as a "circuit," "module," or "platform."
[0073] Figure 7 This is a schematic diagram of the tenant-level multi-factor pricing real-time configuration device of the present invention. See below for reference. Figure 7 To describe an electronic device 600 according to this embodiment of the present invention. Figure 7 The electronic device 600 shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of the present invention.
[0074] like Figure 7 As shown, the electronic device 600 is presented in the form of a general-purpose computing device. The components of the electronic device 600 may include, but are not limited to: at least one processing unit 610, at least one storage unit 620, a bus 630 connecting different platform components (including storage unit 620 and processing unit 610), a display unit 640, etc.
[0075] The storage unit stores program code, which can be executed by the processing unit 610 to perform the steps described in the method section of this specification according to various exemplary embodiments of the present invention. For example, the processing unit 610 can perform actions such as... Figure 1 The steps are shown in the figure.
[0076] Storage unit 620 may include readable media in the form of volatile storage units, such as random access memory (RAM) 6201 and / or cache 6202, and may further include read-only memory (ROM) 6203.
[0077] Storage unit 620 may also include a program / utility 6204 having a set (at least one) program module 6205, such program module 6205 including but not limited to: operating system, one or more application programs, other program modules and program data, each or some combination of these examples may include an implementation of a network environment.
[0078] Bus 630 can represent one or more of several types of bus structures, including a memory cell bus or memory cell controller, a peripheral bus, a graphics acceleration port, a processing unit, or a local bus using any of the multiple bus structures.
[0079] Electronic device 600 can also communicate with one or more external devices 700 (e.g., keyboard, pointing device, Bluetooth device, etc.), and with one or more devices that enable a user to interact with electronic device 600, and / or with any device that enables electronic device 600 to communicate with one or more other computing devices (e.g., router, modem, etc.). This communication can be performed via input / output (I / O) interface 650. Furthermore, electronic device 600 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) via network adapter 660. Network adapter 660 can communicate with other modules of electronic device 600 via bus 630. It should be understood that, although not shown in the figures, other hardware and / or software modules can be used in conjunction with electronic device 600, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage platforms.
[0080] This invention also provides a computer-readable storage medium for storing a program, which, when executed, implements the steps of a tenant-level multi-factor pricing real-time configuration method. In some possible implementations, various aspects of this invention can also be implemented as a program product comprising program code that, when run on a terminal device, causes the terminal device to perform the steps described in the above-described method section of this specification according to various exemplary embodiments of the invention.
[0081] As shown above, the tenant-level multi-factor pricing real-time configuration system of this invention in this embodiment enables the pricing dimension itself to be made into a tenant-level configuration item. A single pricing configuration is used as the sole source to generate four-terminal products. Each enterprise holds independent pricing configuration and quotation data, and the pricing capability is pushed down to the local order entry terminal to complete the task. This achieves zero-code configuration of tenant-level pricing rules, multi-terminal consistency guarantee, and real-time pricing for order entry.
[0082] Figure 8 This is a schematic diagram of the structure of the computer-readable storage medium of the present invention. (Reference) Figure 8 As shown, a program product 800 for implementing the above-described method according to an embodiment of the present invention is described. It may employ a portable compact disc read-only memory (CD-ROM) and include program code, and may run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited thereto. In the present invention, the readable storage medium may be any tangible medium containing or storing a program that may be used by or in conjunction with an instruction execution system, apparatus, or device.
[0083] The program product may employ any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of readable storage media (a non-exhaustive list) include: electrical connections having one or more wires, portable disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0084] Computer-readable storage media may include data signals propagated in baseband or as part of a carrier wave, carrying readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A readable storage medium may also be any readable medium other than a readable storage medium that can transmit, propagate, or transfer a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the readable storage medium may be transmitted using any suitable medium, including but not limited to wireless, wired, optical fiber, RF, etc., or any suitable combination thereof.
[0085] Program code for performing the operations of this invention can be written in any combination of one or more programming languages, including object-oriented programming languages such as Java and C++, and conventional procedural programming languages such as C or similar languages. The program code can execute entirely on the user's computing device, partially on the user's device, as a standalone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).
[0086] In summary, the purpose of this invention is to provide a tenant-level multi-factor pricing real-time configuration method, system, device, and storage medium that enables the pricing dimension itself to be made into a tenant-level configuration item. A single pricing configuration serves as the sole source for generating four-terminal products. Each enterprise holds independent pricing configuration and quotation data, and the pricing capability is decentralized to the local billing terminal. This achieves zero-code configuration of tenant-level pricing rules, multi-terminal consistency assurance, and real-time billing upon order entry.
[0087] The above description, in conjunction with specific preferred embodiments, provides a further detailed explanation of the present invention. It should not be construed that the specific implementation of the present invention is limited to these descriptions. For those skilled in the art, various simple deductions or substitutions can be made without departing from the concept of the present invention, and all such modifications and substitutions should be considered within the scope of protection of the present invention.
Claims
1. A tenant-level multi-factor pricing real-time configuration method, characterized in that, Includes the following steps: S110. Construct a two-dimensional model of pricing elements, decompose the pricing rules into two dimensions: pricing factors and segmented intervals. The pricing factors include at least conditional factors, segmented factors, backfilling factors, and calculation factors. The segmented intervals support five segmentation methods: by weight, by volume, by number of pieces, by kilometer, and by number of trays. Each segmented interval is associated with at least one rate item. S120. Define a unified column code for each combination of interval and rate item. The format of the unified column code is: interval type identifier_lower limit value_upper limit value_rate item identifier. Establish a forward generation algorithm and a reverse parsing algorithm for the unified column code, so that the unified column code serves as a data structure specification that runs through the storage layer, table layer, template layer and pricing layer. S130. Receive the pricing configuration operation of the platform operator for the target tenant, store the pricing factor, segment interval division point and billing caliber enabled by the target tenant into the tenant's independent database, and use the pricing configuration as the only source to generate the quotation data storage column mapping, quotation table two-layer header, batch import template and pricing data retrieval logic through configuration-driven generation engine. S140. Receive a page access request, parse the page access request to extract the target tenant code, route the read / write request to the corresponding tenant independent database according to the target tenant code, and restore the original data source context after the request ends. S150. The server packages and sends the pricing configuration, quotation data and billing caliber of the target tenant to the billing terminal in one go. The billing terminal performs syntax parsing on the billing caliber to construct an executable calculation function object and caches it. At the same time, it constructs a hash group index for the quotation data according to the customer identifier and the scenario identifier. S160. During the order entry process, the order entry terminal responds to changes in the waybill field and triggers local pricing. First, it determines whether the current waybill falls into a special pricing scenario. If it does, it reads the scenario-level billing caliber. If it does not, it backtracks to read the rule-level general billing caliber. Then, it matches the quotation line according to the condition priority and extracts the rate according to the cargo volume falling into the corresponding segment interval. It calculates the fee according to the extracted rate and billing caliber and fills it back in in real time. No network requests are initiated throughout the process. S170. When switching pages or closing, perform pre-departure processing, prompt or save any unsubmitted data, and release related resources.
2. The tenant-level multi-factor pricing real-time configuration method as described in claim 1, characterized in that, Step S110 includes: S111. The pricing factors are divided into four categories: conditional factors, segmentation factors, backfilling factors, and calculation factors. The conditional factors are used to define the matching conditions of the quotation line. The segmentation factors are used to define the dimensions on which the cargo volume segmentation is based. The backfilling factors are used to define the fields that need to be backfilled after the pricing is completed. The calculation factors are used to define the parameters that participate in the calculation of the billing formula. S112. Configure five segmentation methods for the segmented intervals: segmentation by weight, segmentation by volume, segmentation by number of pieces, segmentation by kilometer, and segmentation by number of tows. Each segmentation method corresponds to a different interval division method and interval upper and lower limit value type. S113. At least one rate item is attached to each segment interval, and the rate item includes any combination of starting price, first segment price, first price, subsequent price, minimum price, maximum price, surcharge percentage, fixed delivery fee, pallet unit price and adjustment amount.
3. The tenant-level multi-factor pricing real-time configuration method as described in claim 1, characterized in that, Step S120 includes: S121. Establish the forward generation algorithm for the unified column code: obtain the conventional abbreviation identifier of the interval type, and concatenate it with the lower limit value of the interval, the upper limit value of the interval, and the rate item identifier in sequence with delimiters to generate a unique column code string; S122. Establish the reverse parsing algorithm of the unified column code: divide the column code string according to the delimiter, locate the interval type with the first segment, locate the specific interval by concatenating the first three segments, and locate the rate item with the last segment, so as to realize the unambiguous bidirectional mapping from column code to interval definition and rate item. S123. The unified column code is used as a data structure specification throughout the storage layer, table layer, template layer and pricing layer: in the storage layer, the unified column code is used to locate the access fields of the interval rows; in the table layer, the unified column code is used as the column identifier for rendering and returning the quotation table; in the template layer, the unified column code is used to generate the column header of the import template and perform reverse parsing of the imported data; in the pricing layer, the unified column code is used to locate the rate data of the hit interval.
4. The tenant-level multi-factor pricing real-time configuration method as described in claim 1, characterized in that, Step S130 includes: S131. Store the pricing factors, segmentation intervals, and billing methods selected by the platform operators for the target tenant into the tenant's dedicated rule configuration table, factor configuration table, interval configuration table, and scenario pricing table, respectively. S132. Using the pricing configuration as the sole source, the configuration-driven generation engine reads the pricing configuration and generates a two-layer header of the quotation table in real time: the upper layer is the basic condition column and the column of each segment interval, and the lower layer is the column of each rate item under each segment interval. The order terminal does not fix any column definition and directly renders the quotation table dynamically according to the header structure issued by the server. S133. The configuration-driven generation engine dynamically generates a batch import spreadsheet template according to the pricing configuration. The template contains a two-layer merged header consistent with the quotation table. During import, the imported columns are reverse parsed back to factor rows and interval rows according to the reverse parsing algorithm of the unified column encoding. It shares the same database entry channel with the page entry. S134. The configuration-driven generation engine automatically establishes a quotation data storage column mapping according to the pricing configuration: the factors enabled by the target tenant are automatically mapped to the corresponding columns of the factor row-wide table according to the configuration dictionary, the columns that are not enabled are left blank, and the rate item values of each interval are stored in the interval row-narrow table according to the unified column code.
5. The tenant-level multi-factor pricing real-time configuration method as described in claim 1, characterized in that, Step S140 includes: S141. When a request arrives, push the current data source information onto the thread context stack for backup. S142. Locate the corresponding target data source according to the target tenant code. If it is the first access, initialize the connection and cache it as needed. If it is not the first access, reuse the cached connection. S143. If the target data source is already in the current location, the database operation is executed directly to avoid repeated switching. If the target data source is not currently in the current location, the user switches to the target data source and then executes the database operation. S144. After the database operation is completed, regardless of success or failure, the backed-up original data source information is popped from the thread context stack and the original data source context is restored to ensure tenant isolation and thread safety under concurrent calls.
6. The tenant-level multi-factor pricing real-time configuration method as described in claim 1, characterized in that, Step S150 includes: S151. The server packages the target tenant's pricing configuration, quotation data, scenario list and billing caliber text into a data package and sends it to the billing terminal all at once when the billing page is opened. S152. The billing terminal performs lexical analysis and syntax parsing on the billing caliber text for each fee type, constructs a directly callable calculation function object, and caches the calculation function object in memory according to the fee type. During subsequent pricing, the corresponding calculation function object is directly called to evaluate, avoiding repeated parsing of the caliber text. S153. The order terminal constructs a first-level hash group index for the quotation data according to the customer identifier, and constructs a second-level hash group index according to the scenario identifier within the customer group. When calculating the price, the candidate quotation line set is located with constant time complexity to avoid traversing the entire quotation data.
7. The tenant-level multi-factor pricing real-time configuration method as described in claim 1, characterized in that, Step S160 includes: S161. During the order entry process, the order entry terminal listens for changes in the waybill fields. When a change in a field affecting pricing is detected, local pricing is automatically triggered. S162. When calculating the price, the current waybill's shipping unit, receiving unit, carrier, originating station, and destination station information are first matched with the set of scenario conditions to determine whether any special pricing scenario is matched. If matched, the scenario-level billing caliber and rebubble conversion caliber of that scenario are read. If not matched, the rule-level general billing caliber and rebubble conversion caliber are read back, forming a two-level overwrite decision chain with scenario-level caliber as the priority and rule-level caliber as the fallback. S163. After determining the billing caliber, traverse the quotation data according to the priority order of the condition factors, match the quotation line that matches the current waybill conditions, and then according to the cargo volume value of the current waybill falling into the corresponding segment interval, and extract the corresponding rate value from the quotation data by the unified column code corresponding to the matched interval and the rate item combination. S164. Substitute the retrieved rate value and the current waybill's cargo quantity parameter into the calculation function object to perform calculation, obtain the pricing result, and immediately fill it back into the corresponding cost field of the waybill. The entire process is completed locally on the order-issuing terminal without initiating any pricing request to the server.
8. A tenant-level multi-factor pricing real-time configuration system, used to implement the tenant-level multi-factor pricing real-time configuration method according to any one of claims 1 to 7, characterized in that, include: The element modeling module is used to construct a two-dimensional model of pricing elements, decomposing the pricing rules into two dimensions: pricing factors and segmented intervals. The pricing factors include at least conditional factors, segmented factors, backfilling factors, and calculation factors. The segmented intervals support five segmentation methods: by weight, by volume, by number of pieces, by kilometer, and by number of trays. Each segmented interval is associated with at least one rate item. The coding specification module is used to define a unified column code for each combination of interval and rate item. The format of the unified column code is: interval type identifier_lower limit value_upper limit value_rate item identifier. The module also establishes a forward generation algorithm and a reverse parsing algorithm for the unified column code, so that the unified column code serves as a data structure specification that runs through the storage layer, table layer, template layer and pricing layer. The pricing configuration module is used to receive pricing configuration operations from platform operators for target tenants, store the pricing factors, segment interval division points and billing calibers enabled by the target tenants into the tenant's independent database, and use the pricing configuration as the sole source to generate the quotation data storage column mapping, quotation table two-layer header, batch import template and pricing data retrieval logic through configuration-driven generation engine. The request parsing module is used to receive page access requests, parse the page access requests to extract the target tenant code, route the read and write requests to the corresponding tenant independent database according to the target tenant code, and restore the original data source context after the request ends. The hash index module is used by the server to package and send the pricing configuration, quotation data and billing caliber of the target tenant to the billing terminal at one time. The billing terminal performs syntax parsing on the billing caliber to construct an executable calculation function object and caches it. At the same time, it constructs a hash grouping index on the quotation data according to the customer identifier and the scenario identifier. The scenario management module is used to trigger local pricing in response to changes in the waybill fields during the order entry process. First, it determines whether the current waybill matches the special pricing scenario. If it does, it reads the scenario-level billing caliber. If it does not match, it backtracks to read the rule-level general billing caliber. Then, it matches the quotation line according to the priority of the conditions and extracts the rate according to the cargo volume falling into the corresponding segment interval. It calculates the fee according to the extracted rate and billing caliber and backfills it in real time. No network requests are initiated throughout the process. The resource release module is used to perform pre-exit processing when switching pages or closing, prompting or saving unsubmitted data, and releasing related resources.
9. A tenant-level multi-factor pricing real-time configuration device, characterized in that, include: processor; A memory in which executable instructions of the processor are stored; The processor is configured to perform the steps of the tenant-level multi-factor pricing real-time configuration method according to any one of claims 1 to 7 by executing the executable instructions.
10. A computer-readable storage medium for storing a program, characterized in that, When the program is executed by the processor, it implements the steps of the tenant-level multi-factor pricing real-time configuration method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Multi-tenant-based mileage fee rationality verification
CN119576441A
Shared tray leasing scheme optimization method and system
CN121329564A
