CN107483532A - A kind of method for uploading of behavioral data, Resource Server and storage medium - Google Patents
A kind of method for uploading of behavioral data, Resource Server and storage medium Download PDFInfo
- Publication number
- CN107483532A CN107483532A CN201710506118.5A CN201710506118A CN107483532A CN 107483532 A CN107483532 A CN 107483532A CN 201710506118 A CN201710506118 A CN 201710506118A CN 107483532 A CN107483532 A CN 107483532A
- Authority
- CN
- China
- Prior art keywords
- data
- information
- upload
- target
- capsule
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/50—Network services
- H04L67/60—Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/50—Network services
- H04L67/56—Provisioning of proxy services
- H04L67/568—Storing data temporarily at an intermediate stage, e.g. caching
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/50—Network services
- H04L67/60—Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources
- H04L67/62—Establishing a time schedule for servicing the requests
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Information Transfer Between Computers (AREA)
Abstract
The invention discloses a kind of method for uploading of behavioral data, Resource Server and storage medium, this method includes:From configuration file, the default mark of target and target property information that the Data Identification in the behavioral data uploaded with client matches are obtained;According to target property information, judge whether behavioral data needs to upload immediately;If it is required, then Data Identification and target property information are uploaded to Platform Server;If it is not required, then Data Identification and target property information are added to data capsule;Judge whether the information content in data capsule is more than M;Judge whether the duration away from data capsule the last time upload information is more than T;If the information content in data capsule is more than M, or, the duration away from data capsule the last time upload information is more than T, then the information in upload data capsule to Platform Server.The present invention, which realizes, reduces the technique effect that difficulty, reduction network blockage and Platform Server CPU consumption were safeguarded and changed to later data.
Description
Technical field
The present invention relates to Internet technical field, more particularly to a kind of method for uploading of behavioral data, Resource Server and
Storage medium.
Background technology
Improved for the ease of manufacturer and understand user's use habit, flash player can largely collect user behavior data
Or flash player factum data, to upload to Platform Server, to facilitate Platform Server to carry out analysis mining
Go out the data of valuable content.
Current collection method is that flash player directly uploads the behavioral data of collection transmission to Platform Server.
However, because business scenario is various and scattered during data are collected, the data maintenance collected is got up
It is relatively difficult.Particularly need to consume a large amount of human costs in the case where the data that later stage class is collected need to change and go to receive again
During collection, such data is modified one by one.
In addition, it is possible that flash player reports a large amount of numbers to Platform Server simultaneously under some business scene
Can cause flash player or Resource Server and the peak value of Platform Server network communication according to, such case, increase bandwidth into
This, while after Platform Server some timing node receives a large amount of flash player data suddenly, carry out service logic
If, easily lift the CPU consumption of Platform Server.
It can be seen that, there is data maintenance and modification be difficult, Yi Zao in the method that existing flash player uploads behavioral data
Into the technical problem of the CPU consumption of network blockage and lifting Platform Server.
The content of the invention
The embodiment of the present application solves by providing a kind of method for uploading of behavioral data, Resource Server and storage medium
The method that flash player of the prior art collects behavioral data, existing data maintenance and modification are difficult, easily cause net
Network blocks and the technical problem of the CPU consumption of lifting Platform Server.
In a first aspect, this application provides a kind of method for uploading of behavioral data, applied in Resource Server, including:
From the configuration file to prestore, the target that the Data Identification ID in the behavioral data uploaded with client is matched is obtained
Default mark ID, and target property information corresponding with the default mark ID;
According to the target property information, judge whether the behavioral data needs to upload immediately;
If the behavioral data needs to upload immediately, the Data Identification ID and objective attribute target attribute letter are directly uploaded
Cease to the Platform Server;
If the behavioral data need not upload immediately, the Data Identification ID and the target property information are added
Add to data capsule;
Judge whether the information content in the data capsule is more than M;Judge away from the last upload of the data capsule
Whether the duration of information is more than T;M is positive integer, and T is positive number;
If the information content in the data capsule is more than M, or, away from data capsule the last time upload information
Duration is more than T, then uploads the information in the data capsule to the Platform Server, and empty the data capsule.
Optionally, the default mark of target that the Data Identification ID in the behavioral data that the acquisition uploads with client is matched
ID, and target property information corresponding with the default mark ID, including:Receive the behavioral data that client is sent, institute
Stating behavioral data includes the Data Identification ID;In the N number of default mark ID for judging the configuration file, if exist and institute
State the default mark ID of the target of Data Identification ID matchings;Wherein, N number of pre- bidding is also preset with the configuration file
Know attribute information corresponding to each default mark ID in ID;N is positive integer;If exist and the data in the configuration file
The default mark ID of target of ID matchings is identified, then obtains the target property information corresponding to the default mark ID of the target.
Optionally, in the N number of default mark ID for judging configuration file, if exist and matched with the Data Identification ID
The default mark ID of the target after, in addition to:Matched if be not present in the configuration file with the Data Identification ID
The default mark ID of target, then refusal upload the Data Identification ID.
Optionally, before the behavioral data for receiving client and sending, in addition to:Use the loader classes of system level
Object load the configuration file;LoadComplete methods are triggered, first the configuration file is converted into JSON data, so
After deposit the JSON data into logData variables;In the N number of default mark ID for judging configuration file, if exist
The default mark ID of target matched with the Data Identification ID, including:Addlog methods are called, by traveling through in logData
N number of default mark ID is come compared with the Data Identification ID, so as to judge whether and the Data Identification ID
The default mark ID of the target of matching;Target property information corresponding to the default mark ID of the acquisition target, including:Obtain institute
Target property information corresponding to the default mark ID of target is stated, and the target property information is entered as variable Singledata.
Optionally, the default mark of target that the Data Identification ID in the behavioral data that the acquisition uploads with client is matched
Before ID, in addition to:Load and parse the configuration file;Initialize reported data timer;The reported data timer
For judging whether the duration away from data capsule the last time upload information is more than T;Data management system is collected in initialization;The number
It is used for the behavioral data for receiving client transmission according to manager.
Optionally, it is described to load and parse the configuration file, including:Object using the loader classes of system level comes
Load the configuration file;LoadComplete methods are triggered, first the configuration file is converted into JSON data, then deposits institute
JSON data are stated into logData variables.
Optionally, it is described according to the target property information, judge whether the behavioral data needs to upload immediately, wrap
Include:Using design variables bolan as the variable for whether needing to upload immediately is characterized, pass through Bolan=Singledata.istimely
>0true:Flase order judges whether the behavioral data needs to upload immediately;When istimely is 1, table
Sign needs to upload immediately, and the command execution results are true;When istimely is 0, sign need not upload immediately, described
Command execution results are flase;Wherein, the numerical value of the istimely is the target for being set in advance in the configuration file
In attribute information.
Second aspect, there is provided a kind of Resource Server, including:
Acquiring unit, for from the configuration file to prestore, obtaining the data mark in the behavioral data uploaded with client
Know the default mark ID of target of ID matchings, and target property information corresponding with the default mark ID;
First judging unit, for according to the target property information, judging whether the behavioral data is needed on immediately
Pass;
Uploading unit, if for the behavioral data need immediately upload, directly upload the Data Identification ID and
The target property information is to the Platform Server;
Adding device, if need not be uploaded immediately for the behavioral data, by the Data Identification ID and described
Target property information is added to data capsule;
Second judging unit, for judging whether the information content in the data capsule is more than M;Judge away from the data
Whether the duration of container the last time upload information is more than T;
Unit is emptied, if it is more than M for the information content in the data capsule, or, it is nearest away from the data capsule
The duration of upload information is more than T, then uploads the information in the data capsule to the Platform Server, and empties described
Data capsule.
The third aspect, there is provided a kind of Resource Server, including memory, processor and storage on a memory and can located
The computer program that runs on reason device, following steps are realized during the computing device described program:
From the configuration file to prestore, the target that the Data Identification ID in the behavioral data uploaded with client is matched is obtained
Default mark ID, and target property information corresponding with the default mark ID;
According to the target property information, judge whether the behavioral data needs to upload immediately;
If the behavioral data needs to upload immediately, the Data Identification ID and objective attribute target attribute letter are directly uploaded
Cease to the Platform Server;
If the behavioral data need not upload immediately, the Data Identification ID and the target property information are added
Add to data capsule;
Judge whether the information content in the data capsule is more than M;Judge away from the last upload of the data capsule
Whether the duration of information is more than T;
If the information content in the data capsule is more than M, or, away from data capsule the last time upload information
Duration is more than T, then uploads the information in the data capsule to the Platform Server, and empty the data capsule.
Fourth aspect, there is provided a kind of computer-readable recording medium, be stored thereon with computer program, the program is processed
Device realizes following steps when performing:
From the configuration file to prestore, the target that the Data Identification ID in the behavioral data uploaded with client is matched is obtained
Default mark ID, and target property information corresponding with the default mark ID;
According to the target property information, judge whether the behavioral data needs to upload immediately;
If the behavioral data needs to upload immediately, the Data Identification ID and objective attribute target attribute letter are directly uploaded
Cease to the Platform Server;
If the behavioral data need not upload immediately, the Data Identification ID and the target property information are added
Add to data capsule;
Judge whether the information content in the data capsule is more than M;Judge away from the last upload of the data capsule
Whether the duration of information is more than T;
If the information content in the data capsule is more than M, or, away from data capsule the last time upload information
Duration is more than T, then uploads the information in the data capsule to the Platform Server, and empty the data capsule.
The one or more technical schemes provided in the embodiment of the present application, have at least the following technical effects or advantages:
In method, Resource Server and the storage medium that the embodiment of the present application provides, on the one hand, to upload objective attribute target attribute letter
Breath, which substitutes, uploads behavioral data, by setting target property information in configuration file in advance, can effectively improve and upload data
Uniformity and regularity, reduce the difficulty of follow-up data maintenance, and only need to change the realization of configuration file can to uploading
The agreement modification of data, improves modification efficiency.On the other hand, first according to the target property information, the behavior number is judged
According to whether needing to upload immediately;Put down if desired, then directly uploading the Data Identification ID and the target property information to described
Platform server;As do not needed, then the Data Identification ID and the target property information are added to data capsule;Will be real-time
Property less demanding file be first stored in data capsule, avoid period from occurring largely going up transmitting file, reduce network congestion
Consumed with Platform Server CPU;Further, the information content in data capsule is more than M, or, the last away from data capsule
In the case that the duration of upload information is more than T, the information in the data capsule is uploaded to the Platform Server, and empty institute
Data capsule is stated, uploading rule with reference to two kinds is further ensured that orderly upload, reduces network congestion and Platform Server CPU disappears
Consumption.
Brief description of the drawings
Technical scheme in order to illustrate the embodiments of the present invention more clearly, make required in being described below to embodiment
Accompanying drawing is briefly described, it should be apparent that, drawings in the following description are some embodiments of the present invention, for this
For the those of ordinary skill of field, on the premise of not paying creative work, it can also be obtained according to these accompanying drawings other
Accompanying drawing.
Fig. 1 is a kind of flow chart of the method for uploading of behavioral data in the embodiment of the present application;
Fig. 2 is a kind of structural representation of Resource Server in the embodiment of the present application two;
Fig. 3 is a kind of structural representation of Resource Server in the embodiment of the present application three;
Fig. 4 is a kind of structural representation of computer-readable recording medium 400 in the embodiment of the present application four.
Embodiment
The embodiment of the present application solves by providing a kind of method for uploading of behavioral data, Resource Server and storage medium
The method that flash player of the prior art collects behavioral data, existing data maintenance and modification are difficult, easily cause net
Network blocks and the technical problem of the CPU consumption of lifting Platform Server, realizes and reduces later data maintenance and modification difficulty, subtracts
The technique effect of the CPU consumption of few network blockage and Platform Server.
The technical scheme of the embodiment of the present application is in order to solve the above technical problems, general thought is as follows:
A kind of method for uploading of behavioral data, applied in Resource Server, including:
From the configuration file to prestore, the target that the Data Identification ID in the behavioral data uploaded with client is matched is obtained
Default mark ID, and target property information corresponding with the default mark ID;
According to the target property information, judge whether the behavioral data needs to upload immediately;
If the behavioral data needs to upload immediately, the Data Identification ID and objective attribute target attribute letter are directly uploaded
Cease to the Platform Server;
If the behavioral data need not upload immediately, the Data Identification ID and the target property information are added
Add to data capsule;
Judge whether the information content in the data capsule is more than M;Judge away from the last upload of the data capsule
Whether the duration of information is more than T;M is positive integer, and T is positive number;
If the information content in the data capsule is more than M, or, away from data capsule the last time upload information
Duration is more than T, then uploads the information in the data capsule to the Platform Server, and empty the data capsule.
Specifically, on the one hand, upload behavioral data is substituted to upload target property information, by advance in configuration file
Middle setting target property information, the uniformity and regularity for uploading data can be effectively improved, reduce the difficulty of follow-up data maintenance
Degree, and only need to change agreement modification of the configuration file can realization to uploading data, improve modification efficiency.The opposing party
Face, first according to the target property information, judge whether the behavioral data needs to upload immediately;If desired, then directly upload
The Data Identification ID and the target property information are to the Platform Server;As do not needed, then by the Data Identification ID
Data capsule is added to the target property information;The not high file of requirement of real-time is first stored in data capsule, kept away
Transmitting file need to largely be gone up by exempting from a period appearance, reduce network congestion and Platform Server CPU consumption;Further, hold in data
In the case that information content in device is more than M, or, the duration away from data capsule the last time upload information is more than T, described in upload
Information in data capsule empties the data capsule to the Platform Server, and uploading rule with reference to two kinds further protects
Card uploads in order, reduces network congestion and Platform Server CPU consumption.
In order to be better understood from above-mentioned technical proposal, below in conjunction with Figure of description and specific embodiment to upper
Technical scheme is stated to be described in detail.
Embodiment one
As shown in figure 1, present embodiments providing a kind of method for uploading of behavioral data, applied in Resource Server, wrap
Include:
Step S101, from the configuration file to prestore, obtain the Data Identification ID in the behavioral data uploaded with client
The default mark ID of the target of matching, and target property information corresponding with the default mark ID;
Step S102, according to the target property information, judge whether the behavioral data needs to upload immediately;
Step S103, if the behavioral data needs to upload immediately, directly upload the Data Identification ID and described
Target property information is to Platform Server;
Step S104, if the behavioral data need not upload immediately, by the Data Identification ID and the target
Attribute information is added to data capsule;
Step S105, judges whether the information content in the data capsule is more than M;Judge nearest away from the data capsule
Whether the duration of upload information is more than T;M is positive integer, and T is positive number;
Step S106, if the information content in the data capsule is more than M, or, it is the last away from the data capsule
The duration of upload information is more than T, then uploads the information in the data capsule to the Platform Server, and empty the data
Container.
It should be noted that in the embodiment of the present application, the Resource Server can be computer equipment, high in the clouds or meter
Machine equipment group is calculated, this is not restricted.The client can be desktop computer, smart mobile phone or tablet personal computer, not limit herein
System.
Below, the detailed implementation steps of the method for uploading of the behavioral data of the application offer are provided with reference to Fig. 1:
First, step S101 is performed, from the configuration file to prestore, obtains the number in the behavioral data uploaded with client
According to the default mark ID of target of mark ID matchings, and target property information corresponding with the default mark ID.
In the present embodiment, the method for obtaining the default mark ID of the target and the target property information is:
The behavioral data that client is sent is received, the behavioral data includes Data Identification ID.
In the embodiment of the present application, before the behavioral data that the server receives that client is sent, can also include:
Load and parse the configuration file;
Initialize reported data timer;The reported data timer is used to judge away from the last upload of data capsule
Whether the duration of information is more than T;Wherein, T is positive number, and unit can be the second, point, hour, this is not restricted;
Data management system is collected in initialization;The data management system is used for the behavioral data for receiving client transmission.
In the embodiment of the present application, the configuration file is set in advance in the server, is receiving client
Need first to load and parse the configuration file before the behavioral data of transmission, specific loading and analytic method are:
First the configuration file is loaded using the object of the loader classes of system level;
Such as:The loading of configuration file is realized using following codes:
Loader=new URLLoader ();
loader.addEventListener(Event.COMPLETE,loadComplete).
loader.load(urlrequest);
Wherein, Urlrequest is a system circle network request, and behavior is arrived by the request of above method can
Data configuration, complete the loading of the configuration file.
Then, the configuration file is loaded, request to behavioral data can trigger loadComplete methods with postponing, will
The configuration file is converted into JSON data, then deposits the JSON data into logData variables.
Next, it is judged that in N number of default mark ID of configuration file, if the mesh matched with the Data Identification ID be present
The default mark ID of mark;Wherein, it is corresponding that each default mark ID is also preset with N number of default mark ID in the configuration file
Attribute information;N is positive integer.
In the embodiment of the present application, the default mark ID of the target matched with the Data Identification ID, can refer to and institute
State the default mark ID of Data Identification ID identicals target;After the calculating that preset rules are either carried out with the Data Identification ID
The default mark ID of the equal target of result of calculation, the calculating can be the following combination of any one or more:Addition, subtract
Method, multiplication, division, power operation, displacement, remove part or order change etc..
In the embodiment of the present application, in the configuration file, the behavior number of the pre-recorded collection in need of staff
According to ID, i.e., described N number of default mark ID, in specific implementation process, staff can be according to significance level and data category
Need to collect to determine which ID data etc. factor, and be recorded in the configuration file.
In the configuration file, also corresponding record has in N number of default mark ID corresponding to each default mark ID
Attribute information attribute, in specific implementation process, the attribute information can include following any one or more information
Combination:This presets the implication of behavior corresponding to mark ID, user operates, this presets ID pairs of mark corresponding to the default mark ID
Whether the data source answered needs upload etc. immediately with data corresponding to the default mark ID.Staff can use default
Regular code name or rule description are used as the attribute information, to avoid numerous and diverse, the scrappy and form of presentation of attribute information different,
It is easy to follow-up inquiry and management.
It should be noted that strict configuration needs well the pre- of each behavioral data uploaded in advance in the configuration file
Bidding knows ID, and is correspondingly arranged attribute information, and carefully and neatly done and regular due to configuration file, configuration file can be by non-technical personnel
Safeguard, reduce maintenance cost.
In the embodiment of the present application, the default mark ID of the target for judging whether to match with the Data Identification ID
Method be specifically as follows:
Assuming that it is datamanager to collect data management system, Addlog methods, Addlog in datamanager be present
Method is using the Data Identification ID that is collected into as parameter, and it, which act as collecting one, gets data ready, and Addlog methods are adjusted
With rear, compared by traveling through N number of default mark ID in foregoing logData variables with the Data Identification ID
Compared with so as to judge whether the default mark ID of target matched with the Data Identification ID.
If the default mark ID of the target matched with the Data Identification ID in the configuration file be present, described in acquisition
Target property information corresponding to the default mark ID of target.
Specifically, obtaining the method for the target property information can be:It is corresponding to obtain the default mark ID of the target
Target property information, and the target property information is entered as variable Singledata.I.e. by traveling through logData variables
After finding the default mark ID of target of matching, the target category collected is needed according to corresponding to being found the default mark ID of the target
Property information, and it is entered as variable Singledata.It is for instance possible to use following codes realize traversal logData variables and
It is entered as variable Singledata:
Then, the Data Identification ID and the target property information are uploaded to Platform Server, is specifically as follows:Upload
The Singledata variables are to Platform Server.
In the application implementation process simultaneously, it is contemplated that it is possible that flash player is given under some business scene
Platform Server reports mass data, and such case can cause flash player or Resource Server and Platform Server network
The peak value of communication, increase bandwidth cost, while some timing node receives a large amount of flash broadcastings suddenly in Platform Server
After device data, easily lifted if service logic the CPU consumption of Platform Server.Therefore the application is set first according to data
Real-time property, to determine whether to upload data immediately, the data that need not be uploaded immediately are held by the data of Resource Server
Device is postponed uploading, and so as to reduce the CPU of Platform Server consumption and avoid network blockage, details are as follows:
Step S102 is performed, according to the target property information, judges whether the behavioral data needs to upload immediately.
, can first root when including the description of real-time property in the target property information in specific implementation process
According to the target property information, judge whether the behavioral data needs to upload immediately.
If the behavioral data needs to upload immediately, perform step S103, directly upload the Data Identification ID and
The target property information is to Platform Server;
If the behavioral data need not upload immediately, step S104 is performed, by the Data Identification ID and described
Target property information is added to data capsule;
Specifically, because the behavioral data of some business scenarios is effective property, needs in time believe data
Breath is uploaded for analyzing and processing, that is, needs to judge whether the target property information (such as Singledata variables) is to belong in real time
Property, to judge whether being to need to upload this behavioral data obtained in time.
For example, istimely is the real-time property code configured in behavior data file, when behavior data are desirable
When uploading in time, istimely 1, otherwise istimely is 0, and such later maintenance only needs to change configuration file
Istimely value can changes its actual effect attribute.It is of course also possible to other codes are set to characterize real-time property, herein not
It is restricted.
Assuming that using design variables bolan to characterize whether need the variable that uploads immediately, it is corresponding to pass through:Bolan
=Singledata.istimely>0true:Flase order judges real-time property, and when istimely is 1, characterizing needs
Immediately to upload, the command execution results are true;When istimely is 0, sign need not upload immediately, the order
Implementing result is flase;Wherein, the numerical value of the istimely is the objective attribute target attribute for being set in advance in the configuration file
In information.
A http request is directly transmitted when Bolan is true and uploads the Data Identification ID and objective attribute target attribute letter
Cease (Singledata variables), otherwise the Data Identification ID and the target property information (Singledata variables) are added
Into data capsule LogList.
Further, Resource Server and Platform Server caused by being uploaded in order to avoid the concentration of information in data capsule
Block, and further avoid Platform Server cpu spike exorbitant expenditure, the application is also set up:
Step S105, judges whether the information content in the data capsule is more than M;Judge nearest away from the data capsule
Whether the duration of upload information is more than T;M is positive integer, and T is positive number;
Step S106, if the information content in the data capsule is more than M, or, it is the last away from the data capsule
The duration of upload information is more than T, then uploads the information in the data capsule to the Platform Server, and empty the data
Container.
Specifically, judge whether the method more than M is the information content in the data capsule:In operation before
Program can be toward storage Singledata variable datas in data capsule LogList, if processing can cause in LogList not in time
Unlimited increase is deposited so setting LogList maximum lengths as N (for example, N is equal to 20), when LogList length is more than N,
Data are sent and emptied one by one in LogList, to avoid internal memory from overflowing.Assuming that variable needSeed characterizes LogList length
Whether degree exceeds, then passes through needSeed=LogList.lenght>Ntrue:False can be judged, work as needSeed
For data in LogList are sent and emptied one by one during true.
Just corresponding data object in LogList is cleared up for example, can set and often upload a Singledata variable
Fall, the specific method of upload can be characterized in program setting sendData methods, the parameter of this method is wall scroll behavioral data pair
As specific code is:
Using While functions when LogList.lenght is more than 0, the logic performed in braces can be circulated, _ data takes
First element of LogList was obtained, sendData methods is recalled and is uploaded to Platform Server, LogList.shit () function
First element of LogList can be deleted, such LogList.lenght can reduce 1.
In specific implementation process, whether the duration of the judgement away from data capsule the last time upload information is more than
T, realized by the reported data timer initialized before.Specifically, the reported data timer can be kept away
The behavioral data not uploaded for exempting to accumulate in the data capsule is excessive.Assuming that the timer is Delaytimer.It is triggered
Time be the T seconds (such as 120 seconds), then Delaytimer=new Timer (120*1000,0), when initializing Delaytimer
It is 0 to set second parameter, can thus allow Delaytimer infinitely to respond.It can be held when timer triggers every time simultaneously
Row uploads and emptied the data in the data capsule.
Specifically, by setting in data capsule information content and away from data capsule the last time upload information
Both judgment rules of duration are combined, and carry out the upload of non-promptness data message in processing data container, can effectively avoid counting
The blocking of Resource Server and Platform Server caused by being uploaded according to the concentration of information in container, and further avoid platform service
Device cpu spike exorbitant expenditure.
In addition, if the default mark ID of the target matched with the Data Identification ID is not present in the configuration file, then
Refusal uploads the Data Identification ID.Avoid uploading unessential data, reduce the complexity of follow-up data management.
Specifically, data maintenance difficulty is collected in order to solve flash under a large number of services scene, when collecting behavioral data
The logic that one section of collection data is inserted in each conventional service node is not used, but collection number is added by configuration file
Go to collect behavioral data according to the scheme of manager, i.e., each default mark ID that need to upload data is first finished writing in configuration file
And corresponding attribute information, read and matched somebody with somebody according to the Data Identification ID of the behavioral data of acquisition by collection data management system
Put corresponding target property information in file, and data numerous and diverse and zero are uploaded to reduce by uploading the target property information
Broken degree, is easy to later maintenance, because flash applications only safeguard mark ID, it is necessary to only need to repair when changing user behavior data
Change the configuration file, effectively improve follow-up management and modification efficiency.
Further, first judge whether behavioral data is the behavioral data (having real-time) for needing to upload in time, if
Behavioral data with real-time is uploaded to Platform Server at once, otherwise performs non-promptness scheme:To not needing on immediately
The property file of biography is first put into data capsule LogList unified storage, and wait uploads to Platform Server.If behavioral data
Number of containers all uploads data in behavioral data container and behavioral data container is emptied again more than N bars, sets simultaneously
Timer is put all to upload data in behavioral data container per T durations and empty behavioral data container.On both
Pass rule be combined to handle non-promptness data, can avoid the occurrence of upload peak value it is too high, network congestion, Platform Server
CPU exorbitant expenditures.
Based on same inventive concept, this application provides device corresponding to embodiment one, detailed in Example two.
Embodiment two
As shown in Fig. 2 this implementation provides a kind of Resource Server, including:
Acquiring unit 201, for from the configuration file to prestore, obtaining the data in the behavioral data uploaded with client
Identify the default mark ID of target of ID matchings, and target property information corresponding with the default mark ID;
First judging unit 202, for according to the target property information, judging whether the behavioral data needs immediately
Upload;
Uploading unit 203, if needing to upload immediately for the behavioral data, directly upload the Data Identification ID
With the target property information to Platform Server;
Adding device 204, if need not be uploaded immediately for the behavioral data, by the Data Identification ID and institute
State target property information and be added to data capsule;
Second judging unit 205, for judging whether the information content in the data capsule is more than M;Judge away from described
Whether the duration of data capsule the last time upload information is more than T;
Unit 206 is emptied, if it is more than M for the information content in the data capsule, or, away from the data capsule most
The duration of a nearly upload information is more than T, then uploads the information in the data capsule to the Platform Server, and empty institute
State data capsule.
By the Resource Server that the present embodiment is introduced is a kind of upload of behavioral data in implementation the embodiment of the present application
Equipment used by method, so based on the method described in the embodiment of the present application one, those skilled in the art can
The embodiment and its various change form of the Resource Server of the present embodiment are understood, so being taken herein for the resource
How business device realizes that the method in the embodiment of the present application is no longer discussed in detail.As long as those skilled in the art implement the application
Equipment used by method in embodiment, belong to the scope to be protected of the application.
Based on same inventive concept, this application provides Resource Server corresponding to embodiment one, detailed in Example three.
Embodiment three
As shown in figure 3, this implementation provides a kind of Resource Server, including memory 310, processor 320 and it is stored in
On memory 320 and the computer program 311 that can run on the processor 320, when processor 320 performs computer program 311
Realize following steps:
From the configuration file to prestore, the target that the Data Identification ID in the behavioral data uploaded with client is matched is obtained
Default mark ID, and target property information corresponding with the default mark ID;
According to the target property information, judge whether the behavioral data needs to upload immediately;
If the behavioral data needs to upload immediately, the Data Identification ID and objective attribute target attribute letter are directly uploaded
Cease to Platform Server;
If the behavioral data need not upload immediately, the Data Identification ID and the target property information are added
Add to data capsule;
Judge whether the information content in the data capsule is more than M;Judge away from the last upload of the data capsule
Whether the duration of information is more than T;M is positive integer, and T is positive number;
If the information content in the data capsule is more than M, or, away from data capsule the last time upload information
Duration is more than T, then uploads the information in the data capsule to the Platform Server, and empty the data capsule.
In specific implementation process, when processor 320 performs computer program 311, it is possible to achieve any in embodiment one
Embodiment.
By the Resource Server that the present embodiment is introduced is a kind of upload of behavioral data in implementation the embodiment of the present application
Equipment used by method, so based on the method described in the embodiment of the present application one, those skilled in the art can
The embodiment and its various change form of the Resource Server of the present embodiment are understood, so being taken herein for the resource
How business device realizes that the method in the embodiment of the present application is no longer discussed in detail.As long as those skilled in the art implement the application
Equipment used by method in embodiment, belong to the scope to be protected of the application.
Based on same inventive concept, this application provides storage medium corresponding to embodiment one, detailed in Example four.
Example IV
As shown in figure 4, this implementation provides a kind of computer-readable recording medium 400, computer program is stored thereon with
411, the computer program 411 realizes following steps when being executed by processor:
From the configuration file to prestore, the target that the Data Identification ID in the behavioral data uploaded with client is matched is obtained
Default mark ID, and target property information corresponding with the default mark ID;
According to the target property information, judge whether the behavioral data needs to upload immediately;
If the behavioral data needs to upload immediately, the Data Identification ID and objective attribute target attribute letter are directly uploaded
Cease to Platform Server;
If the behavioral data need not upload immediately, the Data Identification ID and the target property information are added
Add to data capsule;
Judge whether the information content in the data capsule is more than M;Judge away from the last upload of the data capsule
Whether the duration of information is more than T;M is positive integer, and T is positive number;
If the information content in the data capsule is more than M, or, away from data capsule the last time upload information
Duration is more than T, then uploads the information in the data capsule to the Platform Server, and empty the data capsule.
In specific implementation process, when the computer program 411 is executed by processor, it is possible to achieve any in embodiment one
Embodiment.
It should be understood by those skilled in the art that, embodiments of the invention can be provided as method, system or computer program
Product.Therefore, the present invention can use the reality in terms of complete hardware embodiment, complete software embodiment or combination software and hardware
Apply the form of example.Moreover, the present invention can use the computer for wherein including computer usable program code in one or more
The computer program production that usable storage medium is implemented on (including but is not limited to magnetic disk storage, CD-ROM, optical memory etc.)
The form of product.
The present invention is the flow with reference to method according to embodiments of the present invention, equipment (system) and computer program product
Figure and/or block diagram describe.It should be understood that can be by every first-class in computer program instructions implementation process figure and/or block diagram
Journey and/or the flow in square frame and flow chart and/or block diagram and/or the combination of square frame.These computer programs can be provided
The processors of all-purpose computer, special-purpose computer, Embedded Processor or other programmable data processing devices is instructed to produce
A raw machine so that produced by the instruction of computer or the computing device of other programmable data processing devices for real
The device for the function of being specified in present one flow of flow chart or one square frame of multiple flows and/or block diagram or multiple square frames.
These computer program instructions, which may be alternatively stored in, can guide computer or other programmable data processing devices with spy
Determine in the computer-readable memory that mode works so that the instruction being stored in the computer-readable memory, which produces, to be included referring to
Make the manufacture of device, the command device realize in one flow of flow chart or multiple flows and/or one square frame of block diagram or
The function of being specified in multiple square frames.
These computer program instructions can be also loaded into computer or other programmable data processing devices so that counted
Series of operation steps is performed on calculation machine or other programmable devices to produce computer implemented processing, so as in computer or
The instruction performed on other programmable devices is provided for realizing in one flow of flow chart or multiple flows and/or block diagram one
The step of function of being specified in individual square frame or multiple square frames.
Although preferred embodiments of the present invention have been described, but those skilled in the art once know basic creation
Property concept, then can make other change and modification to these embodiments.So appended claims be intended to be construed to include it is excellent
Select embodiment and fall into having altered and changing for the scope of the invention.
Obviously, those skilled in the art can carry out the essence of various changes and modification without departing from the present invention to the present invention
God and scope.So, if these modifications and variations of the present invention belong to the scope of the claims in the present invention and its equivalent technologies
Within, then the present invention is also intended to comprising including these changes and modification.
Claims (10)
- A kind of 1. method for uploading of behavioral data, applied in Resource Server, it is characterised in that including:From the configuration file to prestore, obtain the target that the Data Identification ID in the behavioral data uploaded with client is matched and preset Identify ID, and target property information corresponding with the default mark ID;According to the target property information, judge whether the behavioral data needs to upload immediately;If the behavioral data needs to upload immediately, the Data Identification ID and the target property information are directly uploaded extremely Platform Server;If the behavioral data need not upload immediately, the Data Identification ID and the target property information are added to Data capsule;Judge whether the information content in the data capsule is more than M;Judge away from data capsule the last time upload information Duration whether be more than T;M is positive integer, and T is positive number;If the information content in the data capsule is more than M, or, the duration away from data capsule the last time upload information More than T, then the information in the data capsule is uploaded to the Platform Server, and empty the data capsule.
- 2. the method as described in claim 1, it is characterised in that the data in the behavioral data that the acquisition uploads with client Identify the default mark ID of target of ID matchings, and target property information corresponding with the default mark ID, including:The behavioral data that client is sent is received, the behavioral data includes the Data Identification ID;In the N number of default mark ID for judging the configuration file, if the target matched with the Data Identification ID be present Default mark ID;Wherein, also it is preset with the configuration file in N number of default mark ID corresponding to each default mark ID Attribute information;N is positive integer;If the default mark ID of the target matched with the Data Identification ID in the configuration file be present, the target is obtained The target property information corresponding to default mark ID.
- 3. method as claimed in claim 2, it is characterised in that in the N number of default mark ID for judging configuration file, if After the default mark ID of the target matched with the Data Identification ID, in addition to:If the default mark ID of the target matched with the Data Identification ID is not present in the configuration file, refusal uploads institute State Data Identification ID.
- 4. method as claimed in claim 2, it is characterised in thatBefore the behavioral data for receiving client and sending, in addition to:The configuration file is loaded using the object of the loader classes of system level;Trigger loadComplete methods, first institute State configuration file and be converted into JSON data, then deposit the JSON data into logData variables;In the N number of default mark ID for judging configuration file, if exist and preset with the Data Identification ID targets matched ID is identified, including:Call Addlog methods, by travel through N number of default mark ID in logData variables come with the Data Identification ID It is compared, so as to judge whether the default mark ID of target matched with the Data Identification ID;Target property information corresponding to the default mark ID of the acquisition target, including:Target property information corresponding to the default mark ID of the target is obtained, and the target property information is entered as variable Singledata。
- 5. the method as described in claim 1, it is characterised in that the data in the behavioral data that the acquisition uploads with client Before the default mark ID of target for identifying ID matchings, in addition to:Load and parse the configuration file;Initialize reported data timer;The reported data timer is used to judge away from data capsule the last time upload information Duration whether be more than T;Data management system is collected in initialization;The data management system is used for the behavioral data for receiving client transmission.
- 6. method as claimed in claim 5, it is characterised in that it is described to load and parse the configuration file, including:The configuration file is loaded using the object of the loader classes of system level;LoadComplete methods are triggered, first the configuration file is converted into JSON data, then deposits the JSON data and arrives In logData variables.
- 7. the method as described in claim 1, it is characterised in that it is described according to the target property information, judge the behavior Whether data need to upload immediately, including:Using design variables bolan as the variable for whether needing to upload immediately is characterized, pass through Bolan= Singledata.istimely>0true:Flase order judges whether the behavioral data needs to upload immediately;When istimely is 1, characterizing needs to upload immediately, and the command execution results are true;When istimely is 0, sign need not upload immediately, and the command execution results are flase;Wherein, the numerical value of the istimely is to be set in advance in the target property information of the configuration file.
- A kind of 8. Resource Server, it is characterised in that including:Acquiring unit, for from the configuration file to prestore, obtaining the Data Identification ID in the behavioral data uploaded with client The default mark ID of the target of matching, and target property information corresponding with the default mark ID;First judging unit, for according to the target property information, judging whether the behavioral data needs to upload immediately;Uploading unit, if needing to upload immediately for the behavioral data, directly upload the Data Identification ID and described Target property information is to Platform Server;Adding device, if need not be uploaded immediately for the behavioral data, by the Data Identification ID and the target Attribute information is added to data capsule;Second judging unit, for judging whether the information content in the data capsule is more than M;Judge away from the data capsule Whether the duration of the last upload information is more than T;Unit is emptied, if it is more than M for the information content in the data capsule, or, it is the last away from the data capsule The duration of upload information is more than T, then uploads the information in the data capsule to the Platform Server, and empty the data Container.
- 9. a kind of Resource Server, including memory, processor and storage are on a memory and the meter that can run on a processor Calculation machine program, it is characterised in that realize following steps during the computing device described program:From the configuration file to prestore, obtain the target that the Data Identification ID in the behavioral data uploaded with client is matched and preset Identify ID, and target property information corresponding with the default mark ID;According to the target property information, judge whether the behavioral data needs to upload immediately;If the behavioral data needs to upload immediately, the Data Identification ID and the target property information are directly uploaded extremely Platform Server;If the behavioral data need not upload immediately, the Data Identification ID and the target property information are added to Data capsule;Judge whether the information content in the data capsule is more than M;Judge away from data capsule the last time upload information Duration whether be more than T;If the information content in the data capsule is more than M, or, the duration away from data capsule the last time upload information More than T, then the information in the data capsule is uploaded to the Platform Server, and empty the data capsule.
- 10. a kind of computer-readable recording medium, is stored thereon with computer program, it is characterised in that the program is by processor Following steps are realized during execution:From the configuration file to prestore, obtain the target that the Data Identification ID in the behavioral data uploaded with client is matched and preset Identify ID, and target property information corresponding with the default mark ID;According to the target property information, judge whether the behavioral data needs to upload immediately;If the behavioral data needs to upload immediately, the Data Identification ID and the target property information are directly uploaded extremely Platform Server;If the behavioral data need not upload immediately, the Data Identification ID and the target property information are added to Data capsule;Judge whether the information content in the data capsule is more than M;Judge away from data capsule the last time upload information Duration whether be more than T;If the information content in the data capsule is more than M, or, the duration away from data capsule the last time upload information More than T, then the information in the data capsule is uploaded to the Platform Server, and empty the data capsule.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710506118.5A CN107483532B (en) | 2017-06-28 | 2017-06-28 | Behavior data uploading method, resource server and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710506118.5A CN107483532B (en) | 2017-06-28 | 2017-06-28 | Behavior data uploading method, resource server and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN107483532A true CN107483532A (en) | 2017-12-15 |
CN107483532B CN107483532B (en) | 2020-05-08 |
Family
ID=60594878
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710506118.5A Active CN107483532B (en) | 2017-06-28 | 2017-06-28 | Behavior data uploading method, resource server and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107483532B (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108377270A (en) * | 2018-03-21 | 2018-08-07 | 耘申信息科技(上海)有限公司 | A kind of equipment uses the reporting management method and system of data |
Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101534415A (en) * | 2009-04-23 | 2009-09-16 | 天柏宽带网络科技(北京)有限公司 | Method and system for transmitting file in real time |
CN102480481A (en) * | 2010-11-26 | 2012-05-30 | 腾讯科技(深圳)有限公司 | Method and device for improving security of product user data |
CN102984244A (en) * | 2012-11-21 | 2013-03-20 | 用友软件股份有限公司 | Uploading system and uploading method of bill data |
CN103166827A (en) * | 2011-12-09 | 2013-06-19 | 北京神州泰岳软件股份有限公司 | Method and system for user behavior data reporting |
CN104539739A (en) * | 2015-01-26 | 2015-04-22 | 浙江大学 | System, method and device for uploading files |
WO2015196711A1 (en) * | 2014-06-24 | 2015-12-30 | 深圳市志友企业发展促进中心 | Method, device and system for tracking resource transmission |
CN105610915A (en) * | 2015-12-15 | 2016-05-25 | 深圳市慧动创想科技有限公司 | Data reporting method and system |
CN105933368A (en) * | 2015-12-24 | 2016-09-07 | 中国银联股份有限公司 | User behavior data uploading method and device |
CN106790380A (en) * | 2016-11-21 | 2017-05-31 | 广州华多网络科技有限公司 | Data reporting method and device |
CN106878397A (en) * | 2017-01-21 | 2017-06-20 | 浙江沛宏网络科技有限公司 | A kind of WEB user behaviors feedback method and system |
-
2017
- 2017-06-28 CN CN201710506118.5A patent/CN107483532B/en active Active
Patent Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101534415A (en) * | 2009-04-23 | 2009-09-16 | 天柏宽带网络科技(北京)有限公司 | Method and system for transmitting file in real time |
CN102480481A (en) * | 2010-11-26 | 2012-05-30 | 腾讯科技(深圳)有限公司 | Method and device for improving security of product user data |
CN103166827A (en) * | 2011-12-09 | 2013-06-19 | 北京神州泰岳软件股份有限公司 | Method and system for user behavior data reporting |
CN102984244A (en) * | 2012-11-21 | 2013-03-20 | 用友软件股份有限公司 | Uploading system and uploading method of bill data |
WO2015196711A1 (en) * | 2014-06-24 | 2015-12-30 | 深圳市志友企业发展促进中心 | Method, device and system for tracking resource transmission |
CN104539739A (en) * | 2015-01-26 | 2015-04-22 | 浙江大学 | System, method and device for uploading files |
CN105610915A (en) * | 2015-12-15 | 2016-05-25 | 深圳市慧动创想科技有限公司 | Data reporting method and system |
CN105933368A (en) * | 2015-12-24 | 2016-09-07 | 中国银联股份有限公司 | User behavior data uploading method and device |
CN106790380A (en) * | 2016-11-21 | 2017-05-31 | 广州华多网络科技有限公司 | Data reporting method and device |
CN106878397A (en) * | 2017-01-21 | 2017-06-20 | 浙江沛宏网络科技有限公司 | A kind of WEB user behaviors feedback method and system |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108377270A (en) * | 2018-03-21 | 2018-08-07 | 耘申信息科技(上海)有限公司 | A kind of equipment uses the reporting management method and system of data |
CN108377270B (en) * | 2018-03-21 | 2021-02-26 | 耘申信息科技(上海)有限公司 | Method and system for reporting and managing equipment use data |
Also Published As
Publication number | Publication date |
---|---|
CN107483532B (en) | 2020-05-08 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP6878450B2 (en) | Methods and devices to prevent advertising fraud and storage media | |
CN107231264A (en) | For the method and apparatus for the capacity for managing Cloud Server | |
WO2018103590A1 (en) | Method, device, and system for assigning pickup tasks | |
CN109885399A (en) | Data processing method, electronic device, computer equipment and storage medium | |
CN111478857B (en) | Interface current limiting control method and device and electronic equipment | |
CN107403334A (en) | Data processing method and device | |
CN111126928B (en) | Method and device for auditing release content | |
CN112486788B (en) | Workload assessment method, workload assessment device, electronic equipment and readable storage medium | |
CN106685894B (en) | Risk identification method, device and system | |
CN107026900A (en) | One kind shoots method for allocating tasks and device | |
CN111585798B (en) | Network resource parameter configuration method, device and computer readable storage medium | |
CN109857650A (en) | A kind of game performance monitor method and system | |
CN108268357A (en) | real-time data processing method and device | |
CN111984733A (en) | Data transmission method and device based on block chain and storage medium | |
CN109460930B (en) | Method for determining risk account and related equipment | |
CN107493315A (en) | A kind of collection method of behavioral data, Resource Server and storage medium | |
CN108632358B (en) | Token management method and device based on WIFI sharing | |
CN107292659A (en) | Health service topsis system and method based on concern amount and consumption number of times | |
CN107483532A (en) | A kind of method for uploading of behavioral data, Resource Server and storage medium | |
CN106570060A (en) | Data random extraction method and apparatus in information flow | |
CN110389885A (en) | High frequency transaction monitoring method and device | |
CN109120955A (en) | A kind of recommended method and relevant device of direct broadcasting room | |
CN109218766B (en) | Method for summoning bean vermicelli, live broadcast platform server and anchor terminal | |
CN107281754B (en) | A kind of application identities matching process and its equipment, storage medium, server | |
TWI777106B (en) | Method, device, network device and computer-readable storage medium for determining preferential amount |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
TR01 | Transfer of patent right | ||
TR01 | Transfer of patent right |
Effective date of registration: 20230718 Address after: 332000 Room 201, Building 1, next to Sanli Primary School, Sanli Village, Baishuihu Street, Xunyang District, Jiujiang City, Jiangxi Province Patentee after: Jiangxi Minghang Information Technology Co.,Ltd. Address before: 430000 East Lake Development Zone, Wuhan City, Hubei Province, No. 1 Software Park East Road 4.1 Phase B1 Building 11 Building Patentee before: WUHAN DOUYU NETWORK TECHNOLOGY Co.,Ltd. |