CN112671597B - Method for carrying out sectional statistics on internal and external flows of elastic public network IP in shared bandwidth - Google Patents

Method for carrying out sectional statistics on internal and external flows of elastic public network IP in shared bandwidth Download PDF

Info

Publication number
CN112671597B
CN112671597B CN202011337947.3A CN202011337947A CN112671597B CN 112671597 B CN112671597 B CN 112671597B CN 202011337947 A CN202011337947 A CN 202011337947A CN 112671597 B CN112671597 B CN 112671597B
Authority
CN
China
Prior art keywords
metering
flow
quality
eip
total
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
Application number
CN202011337947.3A
Other languages
Chinese (zh)
Other versions
CN112671597A (en
Inventor
许勇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Unicloud Technology Co Ltd
Original Assignee
Unicloud Technology Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Unicloud Technology Co Ltd filed Critical Unicloud Technology Co Ltd
Priority to CN202011337947.3A priority Critical patent/CN112671597B/en
Publication of CN112671597A publication Critical patent/CN112671597A/en
Application granted granted Critical
Publication of CN112671597B publication Critical patent/CN112671597B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/50Reducing energy consumption in communication networks in wire-line communication networks, e.g. low power modes or reduced link rate

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention provides a method for carrying out sectional statistics on internal and external flow of an elastic public network IP in a shared bandwidth, which comprises the following steps: designing a product flow usage record table: the system is used for recording whether the specification, the starting and ending metering time, the metering period usage amount and the EIP of each product instance are in a shared bandwidth or not, and regularly reading the flow data to store an inventory table; and (3) starting metering: and starting measurement when the EIP binds the instance, storing product information into the table, wherein the table comprises a measurement period, measurement starting time and the bound instance, and additionally setting the is _ static to be 0, indicating that the counting of the flow of the time period is not completed at present, judging whether the current EIP is in the shared bandwidth, and recording the is _ in _ bws. The method for carrying out sectional statistics on the internal and external flow of the elastic public network IP in the shared bandwidth can support the split of the instance fee of EIP charging according to the flow, if the EIP is in the shared bandwidth, the flow fee in the shared bandwidth is not charged, and only the instance fee is charged; if the EIP is not in the shared bandwidth, EIP traffic fees and instance fees are charged.

Description

Method for carrying out sectional statistics on internal and external flows of elastic public network IP in shared bandwidth
Technical Field
The invention belongs to the field of elastic public networks, and particularly relates to a method for carrying out sectional statistics on internal and external flows of an elastic public network IP in a shared bandwidth.
Background
An Elastic IP Address (EIP) is a public IP Address resource that can be purchased and held independently. The Shared Bandwidth (BWS) can provide the Bandwidth multiplexing capability of multiple IP addresses at a geographic level, and can share the same Bandwidth for the instances of ECS, load balancing, NAT gateway, etc. that bind EIP. The shared bandwidth can be understood as a pool for encapsulating the EIP, all EIPs in the pool share the same bandwidth, and thus when counting EIP traffic, traffic counted in the shared bandwidth is distinguished from traffic not counted in the shared bandwidth. EIP and BWS are two different products, so when the EIP and BWS are charged for flow, corresponding distinction is needed.
Disclosure of Invention
In view of this, the present invention is directed to provide a method for performing a segmented statistics on flows in and out of a shared bandwidth of an elastic public network IP, where a public cloud operator can conveniently obtain specific usage amounts of flows of an EIP and a BWS of each user, and perform charging according to the usage amounts of the flows.
In order to achieve the purpose, the technical scheme of the invention is realized as follows:
a method for carrying out sectional statistics on internal and external flow of an elastic public network IP in a shared bandwidth comprises the following steps:
a1, designing a product flow usage record table: the system is used for recording whether the specification, the starting and ending metering time, the metering period usage amount and the EIP of each product instance are in a shared bandwidth or not, and regularly reading the flow data to store an inventory table;
a2, starting metering: when an EIP binds an instance, starting metering, storing product information into the table, wherein the product information comprises a metering period, metering starting time and the bound instance, and additionally, an is _ static is set to be 0, which indicates that the counting of the flow of the time period is not completed at present, judging whether the current EIP is in a shared bandwidth, and recording the is _ in _ bws;
a3, finishing metering: the metering is finished when the EIP unbinds the instance or deletes the instance, a tbl _ network _ flow _ volume _ record table is inquired according to the timing period and the is _ static =0, records of all products in the table are obtained, and then screening inquiry is carried out on the instance Id to be metered;
a4, starting eip metering, and ending the shared bandwidth metering, namely moving out eip from the shared bandwidth;
a5, ending the eip metering, and starting the shared bandwidth metering, namely adding the eip into the shared bandwidth;
a6, point timing measurement: in the running period of the product, timing statistical operation is needed when reaching the integral point;
a7, inquiring metering information: inquiring according to the product Id, the type, the metering period and the is _ in _ bws, inquiring a corresponding data table according to the metering period and the is _ in _ bws, and inquiring the flow in the shared bandwidth and the flow not in the shared bandwidth;
and A8, calculating the flow quality of the metering period at the current moment.
Further, the method comprises the following steps:
s1, when an EIP is bound, starting metering, namely the metering is started according to the A2;
s2, if the EIP is unbound or deleted, ending the metering operation, namely ending the metering in the step A3;
s3, if the eip is added into the shared bandwidth, the eip metering is ended, and the shared bandwidth metering is started, namely the eip metering is ended in the step A5;
s4, if the eip is removed from the shared bandwidth, starting the eip metering, and ending the shared bandwidth metering, namely starting the eip metering in the A4;
and S5, inquiring the EIP flow usage amount of one metering period, and inquiring according to the product Id, the type, the metering period and the is _ in _ bws.
Further, in A3, if there is a record, modifying a field in the table, including a meter _ end _ time, and is _ static is set to 1;
reading a current _ flow value of the Monitor at the current moment, storing the current _ flow value into total _ quality, then calculating the flow of the metering period at the current moment according to A8, and storing the flow into quality, namely the flow used in the time period:
and if no record exists, inserting a new record into the table, reading the flow value of the Monitor at the current moment, storing the flow value into the total _ quality, calculating the quality, storing the quality into the quality field, judging whether the current eip is in the shared bandwidth, and recording the is _ in _ bws.
Further, in A4, ensuring that the eip is in a binding state, querying a monitored current time flow, obtaining a total flow, querying records of is _ in _ bws =1 and is _ static =0 in a metering period, if the records exist, modifying the quality and the total _ quality in the records, modifying the statistics that is the is _ static is set to 1, recording a current end metering time meter _ end _ time, wherein the total _ quality is the monitored and obtained total flow at the current time, and then calculating the flow quality of the metering period where the current time is located according to A8; if the current value is not equal to the current value, inserting a new record into the table, reading the flow value of the Monitor at the current moment, storing the flow value into the total _ quality, then calculating the quality (namely inquiring the total _ quality of the last metering period, if a plurality of records exist, obtaining the latest value (sorting according to the meter _ end _ time), subtracting the total _ quality of the last period from the current total _ quality to obtain the quality), storing the quality field, and recording the is _ in _ bws as 0;
a new record is added, not in the shared bandwidth (is _ in _ bws = 0) and not counted (is _ static = 0).
Further, in A5, ensuring that the eip is in a binding state, inquiring the monitored current flow, and acquiring the total flow;
inquiring records of is _ in _ bws =0 and is _ static =0 in a metering period, if the records exist, modifying the quality and the total _ quality in the records, and if the records exist, modifying the records to be counted, namely the is _ static is set to be 1, and recording the current end metering time meter _ end _ time; wherein, the total _ quality is the total flow monitored and obtained at the current moment, and then the flow quality of the metering period at the current moment is calculated according to A8; if the current flow value does not exist, inserting a new record into the table, reading the flow value of the Monitor at the current moment, storing the flow value into the total _ quality, then calculating the quality, storing the quality into the quality field, and recording the is _ in _ bws as 1;
one record is added in the shared bandwidth (is _ in _ bws = 1), and is not counted (is _ static = 0).
Further, the integer timing metering of A6 includes:
performing statistical operation at fixed time, scanning a tbl _ network _ flow _ volume _ record table, inquiring according to the product type, the metering period and the is _ static =0 to obtain a product record of the flow which is not counted in the metering period, changing the record of the is _ static =0 into is _ static =1, recording the metering time meter _ end _ time which is currently finished, calculating the usage amount, reading the flow value of the Monitor at the current moment, storing the flow value into the total _ quality, calculating the flow of the metering period in which the current moment is located according to A8, and storing the flow into the quality;
inquiring an example record list in which the product normally operates and the state is binding, if the product Id is not in a tbl _ network _ flow _ volume _ record table, storing the metering information of the product into the tbl _ network _ flow _ volume _ record table, namely reading the flow value of the Monitor at the current moment, storing the flow value into the total _ quality, then inquiring the total _ quality of the last metering period, if a plurality of records exist, obtaining the latest value, subtracting the total _ quality of the last period from the current total _ quality, storing the quality in the table, judging whether the eip is in the shared bandwidth, and modifying the is _ in _ bws.
Further, calculating the flow quality of the metering cycle in which the current time is located in A8 includes: reading a current _ flow value of the current time of the Monitor, inquiring a tbl _ network _ flow _ volume _ record table according to the timing period and the is _ static =1, and acquiring the latest total _ quality if a record exists, wherein the quality is the difference between the total _ quality and the current _ flow mentioned above;
if no record exists, the last timing period and the record of is _ static =1 are queried, and if yes, the latest total _ quality is taken, where the quality is the difference between the total _ quality and the current _ flow mentioned above, and if not, the quality is the total flow current _ flow obtained by monitoring at the current moment.
Compared with the prior art, the method for carrying out sectional statistics on the internal and external flow of the elastic public network IP in the shared bandwidth has the following advantages:
(1) The method for carrying out sectional statistics on the internal and external flow of the elastic public network IP in the shared bandwidth can support the split of the instance fee of EIP charging according to the flow, if the EIP is in the shared bandwidth, the flow fee in the shared bandwidth is not charged, and only the instance fee is charged; if the EIP is not in the shared bandwidth, charging EIP flow rate cost and instance cost;
(2) The method for carrying out sectional statistics on the internal and external flows of the elastic public network IP in the shared bandwidth can conveniently obtain the flow usage amount of the shared bandwidth according to the sectional flow statistics, and is favorable for the flow charging of the shared bandwidth.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate an embodiment of the invention and, together with the description, serve to explain the invention and not to limit the invention. In the drawings:
fig. 1 is a schematic diagram illustrating a method for measuring the internal and external traffic of a segment-statistics flexible public network IP in a shared bandwidth according to an embodiment of the present invention;
fig. 2 is a schematic diagram illustrating an ending measurement of a method for performing segmented statistics on flows of an elastic public network IP within and outside a shared bandwidth according to an embodiment of the present invention;
fig. 3 is a schematic diagram illustrating a method for performing statistics on the internal and external flows of the flexible public network IP in a shared bandwidth at an integral point timing measurement according to an embodiment of the present invention;
fig. 4 is a schematic diagram illustrating a method for performing segmented statistics on flows of an elastic public network IP within and outside a shared bandwidth, according to an embodiment of the present invention, starting eip metering and ending the shared bandwidth metering;
fig. 5 is a schematic flow chart illustrating a method for performing segmented statistics on flows of an elastic public network IP within and outside a shared bandwidth to end eip metering and start shared bandwidth metering according to an embodiment of the present invention;
fig. 6 is a schematic flow chart of flow qualification for calculating a metering period of a current time according to the method for performing segmented statistics on internal and external flows of the elastic public network IP in the shared bandwidth according to the embodiment of the present invention.
Detailed Description
It should be noted that the embodiments and features of the embodiments may be combined with each other without conflict.
In the description of the present invention, it is to be understood that the terms "central," "longitudinal," "lateral," "upper," "lower," "front," "rear," "left," "right," "vertical," "horizontal," "top," "bottom," "inner," "outer," and the like are used in the orientations and positional relationships indicated in the drawings, which are based on the orientations and positional relationships indicated in the drawings, and are used for convenience in describing the present invention and for simplicity in description, but do not indicate or imply that the device or element so referred to must have a particular orientation, be constructed in a particular orientation, and be operated, and thus should not be construed as limiting the present invention. Furthermore, the terms "first," "second," and the like are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or to implicitly indicate a number of the indicated technical features. Thus, a feature defined as "first," "second," etc. may explicitly or implicitly include one or more of that feature. In the description of the present invention, "a plurality" means two or more unless otherwise specified.
In the description of the present invention, it should be noted that, unless otherwise explicitly specified or limited, the terms "mounted," "connected," and "connected" are to be construed broadly, e.g., as meaning either a fixed connection, a removable connection, or an integral connection; can be mechanically or electrically connected; they may be connected directly or indirectly through intervening media, or they may be interconnected between two elements. The specific meanings of the above terms in the present invention can be understood by those of ordinary skill in the art through specific situations.
The present invention will be described in detail below with reference to the embodiments with reference to the attached drawings.
A method for carrying out sectional statistics on internal and external flow of an elastic public network IP in a shared bandwidth comprises the following steps:
a1, designing a product flow usage record table: the system is used for recording whether the specification, the starting and ending metering time, the metering period usage amount and the EIP of each product instance are in a shared bandwidth or not, and regularly reading the flow data to store an inventory table;
a2, starting metering: when an EIP binds an instance, starting metering, storing product information into the table, wherein the product information comprises a metering period, metering starting time and the bound instance, and additionally, an is _ static is set to be 0, which indicates that the counting of the flow of the time period is not completed at present, judging whether the current EIP is in a shared bandwidth, and recording the is _ in _ bws;
a3, finishing metering: the metering is finished when the EIP unbinds the instance or deletes the instance, a tbl _ network _ flow _ volume _ record table is inquired according to the timing period and the is _ static =0, records of all products in the table are obtained, and then screening inquiry is carried out on the instance Id to be metered;
a4, starting eip metering, and ending the shared bandwidth metering, namely moving out eip from the shared bandwidth;
a5, ending the eip metering, and starting the shared bandwidth metering, namely adding the eip into the shared bandwidth;
a6, point timing measurement: in the running period of the product, timing statistical operation is needed when reaching the integral point;
a7, inquiring metering information: inquiring according to the product Id, the type, the metering period and the is _ in _ bws, inquiring a corresponding data table according to the metering period and the is _ in _ bws, and inquiring the flow in the shared bandwidth and the flow not in the shared bandwidth;
and A8, calculating the flow quality of the metering period at the current moment.
A method for carrying out sectional statistics on internal and external flow of an elastic public network IP in a shared bandwidth comprises the following steps:
s1, when an EIP is bound, starting metering, namely the metering is started according to the A2;
s2, if the EIP is unbound or deleted, ending the metering operation, namely ending the metering in the step A3;
s3, if the eip is added into the shared bandwidth, the eip metering is ended, and the shared bandwidth metering is started, namely the eip metering is ended in the step A5;
s4, if the eip is removed from the shared bandwidth, starting eip metering, and ending the shared bandwidth metering, namely starting the eip metering in the A4;
and S5, inquiring the EIP flow usage amount of one metering period, and inquiring according to the product Id, the type, the metering period and the is _ in _ bws.
In A3, if a record exists, modifying fields in a table, including a meter _ end _ time, and an is _ static is set to be 1;
reading a current _ flow value of the Monitor at the current moment, storing the current _ flow value into total _ quality, then calculating the flow of the metering period at the current moment according to A8, and storing the flow into quality, namely the flow used in the time period:
and if no record exists, inserting a new record into the table, reading the flow value of the Monitor at the current moment, storing the flow value into the total _ quality, calculating the quality, storing the quality into the quality field, judging whether the current eip is in the shared bandwidth, and recording the is _ in _ bws.
In A4, ensuring that the eip is in a binding state, inquiring the monitored current time flow, acquiring total flow, inquiring records of is _ in _ bws =1 and is _ static =0 in a metering period, if the records exist, modifying the precision and the total _ precision in the records, modifying the statistics that is the is _ static is set to 1, recording the current end metering time meter _ end _ time, wherein the total _ precision is the total flow monitored and acquired at the current time, and then calculating the flow precision of the metering period where the current time is according to A8; if the current value is not equal to the current value, inserting a new record into the table, reading the flow value of the Monitor at the current moment, storing the flow value into the total _ quality, then calculating the quality (namely inquiring the total _ quality of the last metering period, if a plurality of records exist, obtaining the latest value (sorting according to the meter _ end _ time), subtracting the total _ quality of the last period from the current total _ quality to obtain the quality), storing the quality field, and recording the is _ in _ bws as 0;
a new record is added, not in the shared bandwidth (is _ in _ bws = 0), and not counted (is _ static = 0).
In A5, ensuring that the eip is in a binding state, inquiring the monitored current flow, and acquiring the total flow;
inquiring records of is _ in _ bws =0 and is _ static =0 in a metering period, if the records exist, modifying the quality and the total _ quality in the records, and if the records exist, modifying the records to be counted, namely the is _ static is set to be 1, and recording the current end metering time meter _ end _ time; wherein, the total _ quality is the total flow monitored and obtained at the current moment, and then the flow quality of the metering period at the current moment is calculated according to A8; if the current flow value does not exist, inserting a new record into the table, reading the flow value of the Monitor at the current moment, storing the flow value into the total _ quality, then calculating the quality, storing the quality into the quality field, and recording the is _ in _ bws as 1;
one record is added in the shared bandwidth (is _ in _ bws = 1), and is not counted (is _ static = 0).
The whole-point timing measurement of A6 comprises:
performing statistical operation at fixed time, scanning a tbl _ network _ flow _ volume _ record table, inquiring according to the product type, the metering period and the is _ static =0 to obtain a product record of the flow which is not counted in the metering period, changing the record of the is _ static =0 into is _ static =1, recording the metering time meter _ end _ time which is currently finished, calculating the usage amount, reading the flow value of the Monitor at the current moment, storing the flow value into the total _ quality, calculating the flow of the metering period in which the current moment is located according to A8, and storing the flow into the quality;
inquiring the example record list of the product which is normally operated and the state is binding, if the product Id is not in the tbl _ network _ flow _ volume _ record table, storing the metering information of the product into the tbl _ network _ flow _ volume _ record table, namely reading the flow value of the Monitor at the current moment, storing the total _ quantity, inquiring the total _ quantity of the last metering period, if a plurality of records exist, obtaining the latest value, subtracting the total _ quantity of the last period from the current total _ quantity, storing the quantity in the table, judging whether the eip is in the shared bandwidth, and modifying the is _ in _ bws.
Calculating the flow quality of the metering period at the current moment in the step 8 comprises the following steps: reading a current _ flow value of the current time of the Monitor, inquiring a tbl _ network _ flow _ volume _ record table according to the timing period and the is _ static =1, and acquiring the latest total _ quality if a record exists, wherein the quality is the difference between the total _ quality and the current _ flow mentioned above;
if no record exists, the last timing period and the record of is _ static =1 are queried, and if yes, the latest total _ quality is taken, where the quality is the difference between the total _ quality and the current _ flow mentioned above, and if not, the quality is the total flow current _ flow obtained by monitoring at the current moment.
As shown in fig. 1 to fig. 6, the present invention provides a method for performing a segmented statistics on flows in and out of a shared bandwidth of an elastic public network IP, so that a public cloud operator can conveniently obtain a specific usage amount of flows of each user EIP and BWS, and perform charging according to the usage amount of the flows. In order to achieve the above object, the present application provides the following technical solutions:
1. designing a product flow usage recording table for recording the specification, the starting and ending metering time, the metering cycle usage and whether the EIP is in the shared bandwidth, and the like of each product instance, regularly reading the flow data in the Monitor, and storing an inventory table, wherein the table is as follows:
Figure BDA0002797805960000111
2. the metering function is started and the metering is started,
when an EIP binds an instance, metering is started, product information is stored in a tbl _ network _ flow _ volume _ record table and comprises information of a metering period, metering starting time, the bound instance and the like, in addition, the is _ static is set to be 0, the statistics of the flow of the time period is not completed at present, whether the current EIP is in a shared bandwidth or not is judged, and the is _ in _ bws is recorded;
3. the metering function is ended and the metering is completed,
EIP unbinds the instance or finishes metering when deleting, queries a tbl _ network _ flow _ volume _ record table according to the timing period and is _ static =0, acquires records of all products in the table, then performs screening query on the instance Id to be metered,
(1) If the record exists, modifying the fields in the table, including the meter _ end _ time and the is _ static to be 1; reading the current _ flow value of the Monitor at the current moment, storing the current _ flow value into total _ quality, then calculating the flow of the metering period at the current moment according to the following 8 th point, and storing the quality, namely the flow used in the time period:
(2) If no record exists, inserting a new record into the table, reading the flow value of the Monitor at the current moment, storing the flow value into the total _ quality, then calculating the quality (namely inquiring the total _ quality of the last metering period, if a plurality of records exist, obtaining the latest value (sorting according to the meter _ end _ time), subtracting the total _ quality of the last period from the current total _ quality to obtain the quality), storing the quality field, judging whether the current eip is in the shared bandwidth, and recording is _ in _ bws;
4. start eip metering, end shared Bandwidth metering (eip moves out of shared Bandwidth)
(1) The premise eip is that the binding state,
(2) Inquiring the monitored current flow to obtain the total flow;
(3) Inquiring records of is _ in _ bws =1 and is _ static =0 in a metering period, if the records exist, modifying the quality and the total _ quality in the records, modifying the statistics that is the is _ static is set to 1, recording the current end metering time meter _ end _ time, wherein the total _ quality is the total flow monitored and obtained at the current moment, and then calculating the flow quality of the metering period at the current moment according to the following 8 th point; if the current value is not equal to the current value, inserting a new record into the table, reading the flow value of the Monitor at the current moment, storing the flow value into the total _ quality, then calculating the quality (namely inquiring the total _ quality of the last metering period, if a plurality of records exist, obtaining the latest value (sorting according to the meter _ end _ time), subtracting the total _ quality of the last period from the current total _ quality to obtain the quality), storing the quality field, and recording the is _ in _ bws as 0;
(4) Adding a new record, not in the shared bandwidth (is _ in _ bws = 0), and not counting (is _ static = 0);
5. end eip metering, start shared Bandwidth metering (eip Add to shared Bandwidth)
(1) The premise eip is that the binding state,
(2) Inquiring the monitored current flow to obtain the total flow;
(3) Inquiring records of is _ in _ bws =0 and is _ static =0 in a metering period, if the records exist, modifying the quality and the total _ quality in the records, and if the records exist, modifying the records to be counted, namely the is _ static is set to be 1, and recording the current end metering time meter _ end _ time; wherein, the total _ quality is the total flow monitored and obtained at the current moment, and then the flow quality of the metering period at the current moment is calculated according to the following 8 th point; if the current value is not equal to the current value, inserting a new record into the table, reading the flow value of the Monitor at the current moment, storing the flow value into the total _ quality, then calculating the quality (namely inquiring the total _ quality of the last metering period, if a plurality of records exist, obtaining the latest value (sorting according to the meter _ end _ time), subtracting the total _ quality of the last period from the current total _ quality to obtain the quality), storing the quality field, and recording the is _ in _ bws as 1;
(4) Adding a record in the shared bandwidth (is _ in _ bws = 1) and not counting (is _ static = 0);
6. the timing measurement is carried out at the integral point,
at the end of the product run, a timed statistical operation is required.
(1) Performing statistical operation at fixed time, scanning a tbl _ network _ flow _ volume _ record table, inquiring according to the product type, the metering period and the is _ static =0 to obtain a product record of the flow which is not counted in the metering period, changing the record of the is _ static =0 into is _ static =1, recording the metering time meter _ end _ time which is currently ended, calculating the usage, reading the flow value of the Monitor at the current moment, storing the flow value into the total _ quality, calculating the flow which is stored in the metering period at the current moment according to the following 8 th point, and storing the quality
(2) Inquiring the example record list in which the product normally operates and the state is binding, if the product Id is not in the tbl _ network _ flow _ volume _ record table, storing the metering information of the product into the tbl _ network _ flow _ volume _ record table (including the usage amount), namely reading the flow value of the Monitor at the current moment, storing the total _ quality, then inquiring the total _ quality of the last metering period, if a plurality of records exist, acquiring the latest value (sorting according to the meter _ end _ time), subtracting the total _ quality of the last period from the current total _ quality, storing the quality in the table, judging whether the edge is in the shared bandwidth, and modifying the is _ in _ bws.
7. And inquiring the metering information, namely inquiring according to the product Id, the type, the metering period and the is _ in _ bws, inquiring a corresponding data table according to the metering period and the is _ in _ bws, and inquiring the flow in the shared bandwidth and the flow not in the shared bandwidth.
8. Calculating the flow qualification of the metering period at the current moment
Reading a current flow value current _ flow of the Monitor at the current moment, inquiring a tbl _ network _ flow _ volume _ record table (inquiring in descending order according to the meter _ end _ time) according to the timing period and the is _ static =1, and if a record exists, acquiring the latest total _ quality, wherein the quality is the difference between the total _ quality and the current _ flow mentioned above; if no record exists, the last timing period and the record of is _ static =1 are queried, and if yes, the latest total _ quality is taken, where the quality is the difference between the total _ quality and the current _ flow mentioned above, and if not, the quality is the total flow current _ flow obtained by monitoring at the current moment.
The specific operation steps are as follows:
1. when binding the EIP, starting metering, namely starting a metering function at the 2 nd point mentioned in the description of the method;
2. if the EIP is unbound or deleted, the end metering operation is carried out, namely the 3 rd point end metering function mentioned in the description of the method is carried out;
3. if the eip is added into the shared bandwidth, the eip metering is ended, and the shared bandwidth metering is started, namely, the 5 th point mentioned in the description of the method;
4. if the eip is removed from the shared bandwidth, starting eip metering and ending the shared bandwidth metering, namely, the 4 th point mentioned in the above description of the method;
5. and inquiring the EIP flow usage amount of one metering period, and inquiring according to the product Id, type, metering period and is _ in _ bws.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.

Claims (5)

1. A method for carrying out sectional statistics on internal and external flow of an elastic public network IP in a shared bandwidth is characterized by comprising the following steps:
a1, designing a product flow usage record table: the system is used for recording whether the specification, the starting and ending metering time, the metering period usage and the EIP of each product instance are in a shared bandwidth or not, and reading flow data at regular time and storing the flow data into a data table;
a2, starting metering: when an EIP binds an instance, starting metering, storing product information into the table, wherein the product information comprises a metering period, metering starting time and the bound instance, and additionally, an is _ static is set to be 0, which indicates that the counting of the flow of the time period is not completed at present, judging whether the current EIP is in a shared bandwidth, and recording the is _ in _ bws;
a3, finishing metering: the EIP unbinds the instance or finishes metering when deleting, queries a tbl _ network _ flow _ volume _ record table according to the metering period and the is _ static =0, acquires records of all products in the table, and then performs screening query on the instance Id of finishing metering;
a4, starting eip metering, and ending the shared bandwidth metering, namely moving out eip from the shared bandwidth;
a5, ending the eip metering, and starting the shared bandwidth metering, namely adding the eip into the shared bandwidth;
a6, point timing measurement: in the running period of the product, timing statistical operation is needed when reaching the integral point;
a7, inquiring metering information: inquiring according to the product Id, the type, the metering period and the is _ in _ bws, inquiring a corresponding data table according to the metering period and the is _ in _ bws, and inquiring the flow in the shared bandwidth and the flow not in the shared bandwidth;
a8, calculating the flow qualification of the metering period at the current moment;
the method comprises the following steps:
s1, when an EIP is bound, starting metering, namely the metering is started according to the A2;
s2, if the EIP is unbound or deleted, ending the metering operation, namely ending the metering in the step A3;
s3, if the eip is added into the shared bandwidth, the eip metering is ended, and the shared bandwidth metering is started, namely the eip metering is ended in the step A5;
s4, if the eip is removed from the shared bandwidth, starting eip metering, and ending the shared bandwidth metering, namely starting the eip metering in the A4;
s5, inquiring the EIP flow usage amount of one metering period, and inquiring according to the product Id, the type, the metering period and the is _ in _ bws;
in A3, if a record exists, modifying a field in the table, wherein the field comprises a meter _ end _ time, and is _ static is set to be 1;
reading a current _ flow value of the Monitor at the current moment, storing the current _ flow value into total _ quality, then calculating the flow of the metering period at the current moment according to A8, and storing the flow into quality, namely the flow used in the time period:
and if no record exists, inserting a new record into the table, reading the flow value of the Monitor at the current moment, storing the flow value into the total _ quality, calculating the quality, storing the quality into the quality field, judging whether the current eip is in the shared bandwidth, and recording the is _ in _ bws.
2. The method of claim 1, wherein the method comprises the following steps: in A4, ensuring that the eip is in a binding state, inquiring the monitored current time flow, acquiring total flow, inquiring records of is _ in _ bws =1 and is _ static =0 in a metering period, if the records exist, modifying the precision and the total _ precision in the records, modifying the statistics that is the is _ static is set to 1, recording the current end metering time meter _ end _ time, wherein the total _ precision is the total flow monitored and acquired at the current time, and then calculating the flow precision of the metering period where the current time is according to A8; if the current flow value does not exist, inserting a new record into the table, reading the flow value of the Monitor at the current moment, storing the flow value into the total _ quality, and then calculating the quality, wherein the method for calculating the quality comprises the following steps: inquiring the total _ quality of the last metering period, if a plurality of records exist, sequencing according to the meter _ end _ time to obtain the latest value, subtracting the total _ quality of the last period from the current total _ quality to obtain the quality, storing the quality into a quality field, and recording that is _ in _ bws is 0;
a record is newly added, is _ in _ bws =0 in the shared bandwidth, and is _ static =0 is not counted.
3. The method of claim 1, wherein the method comprises the following steps: in A5, ensuring that the eip is in a binding state, inquiring the monitored current flow, and acquiring the total flow;
inquiring records of is _ in _ bws =0 and is _ static =0 in a metering period, if the records exist, modifying the quality and the total _ quality in the records, and if the records exist, modifying the records to be counted, namely the is _ static is set to be 1, and recording the current end metering time meter _ end _ time; wherein, the total _ quality is the total flow monitored and obtained at the current moment, and then the flow quality of the metering period at the current moment is calculated according to A8; if the current flow value does not exist, inserting a new record into the table, reading the flow value of the Monitor at the current moment, storing the flow value into the total _ quality, then calculating the quality, storing the quality into the quality field, and recording the is _ in _ bws as 1;
and adding a new record, wherein is _ in _ bws =1 in the shared bandwidth, and is _ static =0 is not counted.
4. The method of claim 1, wherein the A6 whole-time metering comprises:
performing statistical operation at fixed time, scanning a tbl _ network _ flow _ volume _ record table, inquiring according to the product type, the metering period and the is _ static =0 to obtain a product record of the flow which is not counted in the metering period, changing the record of the is _ static =0 into is _ static =1, recording the metering time meter _ end _ time which is currently finished, calculating the usage amount, reading the flow value of the Monitor at the current moment, storing the flow value into the total _ quality, calculating the flow of the metering period in which the current moment is located according to A8, and storing the flow into the quality;
inquiring an example record list in which the product normally operates and the state is binding, if the product Id is not in a tbl _ network _ flow _ volume _ record table, storing the metering information of the product into the tbl _ network _ flow _ volume _ record table, namely reading the flow value of the Monitor at the current moment, storing the flow value into the total _ quality, then inquiring the total _ quality of the last metering period, if a plurality of records exist, obtaining the latest value, subtracting the total _ quality of the last period from the current total _ quality, storing the quality in the table, judging whether the eip is in the shared bandwidth, and modifying the is _ in _ bws.
5. The method for the segmented statistic resilient public network IP traffic in and out of the shared bandwidth as claimed in claim 1, wherein the calculating the traffic quality of the metering period at the current moment in A8 comprises: reading a current _ flow value of the current time of the Monitor, inquiring a tbl _ network _ flow _ volume _ record table according to the metering period and the is _ static =1, and if a record exists, acquiring the latest total _ quality, wherein the quality is the difference between the total _ quality and the current _ flow mentioned above;
if no record exists, the last metering cycle and the record of is _ static =1 are queried, and if yes, the latest total _ quality is taken, where the quality is the difference between the total _ quality and the current _ flow mentioned above, and if not, the quality is the total flow current _ flow obtained by monitoring at the current moment.
CN202011337947.3A 2020-11-25 2020-11-25 Method for carrying out sectional statistics on internal and external flows of elastic public network IP in shared bandwidth Active CN112671597B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011337947.3A CN112671597B (en) 2020-11-25 2020-11-25 Method for carrying out sectional statistics on internal and external flows of elastic public network IP in shared bandwidth

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011337947.3A CN112671597B (en) 2020-11-25 2020-11-25 Method for carrying out sectional statistics on internal and external flows of elastic public network IP in shared bandwidth

Publications (2)

Publication Number Publication Date
CN112671597A CN112671597A (en) 2021-04-16
CN112671597B true CN112671597B (en) 2023-03-24

Family

ID=75404115

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011337947.3A Active CN112671597B (en) 2020-11-25 2020-11-25 Method for carrying out sectional statistics on internal and external flows of elastic public network IP in shared bandwidth

Country Status (1)

Country Link
CN (1) CN112671597B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113806367A (en) * 2021-09-08 2021-12-17 紫光云(南京)数字技术有限公司 Method for measuring elastic public network IP according to pause time
CN114710443B (en) * 2022-03-17 2024-03-19 杭州华橙软件技术有限公司 Traffic scheduling method and device for forwarding server

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109951402A (en) * 2017-12-21 2019-06-28 上海盛霄云计算技术有限公司 A kind of method of adjustment of shared bandwidth
CN111262960A (en) * 2020-01-15 2020-06-09 山东汇贸电子口岸有限公司 Public cloud elastic public network IP cluster implementation method and system
CN111625541A (en) * 2020-05-11 2020-09-04 紫光云技术有限公司 Method for measuring IP (Internet protocol) of elastic public network according to flow

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101047711B (en) * 2006-04-27 2010-08-18 华为技术有限公司 Method for IP message transmitting, bargaining bandwidth saving ability and saving network bandwidth

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109951402A (en) * 2017-12-21 2019-06-28 上海盛霄云计算技术有限公司 A kind of method of adjustment of shared bandwidth
CN111262960A (en) * 2020-01-15 2020-06-09 山东汇贸电子口岸有限公司 Public cloud elastic public network IP cluster implementation method and system
CN111625541A (en) * 2020-05-11 2020-09-04 紫光云技术有限公司 Method for measuring IP (Internet protocol) of elastic public network according to flow

Also Published As

Publication number Publication date
CN112671597A (en) 2021-04-16

Similar Documents

Publication Publication Date Title
CN112671597B (en) Method for carrying out sectional statistics on internal and external flows of elastic public network IP in shared bandwidth
CN105814593B (en) Data communications method and data communication system
US8180333B1 (en) Differential routing of communication-usage records
CN107133841A (en) A kind of charging pile website recommendation method and apparatus
CN110557729B (en) Roaming charging method and device
KR20140119160A (en) Tracking data usage under a schematized data plan
CN111641513A (en) Method for measuring time of elastic public network IP
CN111064634A (en) Method and device for monitoring mass Internet of things terminal online state
WO2011042903A1 (en) Computer network service providing system including self adjusting volume enforcement functionality
CN1980191B (en) Accounting based on active packet time
BRPI0808689A2 (en) METHOD AND APPARATUS FOR MEASURING DISTINCTIONS BETWEEN MARKETING AND PREPAID VERSUS POST PAID CUSTOMER BASE FOR WIRELESS COMMUNICATION SERVICE PROVIDERS.
CN111625541A (en) Method for measuring IP (Internet protocol) of elastic public network according to flow
CN108153758A (en) A kind of data accumulation method, apparatus and electronic equipment
CN108833123A (en) Based on according to quantity cloud host charging method and device
CN108364049A (en) Assets management method and system
WO2004077765A1 (en) Communication charge sorting method and device
CN105718539B (en) A kind of database application method and device
CN101217385B (en) A method and system for the temporary storage and treatment of charging bill
CN102612058B (en) Method and device for determining performance index statistical result
CN113225218A (en) Method and device for checking call ticket quality
WO2021258719A1 (en) Billing method and system for container platform
CN113806367A (en) Method for measuring elastic public network IP according to pause time
JP2003281668A (en) Charging communication terminal, external server, communication system and charging method
CN111222926A (en) Invoicing method and device
JP2003281293A (en) Data storage metered rate charging method and data storage metered rate charging device

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