CN105550209B - A kind of method for processing resource and device - Google Patents

A kind of method for processing resource and device Download PDF

Info

Publication number
CN105550209B
CN105550209B CN201510874150.XA CN201510874150A CN105550209B CN 105550209 B CN105550209 B CN 105550209B CN 201510874150 A CN201510874150 A CN 201510874150A CN 105550209 B CN105550209 B CN 105550209B
Authority
CN
China
Prior art keywords
resource
business
dosage
user
data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201510874150.XA
Other languages
Chinese (zh)
Other versions
CN105550209A (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.)
Sina Technology China Co Ltd
Original Assignee
Sina Technology China 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 Sina Technology China Co Ltd filed Critical Sina Technology China Co Ltd
Priority to CN201510874150.XA priority Critical patent/CN105550209B/en
Publication of CN105550209A publication Critical patent/CN105550209A/en
Application granted granted Critical
Publication of CN105550209B publication Critical patent/CN105550209B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/11File system administration, e.g. details of archiving or snapshots
    • G06F16/116Details of conversion of file system types or formats
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/21Design, administration or maintenance of databases
    • G06F16/215Improving data quality; Data cleansing, e.g. de-duplication, removing invalid entries or correcting typographical errors
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2458Special types of queries, e.g. statistical queries, fuzzy queries or distributed queries
    • G06F16/2462Approximate or statistical queries

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Probability & Statistics with Applications (AREA)
  • Fuzzy Systems (AREA)
  • Computational Linguistics (AREA)
  • Software Systems (AREA)
  • Mathematical Physics (AREA)
  • Quality & Reliability (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention discloses a kind of method for processing resource and devices, the method for processing resource includes: loading configuration file, according to the mark of the corresponding first resource data of each business for including in the configuration file, obtain the corresponding first resource data of each business, according to the corresponding first resource statistical rules of each business for including in the configuration file, the corresponding first resource data of each business got are counted, determine the corresponding first resource dosage of each first resource data.Unlike the prior art yes, the convenience for defining statistical rules is greatly improved by the way of configuration file, and do not have to be recompilated for all existing statistical rules, furthermore, the statistical rules made by oneself for the resource data of all kinds of business can also be easily issued by the way of configuration file, loading configuration file will not influence the normal work of service system, it is ensured that the stable operation of service system.

Description

A kind of method for processing resource and device
Technical field
The present invention relates to field of computer technology more particularly to a kind of method for processing resource and device.
Background technique
With the development of information technology, it is abundant various that service provider (such as: website) can provide type for user Business, thus, user can be easily using the business needed for it.
Currently, when user is using all kinds of business provided by service provider, can generate corresponding resource data (such as: User use business during processor load value, the amount of storage of memory space etc.).Resource data, which is able to reflect user, to be made With the use state of all kinds of business, in practical applications, in order to guarantee that user can be normally used business, therefore service provider It would generally the resource data progress statistical disposition generated when using business to user.
In the prior art, the statistical disposition of resource data when to user using all kinds of business, often by service provider Internal service system is realized.Specifically: in service system, for different business, corresponding resource processing can be all set Rule, so as to resource data generated when counting user is using different business.
But the resource in existing resource processing system handles rule, can only have business for service provider Resource data carry out statistical disposition, once service provider's Added Business, due to Added Business resource data type with There is the resource data type of business different, leads to the resource data of the incompatible Added Business of existing resource processing rule, at this point, It can only be recompilated for whole resources processing rule in resource processing system, and publication is compiled again in service system Resource after translating handles rule, so as to the resource data of the compatible Added Business of resource processing rule.Obviously, such mode operates It is cumbersome, and in compilation process, service system normally can not carry out statistical disposition to resource data.
Summary of the invention
The embodiment of the present invention provides a kind of method for processing resource and device, to solve the volume of existing resource processing rule Translate the excessively cumbersome problem of process.
A kind of method for processing resource provided in an embodiment of the present invention, comprising:
Loading configuration file;
According to the mark of the corresponding first resource data of each business for including in the configuration file, it is corresponding to obtain each business First resource data;
According to the corresponding first resource statistical rules of each business for including in the configuration file, to each business got Corresponding first resource data are counted, and determine the corresponding first resource dosage of each first resource data.
A kind of resource processing unit that the embodiment of the present invention separately provides, comprising:
Loading module is used for loading configuration file;
Module is obtained, for the mark according to the corresponding first resource data of each business for including in the configuration file, Obtain the corresponding first resource data of each business;
Statistical module, it is right for according to the corresponding first resource statistical rules of each business for including in the configuration file The corresponding first resource data of each business got are counted, and determine that the corresponding first resource of each first resource data is used Amount.
The embodiment of the present invention provides a kind of method for processing resource and device, wherein the resource processing side in through the invention Method can make corresponding service system load should after service provider provides Added Business by the way of configuration file Configuration file, and the statistical rules for changing the resource data for Added Business for including in configuration file is obtained, with the prior art It is different that the convenience for defining statistical rules is yes greatly improved by the way of configuration file, and do not have to for all existing Statistical rules recompilated, in addition, can also easily be issued by the way of configuration file for all kinds of business The statistical rules that resource data is made by oneself, loading configuration file will not influence the normal work of service system, it is ensured that service The stable operation of system.
Detailed description of the invention
The drawings described herein are used to provide a further understanding of the present invention, constitutes a part of the invention, this hair Bright illustrative embodiments and their description are used to explain the present invention, and are not constituted improper limitations of the present invention.In the accompanying drawings:
Fig. 1 is that resource provided in an embodiment of the present invention handles process schematic;
Fig. 2 is the service architecture schematic diagram for being responsible for resource processing in service system provided in an embodiment of the present invention;
Fig. 3 is resource processing device structure diagram provided in an embodiment of the present invention.
Specific embodiment
To make the object, technical solutions and advantages of the present invention clearer, below in conjunction with the specific embodiment of the invention and Technical solution of the present invention is clearly and completely described in corresponding attached drawing.Obviously, described embodiment is only the present invention one Section Example, instead of all the embodiments.Based on the embodiments of the present invention, those of ordinary skill in the art are not doing Every other embodiment obtained under the premise of creative work out, shall fall within the protection scope of the present invention.
Just it has been observed that in the prior art, the system of the resource data for existing business is defined in traditional service system Meter rule, when service provider provides Added Business, existing statistical rules but and the resource data of incompatible Added Business, this When need to increase corresponding statistical rules newly in service system, but due to the architected features inside traditional service system, cause To add statistical rules in service system, whole statistical rules in service system can only be recompilated, in this way Mode it is relatively complicated, and influence service system normal operation.For this purpose, the present invention to solve the above-mentioned problems, provides one Kind method for processing resource.As described below.
Fig. 1 be resource treatment process provided in an embodiment of the present invention, the process specifically includes the following steps:
S101: loading configuration file.
The configuration file specifically can be the go for being compiled and generating with go language (a kind of advanced assembler language) File, wherein containing the rule counted for resource data.Here it and does not constitute a limitation of the invention.
Unlike the prior art, service system is not operated in for the statistical rules of resource data in the present invention It is interior, but configured in a manner of above-mentioned configuration file, even if service provider provides Added Business, then, it can also be with Easily by way of configuration file, increase the statistical rules of the resource data for Added Business.That is, working as service system When operation, so that it may above-mentioned configuration file is loaded, to execute corresponding operation according to the statistical rules in configuration file.
S102: according to the mark of the corresponding first resource data of each business for including in the configuration file, each industry is obtained It is engaged in corresponding first resource data.
The first resource data are exactly user when using different business, resource data generated, such as: Memory capacity data generated when user uses cloud storage service, user transmission flow generated when using transmission services Data etc..Certainly, in embodiments of the present invention, first resource data specifically can be such as: " user A, cloud storage service, Use capacity: 1G, maximum capacity: the form of 2G ", this is not constituted a limitation of the invention simultaneously.
Under practical application scene, service provider can provide all kinds of different business, and a large number of users can be used freely Different business, user can generate corresponding first resource data, when using each business in order to distinguish difference The first resource data of business, therefore in embodiments of the present invention, the mark of different business is usually contained in first resource data, the Mark in one resource data reflects the specific affiliated business of the first resource data.
Based on this, the mark of the corresponding first resource data of each business is defined in configuration file, it also can basis Above-mentioned mark, to obtain the corresponding first resource data of different business.
It should be noted that in one embodiment of the invention, corresponding resource data acquisition system can be passed through (system can be the subsystem in service system, for acquiring the corresponding first resource data of each business), and will adopt Collect obtained first resource data to be stored in corresponding resource database, then, service system can be from resource database In, get the corresponding first resource data of each business.Certainly, mode here does not constitute the restriction to the application.
S103: according to the corresponding first resource statistical rules of each business for including in the configuration file, to what is got The corresponding first resource data of each business are counted, and determine the corresponding first resource dosage of each first resource data.
Just it has been observed that containing the statistical rules of the first resource for each business in configuration file.It is advised by the statistics Then, user can be gone out with accurate statistics and uses first resource dosage needed for business.In embodiments of the present invention, each first resource Data can reflect first resource dosage.
Such as: it uses the example above, the first resource data that user A is generated using cloud storage service are as follows:
" user A, cloud storage service, has used capacity: 1G, maximum capacity: 2G ".
In the first resource data, " having used capacity " this reflect the occupied cloud storage resource of user (that is, dosage of resource), then, it can also be united according to the first resource for cloud storage service for including in configuration file Meter rule, determines the corresponding first resource dosage of the first resource data are as follows: 1G.
Clearly for each first resource data of different business, it can determine that its is right according to above-mentioned statistical rules The first resource dosage answered.
It should be noted that in embodiments of the present invention, it, can be by the clothes inside service provider for above-mentioned steps Business system executes, alternatively, can be executed by the service subsystem for carrying out resource statistics in service system, not structure here The restriction of pairs of the application.In practical application scene, the service system be can be based on business infrastructure platform The system that the server (or server cluster) of (Platform-as-a-Service, PaaS) framework is constituted, that is, service system System provides all kinds of business services in a manner of platform.
Through the above steps, after service provider provides Added Business, phase can be made by the way of configuration file The service system answered loads the configuration file, and obtains the system for changing the resource data for Added Business for including in configuration file Meter rule greatly improves the convenience for defining statistical rules unlike the prior art yes by the way of configuration file, and Without being recompilated for all existing statistical rules, in addition, can also easily be sent out by the way of configuration file The statistical rules that cloth is made by oneself for the resource data of all kinds of business, loading configuration file will not influence the normal work of service system Make, it is ensured that the stable operation of service system.
Aforesaid way makes the service system in service provider, can (include easily newly-increased industry to different business Business also includes existing business) corresponding first resource data are counted, and it is (namely above-mentioned to obtain corresponding resource usage First resource dosage), it is believed that first resource dosage reflects the degree that user consumes resource, and in practical applications, User is using resource consumed by business, usually as provided by service provider, as: cloud provided by service provider Memory space, the transmission resources such as flow, in certain actual scenes, service provider can also provide a kind of Secondary resource (such as: empty Quasi- currency), the first resource that the Secondary resource settles accounts its consumption can be used in user, that is to say, that service provider can be On the basis of determining first resource consumed by user, Secondary resource consumed by user is further determined that out.
In other words, the extension as above-mentioned method as shown in Figure 1, can also further determine that second consumed by user Resource, below just will be to determine that Secondary resource consumed by user is described in detail as scene.
Under the scene, corresponding function can be realized using service architecture as shown in Figure 2.In Fig. 2, number of resources According to service for obtaining the corresponding first resource data of different business, checking treatment service for resource data for being examined It tests, the conversion of data format, and Various types of data needed for determining Secondary resource is provided, resource processing service is for for obtaining Data determine Secondary resource consumed by user.A kind for the treatment of process of streaming is formed between each service in Fig. 2, to make It obtains during determining resource consumed by user, it is more efficient.Certainly, it here and does not constitute a limitation of the invention.
The process for determining Secondary resource consumed by user will be carried out specifically based on the service architecture in Fig. 2 below It is bright.
Determine that the process of first resource dosage is similar to above-mentioned process as shown in Figure 1 according to first resource data, therefore It is no longer repeated herein.
Under this scene, the first resource that user is consumed using different business can be tied with same Secondary resource It calculates, still, first resource dosage corresponding to different business may have different formats, such as: for cloud storage service For, the format of corresponding first resource dosage are as follows:
" user A, cloud storage service, has used capacity: 10G ";
For bandwidth traffic business, the format of corresponding first resource dosage are as follows:
" user B, bandwidth traffic business, speed of download: 2mb/s ";
Obviously, the data format of first resource dosage corresponding to two different business is different, a kind of resource use Amount reflects the memory space of consumption, and another resource usage reflects the communication bandwidth of consumption.
So, for the checking treatment service in Fig. 2, in order to be counted for different first resource dosages It calculates, it is necessary to different first resource dosages is converted into unified data format, therefore in embodiments of the present invention, checking treatment Service provides a kind of conversion function of data format, in this case, in the configuration file further include: is directed to each business pair The format transformation rule for the first resource dosage answered, in the case, the method also includes: according in the configuration file The Data Format Transform of each first resource dosage is identical format by format transformation rule.
It should be noted that under this scene, it still can be by the way of configuration file, rule needed for configuring.Such as: being directed to For first resource dosage with different data format, different format transfer functions is called respectively, by different data format First resource dosage, be converted to unified data format.Specifically: the respective rule according to specified in configuration file is adjusted With corresponding function, the first resource dosage 10GB of above-mentioned reflection memory space consumption is converted to 10, correspondingly, data lattice Formula conversion are as follows:
" user A, cloud storage service, use resource: 10 "
Similarly, the first resource dosage 2mb/s of the consumption of above-mentioned reflection communication bandwidth is converted into 20 (2mb/s= 16Mbps, it is assumed that it belongs to 20M bandwidth service provided by service provider), then, Data Format Transform are as follows:
" user B, bandwidth traffic business, use resource: 20 "
In this example as it can be seen that first resource dosage is converted to the identical data without dosage unit after conversion Format, in order to Secondary resource consumed by subsequent determining user.
Certainly, above content is intended merely to intuitive specification format conversion process and a kind of example for showing, this is not constituted Limitation of the invention.
In conjunction with above content, in embodiments of the present invention, by the way of configuration file, can easily define different Rule, so that checking treatment service is according to rule defined in configuration file, to the data format of different first resource dosages It is converted.
In view of that in practical applications, may exist from the data format of the first resource dosage of different business different Often, abnormal data will affect the accuracy of Secondary resource consumed by subsequent determination, so, as in the embodiment of the present invention A kind of mode also provides a kind of data cleansing function in checking treatment service as shown in Figure 2, in other words, by each first Before the Data Format Transform of resource usage is identical format, the method also includes: to the data of each first resource dosage Format is detected, and rejects the first resource dosage of the format exception detected.
Certainly, in practical applications, for checking treatment service, wherein also settable different sub-services, such as:
StorContinues sub-services, for determining in storage class business, the duration of storage resource used by a user.
MergeMinuteData sub-services, the data (service system for summarizing in set period of time, in service system May be made of server cluster, the different server in cluster is responsible for handling partial data), that is, the sub-services ensure that Data it is of overall importance.
PatchUserInfo sub-services, for determining according to the user identifier (such as: User ID) in first resource dosage The corresponding user gradation of the user.
InterruptService sub-services, for determining the user gradation currently corresponding resource according to user gradation Quota information, if the resource of user's consumption is more than quota, notice managing and control system is disabled into the business for the user.
Above-mentioned sub-services ensure that the accuracy of final calculated Secondary resource, and certainly, these sub-services can root It is adjusted according to the needs of practical application, does not constitute the restriction to the application here.
By the above process, the resource processing service in Fig. 2 can calculate Secondary resource consumed by user, specifically Ground, in the configuration file further include: the computation rule of Secondary resource dosage corresponding with the first resource dosage of each business;Institute State method further include: be directed to each business, determine that user is corresponding using generated each first resource data when the business The sum of first resource dosage, according to corresponding second money of the first resource dosage of the sum of described first resource dosage and the business The computation rule of source dosage determines that the user uses Secondary resource dosage needed for the business.
What needs to be explained here is that same user may continue to use, or be used for multiple times for each business, that It just needs to add up user using resource consumed by business, that is, the sum of above-mentioned first resource dosage.
After obtaining the sum of first resource dosage, it can determine that user is consumed according to corresponding computation rule Secondary resource, certainly, in embodiments of the present invention, computation rule can be defined in configuration file, such mode Substantially increase the convenience of calculating process.
In view of in practical applications, the user gradation of different user is different, service provider may be for not With the user of user gradation, different resource quota amounts is distributed, so, during calculating Secondary resource, needed toward contact Consider the corresponding resource quota amount of user gradation.
Specifically, according to the corresponding Secondary resource of first resource dosage of the sum of described first resource dosage and the business The computation rule of dosage determines that the user using Secondary resource dosage needed for the business, specifically includes: determining the user Corresponding user gradation determines the user couple according to the corresponding relationship of preset user gradation and first resource quota information The first resource quota information answered, according to the sum of the corresponding first resource quota information of the user, the first resource dosage And the computation rule of the corresponding Secondary resource dosage of first resource dosage of the business, determine that the user uses the business institute The Secondary resource dosage needed.
Wherein, first resource quota information reflects the quota amount of the consumable first resource of user, if user is disappeared The first resource dosage of consumption is simultaneously less than its quota amount, it is possible to think that the user does not need consumption Secondary resource.Only use The quota amount of the corresponding first resource in family has been more than its quota amount, which just needs to consume Secondary resource.
It is based on this, in embodiments of the present invention, according to the corresponding first resource quota information of the user, described The computation rule of the corresponding Secondary resource dosage of the first resource dosage of the sum of one resource usage and the business, determines the use Secondary resource dosage needed for family uses the business, specifically includes: according to the corresponding first resource quota information of the user and The sum of described first resource dosage determines that the sum of first resource dosage exceeds the excess dosage of first resource quota, judges excess Whether dosage is greater than preset threshold, if so, according to the first resource dosage of the excess dosage and the business corresponding The computation rule of two resource usages determines the user using Secondary resource dosage needed for the business, otherwise, it determines the use Family is zero using Secondary resource dosage needed for the business.
Wherein, above-mentioned preset threshold can be set as zero.
In order to clearly be set forth in the process for the Secondary resource for calculating user's consumption under practical application scene, now with an application Example is described in detail.
In this example, Secondary resource is ideal money, and user uses first resource consumed by business, then, user Need to pay the ideal money of respective numbers.That is, will be calculated according to first resource used by a user in this example User needs the ideal money paid.
It is assumed herein that service provider provides three kinds of business services: business A, business B, business C.Wherein, business A is to ask The flow business of class is sought, business B is the processing business for requesting class, and business C is storage service.
Assuming that user User1 has used above-mentioned 3 class business respectively, corresponding first resource data are generated, when service is System got above-mentioned first resource data after, will the rule according to defined in corresponding configuration file, to 3 kind first Resource data is handled.At this time, it is assumed that following rule is defined in configuration file:
Two functions Clear001, Clear101 are called for business A in data scrubbing link;For business B, C, adjust With function Clear001.
In format conversion links, for business A, B, C, difference call format transfer function M1, M2, M3.
So, service system will call corresponding function, respectively to above-mentioned 3 according to the rule in above-mentioned configuration file Kind first resource data are handled.In this example, the function called specifically can be hook function, not constitute here It limits.
It is assumed that respectively obtaining the first money of the unified format as shown in following table 1 to table 3 after being handled according to rule Source dosage:
The corresponding first resource dosage of business A:
User Request number of times Expend flow
User1 2000 800mb
Table 1
The corresponding first resource dosage of business B:
User CPU uses the time Resource uses the time
User1 1h 1h
Table 2
The corresponding first resource dosage of business C:
User Amount of storage Storage time
User1 10G 24h
Table 3
Next, service system will acquire the user gradation of the user User1, it is assumed that the user gradation of the user User1 It is 3, the computation rule of the corresponding ideal money of the user gradation is as shown in table 4 below:
CPU is used Request number of times Amount of storage Storage time Flow
2/h 4/1000 time 2/1GB 1/8h 2/100mb
Table 4
The price for the ideal money that different resource to be paid is shown in table 4.
In addition, service system will also determine the resource quota information of user User1, it is assumed that the resource of the user User1 is matched Volume information is as shown in table 5 below:
CPU quota Request number of times Amount of storage Storage time Flow
1h 500 times 2GB 8h 300mb
Table 5
As seen from Table 5, resource consumed by user User1 can not then consume ideal money in its quota amount, in conjunction with Table 5 and table 4 can determine that the user User1 consumes the ideal money of 34 units altogether.
After obtaining the results, service system can will export inventory, so that users can browse certainly, needing exist for illustrating , in the prior art, during the ideal money of user's consumption is calculated, if first resource consumed by user Dosage is within quota amount (that is, these first resources used by a user will not consume ideal money), then, clothes Business system can filter out such resource usage, that is, will not export above-mentioned first resource dosage used by a user, this is just Cause the result of output imperfect.And in embodiments of the present invention, it, can be for used by a user all the using aforesaid way One resource data is converted, counts first resource dosage, and calculates the ideal money dosage of user on this basis, such Mode will not filter out any data, can sufficiently show the dosage of all first resources consumed by user.
In the examples described above, user gradation is associated with quota information, unit price, and specific number can be by service provider It determines, is not especially limited here.In addition, if irregular for corresponding data configuration in configuration file, then, it is handling Default rule is just used in the process.
It should be noted that can also include a kind of query service, the query service in service architecture shown in Fig. 2 Query service, example are provided with hypertext transfer protocol (HyperText Transfer Protocol, HTTP) for developer Such as: inquiry in the set time period, receives the business of request amount top 10;Or inquiry is within the set time, consumption is virtual The most user etc. of currency, so that developer obtains the use state of business in real time.
The above are method for processing resource provided in an embodiment of the present invention, are based on same thinking, and the embodiment of the present invention also mentions For a kind of resource processing unit.As shown in figure 3, resource processing unit includes:
Loading module 301 is used for loading configuration file;
Module 302 is obtained, for the mark according to the corresponding first resource data of each business for including in the configuration file Know, obtains the corresponding first resource data of each business;
Statistical module 303, for according to the corresponding first resource statistical rules of each business for including in the configuration file, The corresponding first resource data of each business got are counted, determine the corresponding first resource of each first resource data Dosage.
Under a kind of mode in embodiments of the present invention, in the configuration file that the loading module 301 loads further include: needle To the format transformation rule of the corresponding first resource dosage of each business, at this point, described device further include: conversion module 304 is used for It is identical format by the Data Format Transform of each first resource dosage according to the format transformation rule in the configuration file.
Under a kind of mode in embodiments of the present invention, described device further include: data scrubbing module 305, for each The data format of first resource dosage is detected, and rejects the first resource dosage of the format exception detected.
Under a kind of mode in embodiments of the present invention, in the configuration file that the loading module 301 loads further include: with The computation rule of the corresponding Secondary resource dosage of the first resource dosage of each business, in the case, described device further include: change Module 306 is calculated, for being directed to each business, determines that user is corresponding using generated each first resource data when the business The sum of first resource dosage, according to corresponding second money of the first resource dosage of the sum of described first resource dosage and the business The computation rule of source dosage determines that the user uses Secondary resource dosage needed for the business.
Specifically, the conversion module 306 is specifically used for determining the corresponding user gradation of the user, according to preset The corresponding relationship of user gradation and first resource quota information determines the corresponding first resource quota information of the user, according to The first resource dosage pair of the sum of the corresponding first resource quota information of the user, described first resource dosage and the business The computation rule for the Secondary resource dosage answered determines that the user uses Secondary resource dosage needed for the business.
More specifically, the conversion module 306 is specifically used for according to the corresponding first resource quota information of the user The sum of with the first resource dosage, determine that the sum of first resource dosage exceeds the excess dosage of first resource quota, judgement is super Whether volume dosage is greater than preset threshold, if so, corresponding according to the first resource dosage of the excess dosage and the business The computation rule of Secondary resource dosage determines the user using Secondary resource dosage needed for the business, otherwise, it determines described User is zero using Secondary resource dosage needed for the business.
In a typical configuration, calculating equipment includes one or more processors (CPU), input/output interface, net Network interface and memory.
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 (flash RAM).Memory is computer-readable medium Example.
Computer-readable medium includes permanent and non-permanent, removable and non-removable media can be by any method Or technology come realize information store.Information can be computer readable instructions, data structure, the module of program or other data. The example of the storage medium of computer includes, but are not limited to phase change memory (PRAM), static random access memory (SRAM), moves State random access memory (DRAM), other kinds of random access memory (RAM), read-only memory (ROM), electric erasable Programmable read only memory (EEPROM), flash memory or other memory techniques, read-only disc read only memory (CD-ROM) (CD-ROM), Digital versatile disc (DVD) or other optical storage, magnetic cassettes, tape magnetic disk storage or other magnetic storage devices Or any other non-transmission medium, can be used for storage can be accessed by a computing device information.As defined in this article, it calculates Machine readable medium does not include temporary computer readable media (transitory media), such as the data-signal and carrier wave of modulation.
It should also be noted that, the terms "include", "comprise" or its any other variant are intended to nonexcludability It include so that the process, method, commodity or the equipment that include a series of elements not only include those elements, but also to wrap Include other elements that are not explicitly listed, or further include for this process, method, commodity or equipment intrinsic want Element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that including described want There is also other identical elements in the process, method of element, commodity or equipment.
It will be understood by those skilled in the art that the embodiment of the present invention can provide as method, system or computer program product. Therefore, complete hardware embodiment, complete software embodiment or embodiment combining software and hardware aspects can be used in the present invention Form.It is deposited moreover, the present invention can be used to can be used in the computer that one or more wherein includes computer usable program code The shape for the computer program product implemented on storage media (including but not limited to magnetic disk storage, CD-ROM, optical memory etc.) Formula.
The above description is only an embodiment of the present invention, is not intended to restrict the invention.For those skilled in the art For, the invention may be variously modified and varied.All any modifications made within the spirit and principles of the present invention are equal Replacement, improvement etc., should be included within scope of the presently claimed invention.

Claims (8)

1. a kind of method for processing resource characterized by comprising
Loading configuration file;
According to the mark of the corresponding first resource data of each business for including in the configuration file, each business corresponding is obtained One resource data;
It is corresponding to each business got according to the corresponding first resource statistical rules of each business for including in the configuration file First resource data counted, determine the corresponding first resource dosage of each first resource data;
In the configuration file further include: the computation rule of Secondary resource dosage corresponding with the first resource dosage of each business;
The method also includes:
For each business, the corresponding first resource of generated each first resource data is used when determining user using the business The sum of amount;
According to the calculating of the corresponding Secondary resource dosage of the first resource dosage of the sum of described first resource dosage and the business Rule determines that the user uses Secondary resource dosage needed for the business.
2. the method as described in claim 1, which is characterized in that in the configuration file further include: corresponding for each business The format transformation rule of first resource dosage;
The method also includes:
It is identical lattice by the Data Format Transform of each first resource dosage according to the format transformation rule in the configuration file Formula.
3. method according to claim 2, which is characterized in that be identical by the Data Format Transform of each first resource dosage Format before, the method also includes:
The data format of each first resource dosage is detected, and rejects the first resource dosage of the format exception detected.
4. the method as described in claim 1, which is characterized in that according to the of the sum of described first resource dosage and the business The computation rule of the corresponding Secondary resource dosage of one resource usage determines that the user is used using Secondary resource needed for the business Amount, specifically includes:
Determine the corresponding user gradation of the user;
According to the corresponding relationship of preset user gradation and first resource quota information, the corresponding first resource of the user is determined Quota information;
According to the sum of the corresponding first resource quota information of the user, the first resource dosage and the first money of the business The computation rule of the corresponding Secondary resource dosage of source dosage determines that the user uses Secondary resource dosage needed for the business.
5. method as claimed in claim 4, which is characterized in that according to the corresponding first resource quota information of the user, institute The computation rule for stating the corresponding Secondary resource dosage of first resource dosage of the sum of first resource dosage and the business, determines institute User is stated using Secondary resource dosage needed for the business, is specifically included:
According to the sum of the corresponding first resource quota information of the user and described first resource dosage, first resource dosage is determined The sum of exceed first resource quota excess dosage;
Judge whether excess dosage is greater than preset threshold;
If so, being advised according to the calculating of the corresponding Secondary resource dosage of first resource dosage of the excess dosage and the business Then, determine that the user uses Secondary resource dosage needed for the business;
Otherwise, it determines the user is zero using Secondary resource dosage needed for the business.
6. a kind of resource processing unit characterized by comprising
Loading module is used for loading configuration file;
Module is obtained, for the mark according to the corresponding first resource data of each business for including in the configuration file, is obtained The corresponding first resource data of each business;
Statistical module, for according to the corresponding first resource statistical rules of each business for including in the configuration file, to acquisition To the corresponding first resource data of each business counted, determine the corresponding first resource dosage of each first resource data;
In the configuration file of the loading module load further include: Secondary resource corresponding with the first resource dosage of each business is used The computation rule of amount;
Described device further include: conversion module, it is generated each when determining user using the business for being directed to each business The sum of corresponding first resource dosage of first resource data, according to the sum of described first resource dosage and the first money of the business The computation rule of the corresponding Secondary resource dosage of source dosage determines that the user uses Secondary resource dosage needed for the business.
7. device as claimed in claim 6, which is characterized in that in the configuration file of the loading module load further include: needle To the format transformation rule of the corresponding first resource dosage of each business;
Described device further include: conversion module, for according to the format transformation rule in the configuration file, by each first resource The Data Format Transform of dosage is identical format.
8. device as claimed in claim 7, which is characterized in that described device further include: data scrubbing module, for each the The data format of one resource usage is detected, and rejects the first resource dosage of the format exception detected.
CN201510874150.XA 2015-12-02 2015-12-02 A kind of method for processing resource and device Active CN105550209B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510874150.XA CN105550209B (en) 2015-12-02 2015-12-02 A kind of method for processing resource and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510874150.XA CN105550209B (en) 2015-12-02 2015-12-02 A kind of method for processing resource and device

Publications (2)

Publication Number Publication Date
CN105550209A CN105550209A (en) 2016-05-04
CN105550209B true CN105550209B (en) 2019-02-22

Family

ID=55829398

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510874150.XA Active CN105550209B (en) 2015-12-02 2015-12-02 A kind of method for processing resource and device

Country Status (1)

Country Link
CN (1) CN105550209B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108021357B (en) * 2017-11-20 2022-03-11 北京奇虎科技有限公司 Optimization method and device for program call
CN110297861A (en) * 2019-06-19 2019-10-01 苏州企智信息科技有限公司 A kind of distributed intelligence database data acquisition method based on super market checkout system
CN110852559A (en) * 2019-09-24 2020-02-28 京东数字科技控股有限公司 Resource allocation method and device, storage medium and electronic device
CN111552569B (en) * 2020-04-28 2023-10-20 咪咕文化科技有限公司 System resource scheduling method, device and storage medium
CN117742975A (en) * 2024-02-20 2024-03-22 北京搜狐新媒体信息技术有限公司 Resource data processing method and device, storage medium and electronic equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101345654A (en) * 2008-08-30 2009-01-14 华为技术有限公司 Index computing method and apparatus
CN101631036A (en) * 2008-07-14 2010-01-20 中兴通讯股份有限公司 Method and device for counting website hits
CN103530424A (en) * 2013-10-31 2014-01-22 北京奇虎科技有限公司 Useless file detection method and device
CN103905244A (en) * 2014-01-28 2014-07-02 北京奇虎科技有限公司 Device and method for statistics of visit information

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7877539B2 (en) * 2005-02-16 2011-01-25 Sandisk Corporation Direct data file storage in flash memories

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101631036A (en) * 2008-07-14 2010-01-20 中兴通讯股份有限公司 Method and device for counting website hits
CN101345654A (en) * 2008-08-30 2009-01-14 华为技术有限公司 Index computing method and apparatus
CN103530424A (en) * 2013-10-31 2014-01-22 北京奇虎科技有限公司 Useless file detection method and device
CN103905244A (en) * 2014-01-28 2014-07-02 北京奇虎科技有限公司 Device and method for statistics of visit information

Also Published As

Publication number Publication date
CN105550209A (en) 2016-05-04

Similar Documents

Publication Publication Date Title
CN105550209B (en) A kind of method for processing resource and device
US9384227B1 (en) Database system providing skew metrics across a key space
US9417903B2 (en) Storage management for a cluster of integrated computing systems comprising integrated resource infrastructure using storage resource agents and synchronized inter-system storage priority map
Ishii et al. Elastic stream computing with clouds
US8996647B2 (en) Optimizing storage between mobile devices and cloud storage providers
CN109032801A (en) A kind of request scheduling method, system and electronic equipment and storage medium
CN103699445A (en) Task scheduling method, device and system
CN108667867A (en) Date storage method and device
WO2013191927A1 (en) Ensuring predictable and quantifiable networking performance
CN107229619A (en) Internet service link calls statistics, methods of exhibiting and the device of situation
CN111130810B (en) Charging method and device for cloud service usage package and related equipment
CN109063056A (en) A kind of data query method, system and terminal device
US20210400121A1 (en) Generalized resource accountant
US9262505B2 (en) Input-output prioritization for database workload
CN107291720A (en) A kind of method, system and computer cluster for realizing batch data processing
US10621389B1 (en) Selecting platform-supported services
CN110046187A (en) Data processing system, method and device
CN110489418B (en) Data aggregation method and system
CN111158904A (en) Task scheduling method, device, server and medium
US8548881B1 (en) Credit optimization to minimize latency
CN113052699B (en) Contract data processing method, related device and medium
CN108900482A (en) Execution method, server management system and the storage medium of script
CN111522840B (en) Label configuration method, device, equipment and computer readable storage medium
CN108664322A (en) Data processing method and system
CN110175808A (en) A kind of order management, querying method, device, equipment and medium

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20230307

Address after: Room 501-502, 5/F, Sina Headquarters Scientific Research Building, Block N-1 and N-2, Zhongguancun Software Park, Dongbei Wangxi Road, Haidian District, Beijing, 100193

Patentee after: Sina Technology (China) Co.,Ltd.

Address before: 100080, International Building, No. 58 West Fourth Ring Road, Haidian District, Beijing, 20 floor

Patentee before: Sina.com Technology (China) Co.,Ltd.

TR01 Transfer of patent right