CN112070557B - Processing method and device for extensible charging rules - Google Patents
Processing method and device for extensible charging rules Download PDFInfo
- Publication number
- CN112070557B CN112070557B CN202010976516.5A CN202010976516A CN112070557B CN 112070557 B CN112070557 B CN 112070557B CN 202010976516 A CN202010976516 A CN 202010976516A CN 112070557 B CN112070557 B CN 112070557B
- Authority
- CN
- China
- Prior art keywords
- entity
- charging
- interval
- charging rule
- dimension
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000003672 processing method Methods 0.000 title abstract description 10
- 230000009467 reduction Effects 0.000 claims abstract description 50
- 238000000034 method Methods 0.000 claims abstract description 37
- 238000012545 processing Methods 0.000 claims description 27
- 238000006243 chemical reaction Methods 0.000 claims description 25
- 238000004590 computer program Methods 0.000 claims description 20
- 238000012163 sequencing technique Methods 0.000 claims description 3
- 230000008569 process Effects 0.000 abstract description 9
- 238000010586 diagram Methods 0.000 description 22
- 230000006870 function Effects 0.000 description 12
- 238000004891 communication Methods 0.000 description 6
- 230000008878 coupling Effects 0.000 description 4
- 238000010168 coupling process Methods 0.000 description 4
- 238000005859 coupling reaction Methods 0.000 description 4
- 230000003247 decreasing effect Effects 0.000 description 2
- 238000011161 development Methods 0.000 description 2
- 238000013507 mapping Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 230000000750 progressive effect Effects 0.000 description 2
- 238000012795 verification Methods 0.000 description 2
- 108010001267 Protein Subunits Proteins 0.000 description 1
- 238000003491 array Methods 0.000 description 1
- 238000004422 calculation algorithm Methods 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 239000007795 chemical reaction product Substances 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 239000000463 material Substances 0.000 description 1
- 238000005192 partition Methods 0.000 description 1
- 230000002688 persistence Effects 0.000 description 1
- 239000000047 product Substances 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q30/00—Commerce
- G06Q30/02—Marketing; Price estimation or determination; Fundraising
- G06Q30/0283—Price estimation or determination
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/22—Indexing; Data structures therefor; Storage structures
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/24—Querying
- G06F16/245—Query processing
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q50/00—Information and communication technology [ICT] specially adapted for implementation of business processes of specific business sectors, e.g. utilities or tourism
- G06Q50/06—Energy or water supply
Landscapes
- Engineering & Computer Science (AREA)
- Business, Economics & Management (AREA)
- Theoretical Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Physics & Mathematics (AREA)
- Economics (AREA)
- Strategic Management (AREA)
- Development Economics (AREA)
- Finance (AREA)
- Data Mining & Analysis (AREA)
- Marketing (AREA)
- General Engineering & Computer Science (AREA)
- General Business, Economics & Management (AREA)
- Accounting & Taxation (AREA)
- Health & Medical Sciences (AREA)
- Databases & Information Systems (AREA)
- Game Theory and Decision Science (AREA)
- General Health & Medical Sciences (AREA)
- Human Resources & Organizations (AREA)
- Primary Health Care (AREA)
- Tourism & Hospitality (AREA)
- Software Systems (AREA)
- Water Supply & Treatment (AREA)
- Public Health (AREA)
- Entrepreneurship & Innovation (AREA)
- Computational Linguistics (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
Abstract
The application provides a processing method and a device of an extensible charging rule, wherein the method comprises the following steps: splitting and storing the message of the charging rule according to the entity, associating the entities through the identification of the charging rule, wherein the entity comprises: a charging rule main entity, a single interval definition entity, an interval sequence entity and an interval proportion entity; performing dimension reduction on the charging service elements in the acquired charging request according to the single-interval definition entity; and searching corresponding charging rules from the interval proportion entity according to the charging service elements and the interval sequence entity after the dimension reduction. The dimension-reducing expandable charging storage and query method provided by the application reduces dimension according to the set rule in the process of charging rule storage, reduces dimension of the charging rule of the multi-dimension multi-interval to one dimension for storage, thereby solving the problem of charging rule management caused by different charging intervals and charging dimensions.
Description
Technical Field
The application belongs to the technical field of intelligent charging service, and particularly relates to a processing method and device of an extensible charging rule.
Background
With popularization of the internet, various types of offline charging services are gradually transferred to online for proceeding, and because service modes and charging scenes are different, the used charging dimensions have larger difference, and the number of the charging dimensions is also different, for example, charging is carried out according to transaction amount in some charging scenes, and charging is carried out according to two dimensions of transaction amount and reservation time in other charging scenes; in the scenario of charging according to the transaction amount, the charging can be performed according to the transaction amount in a fixed proportion, or according to different proportions among transaction amount partitions.
At present, each application develops a set of charging engine according to respective specific service scenes, and the problems of repeated development and difficult multiplexing exist. Part of the charging platforms are used for charging in a specific field, the number of charging dimensions and the charging dimensions are relatively fixed, and once the number of the charging dimensions and the charging dimensions are changed, the charging platforms need to be expanded to support.
In summary, there is no unified charging scheme for adapting to various charging intervals and increasing or decreasing charging dimensions, so how to provide a new scheme to solve the above technical problems is a technical problem to be solved urgently.
Disclosure of Invention
The application provides a processing method and a processing device of an extensible charging rule, which at least solve the problem that the current method and the device lack a unified charging scheme which is suitable for different charging intervals and for the increase and decrease of different charging dimensions reasonably.
According to one aspect of the present application, there is provided a processing method of an extensible charging rule, including:
splitting and storing the message of the charging rule according to the entity, associating the entities through the identification of the charging rule, wherein the entity comprises: a charging rule main entity, a single interval definition entity, an interval sequence entity and an interval proportion entity;
performing dimension reduction on the charging service elements in the acquired charging request according to the single-interval definition entity;
and searching corresponding charging rules from the interval proportion entity according to the charging service elements and the interval sequence entity after the dimension reduction.
In one embodiment, splitting and storing the message of the charging rule according to the entity includes:
splitting a message of a charging rule into a charging rule main entity, a single interval definition entity, an interval sequence entity and an interval proportion entity;
performing dimension reduction conversion on the split message of the charging rule according to the entity;
and storing each entity after the dimension reduction conversion in a Key-Value form.
In one embodiment, performing dimension reduction conversion on the split charging rule message according to the entity includes:
converting the message into a list and checking to ensure that the charging rule message is not missed;
generating single interval numbers for each single interval according to the single interval definition entity and filling the single interval numbers into a list;
sequencing the charging rules according to a pre-generated dimension sequence and filling the charging rules into a list;
and generating a combined interval number corresponding to the charging rule according to the single interval number and the list.
In an embodiment, storing each entity after the dimension reduction conversion in a form of Key-Value includes:
loading data of a charging rule main entity in the list into a memory, and assigning Key as a service identifier;
loading data of a single-interval definition entity in the list into a memory, and assigning a Key according to the identification of a charging rule and a dimension name;
loading the dimension sequence into a memory, assigning Key according to the identification of the charging rule, and assigning Value according to the dimension sequence;
and loading the interval rule entity data into a memory, and assigning Key values according to the identification of the charging rule and the combination interval number.
In an embodiment, searching for a corresponding charging rule from the interval proportion entity according to the dimension-reduced charging service element and the interval sequence entity includes:
retrieving the corresponding charging rule identification from the charging rules according to the service identification in the charging service element;
retrieving a dimension sequence from the interval sequence entity according to the charging rule number;
searching single interval numbers from the stored single interval definition entities according to the dimension sequence and generating combined interval numbers;
and searching the corresponding charging rule from the interval proportion entity according to the identification of the charging rule and the combination interval number.
According to another aspect of the present application, there is also provided a processing apparatus for extensible charging rules, including:
the splitting dimension-reducing storage unit is used for splitting and storing the message of the charging rule according to the entity, and the entities are associated through the identification of the charging rule, and the entity comprises: a charging rule main entity, a single interval definition entity, an interval sequence entity and an interval proportion entity;
the charging request dimension reduction processing unit is used for dimension reduction of the charging service elements in the acquired charging request according to the single-interval definition entity;
and the charging rule searching unit is used for searching the corresponding charging rule from the interval proportion entity according to the dimension-reduced charging service element and the interval sequence entity.
In one embodiment, the split dimension reduction memory unit includes:
the splitting module is used for splitting the message of the charging rule into a charging rule main entity, a single interval definition entity, an interval sequence entity and an interval proportion entity;
the dimension reduction conversion module is used for dimension reduction conversion of the split charging rule message according to the entity;
and the storage module is used for storing each entity after the dimension reduction conversion in a Key-Value form.
In one embodiment, the dimension reduction conversion module includes:
the multidimensional checking module is used for converting the message into a list and checking the list so as to ensure that the charging rule message is not missed;
the single interval number generation module is used for generating single interval numbers for all the single intervals according to the single interval definition entity and filling the single interval numbers into the list;
the ordering module is used for ordering the charging rules according to a dimension sequence generated in advance and filling the charging rules into a list;
and the combined interval number generation module is used for generating a combined interval number corresponding to the charging rule according to the single interval number and the list.
In one embodiment, the charging request dimension reduction processing unit includes:
the charging rule loading module is used for loading the data of the charging rule main entity in the list into the memory and assigning the Key as a service identifier;
the single interval definition loading module is used for loading data of a single interval definition entity in the list into the memory and assigning the Key with the identification of the charging rule and the dimension name;
the dimension sequence loading module is used for loading the dimension sequence into the memory, assigning the Key according to the identification of the charging rule, and assigning the Value according to the dimension sequence;
and the interval rule loading module is used for loading the interval rule entity data into the memory and assigning the Key value according to the identification of the charging rule and the combination interval number.
In an embodiment, the charging rule searching unit includes:
the charging rule number retrieval module is used for retrieving the corresponding charging rule identification from the charging rules according to the service identification in the charging service element;
the dimension sequence searching module is used for searching the dimension sequence from the interval sequence entity according to the charging rule number;
the combined interval number inquiry module is used for searching the single interval number from the stored single interval definition entity according to the dimension sequence and generating a combined interval number;
and the charging rule query module is used for searching the corresponding charging rule from the interval proportion entity according to the identification of the charging rule and the combination interval number.
The dimension-reducing expandable charging storage and query method provided by the application reduces dimension according to the set rule in the process of charging rule storage, and reduces dimension of the charging rule of the multi-dimension multi-interval to one dimension for storage, thereby solving the management problem caused by different charging intervals and charging dimensions. In addition, the charging rule is loaded into the memory when the system is started each time, so that the calculation performance in the process of calculating the fee is improved, and the parameters in the charging request are subjected to dimension reduction according to the same rule when the charging rule is stored, so that the corresponding charging rule is obtained through matching, and the charging is completed. The application can meet different charging intervals and different charging dimension scenes, and realizes the functions of repeatedly developing, repeatedly using and expanding the charging function coupling in various product applications.
Drawings
In order to more clearly illustrate the embodiments of the application or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described, it being obvious that the drawings in the following description are only some embodiments of the application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a flowchart of a processing method of an extensible charging rule provided by the present application.
Fig. 2 is a flow chart of splitting and storing a message of a charging rule according to an entity in an embodiment of the present application.
Fig. 3 is a flowchart of performing dimension reduction conversion on a message of a split charging rule in an embodiment of the present application.
Fig. 4 is a schematic diagram of a charging engine according to an embodiment of the application.
Fig. 5 is a block diagram of a charging rule entry message in an embodiment of the present application.
FIG. 6 is a core class diagram of a billing engine in accordance with an embodiment of the application.
FIG. 7 is a flow chart of the thermal loading in an embodiment of the application.
FIG. 8 is a flow chart of a billing rule lookup in accordance with an embodiment of the application.
Fig. 9 is a block diagram of a processing device for extensible charging rules according to the present application.
FIG. 10 is a block diagram of a split dimension reduction memory unit according to an embodiment of the present application.
Fig. 11 is a block diagram of a dimension reduction conversion module in an embodiment of the present application.
Fig. 12 is a block diagram of a configuration of a billing request dimension reduction processing unit in the embodiment of the present application.
Fig. 13 is a block diagram illustrating a structure of a charging rule searching unit according to an embodiment of the present application.
Fig. 14 is a schematic diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present application, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
As described in the background art, in order to meet the situations of different charging intervals and increasing and decreasing charging dimensions, the present application provides a processing method of an extensible charging rule, as shown in fig. 1, including:
s101: splitting and storing the message of the charging rule according to the entity, associating the entities through the identification of the charging rule, wherein the entity comprises: a charging rule main entity, a single interval definition entity, an interval sequence entity and an interval proportion entity.
Firstly, different charging rules need to be recorded, specifically, the charging rules are divided into a charging rule main entity, a single interval definition entity, an interval sequence entity, an interval proportion entity and the like, wherein an interval refers to a charging interval, for example, in the charging process of electric charges, the charging is carried out in time intervals, the charging unit prices corresponding to different time intervals are different, in the charging interval from 23 points to 8 points of the next day, the electric charge unit price is 1 yuan, and in the charging interval from 8 points to 23 points, the electric charge unit price is 1.5 yuan. Since the charging rules are often multidimensional, such as a time dimension, a duration dimension, a distance dimension, etc., the multidimensional charging rules need to be reduced in dimension, and are persisted (stored) in a one-dimensional manner that a set of charging rules corresponds to a charging rule number.
S102: and performing dimension reduction on the charging service elements in the acquired charging request according to the single-interval definition entity.
Because the charging rule is reduced from multiple dimensions to one dimension for storage in S101, when the user initiates the charging request, the charging service element in the charging request needs to be reduced from multiple dimensions to one dimension according to the same method, so that the format of the charging rule can be kept consistent with that of the stored charging rule, and the charging rule corresponding to the charging request can be conveniently searched.
S103: and searching corresponding charging rules from the interval proportion entity according to the charging service elements and the interval sequence entity after the dimension reduction.
After the persistence of the dimension reduction of the charging rules and the dimension reduction of the charging service elements are completed, searching the corresponding charging rules from the loaded charging rule base according to the charging service elements and carrying out charging operation according to the charging rules.
In one embodiment, splitting and storing the message of the charging rule according to the entity, as shown in fig. 2, includes:
s201: and splitting the message of the charging rule into a charging rule main entity, a single interval definition entity, an interval sequence entity and an interval proportion entity.
In an embodiment, as shown in fig. 4, an entity diagram of a billing engine according to an embodiment of the present application is shown, where the billing engine mainly includes: charging rule main table, single interval definition table, interval sequence table and 4 entity tables of interval rule table. The charging rule main table is a relation table of service identification and charging rule number, and is used for mapping from the service identification to the rule number of the charging rule, and the rule number of the charging rule can connect the single interval definition table, the interval sequence table and the interval rule table in series.
The single-interval definition table is used for defining an interval of one dimension in a charging rule, mapping the interval to a single-interval number and splicing multidimensional intervals.
The interval sequence table is a description of the sequence of different dimensions of one charging rule, and is used for splicing multidimensional intervals.
The interval rule table is used for defining a charging mode corresponding to a plurality of dimension intervals of one rule, wherein the combined interval consists of single interval numbers in the single interval definition table, and is divided in # mode, and the sequence is determined by the dimension sequence of rule numbers in the interval definition table; the charging type supports a fixed amount and a fixed ratio.
As shown in fig. 5, the structure diagram of the charging rule input message of the present application is shown, wherein busiSeqNo is a service identifier; the fets are charging rule arrays, wherein each element is a charging rule and consists of a multidimensional interval and a corresponding charging mode; interval is a multi-dimensional interval array, each element in the array is an interval corresponding to one dimension and the dimension is changed, the dimension is a dimension name, start is a starting interval, and end is a stopping interval; the feeType is a charging type and comprises two types of fixed amount and fixed proportion; feeValue is a specific billing value, meaning feeType designation. The charging intervals under the fees array need to meet the requirement of forming a grid, and the grid is not covered and omitted.
S202: and performing dimension reduction conversion on the split message of the charging rule according to the entity. Fig. 6 is a core class diagram of a charging engine in an embodiment of the present application, where feerrles are charging rules, and consist of multiple feerrle single charging rules. The FeeRule consists of a plurality of single interval single dimension intervals and 1 interval charging modes. In addition, there are also dimension order objects for generating a combineInterval in the Interval rule interval charging scheme.
In an embodiment, performing dimension reduction conversion on the split charging rule message according to the entity, as shown in fig. 3, includes:
s301: and converting the message into a list and checking to ensure that the charging rule message is not missed.
In a specific embodiment, the charging rule input message is converted, the json format message is converted into a List < Interval >, and then multidimensional Interval verification is performed, so that the intervals of the charging rule are ensured to form a grid, and no coverage and no omission exist in multidimensional space.
S302: and generating single interval numbers for each single interval according to the single interval definition entity and filling the single interval numbers into the list.
In a specific embodiment, in the process of multidimensional interval verification, an interval id (interval number) is generated for each dimension of List < SingleInterval > > and is filled into FeeRules objects.
S303: and sequencing the charging rules according to a pre-generated dimension sequence and filling the charging rules into a list.
In a specific embodiment, the intervals of the first element of the fets (billing rule array) in the billing rule entry message are obtained, ordered according to the dimension names, and filled with a dimension order entity List < dimension order >.
S304: and generating a combined interval number corresponding to the charging rule according to the single interval number and the list.
In a specific embodiment, a combination interval number combineIntervalId is generated from List < dimension order > and the generated IntervalId, and is populated into FeeRules objects. Thus, all operations of reducing the charging rule from the multidimensional interval to the one-dimensional interval are completed, and at this time, one combination interval number corresponds to one charging mode.
S203: and storing each entity after the dimension reduction conversion in a Key-Value form.
In an embodiment, storing each entity after the dimension reduction conversion in a form of Key-Value, as shown in fig. 7, includes:
s701: and loading the data of the charging rule main entity in the list into the memory, and assigning the Key as a service identifier.
S702: and loading the data of the single-interval definition entity in the list into the memory, and assigning the Key by the identification of the charging rule and the dimension name.
S703: and loading the dimension sequence into the memory, assigning the Key according to the identification of the charging rule, and assigning the Value according to the dimension sequence.
S704: and loading the interval rule entity data into a memory, and assigning Key values according to the identification of the charging rule and the combination interval number.
In a specific embodiment, the first step loads all data in a charging rule main table into a memory, and stores the data as Map < String, feeRule >, wherein a key value is a busiSeqNo service identifier, and a value is a rule main table entity; secondly, loading all data in a single interval definition table into a memory, and storing the data as Map < String >, list < single interval >, wherein key value is a rule number of rule+dimension dimension name, and value is a List of all intervals under rule+dimension; thirdly, loading all data in the dimension sequence table into a memory, and storing the data as Map < String >, list < dimension order > >, wherein key value is a rule number of rule, and value is a dimension sequence List < dimension order > under the rule; and step four, loading all data in the interval rule table into a memory, and storing the data into Map < String, interval rule >, wherein the key value is a rule id rule number+combineinterval combination interval number, and the value is an interval rule entity.
In an embodiment, according to the reduced-size charging service element and the interval sequence entity, searching the corresponding charging rule from the interval proportion entity, as shown in fig. 8, including:
s801: and retrieving the corresponding identification of the charging rule from the charging rule according to the service identification in the charging service element.
S802: and retrieving the dimension sequence from the interval sequence entity according to the charging rule number.
S803: and searching the single interval number from the stored single interval definition entity according to the dimension sequence and generating a combined interval number.
S804: and searching the corresponding charging rule from the interval proportion entity according to the identification of the charging rule and the combination interval number.
In a specific embodiment, firstly, according to the sent service identification busiSeqNo rule main table object Map < String, feeRule >, a corresponding charging rule number rule Id is searched out, then, according to the rule number rule Id, a dimension sequence List is searched out from the dimension sequence table object Map < String, list < dimension order >, and thirdly, according to the specific data of each dimension sent in a message, the definition of the dimension is searched out one by one from a single-interval definition table Map < String, list < single interval > according to rule number+dimension dimension name of the rule Id, and then, according to the data of the dimension, a matched single-interval number is found out from the List; fourthly, according to serial numbers in the dimension sequence table, single interval numbers of each dimension are separated and spliced by # and are used for splicing; and fifthly, searching the corresponding interval rule from the interval rule table Map < String, interval rule > according to the rule number+combineinterval combination interval number. After the interval rule is searched, the cost value can be calculated by adopting a corresponding algorithm according to the corresponding charging type and charging value.
Based on the same inventive concept, the embodiment of the present application further provides a processing device of the extensible charging rule, which can be used to implement the method described in the above embodiment, as described in the following embodiment. Because the principle of the processing device for the extensible charging rule to solve the problem is similar to that of the processing method for the extensible charging rule, the implementation of the processing device for the extensible charging rule can refer to the implementation of the processing method for the extensible charging rule, and the repetition is omitted. As used below, the term "unit" or "module" may be a combination of software and/or hardware that implements the intended function. While the system described in the following embodiments is preferably implemented in software, implementation in hardware, or a combination of software and hardware, is also possible and contemplated.
As shown in fig. 9, the present application provides a processing device for extensible charging rules, including:
the splitting dimension-reducing storage unit 801 is configured to split and store a message of a charging rule according to an entity, where each entity is associated with each other by an identifier of the charging rule, and the entity includes: a charging rule main entity, a single interval definition entity, an interval sequence entity and an interval proportion entity;
a charging request dimension-reduction processing unit 802, configured to dimension-reduce the charging service element in the obtained charging request according to the single-interval definition entity;
and the charging rule searching unit 803 is configured to search a corresponding charging rule from the interval proportion entity according to the dimension-reduced charging service element and the interval sequence entity.
In one embodiment, as shown in fig. 10, the split dimension reduction storage unit 801 includes:
the splitting module 901 is configured to split a message of a charging rule into a charging rule main entity, a single interval definition entity, an interval sequence entity and an interval proportion entity;
the dimension-reduction conversion module 902 is configured to dimension-reduce the split charging rule message according to the entity;
the storage module 903 is configured to store each entity after the dimension reduction conversion in a form of Key-Value.
In one embodiment, as shown in fig. 11, the dimension reduction conversion module 902 includes:
the multidimensional checking module 1001 is configured to convert a message into a list and perform checking to ensure that a charging rule message is not missed;
a single interval number generating module 1002, configured to generate a single interval number for each single interval according to a single interval definition entity and fill the single interval number into a list;
a sorting module 1003, configured to sort the charging rules according to a dimension sequence generated in advance and fill the charging rules into a list;
the combined interval number generating module 1004 is configured to generate a combined interval number corresponding to the charging rule according to the single interval number and the list.
In one embodiment, as shown in fig. 12, the charging request dimension reduction processing unit 802 includes:
the charging rule loading module 1101 is configured to load data of a charging rule main entity in the list into the memory, and assign a Key to a service identifier;
the single interval definition loading module 1102 is configured to load data of a single interval definition entity in the list into the memory, and assign a Key with an identifier of a charging rule and a dimension name;
the dimension sequence loading module 1103 is configured to load a dimension sequence into the memory, assign a Key according to an identifier of a charging rule, and assign a Value according to the dimension sequence;
the interval rule loading module 1104 is configured to load interval rule entity data into the memory, and assign the Key value with the identification of the charging rule and the combination interval number.
In an embodiment, as shown in fig. 13, the charging rule searching unit 803 includes:
the charging rule number retrieval module 1201 is configured to retrieve an identifier of a corresponding charging rule from the charging rules according to a service identifier in the charging service element;
a dimension order searching module 1202, configured to retrieve a dimension order from the interval order entity according to the charging rule number;
the combined interval number inquiry module 1203 is configured to search for a single interval number from the stored single interval definition entities according to the dimension sequence and generate a combined interval number;
and the charging rule query module 1204 is configured to search a corresponding charging rule from the interval proportion entity according to the identifier of the charging rule and the combination interval number.
Compared with the prior art, the method provided by the application firstly realizes the function of uniformly managing the charging rules, thereby avoiding the problems of repeated development and incapability of multiplexing of each application, avoiding the frequent change of the charging scene due to the fact that the charging rules are reduced to one-dimensional management, and ensuring high efficiency in charging and retrieving the rules by thermally loading the charging rules into the memory.
It will be appreciated by those skilled in the art that embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The principles and embodiments of the present application have been described in detail with reference to specific examples, which are provided to facilitate understanding of the method and core ideas of the present application; meanwhile, as those skilled in the art will have variations in the specific embodiments and application scope in accordance with the ideas of the present application, the present description should not be construed as limiting the present application in view of the above.
The embodiment of the present application further provides a specific implementation manner of an electronic device capable of implementing all the steps in the method in the foregoing embodiment, and referring to fig. 14, the electronic device specifically includes the following:
a processor 1301, a memory 1302, a communication interface (Communications Interface) 1303, a bus 1304, and a nonvolatile memory 1305;
the processor 1301, the memory 1302, and the communication interface 1303 complete communication with each other through the bus 1304;
the processor 1301 is configured to invoke the computer program in the memory 1302 and the nonvolatile storage 1305, where the processor executes the computer program to implement all the steps in the method in the foregoing embodiment, for example, the processor executes the computer program to implement the following steps:
s101: splitting and storing the message of the charging rule according to the entity, associating the entities through the identification of the charging rule, wherein the entity comprises: a charging rule main entity, a single interval definition entity, an interval sequence entity and an interval proportion entity.
S102: and performing dimension reduction on the charging service elements in the acquired charging request according to the single-interval definition entity.
S103: and searching corresponding charging rules from the interval proportion entity according to the charging service elements and the interval sequence entity after the dimension reduction.
An embodiment of the present application also provides a computer-readable storage medium capable of implementing all the steps of the method in the above embodiment, the computer-readable storage medium storing thereon a computer program that, when executed by a processor, implements all the steps of the method in the above embodiment, for example, the processor implements the following steps when executing the computer program:
s101: splitting and storing the message of the charging rule according to the entity, associating the entities through the identification of the charging rule, wherein the entity comprises: a charging rule main entity, a single interval definition entity, an interval sequence entity and an interval proportion entity.
S102: and performing dimension reduction on the charging service elements in the acquired charging request according to the single-interval definition entity.
S103: and searching corresponding charging rules from the interval proportion entity according to the charging service elements and the interval sequence entity after the dimension reduction.
In this specification, each embodiment is described in a progressive manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments. In particular, for a hardware+program class embodiment, the description is relatively simple, as it is substantially similar to the method embodiment, as relevant see the partial description of the method embodiment. Although the present description provides method operational steps as described in the examples or flowcharts, more or fewer operational steps may be included based on conventional or non-inventive means. The order of steps recited in the embodiments is merely one way of performing the order of steps and does not represent a unique order of execution. When implemented in an actual device or end product, the instructions may be executed sequentially or in parallel (e.g., in a parallel processor or multi-threaded processing environment, or even in a distributed data processing environment) as illustrated by the embodiments or by the figures. The terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, it is not excluded that additional identical or equivalent elements may be present in a process, method, article, or apparatus that comprises a described element. For convenience of description, the above devices are described as being functionally divided into various modules, respectively. Of course, when implementing the embodiments of the present disclosure, the functions of each module may be implemented in the same or multiple pieces of software and/or hardware, or a module that implements the same function may be implemented by multiple sub-modules or a combination of sub-units, or the like. The above-described apparatus embodiments are merely illustrative, for example, the division of the units is merely a logical function division, and there may be additional divisions when actually implemented, for example, multiple units or components may be combined or integrated into another system, or some features may be omitted or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, which may be in electrical, mechanical or other form. The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
It will be appreciated by those skilled in the art that embodiments of the present description may be provided as a method, system, or computer program product. Accordingly, the present specification embodiments may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present description embodiments may take the form of a computer program product on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein. In this specification, each embodiment is described in a progressive manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments. In particular, for system embodiments, since they are substantially similar to method embodiments, the description is relatively simple, as relevant to see a section of the description of method embodiments. In the description of the present specification, a description referring to terms "one embodiment," "some embodiments," "examples," "specific examples," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the embodiments of the present specification.
In this specification, schematic representations of the above terms are not necessarily directed to the same embodiment or example. Furthermore, the different embodiments or examples described in this specification and the features of the different embodiments or examples may be combined and combined by those skilled in the art without contradiction. The foregoing is merely an example of an embodiment of the present disclosure and is not intended to limit the embodiment of the present disclosure. Various modifications and variations of the illustrative embodiments will be apparent to those skilled in the art. Any modification, equivalent replacement, improvement, or the like, which is within the spirit and principles of the embodiments of the present specification, should be included in the scope of the claims of the embodiments of the present specification.
Claims (6)
1. A method for processing an extensible charging rule, comprising:
splitting and storing a message of a charging rule according to entities, and associating the entities through the identification of the charging rule, wherein the entities comprise: a charging rule main entity, a single interval definition entity, an interval sequence entity and an interval proportion entity;
the dimension reduction is carried out on the charging service elements in the acquired charging request according to the single interval definition entity;
searching corresponding charging rules from the interval proportion entity according to the dimension-reduced charging service elements and the interval sequence entity;
the splitting and storing the message of the charging rule according to the entity comprises the following steps:
splitting the message of the charging rule into a charging rule main entity, a single interval definition entity, an interval sequence entity and an interval proportion entity;
performing dimension reduction conversion on the split message of the charging rule according to the entity;
storing each entity subjected to dimension reduction conversion in a Key-Value form;
the step of performing dimension reduction conversion on the split message of the charging rule according to the entity comprises the following steps:
converting the message into a list and checking to ensure that the charging rule message is not missed;
generating single interval numbers for each single interval according to the single interval definition entity and filling the single interval numbers into the list;
sequencing the charging rules according to a dimension sequence generated in advance and filling the charging rules into the list;
generating a combined interval number corresponding to the charging rule according to the single interval number and the list;
the searching, by the service element and the interval sequence entity according to the reduced-dimension charging service element, a corresponding charging rule from the interval proportion entity includes:
retrieving the corresponding charging rule identification from the charging rules according to the service identification in the charging service element;
retrieving a dimension sequence from the interval sequence entity according to the charging rule number;
searching single interval numbers from the stored single interval definition entities according to the dimension sequence and generating combined interval numbers;
and searching the corresponding charging rule from the interval proportion entity according to the identification of the charging rule and the combination interval number.
2. The method for processing the extensible charging rule according to claim 1, wherein each entity after the dimension reduction conversion is stored in a form of Key-Value, comprising:
loading the data of the charging rule main entity in the list into a memory, and assigning Key as a service identifier;
loading the data of the single-interval definition entity in the list into a memory, and assigning the Key by the identification of the charging rule and the dimension name;
loading the dimension sequence into a memory, assigning Key according to the identification of a charging rule, and assigning Value according to the dimension sequence;
and loading the interval rule entity data into a memory, and assigning Key values according to the identification of the charging rule and the combination interval number.
3. A processing apparatus for extensible charging rules, comprising:
the splitting dimension-reducing storage unit is used for splitting and storing the message of the charging rule according to the entity, and the entities are associated through the identification of the charging rule, and the entity comprises: a charging rule main entity, a single interval definition entity, an interval sequence entity and an interval proportion entity;
the charging request dimension reduction processing unit is used for dimension reduction of the charging service elements in the acquired charging request according to the single interval definition entity;
the charging rule searching unit is used for searching the corresponding charging rule from the interval proportion entity according to the dimension-reduced charging service element and the interval sequence entity;
wherein, split dimension reduction memory cell includes:
the splitting module is used for splitting the message of the charging rule into a charging rule main entity, a single interval definition entity, an interval sequence entity and an interval proportion entity;
the dimension reduction conversion module is used for dimension reduction conversion of the split charging rule message according to the entity;
the storage module is used for storing each entity subjected to the dimension reduction conversion in a Key-Value form;
wherein, the dimension reduction conversion module includes:
the multidimensional checking module is used for converting the message into a list and checking the list so as to ensure that the charging rule message is not missed;
the single interval number generation module is used for generating single interval numbers for all the single intervals according to the single interval definition entity and filling the single interval numbers into the list;
the ordering module is used for ordering the charging rules according to a pre-generated dimension sequence and filling the charging rules into the list;
a combined interval number generating module, configured to generate a combined interval number corresponding to the charging rule according to the single interval number and the list;
wherein the charging rule searching unit comprises:
the charging rule number retrieval module is used for retrieving the corresponding charging rule identification from the charging rules according to the service identification in the charging service element;
the dimension sequence searching module is used for searching the dimension sequence from the interval sequence entity according to the charging rule number;
the combined interval number inquiry module is used for searching the single interval number from the stored single interval definition entity according to the dimension sequence and generating the combined interval number;
and the charging rule query module is used for searching the corresponding charging rule from the interval proportion entity according to the identification of the charging rule and the combination interval number.
4. The processing apparatus for extensible charging rules according to claim 3, wherein the charging request dimension reduction processing unit comprises:
the charging rule loading module is used for loading the data of the charging rule main entity in the list into the memory and assigning Key as a service identifier;
the single interval definition loading module is used for loading the data of the single interval definition entity in the list to the memory and assigning the Key with the identification of the charging rule and the dimension name;
the dimension sequence loading module is used for loading the dimension sequence into the memory, assigning the Key according to the identification of the charging rule, and assigning the Value according to the dimension sequence;
and the interval rule loading module is used for loading interval rule entity data into the memory and assigning Key values according to the identification of the charging rule and the combination interval number.
5. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the method of processing the scalable charging rules of claim 1 or 2 when executing the program.
6. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the method of handling extensible charging rules according to claim 1 or 2.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010976516.5A CN112070557B (en) | 2020-09-16 | 2020-09-16 | Processing method and device for extensible charging rules |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010976516.5A CN112070557B (en) | 2020-09-16 | 2020-09-16 | Processing method and device for extensible charging rules |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112070557A CN112070557A (en) | 2020-12-11 |
CN112070557B true CN112070557B (en) | 2023-10-10 |
Family
ID=73695369
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010976516.5A Active CN112070557B (en) | 2020-09-16 | 2020-09-16 | Processing method and device for extensible charging rules |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112070557B (en) |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102957629A (en) * | 2011-08-30 | 2013-03-06 | 华为技术有限公司 | Method and device for queue management |
CN107563741A (en) * | 2017-10-20 | 2018-01-09 | 国信嘉宁数据技术有限公司 | A kind of data save related service charging method and system from damage |
CN109409862A (en) * | 2018-10-19 | 2019-03-01 | 中国建设银行股份有限公司 | Period service charging method, system, device and storage medium |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP5737229B2 (en) * | 2012-06-12 | 2015-06-17 | コニカミノルタ株式会社 | Object sharing system and object input support program |
US9781385B2 (en) * | 2013-03-15 | 2017-10-03 | Blue Jeans Network | User interfaces for presentation of audio/video streams |
-
2020
- 2020-09-16 CN CN202010976516.5A patent/CN112070557B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102957629A (en) * | 2011-08-30 | 2013-03-06 | 华为技术有限公司 | Method and device for queue management |
CN107563741A (en) * | 2017-10-20 | 2018-01-09 | 国信嘉宁数据技术有限公司 | A kind of data save related service charging method and system from damage |
CN109409862A (en) * | 2018-10-19 | 2019-03-01 | 中国建设银行股份有限公司 | Period service charging method, system, device and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN112070557A (en) | 2020-12-11 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN102932415B (en) | Method and device for storing mirror image document | |
CN105515872B (en) | The update method of configuration information, apparatus and system | |
US20140365658A1 (en) | Defragmenting clusters with reserved resources | |
CN110413845B (en) | Resource storage method and device based on Internet of things operating system | |
CN102082832B (en) | Data storage method and device in distributed file system | |
CN105991478A (en) | Server resource distribution method and system | |
CN107203532A (en) | Construction method, the implementation method of search and the device of directory system | |
CN111966631A (en) | Mirror image file generation method, system, equipment and medium capable of being rapidly distributed | |
CN111931009A (en) | Method and device for determining maximum operation path of batch operation | |
Hüls et al. | Coordinated charging strategies for plug-in electric vehicles to ensure a robust charging process | |
CN107818113B (en) | Method and device for determining file access position | |
CN112070557B (en) | Processing method and device for extensible charging rules | |
CN104714983B (en) | The generation method and device of distributed index | |
CN108897858A (en) | The appraisal procedure and device, electronic equipment of distributed type assemblies index fragment | |
CN113986828A (en) | Method and device for storing mass files, electronic equipment and storage medium | |
CN111881086B (en) | Big data storage method, query method, electronic device and storage medium | |
CN101526959B (en) | Data storing method and device | |
CN104063377A (en) | Information processing method and electronic equipment using same | |
CN109947702A (en) | Index structuring method and device, electronic equipment | |
CN103136294A (en) | File operating method and device | |
CN109697234B (en) | Multi-attribute information query method, device, server and medium for entity | |
CN107632938B (en) | Distributed storage product automatic test suite organization method | |
CN116069725A (en) | File migration method, device, apparatus, medium and program product | |
CN115328855A (en) | Method and device for evaluating file reduction degree, storage medium and equipment | |
US20080147221A1 (en) | Grid modeling tool |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |