CN112671597A - 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
CN112671597A
CN112671597A CN202011337947.3A CN202011337947A CN112671597A CN 112671597 A CN112671597 A CN 112671597A CN 202011337947 A CN202011337947 A CN 202011337947A CN 112671597 A CN112671597 A CN 112671597A
Authority
CN
China
Prior art keywords
flow
quality
metering
eip
current
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.)
Granted
Application number
CN202011337947.3A
Other languages
Chinese (zh)
Other versions
CN112671597B (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 statistics 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, start of metering: measuring when EIP binds an instance, storing product information into the table, wherein the measuring period, the measuring starting time and the bound instance are included, in addition, the 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, end of measurement: the EIP unbinds the instance or finishes metering when deleting, queries a tbl _ network _ flow _ volume _ record table according to the timing period and the is _ static ═ 0, acquires records of all products in the table, and then performs screening query on the instance Id to be metered;
a4, starting eip metering, and ending the shared bandwidth metering, namely moving eip out of the shared bandwidth;
a5, ending the eip measurement, and starting the shared bandwidth measurement, namely adding the eip into the shared bandwidth;
a6, punctual 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 binding the EIP, starting metering, namely the starting metering of A2;
s2, if the EIP is unbound or deleted, performing end metering operation, namely the end metering of 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 A5;
s4, if eip is removed from the shared bandwidth, eip metering is started, and the shared bandwidth metering is ended, namely the eip metering is started according to A4;
s5, inquiring the EIP flow usage amount of a metering period, and inquiring according to the product Id, type, metering period and is _ in _ bws.
Further, in a3, if there is a record, modify the fields in the table, including the meter _ end _ time, the 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:
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, storing the quality into the quality field, judging whether the current eip is in the shared bandwidth, and recording is _ in _ bws.
Further, in a4, ensuring that eip is in a binding state, querying a monitored current time flow, obtaining a total flow, querying records of which is _ in _ bws is 1 and is _ static is 0 in a metering period, if yes, modifying the total and total _ total in the records, modifying the statistics that is _ static is 1, recording a current ending metering time meter _ end _ time, wherein the total _ total is the monitored and obtained total flow at the current time, and then calculating the flow total of the metering period at the current time according to A8; if the current 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 (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 a record under a metering period and with the is _ in _ bws being 0 and the is _ static being 0, if the record exists, modifying the quality and the total _ quality in the record, modifying the counted is _ static 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 newly added, in the shared bandwidth (is _ in _ bws is equal to 1), and is not counted (is _ static is equal to 0).
Further, the whole-point timing measurement 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 of 0 to obtain a product record of which the flow is not counted in the metering period, changing the record of which the is _ static of 0 into the is _ static of 1, recording the current end metering time meter _ end _ time, calculating the usage, reading the flow value of the Monitor at the current time, storing the flow value into the total _ quality, calculating the flow of the metering period at the current time according to A8, and storing the flow value into the quality;
inquiring the example record list in which the product is normally operated and the status 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 _ 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, the calculating the flow qualification of the metering period at the current time in A8 includes: reading a current flow value current _ flow of the Monitor at the current moment, inquiring a tbl _ network _ flow _ volume _ record table 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 is _ static record are inquired, if yes, the latest total _ quality is taken, and if not, 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 flows of the IP of the elastic public network 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 "center", "longitudinal", "lateral", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", and the like, indicate orientations or positional relationships based on those shown in the drawings, and are used only for convenience in describing the present invention and for simplicity in description, and do not indicate or imply that the referenced devices or elements must have a particular orientation, be constructed and operated in a particular orientation, and thus, are not to be construed as limiting the present invention. Furthermore, the terms "first", "second", etc. are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. 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 meaning 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, start of metering: measuring when EIP binds an instance, storing product information into the table, wherein the measuring period, the measuring starting time and the bound instance are included, in addition, the 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, end of measurement: the EIP unbinds the instance or finishes metering when deleting, queries a tbl _ network _ flow _ volume _ record table according to the timing period and the is _ static ═ 0, acquires records of all products in the table, and then performs screening query on the instance Id to be metered;
a4, starting eip metering, and ending the shared bandwidth metering, namely moving eip out of the shared bandwidth;
a5, ending the eip measurement, and starting the shared bandwidth measurement, namely adding the eip into the shared bandwidth;
a6, punctual 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 binding the EIP, starting metering, namely the starting metering of A2;
s2, if the EIP is unbound or deleted, performing end metering operation, namely the end metering of 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 A5;
s4, if eip is removed from the shared bandwidth, eip metering is started, and the shared bandwidth metering is ended, namely the eip metering is started according to A4;
s5, inquiring the EIP flow usage amount of a metering period, and inquiring according to the product Id, type, metering period and is _ in _ bws.
In A3, if there is a record, modifying the fields in the table, including the meter _ end _ time, the 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:
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, storing the quality into the quality field, judging whether the current eip is in the shared bandwidth, and recording is _ in _ bws.
In a4, ensuring that the eip is in a binding state, querying flow at the current time of monitoring, obtaining total flow, querying records of which is _ in _ bws is 1 and is _ static is 0 in a metering period, if the records exist, modifying the position and the total _ position in the records, modifying the records to be that the is _ static is set to 1 after statistics, recording the current end metering time meter _ end _ time, wherein the total _ position is the total flow monitored and obtained at the current time, and then calculating the flow position of the metering period where the current time is according to A8; if the current 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 (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 a record under a metering period and with the is _ in _ bws being 0 and the is _ static being 0, if the record exists, modifying the quality and the total _ quality in the record, modifying the counted is _ static 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 newly added, in the shared bandwidth (is _ in _ bws is equal to 1), and is not counted (is _ static is equal to 0).
The integral point timing measurement 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 of 0 to obtain a product record of which the flow is not counted in the metering period, changing the record of which the is _ static of 0 into the is _ static of 1, recording the current end metering time meter _ end _ time, calculating the usage, reading the flow value of the Monitor at the current time, storing the flow value into the total _ quality, calculating the flow of the metering period at the current time according to A8, and storing the flow value into the quality;
inquiring the example record list in which the product is normally operated and the status 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 _ 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.
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 current _ flow of the Monitor at the current moment, inquiring a tbl _ network _ flow _ volume _ record table 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 is _ static record are inquired, if yes, the latest total _ quality is taken, and if not, 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 function is completed,
when the EIP unbinds the instance or finishes metering when deleting, inquiring a tbl _ network _ flow _ volume _ record table according to the timing period and the is _ static ═ 0, acquiring records of all products in the table, then carrying out screening inquiry on the instance Id to be metered,
(1) if the record exists, modifying the fields in the table, wherein the fields comprise a meter _ end _ time and an is _ static which are set 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 and 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 which is _ in _ bws is 1 and is _ static is 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 be 1, recording the current end metering time meter _ end _ time, wherein the total _ quality is total flow obtained by monitoring 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 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 (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, which is 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 a record under a metering period and with the is _ in _ bws being 0 and the is _ static being 0, if the record exists, modifying the quality and the total _ quality in the record, modifying the counted is _ static 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 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 (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 is _ in _ bws as 1;
(4) adding one record, wherein the is _ in _ bws is equal to 1, and the is _ static is not counted;
6. the timing measurement is carried out at the integral point,
timing statistics are required to be performed at the end of the product run.
(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 of 0 to obtain a product record of which the flow is not counted in the metering period, changing the record of the is _ static of 0 to the is _ static of 1, recording the current end metering time meter _ end _ time, calculating the usage, reading the flow value of the Monitor at the current time, storing the flow value into the total _ quality, calculating the flow of the metering period at the current time according to the following 8 th point, and storing the flow into the quality
(2) Inquiring the example record list in which the product 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 (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. Inquiring the metering information, namely inquiring according to the product Id, the type, the metering period and the is _ in _ bws, and inquiring a corresponding data table according to the metering period and the is _ in _ bws can inquire 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 of the current time of the Monitor, 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 records exist, 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 is _ static record are inquired, if yes, the latest total _ quality is taken, and if not, 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. the EIP flow usage amount of one metering period is inquired, and inquiry is carried out according to the product Id, the type, the metering period and the 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 (7)

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 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, start of metering: measuring when EIP binds an instance, storing product information into the table, wherein the measuring period, the measuring starting time and the bound instance are included, in addition, the 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, end of measurement: the EIP unbinds the instance or finishes metering when deleting, queries a tbl _ network _ flow _ volume _ record table according to the timing period and the is _ static ═ 0, acquires records of all products in the table, and then performs screening query on the instance Id to be metered;
a4, starting eip metering, and ending the shared bandwidth metering, namely moving eip out of the shared bandwidth;
a5, ending the eip measurement, and starting the shared bandwidth measurement, namely adding the eip into the shared bandwidth;
a6, punctual 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.
2. The method of claim 1, wherein the method for segmented statistics of resilient public network IP traffic within and outside a shared bandwidth comprises the steps of:
s1, when binding the EIP, starting metering, namely the starting metering of A2;
s2, if the EIP is unbound or deleted, performing end metering operation, namely the end metering of 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 A5;
s4, if eip is removed from the shared bandwidth, eip metering is started, and the shared bandwidth metering is ended, namely the eip metering is started according to A4;
s5, inquiring the EIP flow usage amount of a metering period, and inquiring according to the product Id, type, metering period and is _ in _ bws.
3. The method of claim 1, wherein the method comprises the following steps: in A3, if there is a record, modifying the fields in the table, including the meter _ end _ time, the 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:
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, storing the quality into the quality field, judging whether the current eip is in the shared bandwidth, and recording is _ in _ bws.
4. The method of claim 1, wherein the method comprises the following steps: in a4, ensuring that the eip is in a binding state, querying flow at the current time of monitoring, obtaining total flow, querying records of which is _ in _ bws is 1 and is _ static is 0 in a metering period, if the records exist, modifying the position and the total _ position in the records, modifying the records to be that the is _ static is set to 1 after statistics, recording the current end metering time meter _ end _ time, wherein the total _ position is the total flow monitored and obtained at the current time, and then calculating the flow position of the metering period where the current time is according to A8; if the current 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 (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).
5. 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 a record under a metering period and with the is _ in _ bws being 0 and the is _ static being 0, if the record exists, modifying the quality and the total _ quality in the record, modifying the counted is _ static 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 newly added, in the shared bandwidth (is _ in _ bws is equal to 1), and is not counted (is _ static is equal to 0).
6. The method of claim 1, wherein the A6 of the punctual timing measurement 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 of 0 to obtain a product record of which the flow is not counted in the metering period, changing the record of which the is _ static of 0 into the is _ static of 1, recording the current end metering time meter _ end _ time, calculating the usage, reading the flow value of the Monitor at the current time, storing the flow value into the total _ quality, calculating the flow of the metering period at the current time according to A8, and storing the flow value into the quality;
inquiring the example record list in which the product is normally operated and the status 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 _ 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.
7. 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 current _ flow of the Monitor at the current moment, inquiring a tbl _ network _ flow _ volume _ record table 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 is _ static record are inquired, if yes, the latest total _ quality is taken, and if not, 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 true CN112671597A (en) 2021-04-16
CN112671597B 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)

Cited By (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
CN114710443A (en) * 2022-03-17 2022-07-05 杭州华橙软件技术有限公司 Traffic scheduling method and device for forwarding server

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090022065A1 (en) * 2006-04-27 2009-01-22 Huawei Technologies Co., Ltd. Method And System For Transmitting IP Message, Negotiating Bandwidth Saving Capability And Saving Network Bandwidth
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

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090022065A1 (en) * 2006-04-27 2009-01-22 Huawei Technologies Co., Ltd. Method And System For Transmitting IP Message, Negotiating Bandwidth Saving Capability And Saving Network Bandwidth
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

Cited By (3)

* 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
CN114710443A (en) * 2022-03-17 2022-07-05 杭州华橙软件技术有限公司 Traffic scheduling method and device for forwarding server
CN114710443B (en) * 2022-03-17 2024-03-19 杭州华橙软件技术有限公司 Traffic scheduling method and device for forwarding server

Also Published As

Publication number Publication date
CN112671597B (en) 2023-03-24

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
US8180333B1 (en) Differential routing of communication-usage records
CN101473591B (en) System and method for measuring and reporting service usage
US9699676B2 (en) Policy controller based network statistics generation
US20130196622A1 (en) Updating dynamic data usage plans and statistics
US7761088B1 (en) Method and system for measuring market information for wireless telecommunication devices
CN110557729B (en) Roaming charging method and device
US20020019830A1 (en) System and method for the optimization of data collection
CN110493016B (en) Flow service charging method and device
US20110223882A1 (en) Methods, apparatuses, system and related computer program product for charging of always-on connections
CN111064634A (en) Method and device for monitoring mass Internet of things terminal online state
US20150105044A1 (en) Processing Usage Information For Machine-to-Machine Communication
CN1980191B (en) Accounting based on active packet time
EP2486523A1 (en) Computer network service providing system including self adjusting volume enforcement functionality
CN111641513A (en) Method for measuring time of elastic public network IP
CN106067879B (en) The detection method and device of information
CN104025632A (en) Lte subscriber identity correlation service
CN108833123A (en) Based on according to quantity cloud host charging method and device
CN111628906A (en) Method for carrying out flow statistics and monitoring on IP of bullet-supplying public network
CN111625541A (en) Method for measuring IP (Internet protocol) of elastic public network according to flow
CN102612058B (en) Method and device for determining performance index statistical result
CN105718539B (en) A kind of database application method and device
WO2021258719A1 (en) Billing method and system for container platform
CN109151808A (en) A kind of data analysing method and system
KR100509942B1 (en) A Multiple CDR, Accounting System For Providing Flexibility of Accounting Data Of Data Network And Method of Generating Multiple CDR

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