CN110288333A - A kind of processing method of business datum, client, server and system - Google Patents
A kind of processing method of business datum, client, server and system Download PDFInfo
- Publication number
- CN110288333A CN110288333A CN201910574775.2A CN201910574775A CN110288333A CN 110288333 A CN110288333 A CN 110288333A CN 201910574775 A CN201910574775 A CN 201910574775A CN 110288333 A CN110288333 A CN 110288333A
- Authority
- CN
- China
- Prior art keywords
- time
- server
- client
- time series
- business datum
- 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.)
- Pending
Links
- 238000003672 processing method Methods 0.000 title claims abstract description 26
- 238000000034 method Methods 0.000 claims abstract description 27
- 238000012545 processing Methods 0.000 claims description 30
- 230000005540 biological transmission Effects 0.000 claims description 5
- 238000012217 deletion Methods 0.000 claims description 5
- 230000037430 deletion Effects 0.000 claims description 5
- 238000010586 diagram Methods 0.000 description 12
- 230000002159 abnormal effect Effects 0.000 description 5
- 238000005516 engineering process Methods 0.000 description 3
- 230000006870 function Effects 0.000 description 3
- 230000001360 synchronised effect Effects 0.000 description 2
- 238000004590 computer program Methods 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 235000013399 edible fruits Nutrition 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000000750 progressive effect Effects 0.000 description 1
- 238000012546 transfer Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q20/00—Payment architectures, schemes or protocols
- G06Q20/08—Payment architectures
- G06Q20/14—Payment architectures specially adapted for billing systems
- G06Q20/145—Payments according to the detected use or quantity
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q50/00—Information and communication technology [ICT] specially adapted for implementation of business processes of specific business sectors, e.g. utilities or tourism
- G06Q50/10—Services
Landscapes
- Business, Economics & Management (AREA)
- Accounting & Taxation (AREA)
- General Physics & Mathematics (AREA)
- Tourism & Hospitality (AREA)
- Finance (AREA)
- Strategic Management (AREA)
- Physics & Mathematics (AREA)
- General Business, Economics & Management (AREA)
- Economics (AREA)
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Development Economics (AREA)
- Health & Medical Sciences (AREA)
- General Health & Medical Sciences (AREA)
- Human Resources & Organizations (AREA)
- Marketing (AREA)
- Primary Health Care (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
- Information Transfer Between Computers (AREA)
Abstract
The present invention provides processing method, client, server and the system of a kind of business datum, this method are as follows: when user begins to use the chargeable service of client, user end to server obtains current time stamp, services odd numbers and report interval number of seconds;Client is every reporting interval number of seconds to upload a section business data to server, until user terminates chargeable service, business datum includes at least service odd numbers, time series, business datum number and end of identification;Server determines that user uses the total duration of paid service to all time series deduplications, and based on the time series after deduplication, determines that user uses the total duration of chargeable service.In this programme, client first obtains current time stamp from server before timing starts, after server is to all time series deduplications received, determine that user uses the total duration of paid service based on the time series after deduplication, guarantee the time synchronization of client and server, and improves the billing accuracy of server.
Description
Technical field
The present invention relates to business data processing technical fields, and in particular to a kind of processing method of business datum, client,
Server and system.
Background technique
With the development of internet technology, miscellaneous Internet application is developed, to meet various people's
Demand.
Some Internet applications provide a user chargeable service, when user use chargeable service when, Internet application every
A period of time generates one and includes the time series of time started and deadline, and the time series is uploaded to server.
Server determines that user uses the total duration of paid service according to all time serieses, so that it is determined that the expense that user need to pay
With.But on the one hand, since the time of Internet application is uncontrollable, in fact it could happen that the case where time irreversibility with server,
Server is likely to occur error in duration of the statistics using paid service.On the other hand, when the abnormal feelings such as occurs postponing in network
When condition, the case where Internet application is likely to occur repetition to server sending time sequence, cause charging inaccurate.
Therefore, current Internet application is easy to appear error and charging occurs when to server uplink time sequence
The problems such as inaccurate.
Summary of the invention
In view of this, the embodiment of the present invention provides processing method, client, server and the system of a kind of business datum,
To solve current Internet application when to server uplink time sequence, it is easy to appear error and charging inaccuracy etc. occurs
Problem.
To achieve the above object, the embodiment of the present invention provides the following technical solutions:
First aspect of the embodiment of the present invention discloses a kind of processing method of business datum, is suitable for server, the method
Include:
When user begins to use the chargeable service of client, server is by current time stamp, service odd numbers and between reporting
It is sent to the client every number of seconds, the client is made to start timing;
The server receives the business datum that the client uploads, and uploads to the client feedback as a result, institute
State business datum to include at least: the service odd numbers, time series, business datum number and are used to indicate whether chargeable service ties
The end of identification of beam, the time series are made of time started and deadline, and the upload result is used to indicate the clothes
Business device has received the business datum;
After the user terminates using the chargeable service, the server is to all time series duplicate removals received
It is multiple, and determine that the user uses the total duration of the chargeable service based on the time series after deduplication.
Preferably, the server is to all time series deduplications received, and based on the time sequence after deduplication
Column determine that the user uses the total duration of the chargeable service, comprising:
Sequence of the server according to the time started from front to back, is ranked up all time serieses, obtains
First sorted lists;
The server successively determine the first time sequence of serial number n in first sorted lists number whether etc.
In 1;
If the number of the first time sequence of serial number n is equal to 1, at the beginning of the first time sequence for determining serial number n
Between whether be less than previous time series deadline, if more than the first time sequence of serial number n is added to the second sequence
It in list, if being less than, deletes the time Chong Die with previous time series in the first time sequence of serial number n, and weight will be deleted
The first time sequence of serial number n after the folded time is added in second sorted lists;
If the number of the first time sequence of serial number n is greater than 1, select in the first time sequence of serial number n between the time
Whether it is less than the previous time every longest second time series, and at the beginning of determining the second time series of serial number n
The deadline of sequence, if more than, the second time series of serial number n is added in second sorted lists, if being less than,
It deletes the second time series time Chong Die with previous time series of serial number n, and by the serial number n after deletion overlapping time
The second time series be added in second sorted lists;
The server calculates the sum of the time interval of all time serieses in second sorted lists, determines the use
Family uses the total duration of the chargeable service.
Second aspect of the embodiment of the present invention discloses a kind of processing method of business datum, is suitable for client, the method
Include:
When user begins to use the chargeable service of client, the client obtains current time stamp, clothes from server
Business and reports interval number of seconds at odd numbers, and the client starts timing;
Interval number of seconds is reported every described, the client uploads a section business data to the server, until described
User terminates to make the server to all time series deduplications received using the chargeable service, and is based on duplicate removal
Time series after multiple determines that the user uses the total duration of the chargeable service, and the business datum includes at least: described
The end of identification whether chargeable service terminates, the time sequence are numbered and are used to indicate to service odd numbers, time series, business datum
Column are made of time started and deadline.
Preferably, after the client uploads a section business data to the server, further includes:
If the client does not receive the upload of the server feedback within a preset time as a result, the client repeats
Upload the business datum preset times, wherein the upload result is used to indicate the server and has received the business
Data;
If the client uploads the business datum not successfully in the preset times, the business datum is added
To retrying in queue, and retry upload described in retry business datum in queue.
The third aspect of the embodiment of the present invention discloses a kind of server, and the server includes:
Transmission unit, when for beginning to use the chargeable service of client as user, by current time stamp, service odd numbers and
It reports interval number of seconds to be sent to the client, the client is made to start timing;
Processing unit, the business datum uploaded for receiving the client, and upload to the client feedback as a result,
The business datum includes at least: the service odd numbers, time series, business datum number and whether are used to indicate chargeable service
The end of identification of end, the time series are made of time started and deadline, and the upload result is used to indicate described
Server has received the business datum;
Statistic unit, for after the user terminates using the chargeable service, to all time serieses received
Deduplication, and determine that the user uses the total duration of the chargeable service based on the time series after deduplication.
Preferably, the statistic unit includes:
Sorting module is ranked up all time serieses, obtains for the sequence according to the time started from front to back
To the first sorted lists;
Determining module, for successively determining that the number of the first time sequence of serial number n in first sorted lists is
It is no to be equal to 1, if so, first processing module is executed, if it is not, executing Second processing module;
Whether the first processing module is less than at the beginning of the first time sequence for determining serial number n previous
The deadline of time series, if more than, the first time sequence of serial number n is added in the second sorted lists, if being less than,
It deletes time Chong Die with previous time series in the first time sequence of serial number n, and by the serial number after deletion overlapping time
It is added in second sorted lists for the first time sequence of n;
The Second processing module, in the first time sequence for selecting serial number n time interval it is longest second when
Between sequence, and determine serial number n the second time series at the beginning of whether be less than previous time series deadline,
If more than the second time series of serial number n is added in second sorted lists, if being less than, deletes the of serial number n
The two time serieses time Chong Die with previous time series, and by delete overlapping time after serial number n the second time series
It is added in second sorted lists;
Computing module determines institute for calculating the sum of the time interval of all time serieses in second sorted lists
State the total duration that user uses the chargeable service.
Fourth aspect of the embodiment of the present invention discloses a kind of client, and the client includes:
Acquiring unit, when for beginning to use the chargeable service of client as user, from server obtain current time stamp,
It services odd numbers and reports interval number of seconds, client starts timing;
Uploading unit, for reporting interval number of seconds every described, Xiang Suoshu server uploads a section business data, until institute
Stating user terminates to make the server to all time series deduplications received using the chargeable service, and is based on going
Time series after repeating determines that the user uses the total duration of the chargeable service, and the business datum includes at least: institute
It states service odd numbers, time series, business datum number and is used to indicate the end of identification whether chargeable service terminates, the time
Sequence is made of time started and deadline.
The 5th aspect of the embodiment of the present invention discloses a kind of processing system of business datum, including third party of the embodiment of the present invention
Client disclosed in server disclosed in face and fourth aspect of the embodiment of the present invention.
The open a kind of electronic equipment of the 6th aspect of the embodiment of the present invention, the electronic equipment is for running program, wherein institute
A kind of processing method of business datum as disclosed in first aspect of the embodiment of the present invention is executed when stating program operation, alternatively, executing
A kind of processing method of business datum as disclosed in second aspect of the embodiment of the present invention.
The 7th aspect of the embodiment of the present invention discloses a kind of storage medium, and the storage medium includes the program of storage, wherein
It is controlled in described program operation a kind of disclosed in equipment where the storage medium is executed such as first aspect of the embodiment of the present invention
The processing method of business datum, alternatively, executing a kind of processing side of business datum as disclosed in second aspect of the embodiment of the present invention
Method.
Processing method, client, server and system based on a kind of business datum that the embodiments of the present invention provide,
This method are as follows: when user begins to use the chargeable service of client, user end to server obtains current time stamp, service list
Number and report interval number of seconds;Client is every reporting interval number of seconds to upload a section business data to server, until user terminates
Chargeable service, business datum include at least service odd numbers, time series, business datum number and end of identification;Server is to institute
Having time sequence deduplication, and determine that user uses the total duration of paid service based on the time series after deduplication, it determines and uses
Family uses the total duration of chargeable service.In the present solution, client first obtains current time stamp from server before timing starts,
Client every report time interval number of seconds to server upload a section business data until user terminate using chargeable service.Clothes
After device be engaged in all time series deduplications received, determine that user uses paid service based on the time series after deduplication
Total duration, guarantee client and server time synchronization, and improve server billing accuracy.
Detailed description of the invention
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below
There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this
The embodiment of invention for those of ordinary skill in the art without creative efforts, can also basis
The attached drawing of offer obtains other attached drawings.
Fig. 1 is a kind of processing method flow chart of business datum provided in an embodiment of the present invention;
Fig. 2 is flow chart of the server provided in an embodiment of the present invention to all time series deduplications;
Fig. 3 a is the schematic diagram of the first sorted lists provided in an embodiment of the present invention;
Fig. 3 b is the flow diagram provided in an embodiment of the present invention for obtaining the second sorted lists;
Fig. 4 is a kind of structural block diagram of server provided in an embodiment of the present invention;
Fig. 5 is the structural block diagram of another server provided in an embodiment of the present invention;
Fig. 6 is a kind of structural block diagram of client provided in an embodiment of the present invention;
Fig. 7 is the structural block diagram of another client provided in an embodiment of the present invention.
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete
Site preparation description, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.It is based on
Embodiment in the present invention, it is obtained by those of ordinary skill in the art without making creative efforts every other
Embodiment shall fall within the protection scope of the present invention.
In this application, the terms "include", "comprise" or any other variant thereof is intended to cover non-exclusive inclusion,
So that the process, method, article or equipment for including a series of elements not only includes those elements, but also including not having
The other element being expressly recited, or further include for elements inherent to such a process, method, article, or device.Do not having
There is the element limited in the case where more limiting by sentence "including a ...", it is not excluded that in the mistake including the element
There is also other identical elements in journey, method, article or equipment.
It can be seen from background technology that for user when using chargeable service, Internet application is at regular intervals by time series
It is uploaded to server, server determines that user uses the total duration of paid service according to all time serieses, so that it is determined that with
The expense that family need to be paid.But on the one hand, since the time of Internet application is uncontrollable, in fact it could happen that not with time of server
Synchronous situation, server are likely to occur error in duration of the statistics using paid service.On the other hand, when network prolongs
Late etc. when abnormal conditions, the case where Internet application is likely to occur repetition to server sending time sequence, cause charging inaccurate
Really.
Therefore, the embodiment of the present invention provides processing method, client, server and the system of a kind of business datum, client
End before timing starts first from server obtain current time stamp, client every report time interval number of seconds on server
A section business data are passed until user terminates using chargeable service.After server is to all time series deduplications received,
Determine that user uses the total duration of paid service based on the time series after deduplication, to guarantee the time of client and server
It is synchronous, while improving the billing accuracy of server.
Chargeable service involved in the embodiment of the present invention is metered service, i.e., according to the duration for using chargeable service,
Determine the service fee that need to finally collect.
With reference to Fig. 1, a kind of processing method flow chart of business datum provided in an embodiment of the present invention, the processing are shown
Method the following steps are included:
Step S101: when user begins to use the chargeable service of client, the user end to server obtains current
Timestamp services odd numbers and reports interval number of seconds, and the client starts timing.
During implementing step S101, when the user begins to use the chargeable service, the client
It holds to send to the server and obtains current time stamp, service odd numbers and the request for reporting interval number of seconds.When the client terminates
After receiving the current time stamp of the server transmission, servicing odd numbers and report interval number of seconds, the client starts timing.
Step S102: interval number of seconds is reported every described, the client uploads a section business data to the server.
It should be noted that the business datum includes at least: the service odd numbers, time series, business datum number
With the end of identification for being used to indicate chargeable service and whether terminating, the time series is made of time started and deadline.
During implementing step S102, the client reports interval number of seconds every described, to the service
Device uploads a section business data.
Such as: the client uploaded a section business data to the server every 2 seconds, and the format of business datum is
[OrdeID, ShiftN, ShiftN+InterSeconds, Params, ReportID, OverFlag], wherein N be more than or equal to
1 integer indicates that n-th uploads business datum, and ShiftN is the time offset since the current time stamp, OrdeID
For the service odd numbers, InterSeconds reports interval number of seconds to be described, and Params is other data, and ReportID is to upload
The corresponding unique identification of business datum, the client be based on described OrdeID, ShiftN and ShiftN+InterSeconds
ReportID is generated, OverFlag is the end of identification.
It should be noted that when N is more than or equal to 2, ShiftN=Shift (N-1)+InterSeconds+1.
Further, it should be noted that the time series of each business datum are as follows:
[ShiftN, ShiftN+InterSeconds].
For the value for more preferably illustrating the above-mentioned ShiftN being related to, it is illustrated by the following contents:
Assuming that the 1st upload business datum of the client, reporting interval number of seconds is 2.As shown in the above, 1 N,
Shift1 is 0.When the 2nd upload business datum of the client, Shift2=0+2+1=3.
It should be noted that after the every one section business data of upload to the server of the client, the server
Upload can be fed back as a result, the upload result is used to indicate the server and has received the business datum.
Preferably, after executing step S102, if not receive the server within a preset time anti-for the client
The upload of feedback is as a result, the client repeats to upload the business datum preset times.If the client is at described default time
The business datum is uploaded not successfully in number, the business datum is added to and is retried in queue, and is retried and retried described in upload
Business datum in queue.Such as the business datum retried in queue described in upload was retried every 1 second.
Further, it is retried in queue described, multiple continuous time serieses, that is, have previous time series if it exists
Deadline and latter time sequence at the beginning of it is consistent.Multiple continuous time serieses are merged into one by the client
It retries after a time series and is uploaded to the server.Such as: it is described to retry in queue that there are M continuous time serieses, institutes
Client is stated by after M continuous time serieses merging, Xiang Suoshu server uploads the business datum after merging, specific format
Are as follows:
[OrdeID, ShiftN, ShiftN+InterSeconds*M, Params, ReportID, OverFlag].
Step S103: the server receives the business datum that the client uploads, and in the client feedback
Pass result.
In the process of specific implementation step S103, the server successively receives the business datum that the client uploads,
It is uploaded to the client feedback after being properly received the business datum as a result, to notify the client to be properly received described
Business datum.
It should be noted that the server receives the business datum that the client uploads, include but are not limited to
Lower situation:
Situation one, network are normal, the server after receiving business datum to the client feedback upload as a result,
The client receives the upload result.
Situation two, the client are when uploading business datum, and due to Network Abnormal, the server does not receive described
The business datum that client uploads.
Situation three, network are normal, and the server normally receives the business datum that the client uploads, but described
Server is abnormal when handling the business datum, does not upload result to the client feedback.
Situation four, the server normally receive the business datum that the client uploads, anti-to the client
During uploading result network abnormal situation occurs for feedback, and the client is caused to be unsuccessfully received upload result.
In above-mentioned four kinds of situations, client described in situation two, situation three and situation four can all retry upload business datum,
The process of upload is specifically retried referring to above content, details are not described herein.
Further, it should be noted that when the client successfully uploads business datum every time, the server is every
Secondary receive all succeeds after business datum when uploading result to the client feedback, the time series that the server receives
Such as the following contents:
[Shift1, Shift1+InterSeconds], [Shift2, Shift2+InterSeconds] ... ..
[ShiftN-1, Shift (N-1)+InterSeconds], [ShiftN, ShiftN+InterSeconds].
Step S104: after the user terminates using the chargeable service, the server to receive institute sometimes
Between sequence deduplication, and based on the time series after deduplication determine the user use the chargeable service total duration.
It should be noted that the content in situation three and situation four as shown in above-mentioned steps S103 is it is found that when described
After server receives the business datum that the client uploads, upload not successfully to the client feedback as a result, the visitor
Family end can repeat to upload the business datum.Therefore, the case where time series that the server receives is likely to occur repetition needs
To all time series deduplications received.
During implementing step S104, at the beginning of the server is according to each time series and end
Time, to all time series deduplications.The sum of the time interval of time series after counting deduplication, determines the user
Use the total duration of the chargeable service.
In embodiments of the present invention, when user begins to use the chargeable service of client, client is before timing starts
First from server obtain current time stamp, client every report time interval number of seconds to server upload a section business data it is straight
Terminate to user using chargeable service.After server is to all time series deduplications received, based on after deduplication when
Between sequence determine user use paid service total duration, guarantee client and server time synchronization, and improve service
The billing accuracy of device.
Mistake of the server involved in embodiments of the present invention Fig. 1 step S104 to all time series deduplications
Journey shows server provided in an embodiment of the present invention to the flow chart of all time series deduplications with reference to Fig. 2, including with
Lower step:
Step S201: sequence of the server according to the time started from front to back carries out all time serieses
Sequence, obtains the first sorted lists.
During implementing step S201, at the beginning of the server is based on all time serieses received
Between, it is ranked up according to sequence from front to back, obtains the first sorted lists.
It should be noted that the content as shown in above-mentioned Fig. 1 is it is found that the client may repeat uplink time sequence
Column, it is possible to which there are the time serieses that multiple time starteds are the same.The server sets time started the same time series
Same serial number is set, such as: one at the beginning of the sequence serial number 1 of time series A, time series B and the time series A
The sequence serial number of the time series B is then also configured as 1 by sample.
More preferably to illustrate first sorted lists, lifted by the first sorted lists schematic diagram shown in Fig. 3 a
Example explanation.
In Fig. 3 a, number 0 to 6 indicates the sequence serial number of time series, and 301 to 310 indicate time series.Its
In, time series 301, time series 302, time series 303, time series 304 and time series 307 indicate the client
The time series once uploaded.Time series 305, time series 308 and time series 309 indicate: the client is retrying
Merge the time series uploaded after multiple time serieses in list.Time series 306 and time series 310 are respectively by the client
End twice in succession and three times uplink time Sequence composition.
Step S202: the server successively determines the first time sequence of serial number n in first sorted lists
Whether number is equal to 1, if so, step S203 is executed, if it is not, executing step S204.
During implementing step S202, the content as shown in Fig. 3 a it is found that serial number 3 time sequence
There are laps for column 304, time series 305 and time series 306, that is, there is the case where reclocking.It therefore, is guarantee meter
When it is accurate, whether the number for the first time sequence for needing successively to determine serial number n in the first sorted lists is equal to 1, if serial number
Number for the first time sequence of n is greater than 1, and longest second time series of time interval is selected to be added to the second sorted lists
In.Such as: in Fig. 3 a, the time series 305 of serial number 3 is added in the second sorted lists.
It should be noted that the time interval are as follows: between the time between deadline at the beginning of time series
Every.N is the integer more than or equal to 0.
Step S203: when whether the server is less than previous at the beginning of determining the first time sequence of serial number n
Between sequence deadline, if more than the first time sequence of serial number n is added in the second sorted lists, if being less than, is deleted
Except the time Chong Die with previous time series in the first time sequence of serial number n, and by delete overlapping time after serial number n
First time sequence be added in second sorted lists.
During implementing step S203, the content as shown in Fig. 3 a it is found that time series 308 and when
Between sequence 310 sequence serial number it is although inconsistent, but at the beginning of time series 310 be less than time series 308 cut-off
The case where time, there are timing overlappings.Therefore, it need to delete Chong Die with previous time series in the first time sequence of serial number n
Time, and be added to the first time sequence of serial number n after overlapping time is deleted in second sorted lists.Example
Such as: when the time series 310 in Fig. 3 a is added in the second sorted lists, need to by time series 310 with time sequence
Lap in column 308 is deleted.
Step S204: time interval longest second time in the first time sequence of the server selection serial number n
Sequence, and whether it is less than the deadline of previous time series at the beginning of determining the second time series of serial number n, if
It is greater than, the second time series of serial number n is added in second sorted lists, if being less than, deletes the second of serial number n
The time series time Chong Die with previous time series, and the second time series of the serial number n after deletion overlapping time is added
It adds in second sorted lists.
During implementing step S204, the second time series of serial number n is added to second sequence
Process in list, referring to content shown in above-mentioned steps S203, details are not described herein.
More preferably to illustrate the second sorted lists involved in above-mentioned steps S203 and step S204, in conjunction with Fig. 3 a, lead to
It crosses and obtains the flow diagrams of the second sorted lists shown in Fig. 3 b and be illustrated:
In Fig. 3 b, the time series 301 of serial number 0 is added in the second sorted lists, by serial number 1 when
Between sequence 302 be added in the second sorted lists, the time series 303 of serial number 2 is added in the second sorted lists, by sequence
It number is added in the second sorted lists for 3 time series 305, the time series 307 of serial number 4 is added to the second Sorted list
In table, the time series 308 of serial number 5 is added in the second sorted lists, the time series 310 of serial number 6 is added to
In second sorted lists, wherein will be deleted in the time series 310 with the lap of time series 308.
The second sorted lists finally obtained respectively by time series 301, time series 302, time series 303, when
Between sequence 305, time series 307, time series 308 and delete and the time series 310 after the lap of time series 308
It constitutes.
Step S205: the server calculates the sum of the time interval of all time serieses in second sorted lists,
Determine that the user uses the total duration of the chargeable service.
During implementing step S205, the server calculates institute's having time sequence in second sorted lists
The time interval of column and value, it is described and value be the user use the chargeable service total duration.Such as: in the figure
In 3b, the sum of the time interval for constituting all time serieses of second sorted lists is calculated, the user is obtained and uses institute
State the total duration of chargeable service.
In embodiments of the present invention, user terminates using after chargeable service, and institute's server is to the institute's having time sequence received
Column carry out deduplication, determine that user uses the total duration of chargeable service based on the time series after deduplication.It avoids reclocking
It causes to repeat to charge, improves the billing accuracy of server.
Corresponding with the processing method of a kind of business datum that the embodiments of the present invention provide, with reference to Fig. 4, the present invention is real
It applies example and a kind of structural block diagram of server is also provided, the server includes: that transmission unit 401, processing unit 402 and statistics are single
Member 403;
Transmission unit 401, it is when for beginning to use the chargeable service of client as user, current time stamp, service is single
Number and report interval number of seconds be sent to the client, so that the client is started timing.
Processing unit 402, the business datum uploaded for receiving the client, and upload and tie to the client feedback
Fruit, the business datum include at least: chargeable service is numbered and are used to indicate to the service odd numbers, time series, business datum
The end of identification whether terminated, the time series are made of time started and deadline, and the upload result is used to indicate
The server has received the business datum.Feedback uploads the process of result referring to embodiments of the present invention Fig. 1 step
The corresponding content of S103.
Statistic unit 403, for after the user terminates using the chargeable service, to the institute's having time sequence received
Column deduplication, and determine that the user uses the total duration of the chargeable service based on the time series after deduplication.
In embodiments of the present invention, server receives the business datum that client is sent, and uploads result to client feedback.
When user terminates using chargeable service, server is to all time series deduplications received, based on the time after deduplication
Sequence determines that user uses the total duration of paid service, guarantees the time synchronization of client and server, and improve server
Billing accuracy.
Preferably, a kind of structural block diagram of server provided in an embodiment of the present invention is shown with reference to Fig. 5 in conjunction with Fig. 4,
The statistic unit 403 includes: sorting module 4031, determining module 4032, first processing module 4033, Second processing module
4034 and computing module 4035;
Sorting module 4031 arranges all time serieses for the sequence according to the time started from front to back
Sequence obtains the first sorted lists.The process for obtaining the first sorted lists is opposite referring to embodiments of the present invention Fig. 2 step S201
The content answered.
Determining module 4032, for successively determining of the first time sequence of serial number n in first sorted lists
Whether number is equal to 1, if so, first processing module 4033 is executed, if it is not, executing Second processing module 4034.Determine serial number n's
Whether the number of first time sequence is equal to 1 process, corresponding interior referring to embodiments of the present invention Fig. 2 step S202
Hold.
Whether the first processing module 4033 is less than at the beginning of the first time sequence for determining serial number n
The deadline of previous time series, if more than, the first time sequence of serial number n is added in the second sorted lists, if
It is less than, deletes the time Chong Die with previous time series in the first time sequence of serial number n, and will be after deletion overlapping time
The first time sequence of serial number n is added in second sorted lists.The process of the second sorted lists is obtained referring to above-mentioned
The corresponding content of Fig. 2 step of embodiment of the present invention S203.
The Second processing module 4034, time interval longest in the first time sequence for selecting serial number n
Two time serieses, and whether it is less than the cut-off of previous time series at the beginning of determining the second time series of serial number n
Time, if more than the second time series of serial number n is added in second sorted lists, if being less than, deletes serial number
The second time series of n time Chong Die with previous time series, and by delete overlapping time after serial number n the second time
Sequence is added in second sorted lists.
Computing module 4035, for calculating the sum of the time interval of all time serieses in second sorted lists, really
The fixed user uses the total duration of the chargeable service.
In embodiments of the present invention, user terminates using after chargeable service, and server is to all time serieses received
Deduplication is carried out, determines that user uses the total duration of chargeable service based on the time series after deduplication.It avoids reclocking and make
At repeating to charge, the billing accuracy of server is improved.
Corresponding with the processing method of a kind of business datum that the embodiments of the present invention provide, with reference to Fig. 6, the present invention is real
It applies example and additionally provides a kind of structural block diagram of client, the client includes:
Acquiring unit 601 when for beginning to use the chargeable service of client as user, obtains current time from server
It stabs, service odd numbers and report interval number of seconds, client starts timing.
Uploading unit 602, for reporting interval number of seconds every described, Xiang Suoshu server uploads a section business data, directly
Terminate to make using the chargeable service server to all time series deduplications received to the user, and base
Time series after deduplication determines that the user uses the total duration of the chargeable service, and the business datum is at least wrapped
Include: the service odd numbers, time series, business datum number and are used to indicate the end of identification whether chargeable service terminates, institute
Time series is stated to be made of time started and deadline.
In embodiments of the present invention, client first obtains current time stamp, client from server before timing starts
Every report time interval number of seconds to server upload a section business data until user terminate to make server using chargeable service
Determine that user uses the total of paid service to all time series deduplications received, and based on the time series after deduplication
Duration guarantees the time synchronization of client and server, and improves the billing accuracy of server.
Preferably, a kind of structural block diagram of client provided in an embodiment of the present invention is shown with reference to Fig. 7 in conjunction with Fig. 6,
The client further include:
First retries unit 603, if the upload for not receiving the server feedback within a preset time is as a result, repeat
Upload the business datum preset times, wherein the upload result is used to indicate the server and has received the business
Data.
Second retries unit 604, for uploading the business datum not successfully in the preset times, by the business
Data, which are added to, to be retried in queue, and retries the business datum retried in queue described in upload.
In embodiments of the present invention, if client does not receive the upload of server feedback as a result, will not within a preset time
The business datum that success uploads, which is added to, to be retried in queue, and upload business datum is retried.Guarantee that business datum can be successfully uploaded to
In server, the billing accuracy of server is ensured.
Preferably, corresponding with the processing method of a kind of business datum that the embodiments of the present invention provide, the present invention is real
It applies example and a kind of processing system of business datum is also provided, the system comprises server and client sides.The execution of the server
Principle is referring to corresponding content in the embodiments of the present invention Fig. 4 and Fig. 5, and the implementation principle of the client is referring to above-mentioned
Corresponding content in inventive embodiments Fig. 6 and Fig. 7.
Based on a kind of processing system of business datum disclosed in the embodiments of the present invention, above-mentioned modules can pass through
A kind of electronic equipment realization being made of processor and memory.Specifically: above-mentioned modules are stored in as program unit
In memory, above procedure unit stored in memory is executed by processor to realize the processing of business datum.
Wherein, include kernel in processor, gone in memory to transfer corresponding program unit by kernel.Kernel can be set
One or more realizes the processing of business datum by adjusting kernel parameter.
Memory may include the non-volatile memory in computer-readable medium, random access memory (RAM) and/
Or the forms such as Nonvolatile memory, such as read-only memory (ROM) or flash memory (flashRAM), memory includes at least one storage
Chip.
Further, the embodiment of the invention provides a kind of processors, and the processor is for running program, wherein institute
State the processing method that business datum is executed when program operation.
Further, the embodiment of the invention provides a kind of electronic equipment, the electronic equipment includes processor, memory
And the program that can be run on a memory and on a processor is stored, processor is realized in any embodiment as above when executing program
The processing method of the business datum shown.
Equipment disclosed in the embodiment of the present invention can be PC, PAD, mobile phone etc..
Further, the embodiment of the invention also provides a kind of storage medium, it is stored thereon with program, the program is processed
The processing of business datum is realized when device executes.
Present invention also provides a kind of computer program products, when executing on data processing equipment, are adapted for carrying out just
Processing method of the beginningization just like business datum shown in upper any embodiment.
In conclusion the embodiment of the present invention provides processing method, client, server and the system of a kind of business datum,
This method are as follows: when user begins to use the chargeable service of client, user end to server obtains current time stamp, service list
Number and report interval number of seconds;Client is every reporting interval number of seconds to upload a section business data to server, until user terminates
Chargeable service, business datum include at least service odd numbers, time series, business datum number and end of identification;Server is to institute
Having time sequence deduplication, and determine that user uses the total duration of paid service based on the time series after deduplication, it determines and uses
Family uses the total duration of chargeable service.In the present solution, client first obtains current time stamp from server before timing starts,
Client every report time interval number of seconds to server upload a section business data until user terminate using chargeable service.Clothes
After device be engaged in all time series deduplications received, determine that user uses paid service based on the time series after deduplication
Total duration, guarantee client and server time synchronization, and improve server billing accuracy.
All the embodiments in this specification are described in a progressive manner, same and similar portion between each embodiment
Dividing may refer to each other, and each embodiment focuses on the differences from other embodiments.Especially for system or
For system embodiment, since it is substantially similar to the method embodiment, so describing fairly simple, related place is referring to method
The part of embodiment illustrates.System and system embodiment described above is only schematical, wherein the conduct
The unit of separate part description may or may not be physically separated, component shown as a unit can be or
Person may not be physical unit, it can and it is in one place, or may be distributed over multiple network units.It can root
According to actual need that some or all of the modules therein is selected to achieve the purpose of the solution of this embodiment.Ordinary skill
Personnel can understand and implement without creative efforts.
Professional further appreciates that, unit described in conjunction with the examples disclosed in the embodiments of the present disclosure
And algorithm steps, can be realized with electronic hardware, computer software, or a combination of the two, in order to clearly demonstrate hardware and
The interchangeability of software generally describes each exemplary composition and step according to function in the above description.These
Function is implemented in hardware or software actually, the specific application and design constraint depending on technical solution.Profession
Technical staff can use different methods to achieve the described function each specific application, but this realization is not answered
Think beyond the scope of this invention.
The foregoing description of the disclosed embodiments enables those skilled in the art to implement or use the present invention.
Various modifications to these embodiments will be readily apparent to those skilled in the art, as defined herein
General Principle can be realized in other embodiments without departing from the spirit or scope of the present invention.Therefore, of the invention
It is not intended to be limited to the embodiments shown herein, and is to fit to and the principles and novel features disclosed herein phase one
The widest scope of cause.
Claims (10)
1. a kind of processing method of business datum, which is characterized in that be suitable for server, which comprises
When user begins to use the chargeable service of client, server is by current time stamp, service odd numbers and reports the interval second
Number is sent to the client, and the client is made to start timing;
The server receives the business datum that the client uploads, and uploads to the client feedback as a result, the industry
Business data include at least: the service odd numbers, time series, business datum number and are used to indicate what whether chargeable service terminated
End of identification, the time series are made of time started and deadline, and the upload result is used to indicate the server
Have received the business datum;
After the user terminates using the chargeable service, the server to all time series deduplications received,
And determine that the user uses the total duration of the chargeable service based on the time series after deduplication.
2. the method according to claim 1, wherein the server is to all time series duplicate removals received
It is multiple, and determine that the user uses the total duration of the chargeable service based on the time series after deduplication, comprising:
Sequence of the server according to the time started from front to back, is ranked up all time serieses, obtains first
Sorted lists;
The server successively determines whether the number of the first time sequence of serial number n in first sorted lists is equal to 1;
If the number of the first time sequence of serial number n is equal to 1, it is at the beginning of the first time sequence for determining serial number n
The no deadline less than previous time series, if more than the first time sequence of serial number n is added to the second sorted lists
In, when if being less than, deleting the time Chong Die with previous time series in the first time sequence of serial number n, and overlapping will be deleted
Between after the first time sequence of serial number n be added in second sorted lists;
If the number of the first time sequence of serial number n be greater than 1, select serial number n first time sequence in time interval most
The second long time series, and whether it is less than previous time series at the beginning of determining the second time series of serial number n
Deadline, if more than, the second time series of serial number n is added in second sorted lists, if being less than, delete
The second time series of serial number n time Chong Die with previous time series, and the of the serial number n after overlapping time will be deleted
Two time serieses are added in second sorted lists;
The server calculates the sum of the time interval of all time serieses in second sorted lists, determines that the user makes
With the total duration of the chargeable service.
3. a kind of processing method of business datum, which is characterized in that be suitable for client, which comprises
When user begins to use the chargeable service of client, the client obtains current time stamp, service list from server
Number and report interval number of seconds, the client starts timing;
Interval number of seconds is reported every described, the client uploads a section business data to the server, until the user
Terminate to use the chargeable service, make the server to all time series deduplications received, and based on after deduplication
Time series determine that the user uses the total duration of the chargeable service, the business datum includes at least: the service
Odd numbers, time series, business datum number and be used to indicate the end of identification whether chargeable service terminates, the time series by
Time started and deadline are constituted.
4. according to the method described in claim 3, it is characterized in that, the client uploads a section business number to the server
According to later, further includes:
If the client does not receive the upload of the server feedback within a preset time as a result, the client repeats to upload
The business datum preset times, wherein the upload result is used to indicate the server and has received the business datum;
If the client uploads the business datum not successfully in the preset times, the business datum is added to weight
It tries in queue, and retries the business datum retried in queue described in upload.
5. a kind of server, which is characterized in that the server includes:
Transmission unit when for beginning to use the chargeable service of client as user, by current time stamp, service odd numbers and reports
Interval number of seconds is sent to the client, and the client is made to start timing;
Processing unit, the business datum uploaded for receiving the client, and upload to the client feedback as a result, described
Business datum includes at least: the service odd numbers, time series, business datum number and are used to indicate whether chargeable service terminates
End of identification, the time series is made of time started and deadline, and the upload result is used to indicate the service
Device has received the business datum;
Statistic unit, for after the user terminates using the chargeable service, to all time series duplicate removals received
It is multiple, and determine that the user uses the total duration of the chargeable service based on the time series after deduplication.
6. server according to claim 5, which is characterized in that the statistic unit includes:
Sorting module is ranked up all time serieses for the sequence according to the time started from front to back, obtains
One sorted lists;
Determining module, for successively determine the first time sequence of serial number n in first sorted lists number whether etc.
In 1, if so, first processing module is executed, if it is not, executing Second processing module;
Whether the first processing module is less than the previous time at the beginning of the first time sequence for determining serial number n
The deadline of sequence, if more than the first time sequence of serial number n is added in the second sorted lists, if being less than, is deleted
The time Chong Die with previous time series in the first time sequence of serial number n, and by the serial number n's after deletion overlapping time
First time sequence is added in second sorted lists;
The Second processing module, the longest second time sequence of time interval in the first time sequence for selecting serial number n
Column, and whether it is less than the deadline of previous time series at the beginning of determining the second time series of serial number n, if greatly
In, the second time series of serial number n is added in second sorted lists, if being less than, delete serial number n second when
Between sequence time Chong Die with previous time series, and the second time series for deleting the serial number n after overlapping time is added
To in second sorted lists;
Computing module determines the use for calculating the sum of the time interval of all time serieses in second sorted lists
Family uses the total duration of the chargeable service.
7. a kind of client, which is characterized in that the client includes:
Acquiring unit when for beginning to use the chargeable service of client as user, obtains current time stamp, service from server
Odd numbers and interval number of seconds is reported, client starts timing;
Uploading unit, for reporting interval number of seconds every described, Xiang Suoshu server uploads a section business data, until the use
Family terminates to make the server to all time series deduplications received using the chargeable service, and is based on deduplication
Time series afterwards determines that the user uses the total duration of the chargeable service, and the business datum includes at least: the clothes
The end of identification whether chargeable service terminates, the time series are numbered and are used to indicate to business odd numbers, time series, business datum
It is made of time started and deadline.
8. a kind of processing system of business datum, which is characterized in that wanted including server described in claim 5 or 6 and right
Client described in asking 7.
9. a kind of electronic equipment, which is characterized in that the electronic equipment is for running program, wherein described program is held when running
The processing method of a kind of business datum of the row as described in any in claim 1-2, alternatively, executing as appointed in claim 3-4
A kind of processing method of business datum described in one.
10. a kind of storage medium, which is characterized in that the storage medium includes the program of storage, wherein run in described program
When control the storage medium where equipment execute the processing side of business datum as described in any in claim 1-2 a kind of
Method, alternatively, executing a kind of processing method of business datum as described in any in claim 3-4.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910574775.2A CN110288333A (en) | 2019-06-28 | 2019-06-28 | A kind of processing method of business datum, client, server and system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910574775.2A CN110288333A (en) | 2019-06-28 | 2019-06-28 | A kind of processing method of business datum, client, server and system |
Publications (1)
Publication Number | Publication Date |
---|---|
CN110288333A true CN110288333A (en) | 2019-09-27 |
Family
ID=68019543
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910574775.2A Pending CN110288333A (en) | 2019-06-28 | 2019-06-28 | A kind of processing method of business datum, client, server and system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110288333A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110991925A (en) * | 2019-12-13 | 2020-04-10 | 寿光新保农农业科技有限公司 | Performance quantitative statistical method and device comprising auxiliary work seeds |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20130282875A1 (en) * | 2008-05-02 | 2013-10-24 | James Aweya | Method and apparatus for time and frequency transfer in communication networks |
CN107491252A (en) * | 2017-08-21 | 2017-12-19 | 掌阅科技股份有限公司 | Read the statistical method and electronic equipment of duration |
CN108733728A (en) * | 2017-04-25 | 2018-11-02 | 北京京东尚科信息技术有限公司 | Time series data statistical method, device, computer equipment and readable storage medium storing program for executing |
CN109560889A (en) * | 2018-11-09 | 2019-04-02 | 福建福诺移动通信技术有限公司 | A method of realizing App and server-side time synchronization |
-
2019
- 2019-06-28 CN CN201910574775.2A patent/CN110288333A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20130282875A1 (en) * | 2008-05-02 | 2013-10-24 | James Aweya | Method and apparatus for time and frequency transfer in communication networks |
CN108733728A (en) * | 2017-04-25 | 2018-11-02 | 北京京东尚科信息技术有限公司 | Time series data statistical method, device, computer equipment and readable storage medium storing program for executing |
CN107491252A (en) * | 2017-08-21 | 2017-12-19 | 掌阅科技股份有限公司 | Read the statistical method and electronic equipment of duration |
CN109560889A (en) * | 2018-11-09 | 2019-04-02 | 福建福诺移动通信技术有限公司 | A method of realizing App and server-side time synchronization |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110991925A (en) * | 2019-12-13 | 2020-04-10 | 寿光新保农农业科技有限公司 | Performance quantitative statistical method and device comprising auxiliary work seeds |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
EP3451093B1 (en) | Work assistance device, work assistance method, and work assistance program | |
CN107622336A (en) | Method for pushing, the apparatus and system of task | |
JP5724066B2 (en) | Monitoring system, monitoring device, monitoring device program, terminal device, and terminal device program | |
CN110265128A (en) | Method, apparatus, electronic equipment and the readable storage medium storing program for executing of outpatient service plus sige | |
CN110288333A (en) | A kind of processing method of business datum, client, server and system | |
CN107924345A (en) | Data storage area for the polymerization measurement result of measurement | |
CN109034434A (en) | A kind of Intelligent worker assigning method and apparatus | |
CN111510468A (en) | Method and device for scheduling computing tasks, server and computing system | |
CN109949026A (en) | A kind of red packet information generating method, device, terminal and server | |
CN110222253A (en) | A kind of collecting method, equipment and computer readable storage medium | |
CN110110306A (en) | Method for exhibiting data, device, terminal and computer readable storage medium | |
CN109408346A (en) | Method of data capture, device, equipment and storage medium | |
CN109697247A (en) | A kind of detection method and device of data accuracy | |
CN111224791A (en) | Cloud resource charging method and device, electronic equipment and storage medium | |
CN109460842A (en) | A kind of determination method and device of service quality | |
CN113806058A (en) | Task management method and device, storage medium and electronic equipment | |
CN114124747A (en) | Flow pressure measurement system | |
CN109361739A (en) | A kind of method for down loading, device, client, system and storage medium | |
CN110298001B (en) | Method and device for acquiring log data packet and computer readable storage medium | |
CN108664550A (en) | It is a kind of that funnel analysis method and device are carried out to user behavior data | |
CN112422686B (en) | Cloud platform optimization method, device, equipment and readable storage medium | |
EP3297209A1 (en) | Method of implementing updated charging plan and device utilizing same | |
CN110674214B (en) | Big data synchronization method, device, computer equipment and storage medium | |
CN106528724A (en) | Information pushing method and apparatus | |
CN109726243A (en) | A kind of purpose data classifying method, apparatus and system |
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 | ||
TA01 | Transfer of patent application right |
Effective date of registration: 20210113 Address after: 510000 3108, 79 Wanbo 2nd Road, Nancun Town, Panyu District, Guangzhou City, Guangdong Province Applicant after: GUANGZHOU CUBESILI INFORMATION TECHNOLOGY Co.,Ltd. Address before: 28th floor, block B1, Wanda Plaza, Nancun Town, Panyu District, Guangzhou City, Guangdong Province Applicant before: GUANGZHOU HUADUO NETWORK TECHNOLOGY Co.,Ltd. |
|
TA01 | Transfer of patent application right | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20190927 |
|
RJ01 | Rejection of invention patent application after publication |