Invention content
Technical problem to be solved of the embodiment of the present invention is, a kind of information customization method and system is provided, with enhancing
System stability, and improve information customization treatment effeciency.
In order to solve the above-mentioned technical problem, an embodiment of the present invention provides a kind of information customization methods, including:
Plan as a whole central server and receive the customized request for target information that client is sent, which includes
User identifier, target information mark and information customization amount;
The central server of planning as a whole judges the target information mark stored in the pool central server memory
Whether corresponding first information residue total amount is less than the customized amount of described information;If it is not, the customized request is sent to multiple letters
Cease the target information subscription services server in subscription services server;
What the target information subscription services server judged to store in the target information subscription services server memory
The target information identifies whether corresponding information quota surplus is less than the customized amount of described information, if it is not, matching from described information
The customized amount of described information is deducted in volume surplus;
The target information subscription services server is to the customized success response of the pool central server return information;
The pool central server identifies in corresponding first information residue total amount from the target information described in deduction
Information customization amount, and return to customized success response to client.
Wherein, the target information subscription services server judges to deposit in the target information subscription services server memory
The target information of storage identifies whether corresponding information quota surplus is less than after the customized amount of described information, further includes:
If being less than, the target information subscription services server judges that the corresponding customized mark of the target information mark is
No is customized end;
If customized end, the target information subscription services server is ordered to the pool central server return information
Failure response processed, so that the pool central server is to the customized failure response of client return information;
Otherwise, the target information subscription services server sends relocation request to the pool central server;
The pool central server receives the relocation request, judges to store in the pool central server memory
The corresponding second remaining total amount of target information mark whether be 0;
If not 0, the pool central server is according to the described second remaining total amount and information customization service server
Quantity again be the target information subscription services server distribute information quota;
The target information subscription services server rings the customized request according to the information quota of sub-distribution again
It answers;
If 0, the pool central server, which returns to reallocate to the target information subscription services server, unsuccessfully to be rung
It answers;
The target information subscription services server receives the reallocation failure response, by target information mark pair
The customized mark answered is set as customized end, and to the customized failure response of the pool central server return information, so that institute
It states and plans as a whole central server to the customized failure response of client return information.
Wherein, after the pool central server receives the customized request for target information that client is sent,
And the judgement target information stored in central server memory of planning as a whole identifies corresponding first information residue
Whether total amount is less than before the customized amount of described information, further includes:
First quantity of the customized request for planning as a whole to receive in the central server statistical unit time;
The pool central server judges whether first quantity is more than to be deposited in the pool central server memory
The unit interval Information subscription request amount first threshold of storage;
If being more than, the pool central server is to the customized failure response of client return information;
Otherwise, the pool central server execute it is described judge to store in the pool central server memory it is described
Target information identifies the step of whether corresponding first information residue total amount is less than described information customized amount.
Wherein, after the pool central server receives the customized request for target information that client is sent,
And the central server of planning as a whole judges that the target information mark stored in the pool central server memory corresponds to
First information residue total amount whether be less than the customized amount of described information before, further include:
The corresponding customized request of the user identifier for planning as a whole to receive in the central server statistical unit time
Third quantity;
The pool central server judges whether the third quantity is more than to be stored in the pool central server memory
The customized request amount third threshold value of every Subscriber Unit temporal information;
If being more than, the pool central server is to the customized failure response of client return information;
Otherwise, the pool central server execute it is described judge to store in the pool central server memory it is described
Target information identifies the step of whether corresponding first information residue total amount is less than described information customized amount.
Wherein, it is customized to deduct described information from described information quota surplus for the target information subscription services server
After amount, further include:
The target information subscription services server sends information customization success response to database server, so that described
The target information that database server is stored from itself identifies in corresponding third remnant information total amount and deducts described information
Customized amount identifies corresponding updated third Informational redundancies to obtain the target information;
The target information subscription services server obtains described updated stored in the database server
Three remnant information total amounts, and the updated third remnant information total amount is sent to the pool central server;
The target information mark pair planned as a whole central server and will stored in the pool central server memory
The first information residue total amount answered is updated to the updated third Informational redundancies.
The embodiment of the present invention additionally provides a kind of information customization system, including plans as a whole central server and multiple information
Subscription services server;Wherein:
Plan as a whole central server, the customized request for target information for receiving client transmission, the customized request
Include user identifier, target information mark and information customization amount;
The pool central server is additionally operable to the target letter for judging to store in the pool central server memory
Breath identifies whether corresponding first information residue total amount is less than the customized amount of described information;If it is not, the customized request is sent to
Target information subscription services server in multiple information customization service servers;
Described information subscription services server, for when as target information subscription services server, judging the mesh
The target information stored in mark information customization service server memory identifies whether corresponding information quota surplus is less than
The customized amount of described information, if it is not, deducting the customized amount of described information from described information quota surplus;
Described information subscription services server is additionally operable to when as target information subscription services server, to the system
Raise the customized success response of central server return information;
The pool central server is additionally operable to identify in corresponding first information residue total amount from the target information and detain
Customized success response is returned except the customized amount of described information, and to client.
Wherein, described information subscription services server is additionally operable to work as target information subscription services server, and judges
It is small that the target information stored in the target information subscription services server memory identifies corresponding information quota surplus
When described information customized amount, judges that target information mark is corresponding and customized identify whether as customized end;If customized
Terminate, to the customized failure response of the pool central server return information, so that the pool central server is to the visitor
The customized failure response of family end return information;Otherwise, relocation request is sent to the pool central server;
The pool central server is additionally operable to the target letter for judging to store in the pool central server memory
Whether the corresponding second remaining total amount of breath mark is 0;If not 0, according to the described second remaining total amount and information customization business
The quantity of server is that the target information subscription services server distributes information quota again;If 0, to the target information
Subscription services server returns to reallocation failure response;
Described information subscription services server, when being additionally operable to as target information subscription services server, according to dividing again
The information quota matched responds the customized request;Or, the reallocation failure response is received, by the target information mark
Know corresponding customized mark and be set as customized end, and to the customized failure response of the pool central server return information, with
Make the pool central server to the customized failure response of client return information.
Wherein, the pool central server is additionally operable to receive asking for the customized of target information for client transmission
After asking, the first quantity of the customized request received in the statistical unit time;
The pool central server is additionally operable to judge whether first quantity is more than in the pool central server
Deposit the unit interval Information subscription request amount first threshold of middle storage;If being more than, to the customized failure of client return information
Response;Otherwise, corresponding first letter of the target information mark for judging to be stored in the pool central server memory is executed
Whether the remaining total amount of breath is less than the step of described information customized amount.
Wherein, the pool central server is additionally operable to receive asking for the customized of target information for client transmission
After asking, the third quantity of the corresponding customized request of the user identifier received in the statistical unit time;
The pool central server is additionally operable to judge whether the third quantity is more than the pool central server memory
The customized request amount third threshold value of every Subscriber Unit temporal information of middle storage;It is customized to the client return information if being more than
Failure response;Otherwise, the target information mark correspondence for judging to store in the pool central server memory is executed
First information residue total amount the step of whether being less than described information customized amount.
Wherein, described information subscription services server, when being additionally operable to as target information subscription services server, from described
After deducting the customized amount of described information in information quota surplus, information customization success response is sent to database server, with
So that the target information that the database server is stored from itself is identified in corresponding third remnant information total amount and deducts institute
Information customization amount is stated, corresponding updated third Informational redundancies are identified to obtain the target information;
Described information subscription services server obtains the number when being additionally operable to as target information subscription services server
According to the updated third remnant information total amount stored in the server of library, and the updated third remnant information is total
Amount is sent to the pool central server;
The pool central server is additionally operable to the target information that will be stored in the pool central server memory
It identifies corresponding first information residue total amount and is updated to the updated third Informational redundancies.
Implement the embodiment of the present invention, has the advantages that:
When pool central server receives the request customized for target information of client transmission, which includes
User identifier, target information mark and information customization amount, plan as a whole central server and may determine that in the pool central server
The target information for depositing middle storage identifies whether corresponding first information residue total amount is less than the information customization amount, if it is not, this is ordered
System request is sent to the target information subscription services server in multiple information customization service servers;Target information subscription services
Server may determine that the target information stored in the target information subscription services server memory identifies corresponding information quota
Whether surplus is less than information customization amount, if it is not, deduct the information customization amount from information quota surplus, and to planning as a whole center
The customized success response of server returns information, so that plan as a whole central server identifies corresponding first information residue from target information
The information customization amount is deducted in total amount, and returns to customized success response to client, on the one hand, by disposing multiple information customizations
Service server realizes load balancing, enhances system stability, on the other hand, plans as a whole central server and information is ordered
Service server processed according in memory by that in memory, when receiving Information subscription request, can add relevant configuration load
The information of load is responded, and information customization treatment effeciency is improved.
Specific implementation mode
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete
Site preparation describes, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.It is based on
Embodiment in the present invention, those of ordinary skill in the art are obtained every other without creative efforts
Embodiment shall fall within the protection scope of the present invention.
In order to be best understood from a kind of information customization method provided in an embodiment of the present invention and system, below first to of the invention real
The applicable network architecture of example is applied to be described.Referring to Fig. 1, Fig. 1 is a kind of net of information customization provided in an embodiment of the present invention
Network framework schematic diagram.As shown in Figure 1, the network architecture schematic diagram may include client, plan as a whole central server, multiple information
Subscription services server and database server.Wherein, client with plan as a whole central server, plan as a whole central server with
It can be carried out by internet between information customization service server and information customization service server and database server
Communication connection.In the network architecture shown in Fig. 1, database server can be used for storing the relevant configuration letter of information customization
Breath such as message identification, information content, information customization starting and end time, plans as a whole central server unit interval information
Customized request amount threshold value, information customization service server unit interval Information subscription request amount threshold value are believed per the Subscriber Unit time
Cease customized request amount threshold value etc.;Plan as a whole central server receive client transmission for target information customized request when,
The customized request can be sent to the target information subscription services server in multiple information customization service servers, so as to
To realize load balancing, system stability is improved;In addition, pool central server and information customization service server are starting
When, the relevant configuration information stored in database server can be loaded into memory, for example, planning as a whole central server can be with
Load information mark, information content, pool central server unit interval information customization are asked in planning as a whole central server memory
The amount of asking threshold value, the customized request amount threshold value of every Subscriber Unit temporal information etc.;Information customization service server can be in information customization
Load information mark, information customization service server unit interval Information subscription request amount threshold value etc. in service server memory,
To plan as a whole central server and information customization service server need not be when receiving Information subscription request, every time
Relevant information is read from database server, and can directly be read from memory, and information customization treatment effeciency is improved.
In network architecture shown in FIG. 1, client includes but not limited to PC (Personal Computer, personal computer), mobile electricity
Words, removable computer, tablet computer, personal digital assistant (Personal Digital Assistant, PDA), media player,
The user equipmenies such as smart television, smartwatch, intelligent glasses, Intelligent bracelet.
Based on network architecture shown in FIG. 1, an embodiment of the present invention provides a kind of information customization method.As shown in Fig. 2,
For a kind of flow diagram of information customization method provided in an embodiment of the present invention, may comprise steps of:
S201, plan as a whole the customized request for target information that central server receives client transmission, the customized request
Include user identifier, target information mark and information customization amount.
In the embodiment of the present invention, after information customization starts, user can be sent out by client to central server is planned as a whole
Information subscription request is sent, to participate in information customization, wherein may include that user identifier (use by such as user account in the customized request
Family pet name etc.), target information mark (such as Item Number) and information customization amount.
For example, by taking information customization is mobile phone order as an example, after user logs in related application in the client, Ke Yitong
Client is crossed to subscription request of the central server transmission for mobile phone A is planned as a whole, may include that user logs in the subscription request
The user account (i.e. user identifier) of related application (such as Taobao, Jingdone district), corresponding goods number (the i.e. target information of mobile phone A
Mark), and order mobile phone A quantity (information customization amount).
S202, pool central server judge that the target information stored in the pool central server memory mark is corresponding
Whether first information residue total amount is less than information customization amount.If so, the customized failure response of return information;Otherwise, step is gone to
S203。
In the embodiment of the present invention, plan as a whole the customized request for target information that central server receives client transmission
Later, it can be identified according to the target information stored in the target information mark audit memory that the Information subscription request includes
Corresponding remnant information total amount (first information residue total amount), and judge whether the first information residue total amount is less than customized request
The information customization amount for including.Wherein, the initial value of the first information residue total amount is the mesh stored in database server
Mark the corresponding informational capacity of message identification.
If planning as a whole central server judges that the corresponding first information residue total amount of the target information stored in memory mark is small
It is insufficient for the customized demand of user information in the quantity of information customization amount, i.e. target information, planning as a whole central server can
With to the customized failure response of client return information.
Optionally, plan as a whole central server to after the customized failure response of client return information, it can also be in client
Middle output prompt message may include target information mark pair to prompt user information surplus insufficient, in the prompt message
The remnant information total amount answered.
If planning as a whole central server judges that the corresponding first information residue total amount of the target information stored in memory mark is big
In or equal to information customization amount, step S203~S206 can be executed.
S203, plan as a whole the target letter that the customized request is sent in multiple information customization service servers by central server
Cease subscription services server.
In the embodiment of the present invention, plans as a whole central server and judge corresponding first letter of the target information stored in memory mark
When the remaining total amount of breath is greater than or equal to information customization amount, multiple information can be sent to by the customized request by planning as a whole central server
Target information subscription services server in subscription services server.
Wherein, an information customization can be randomly choosed from multiple information customization service servers by planning as a whole central server
Service server is as target information subscription services server;It can be in sequence successively from more alternatively, planning as a whole central server
Select an information customization service server as target information subscription services server in a information customization service server,
Such as, when receiving customized request for the first time, it regard information customization service server 1 as target information subscription services server, again
When receiving customized request, it regard information customization service server 2 as target information subscription services server, and so on;Or
Person, target information subscription services server can be determined according to preset algorithm by planning as a whole central server.
In a kind of optional embodiment, plans as a whole central server and customized request is sent to multiple information customization business
Target information subscription services server in server may include:
Plan as a whole central server and hash (Hash) operation is carried out to user identifier, and the result of hash operations orders information
The quantity modulus of service server processed determines the corresponding multiple information customization service servers of customized request according to the modulus result
In target information subscription services server, and by this it is customized request be sent to the target information subscription services server.
S204, target information subscription services server judge the target stored in target information subscription services server memory
Whether the corresponding information quota surplus of message identification is less than information customization amount.If so, the customized failure response of return information;It is no
Then, step S205 is gone to.
In the embodiment of the present invention, after information customization service server starts, itself can be reported to central server is planned as a whole
Available mode, to, plan as a whole central server can according to the quantity and informational capacity of information customization service server,
It is determined as the information quota of each information customization service server distribution;Information customization service server can add the information quota
It is downloaded in information customization service server memory.
Preferably, when pool central server is that information customization service server distributes information quota, each information customization industry
The information quota of business server distribution can be more than average value.
As an example it is assumed that informational capacity is N, the quantity of information customization service server is M, then plans as a whole central server
Average value (i.e. N/M) can be more than for each information customization service server allocated quota, for example, it is each to plan as a whole central server
Information customization service server allocated quota can be 2N/M, it is thus possible to when some information customization service server accesses
When measuring larger, it can ensure information customization success response to a certain extent.
In the embodiment of the present invention, target information subscription services server receives customized the asking for planning as a whole central server forwarding
It after asking, can be identified according to the target information that the customized request includes, the target information mark stored in audit memory
Corresponding information quota surplus, and judge whether the information quota surplus is less than the information customization that customized request includes
Amount;Wherein, it is the target information subscription services service that the initial value of the information quota surplus, which is above-mentioned pool central server,
The information quota of device distribution.
In a kind of optional embodiment, if target information subscription services server judges target information, mark is corresponding
Information quota surplus is less than information customization amount, i.e. target information subscription services server determines that current quota surplus is insufficient
To meet the needs of user information is customized, then target information subscription services server can be to pool central server return information
Customized failure response, to which planning as a whole central server can be to the customized failure response of client return information.
In another optional embodiment, target information subscription services server judges that target information mark is corresponding
Information quota surplus is less than after information customization amount, may comprise steps of:
11), target information subscription services server judges that target information mark is corresponding and customized identifies whether as customized knot
Beam;If customized end, step 12) is executed;Otherwise, step 13)~step 18) is executed;
12), target information subscription services server is to the customized failure response of central server return information is planned as a whole, so that system
Central server is raised to the customized failure response of client return information;
13), target information subscription services server sends relocation request to central server is planned as a whole;
14), plan as a whole central server and receive the relocation request, judge the target for planning as a whole to store in central server memory
Whether the corresponding second remaining total amount of message identification is 0;If so, executing step 17)~step 18);Otherwise, step 15) is executed
~step 16);
15), plan as a whole central server is again according to the quantity of the second remaining total amount and information customization service server
The target information subscription services server distributes information quota;
16), target information subscription services server responds customized request according to allocated quota again;
17), plan as a whole central server and return to reallocation failure response to target information subscription services server;
18), target information subscription services server receives reallocation failure response, target information is identified corresponding customized
Mark is set as customized end, and to the customized failure response of central server return information is planned as a whole, so as to plan as a whole central server
To the customized failure response of client return information.
In this embodiment, information customization service server can store target information and identify corresponding order in memory
System mark, when this is customized be identified as it is customized at the end of, then show that remnant information total amount is 0, or have reached information customization knot
The beam time.
Correspondingly, target information subscription services server judges that information quota surplus is less than after information content, can sentence
The target information of breaking mark it is corresponding it is customized identify whether as customized end, if customized end, target information subscription services clothes
Being engaged in device can be to the customized failure response of central server return information be planned as a whole, so that plan as a whole central server returns to letter to client
Cease customized failure response.
If not for customized end, i.e., target information subscription services server judges the corresponding customized mark of target information mark
Target information subscription services server can determine that the remaining total amount of target information is not 0, to target information subscription services clothes
Being engaged in device can be to central server transmission relocation request be planned as a whole, and it is that the target information is ordered to plan as a whole central server again with request
Service server processed distributes information quota;Pool central server receives after relocation request, it can be determined that is deposited in memory
Whether the corresponding second remaining total amount of target information mark of storage is 0, if 0, is returned to target information subscription services server
Reallocation failure response is set as ordering so that target information is identified corresponding customized mark by target information subscription services server
System terminates, and to the customized failure response of central server return information is planned as a whole, is returned to client so as to plan as a whole central server
Information customization failure response;If not 0, corresponding second residue can be identified always according to target information by planning as a whole central server
Amount and the quantity of information customization service server are that the target information subscription services server distributes information quota again,
Specific implementation may refer to above-mentioned associated description;Target information subscription services server, which receives, plans as a whole central server again
After the information quota of sub-distribution, customized request can be responded according to the information quota of the sub-distribution again.
S205, target information subscription services server deduct the information customization amount from the information quota surplus, and to
Plan as a whole the customized success response of central server return information.
In the embodiment of the present invention, it is customized that target information subscription services server judges that information quota surplus is greater than or equal to
When the information customization amount that request includes, target information subscription services server can be deducted from the information quota surplus should
Information customization amount, and to plan as a whole the customized success response of central server return information.
For example, it is assumed that information quota surplus is 20, information customization amount is 5, then target information subscription services server can
To deduct the information customization amount from information quota surplus, i.e., information quota surplus is updated to 15 (20-5=by 20
15), and to plan as a whole the customized success response of central server return information.
S206, pool central server deduct the information from the corresponding first information residue total amount of target information mark and order
Amount processed, and return to customized success response to client.
In the embodiment of the present invention, the information that pool central server receives the return of target information subscription services server is ordered
After success response processed, it can be identified in corresponding first information residue total amount from target information and deduct corresponding information customization
Amount, and return to customized success response to client.
For example, it is assumed that it is 100 that target information, which identifies corresponding first information residue total amount, information customization amount is 5, then plans as a whole
Central server can identify in corresponding first information surplus from target information and deduct the information customization amount, i.e., believe target
Breath identifies corresponding first information surplus and is updated to 15 (20-5=15) by 20, and is ordered to central server return information is planned as a whole
Success response processed.
As an alternative embodiment, in above-mentioned steps S205, target information subscription services server is from the information
After deducting the information customization amount in quota surplus, it can also include the following steps:
21), target information subscription services server sends information customization success response to database server, so that data
Library server identifies in corresponding third remnant information total amount from the target information that itself is stored and deducts the information customization amount, with
Corresponding updated third Informational redundancies are identified to target information;
22), it is surplus to obtain the updated third information stored in database server for target information subscription services server
Remaining total amount, and the updated third remnant information total amount is sent to pool central server;
23) target information stored in central server memory mark corresponding first will be planned as a whole by, planning as a whole central server
Remnant information total amount is updated to updated third Informational redundancies.
In this embodiment, target information subscription services server judges that the information quota surplus stored in memory is big
In or be equal to information customization amount, and from information quota surplus deduct information customization amount after, can also be to database server
Information customization success response is sent, so that database server updates the target information and identifies corresponding remnant information total amount,
In, may include information customization amount, the target information mark that customized request includes in the information customization success response.
It, can after database server receives the information customization success response of target information subscription services server transmission
Deduction information in corresponding remnant information total amount (third remnant information total amount) is identified with the target information stored from itself to order
Amount processed identifies corresponding updated third Informational redundancies to obtain target information.Database server obtains updated
After third Informational redundancies, can the updated third Informational redundancies be actively sent to target information subscription services clothes
It is engaged in device, it can also be after inquiry (or obtain) request for receiving target information subscription services server, by updated the
Three remnant information total amounts are sent to target information subscription services server.
It, can be by the update after target information subscription services server gets updated third remnant information total amount
Third remnant information total amount afterwards is sent to pool central server, so that planning as a whole central server will plan as a whole in central server
The corresponding first information residue total amount of target information mark for depositing middle storage is updated to the updated third Informational redundancies,
So as to ensure that the target information for planning as a whole to store in central server memory identifies the newer of corresponding remnant information total amount
Accuracy is avoided since target information identifies corresponding remnant information total amount and changes that (such as information is ordered in database server
Initiator processed increases or decreases target information and identifies corresponding information content), and plan as a whole central server and fail to timely update to lead
The information customization failure of cause.
In the method flow described in Fig. 2, realizes load balancing by the way that multiple information customization service servers are arranged, carry
The high stability of information customization system;Meanwhile it is interior by being loaded into the configuration informations such as remnant information total amount, quota surplus
In depositing, without when receiving customized request every time, reading relevant configuration information from database server, improve
Information customization treatment effeciency.
Based on network architecture shown in FIG. 1, an embodiment of the present invention provides another information customization method.Such as Fig. 3 institutes
Show, for the flow diagram of another information customization method provided in an embodiment of the present invention, may comprise steps of:
S301, plan as a whole the customized request for target information that central server receives client transmission, the customized request
Include user identifier, target information mark and information customization amount.
S302, the first quantity for planning as a whole the customized request received in the central server statistical unit time, and judging should
Whether the first quantity is more than the unit interval Information subscription request amount first threshold for planning as a whole to store in central server memory.If
It is to go to step S303;Otherwise, the customized failure response of return information.
In the embodiment of the present invention, unit interval Information subscription request amount can also be loaded in memory by planning as a whole central server
Threshold value (first threshold).Correspondingly, when pool central server receives being asked for the customized of target information for client transmission
When asking, planning as a whole central server can be with the quantity (the first quantity) of the customized request received in the statistical unit time, and judges
Whether first quantity is more than the unit interval Information subscription request amount first threshold that stores in memory, and is more than when being judged as
When, to the customized failure response of client return information information customization is improved so as to control the visit capacity of information customization system
The stability of system.
For example, it is assumed that unit interval Information subscription request amount first threshold can be 100 beats/min, then when pool center
When server receives customized request, the number of the customized request received in nearest one minute can be counted by planning as a whole central server
Amount, and whether the quantity is judged more than 100 times, if being more than, plans as a whole central server and the customized request is not sent to information
Subscription services server, and to the customized failure response of client return information.
S303, plan as a whole central server and judge the target information for planning as a whole to store in central server memory mark corresponding the
Whether one remnant information total amount is less than information customization amount.If so, the customized failure response of return information;Otherwise, step S304 is gone to.
The customized request is sent to target information in multiple information customization service servers by S304, pool central server
Subscription services server.
In the embodiment of the present invention, the specific implementation of step S303~step S304 may refer to above-mentioned steps S202~step
Associated description in S203, details are not described herein for the embodiment of the present invention.
S305, the customized request received in the target information subscription services server statistics unit interval the second quantity,
And judge whether second quantity is more than that the unit interval information customization stored in target information subscription services server memory is asked
The amount of asking second threshold.If being more than, customized failure response is returned;Otherwise, step S306 is gone to.
In the embodiment of the present invention, target information subscription services server can also load unit interval information and order in memory
Request amount threshold value (second threshold) processed.Correspondingly, plan as a whole central server turn when target information subscription services server receives
When the customized request of hair, target information subscription services server can be with the quantity of the customized request received in the statistical unit time
(the second quantity), and judge whether second quantity is more than two threshold of unit interval Information subscription request flow control stored in memory
Value, and when be judged as be more than when, to plan as a whole the customized failure response of central server return information so that plan as a whole central server to
The customized failure response of client return information, or the customized request is transmitted to other information subscription services server, so as to
The visit capacity for enough controlling information customization system, improves the stability of information customization system.
For example, it is assumed that unit interval Information subscription request amount second threshold can be 20 beats/min, then when target information is ordered
When service server processed receives customized request, target information subscription services server can count to be received in nearest one minute
Customized request quantity, and whether judge the quantity more than 20 times, if being more than, target information subscription services server is to system
Raise the customized failure response of central server return information.
S306, target information subscription services server judge the target information stored in target information subscription services server
Identify whether corresponding information quota surplus is less than information customization amount;If so, returning to customized failure response;Otherwise, step is gone to
Rapid S307.
S307, target information subscription services server deduct the information customization amount from the information quota surplus, and to
Plan as a whole the customized success response of central server return information.
S308, pool central server deduct the information from the corresponding first information residue total amount of target information mark and order
Amount processed, and return to customized success response to client.
In the embodiment of the present invention, the specific implementation of step S306~step S308 may refer to above-mentioned steps S204~step
Associated description in S206, details are not described herein for the embodiment of the present invention.
In the method flow described in Fig. 3, central server unit interval Information subscription request amount is planned as a whole by setting
Threshold value and information customization service server unit interval Information subscription request amount threshold value, have efficiently controlled information customization system
The business processing amount of system, further improves system stability.
Further, in embodiments of the present invention, every Subscriber Unit can also be loaded in memory by planning as a whole central server
The customized request amount threshold value of temporal information (third threshold value), and same user is initiated within the unit interval according to the third threshold value
Information subscription request is limited, and while improving information customization system stability, ensure that the justice of information customization as far as possible
Property.
Correspondingly, in the embodiment of the present invention, plan as a whole central server receive client transmission for target information
After customized request, it can also include the following steps:
31), plan as a whole to receive the user identifier correspondence that the customized request includes in the central server statistical unit time
Customized request third quantity;
32), plan as a whole central server and judge whether the third quantity is every more than planning as a whole to store in central server memory
The customized request amount third threshold value of Subscriber Unit temporal information;If being more than, step 33) is gone to;Otherwise, execute above-mentioned steps S202 or
Step S302 or step S303.
If 33), be more than, plan as a whole central server to the customized failure response of client return information.
Further, in embodiments of the present invention, in order to improve the stability of information customization system, network shown in FIG. 1
In framework, on the one hand, it may include being disposed using active-standby mode to plan as a whole central server, you can to dispose a main pool center
Server, and one or more standby pool central servers;When main pool central server works normally, client is sent
Customized request received and forwarded by main pool central server;It is genuinely convinced in standby pool when main pool central server failure
Plan as a whole central server based on business device or in which a standby pool central server switching;Wherein, active and standby pool central server
Load relevant configuration information in memory in start-up course, and standby central server of planning as a whole can periodically and database service
Device synchronized update relevant configuration information.On the other hand, the side of more set information customization service servers can be disposed by multimachine room
Formula avoids leading to information customization service server not since computer room has unexpectedly incident (such as network interruption, earthquake, fire)
It can use.
Based on the identical technical concept of above method embodiment, the embodiment of the present invention additionally provides a kind of information customization system
System, can be applied to above method embodiment.
May include system as shown in figure 4, being a kind of configuration diagram of information customization system provided in an embodiment of the present invention
Raise central server 401 and multiple information customization service servers 402;Wherein:
Plan as a whole central server 401, the customized request for target information for receiving client transmission, this is customized to ask
Ask includes user identifier, target information mark and information customization amount;
The pool central server 401 is additionally operable to the mesh for judging to store in the pool central server memory
Mark whether the corresponding first information residue total amount of message identification is less than the customized amount of described information;If it is not, the customized request is sent out
Give the target information subscription services server in multiple information customization service servers;
Described information subscription services server 402 is used for when as target information subscription services server, described in judgement
Whether the target information stored in target information subscription services server memory identifies corresponding information quota surplus small
In the customized amount of described information, if it is not, deducting the customized amount of described information from described information quota surplus;
Described information subscription services server 402 is additionally operable to when as target information subscription services server, to described
Plan as a whole the customized success response of 401 return information of central server;
The pool central server 401 is additionally operable to identify corresponding first information residue total amount from the target information
The customized amount of middle deduction described information, and return to customized success response to client.
In an alternative embodiment, described information subscription services server 402 can be also used for when customized as target information
Service server, and judge that the target information stored in the target information subscription services server memory mark is corresponding
When information quota surplus is less than described information customized amount, judges that the target information mark is corresponding and customized identify whether to order
System terminates;If customized end, to the 401 customized failure response of return information of the pool central server, so that the pool
Central server is to the customized failure response of client return information;Otherwise, it is sent again to the pool central server 401
Distribution request;
The pool central server 401 can be also used for the institute for judging to store in the pool central server memory
State whether the corresponding second remaining total amount of target information mark is 0;If not 0, according to the described second remaining total amount and information
The quantity of subscription services server is that the target information subscription services server distributes information quota again;If 0, to described
Target information subscription services server returns to reallocation failure response;
Described information subscription services server 402, when can be also used for as target information subscription services server, according to
The information quota of sub-distribution responds the customized request again;Or, the reallocation failure response is received, by the target
The corresponding customized mark of message identification is set as customized end, and to the 401 customized mistake of return information of the pool central server
Response is lost, so that the pool central server 401 is to the customized failure response of client return information.
In an alternative embodiment, the pool central server 401 can be also used for receiving being directed to for client transmission
After the customized request of target information, the first quantity of the customized request received in the statistical unit time;
The pool central server 401 can be also used for judging whether first quantity is more than the pool center
The unit interval Information subscription request amount first threshold stored in server memory;If being more than, to the client return information
Customized failure response;Otherwise, it executes and judges that the target information mark stored in the pool central server memory corresponds to
First information residue total amount the step of whether being less than described information customized amount.
In an alternative embodiment, described information subscription services server 402 can be also used for receiving pool center service
When the customized request that device is sent, the second quantity of the customized request received in the statistical unit time;
Described information subscription services server 402 can be also used for judging whether second quantity is more than that the target is believed
The unit interval Information subscription request amount second threshold stored in breath subscription services server memory;If being more than, to the pool
The customized failure response of central server return information;Otherwise, it executes in the judgement target information subscription services server
The target information for depositing middle storage identifies the step of whether corresponding information quota surplus is less than described information customized amount.
In an alternative embodiment, the pool central server 401 can be also used for receiving being directed to for client transmission
After the customized request of target information, the third of the corresponding customized request of the user identifier received in the statistical unit time
Quantity;
The pool central server 401 can be also used for judging whether the third quantity is more than genuinely convinced in the pool
The customized request amount third threshold value of every Subscriber Unit temporal information stored in business device memory;If being more than, returned to the client
Information customization failure response;Otherwise, the target information for judging to store in the pool central server memory is executed
The step of whether corresponding first information residue total amount is less than described information customized amount identified.
In an alternative embodiment, described information subscription services server 402 can be also used for as the customized industry of target information
When business server, after deducting the customized amount of described information in described information quota surplus, sends and believe to database server
Customized success response is ceased, so that the target information that the database server is stored from itself identifies corresponding third information
The customized amount of described information is deducted in remaining total amount, and corresponding updated third remnant information is identified to obtain the target information
Amount;
Described information subscription services server 402 when can be also used for as target information subscription services server, obtains
The updated third remnant information total amount stored in the database server, and by the updated third information
Remaining total amount is sent to the pool central server;
The pool central server is additionally operable to the target information that will be stored in the pool central server memory
It identifies corresponding first information residue total amount and is updated to the updated third Informational redundancies.
In an alternative embodiment, the pool central server 401 can be specifically used for breathing out the user identifier
Uncommon hash operations, and by the result of hash operations to the quantity modulus of described information subscription services server, according to the modulus
As a result the target information subscription services service in the corresponding the multiple information customization service server of the customized request is determined
Device, and the customized request is sent to the target information subscription services server.
In the description of this specification, reference term " one embodiment ", " some embodiments ", " example ", " specifically show
The description of example " or " some examples " etc. means specific features, structure, material or spy described in conjunction with this embodiment or example
Point is included at least one embodiment or example of the invention.In the present specification, schematic expression of the above terms are not
It must be directed to identical embodiment or example.Moreover, particular features, structures, materials, or characteristics described can be in office
It can be combined in any suitable manner in one or more embodiments or example.In addition, without conflicting with each other, the skill of this field
Art personnel can tie the feature of different embodiments or examples described in this specification and different embodiments or examples
It closes and combines.
In addition, term " first ", " second " are used for description purposes only, it is not understood to indicate or imply relative importance
Or implicitly indicate the quantity of indicated technical characteristic.Define " first " as a result, the feature of " second " can be expressed or
Implicitly include at least one this feature.In the description of the present invention, the meaning of " plurality " is at least two, such as two, three
It is a etc., unless otherwise specifically defined.
Any process described otherwise above or method description are construed as in flow chart or herein, and expression includes
It is one or more for realizing specific logical function or process the step of executable instruction code module, segment or portion
Point, and the range of the preferred embodiment of the present invention includes other realization, wherein can not press shown or discuss suitable
Sequence, include according to involved function by it is basic simultaneously in the way of or in the opposite order, to execute function, this should be of the invention
Embodiment person of ordinary skill in the field understood.
Expression or logic and/or step described otherwise above herein in flow charts, for example, being considered use
In the order list for the executable instruction for realizing logic function, may be embodied in any computer-readable medium, for
Instruction execution system, device or equipment (system of such as computer based system including processor or other can be held from instruction
The instruction fetch of row system, device or equipment and the system executed instruction) it uses, or combine these instruction execution systems, device or set
It is standby and use.For the purpose of this specification, " computer-readable medium " can any can be included, store, communicating, propagating or passing
Defeated program is for instruction execution system, device or equipment or the dress used in conjunction with these instruction execution systems, device or equipment
It sets.The more specific example (non-exhaustive list) of computer-readable medium includes following:Electricity with one or more wiring
Interconnecting piece (electronic device), portable computer diskette box (magnetic device), random access memory (RAM), read-only memory
(ROM), erasable edit read-only storage (EPROM or flash memory), fiber device and portable optic disk is read-only deposits
Reservoir (CDROM).In addition, computer-readable medium can even is that the paper that can print described program on it or other are suitable
Medium, because can be for example by carrying out optical scanner to paper or other media, then into edlin, interpretation or when necessary with it
His suitable method is handled electronically to obtain described program, is then stored in computer storage.
It should be appreciated that each section of the present invention can be realized with hardware, software, firmware or combination thereof.Above-mentioned
In embodiment, software that multiple steps or method can in memory and by suitable instruction execution system be executed with storage
Or firmware is realized.It, and in another embodiment, can be under well known in the art for example, if realized with hardware
Any one of row technology or their combination are realized:With the logic gates for realizing logic function to data-signal
Discrete logic, with suitable combinational logic gate circuit application-specific integrated circuit, programmable gate array (PGA), scene
Programmable gate array (FPGA) etc..
Those skilled in the art are appreciated that realize all or part of step that above-described embodiment method carries
Suddenly it is that relevant hardware can be instructed to complete by program, the program can be stored in a kind of computer-readable storage medium
In matter, which includes the steps that one or a combination set of embodiment of the method when being executed.
In addition, each functional unit in each embodiment of the present invention can be integrated in a processing module, it can also
That each unit physically exists alone, can also two or more units be integrated in a module.Above-mentioned integrated mould
The form that hardware had both may be used in block is realized, can also be realized in the form of software function module.The integrated module is such as
Fruit is realized in the form of software function module and when sold or used as an independent product, can also be stored in a computer
In read/write memory medium.
Storage medium mentioned above can be read-only memory, disk or CD etc..Although having been shown and retouching above
The embodiment of the present invention is stated, it is to be understood that above-described embodiment is exemplary, and should not be understood as the limit to the present invention
System, those skilled in the art can be changed above-described embodiment, change, replace and become within the scope of the invention
Type.