Summary of the invention
In order to solve the problem of prior art, the embodiment of the present invention provides a kind of method and device of processing subscription information.Described technical scheme is as follows:
On the one hand, provide a kind of method of processing subscription information, described method comprises:
The subscribe request that receiving terminal sends, carries the first mark corresponding to subscriber and the second mark corresponding to content provider in described subscribe request;
Using the corresponding relation of described the first mark and described the second mark as a subscription record, be stored in respectively with subscriber and be designated subscriber's mark of major key and the corresponding relation of content provider's mark and be designated in subscriber's mark of major key and the corresponding relation of content provider's mark with content provider;
Record in total corresponding relation and to identify corresponding subscription by described second and record sum and add an operation in content provider mark and content provider's subscription.
Optionally, described method comprises:
The inquiry request for subscription information that receiving terminal sends, carries mark classification and the 3rd mark in described inquiry request; Wherein, in subscription information, include the subscription record between the user of subscriber's classification and the user of content provider's classification;
In the time identifying described mark classification for subscriber's classification, in buffer memory, whether inquiry there is subscription record corresponding to described the 3rd mark; If do not inquired, identify in the corresponding relation identifying with content provider the subscription record that inquiry packet identifies containing the described the 3rd and state is effective status the subscriber who is designated major key with subscriber;
When identifying described mark classification when content provider's classification, record in content provider's mark and content provider's subscription that in total corresponding relation, to inquire about subscription record corresponding to described the 3rd mark total.
Optionally, described in the corresponding relation that subscriber identifies and content provider identifies that is designated major key with subscriber, after the subscription that inquiry packet identifies containing the described the 3rd and state is effective status is recorded, described method also comprises:
The subscription record inquiring is stored in buffer memory, and the subscription inquiring described in arranging is recorded in the effective time in described buffer memory.
Optionally, described method also comprises:
The request of cancelling subscriptions that receiving terminal sends, carries the 4th mark and the 5th mark corresponding to content provider corresponding to subscriber in described subscribe request;
Identify in the corresponding relation identifying with content provider the subscriber who is designated major key with subscriber, inquiry packet identifies the subscription record of corresponding relation containing described the 4th mark and the described the 5th, and the state in the subscription record inquiring is changed to disarmed state;
Identify in the corresponding relation identifying with content provider the subscriber who is designated major key with content provider, inquiry packet identifies the subscription record of corresponding relation containing described the 4th mark and the described the 5th, and the state in the subscription record inquiring is changed to disarmed state;
Record in total corresponding relation and to identify corresponding subscription by the described the 5th and record sum and subtract an operation in content provider mark and content provider's subscription.
Optionally, described method also comprises:
Periodically according to the corresponding relation of subscriber's mark with content provider's mark that is designated major key with content provider, content provider's mark and content provider's subscription are recorded in total corresponding relation to content provider and identify corresponding subscription and record sum and upgrade and revise.
On the other hand, provide a kind of device of processing subscription information, described device comprises:
The first receiver module, the subscribe request sending for receiving terminal, carries the first mark corresponding to subscriber and the second mark corresponding to content provider in described subscribe request;
The first memory module, be used for using the corresponding relation of described the first mark and described the second mark as a subscription record, be stored in respectively with subscriber and be designated subscriber's mark of major key and the corresponding relation of content provider's mark and be designated in subscriber's mark of major key and the corresponding relation of content provider's mark with content provider;
The first processing module, identifies corresponding subscription by described second and records sum and add an operation for record total corresponding relation in content provider mark and content provider's subscription.
Optionally, described device also comprises:
The second receiver module, the inquiry request for subscription information sending for receiving terminal, carries mark classification and the 3rd mark in described inquiry request; Wherein, in subscription information, include the subscription record between the user of subscriber's classification and the user of content provider's classification;
The first enquiry module, in the time identifying described mark classification for subscriber's classification, in buffer memory, whether inquiry there is subscription record corresponding to described the 3rd mark; If do not inquired, identify in the corresponding relation identifying with content provider the subscription record that inquiry packet identifies containing the described the 3rd and state is effective status the subscriber who is designated major key with subscriber;
The second enquiry module, for when identifying described mark classification when content provider's classification, records in content provider's mark and content provider's subscription that in total corresponding relation, to inquire about subscription record corresponding to described the 3rd mark total.
Optionally, described device also comprises:
The second memory module, for the subscription record inquiring is stored in to buffer memory, and the subscription inquiring described in arranging is recorded in the effective time in described buffer memory.
Optionally, described device also comprises:
The 3rd receiver module, the request of cancelling subscriptions sending for receiving terminal, carries the 4th mark and the 5th mark corresponding to content provider corresponding to subscriber in described subscribe request;
The first change module, for be designated subscriber's mark of major key and the corresponding relation that content provider identifies with subscriber, inquiry packet identifies the subscription record of corresponding relation containing described the 4th mark and the described the 5th, and the state in the subscription record inquiring is changed to disarmed state;
The second change module, for be designated subscriber's mark of major key and the corresponding relation that content provider identifies with content provider, inquiry packet identifies the subscription record of corresponding relation containing described the 4th mark and the described the 5th, and the state in the subscription record inquiring is changed to disarmed state;
The second processing module, identifies corresponding subscription by the described the 5th and records sum and subtract an operation for record total corresponding relation in content provider mark and content provider's subscription.
Optionally, described device also comprises:
Update module,, content provider's mark and content provider's subscription are recorded in total corresponding relation to content provider and identify corresponding subscription and record sum and upgrade and revise according to the corresponding relation of subscriber's mark with content provider's mark that is designated major key with content provider for periodically.
The beneficial effect that the technical scheme that the embodiment of the present invention provides is brought is:
By managing respectively subscribing in the subscription information table that record is stored in respectively in subscription information table corresponding to subscriber and content provider is corresponding, and directly record total corresponding relation in content provider's mark with content provider's subscription and increase each content provider's subscription sum, to at directly query contents supplier's subscription sum in this subscription record of when inquiry, improved inquiry velocity.In addition, for fear of large data level, other adds to subscribe to record or cancel subscriptions and records in operating process the Data Update mistake easily occurring, also can periodically record total corresponding relation to content provider's mark and content provider's subscription and safeguard.
Embodiment
For making the object, technical solutions and advantages of the present invention clearer, below in conjunction with accompanying drawing, embodiment of the present invention is described further in detail.
Embodiment mono-
The embodiment of the present invention provides a kind of method of processing subscription information, and referring to Fig. 1, method flow comprises:
101: the subscribe request that receiving terminal sends, in subscribe request, carry the first mark corresponding to subscriber and the second mark corresponding to content provider;
102: using the corresponding relation of the first mark and the second mark as a subscription record, be stored in respectively with subscriber and be designated subscriber's mark of major key and the corresponding relation of content provider's mark and be designated in subscriber's mark of major key and the corresponding relation of content provider's mark with content provider;
103: record and in total corresponding relation, subscription corresponding the second mark is recorded to sum and add an operation in content provider mark and content provider's subscription.
Enforcement scene for the embodiment of the present invention can include but not limited to: online education platform, audio-visual amusement platform.Wherein, online education platform middle school student's class of subscriber is subscriber's classification, and teacher's class of subscriber is content provider's classification, the online course that student can watch the teacher of subscription to provide in this online education platform; In audio-visual amusement platform, user's class of subscriber is subscriber's classification, and main broadcaster's class of subscriber is content provider's classification, the content of multimedia that user can watch the main broadcaster of subscription to provide in this audio-visual amusement platform.
Wherein, in the database of Subscriber, preserve in advance three tables, be respectively subscription information table corresponding to subscriber, the subscription sum table that the subscription information table that content provider is corresponding and content provider are corresponding.
In subscription information table corresponding to subscriber, store the corresponding relation that is designated subscriber's mark with content provider's mark of major key with subscriber, in subscription information table corresponding to this subscriber every subscribes to and in record, can also preserve this subscription and record corresponding state, for identifying the validity of this subscription record, i.e. effective status or disarmed state; Can also preserve the change time of this record.Wherein, be designated the major key of this table with subscriber,, in the time being designated search key by subscriber and inquiring about, can improve the inquiry velocity in this table.
In subscription information table corresponding to content provider, store the corresponding relation that is designated subscriber's mark with content provider's mark of major key with subscriber, in subscription information table corresponding to this subscriber every subscribes to and in record, can also preserve this subscription and record corresponding state, for identifying the validity of this subscription record, i.e. effective status or disarmed state; Can also preserve the change time of this record.Wherein, be designated the major key of this table with content provider,, in the time being designated search key by content provider and inquiring about, can improve the inquiry velocity in this table.
Subscription sum corresponding to content provider stores content provider's mark in showing and records total corresponding relation with content provider's subscription.
In the embodiment of the present invention, add the process of subscribing to record, manage respectively subscribing in the subscription information table that record is stored in respectively in subscription information table corresponding to subscriber and content provider is corresponding, and directly record total corresponding relation in content provider's mark with content provider's subscription and increase each content provider's subscription sum, to at directly query contents supplier's subscription sum in this subscription record of when inquiry, improved inquiry velocity.In addition, for fear of large data level, other adds to subscribe to record or cancel subscriptions and records in operating process the Data Update mistake easily occurring, also can periodically record total corresponding relation to content provider's mark and content provider's subscription and safeguard.
Embodiment bis-
The embodiment of the present invention provides in a kind of method of processing subscription information adds the method for subscribing to record, and referring to Fig. 2, method flow comprises:
201: the subscribe request that receiving terminal sends, in subscribe request, carry the first mark corresponding to subscriber and the second mark corresponding to content provider.
202: using the corresponding relation of described the first mark and described the second mark as a subscription record, be stored in respectively with subscriber and be designated subscriber's mark of major key and the corresponding relation of content provider's mark and be designated in subscriber's mark of major key and the corresponding relation of content provider's mark with content provider.
The corresponding relation of the first mark and the second mark is stored in subscription information table corresponding to subscriber, and the state that this corresponding relation is stored in subscription in subscription information table corresponding to subscriber record is set to effective status, and it is the current time by change set of time.
The corresponding relation of the first mark and the second mark is stored in subscription information table corresponding to subscribed person, and the state that this corresponding relation is stored in subscription in subscription information table corresponding to subscriber record is set to effective status, and it is the current time by change set of time.
203: record and in total corresponding relation, subscription corresponding the second mark is recorded to sum and add an operation in content provider mark and content provider's subscription.
Preferably, in the subscription information table corresponding to subscriber and subscription information table corresponding to content provider, add in the operating process of subscribing to record and cancelling subscriptions record, record sum and make mistakes for fear of subscribing in subscription corresponding to the content provider who too much causes due to operating process sum table, a kind of method that subscription sum table corresponding to content provider safeguarded is also provided in the embodiment of the present invention, and the method step is not restricted to the time sequencing in said process.
204: periodically according to the corresponding relation of subscriber's mark with content provider's mark that is designated major key with content provider, content provider's mark and content provider's subscription are recorded in total corresponding relation to content provider and identify corresponding subscription and record sum and upgrade and revise.
In the embodiment of the present invention, add the process of subscribing to record, manage respectively subscribing in the subscription information table that record is stored in respectively in subscription information table corresponding to subscriber and content provider is corresponding, and directly record total corresponding relation in content provider's mark with content provider's subscription and increase each content provider's subscription sum, to at directly query contents supplier's subscription sum in this subscription record of when inquiry, improved inquiry velocity.In addition, for fear of large data level, other adds to subscribe to record or cancel subscriptions and records in operating process the Data Update mistake easily occurring, also can periodically record total corresponding relation to content provider's mark and content provider's subscription and safeguard.
Embodiment tri-
The embodiment of the present invention provides the method for query subscription record in a kind of method of processing subscription information, and referring to Fig. 3, method flow comprises:
301: the inquiry request for subscription information that receiving terminal sends, in inquiry request, carry mark classification and the 3rd mark; Wherein, in subscription information, include the subscription record between the user of subscriber's classification and the user of content provider's classification.
302: in the time identifying mark classification for subscriber's classification, in buffer memory, whether inquiry exists subscription record corresponding to the 3rd mark.
Wherein, in buffer memory, store the subscription record that subscriber inquired about before default effective time, the subscription record of storing in buffer memory comprises that subscriber identifies the corresponding relation identifying with content provider, each subscribes to record all can arrange effective time, in the time that arrive in effective time, in buffer memory, can delete this subscription record.
303: have subscription record corresponding to the 3rd mark if inquired in buffer memory, the subscription this being inquired record returns to terminal as Query Result.
304: if do not inquired, identify in the corresponding relation identifying with content provider the subscription record that inquiry packet identifies containing the 3rd and state is effective status the subscriber who is designated major key with subscriber.
Query script is to inquire about in subscription information table corresponding to subscriber, is designated search key with the 3rd, and in the corresponding relation of subscriber's mark and content provider's mark, inquiry comprises the subscription record of the 3rd mark.
305: if comprise the 3rd mark and state as the subscription record of effective status being designated taking subscriber to inquire in the subscriber mark of major key and the corresponding relation of content provider's mark, the subscription record inquiring is returned to terminal as Query Result.
306: the subscription record inquiring is stored in buffer memory, and the subscription that setting inquires is recorded in the effective time in buffer memory.
In the time that arrive in effective time, this subscription record being stored in buffer memory is deleted.
307: when identifying mark classification when content provider's classification, record in content provider's mark and content provider's subscription that in total corresponding relation, to inquire about subscription record corresponding to the 3rd mark total.
Query script is to inquire about in subscription sum table corresponding to content provider.
308: the subscription record sum inquiring is returned to terminal as Query Result.
The embodiment of the present invention judges by the mark classification in the inquiry request for subscription information, in the time that mark classification is subscriber's classification, in buffer memory, whether inquiry there is subscription record corresponding to the 3rd mark, if there is no in the corresponding relation that subscriber identifies and content provider identifies that is designated major key with subscriber, inquires about subscription record corresponding to the 3rd mark; In mark classification while be content provider's classification, record and in total corresponding relation, inquire about subscription corresponding to the 3rd mark and record total in content provider's mark and content provider's subscription.These two kinds of inquiry modes for different classes of user, can distinguish query script and subscription and the ablation process cancelling subscriptions, and have improved the efficiency of query script, have reduced the time that query script consumes.
Embodiment tetra-
The embodiment of the present invention provides a kind of method that cancels subscriptions and record in method of processing subscription information, and referring to Fig. 4, method flow comprises:
401: the request of cancelling subscriptions that receiving terminal sends, in subscribe request, carry the 4th mark and the 5th mark corresponding to content provider corresponding to subscriber.
402: identify in the corresponding relation identifying with content provider the subscriber who is designated major key with subscriber, inquiry packet identifies the subscription record of corresponding relation containing the 4th mark and the 5th, and the state in the subscription record inquiring is changed to disarmed state.
Wherein, in subscription information table corresponding to subscriber, and state in the subscription record that comprises the 4th mark and the 5th mark corresponding relation is set to disarmed state, and is the current time by changing set of time.
403: identify in the corresponding relation identifying with content provider the subscriber who is designated major key with content provider, inquiry packet identifies the subscription record of corresponding relation containing the 4th mark and the 5th, and the state in the subscription record inquiring is changed to disarmed state.
Wherein, in subscription information table corresponding to subscribed person, and state in the subscription record that comprises the 4th mark and the 5th mark corresponding relation is set to disarmed state, and is the current time by changing set of time.
404: record in total corresponding relation and to identify corresponding subscription by the 5th and record sum and subtract an operation in content provider mark and content provider's subscription.
In subscription corresponding to content provider sum table, inquire about subscription record corresponding to the 5th mark, and subscription corresponding to the 5th mark in this subscription record subtracts an operation in recording sum.
The process of the record that cancels subscriptions in the embodiment of the present invention is managed respectively respectively subscribing to record in subscription information table corresponding to subscriber and in subscription information table corresponding to content provider.And directly record total corresponding relation in content provider's mark and content provider's subscription and delete each content provider's subscription sum so that in the time of inquiry direct query contents supplier's subscription sum in this subscription record, improved inquiry velocity.
Embodiment five
The embodiment of the present invention provides a kind of device of processing subscription information, and referring to Fig. 5, this device comprises:
The first receiver module 501, the subscribe request sending for receiving terminal, carries the first mark corresponding to subscriber and the second mark corresponding to content provider in described subscribe request;
The first memory module 502, be used for using the corresponding relation of described the first mark and described the second mark as a subscription record, be stored in respectively with subscriber and be designated subscriber's mark of major key and the corresponding relation of content provider's mark and be designated in subscriber's mark of major key and the corresponding relation of content provider's mark with content provider;
The first processing module 503, identifies corresponding subscription by described second and records sum and add an operation for record total corresponding relation in content provider mark and content provider's subscription.
Wherein, described device also comprises:
The second receiver module 504, the inquiry request for subscription information sending for receiving terminal, carries mark classification and the 3rd mark in described inquiry request; Wherein, in subscription information, include the subscription record between the user of subscriber's classification and the user of content provider's classification;
The first enquiry module 505, in the time identifying described mark classification for subscriber's classification, in buffer memory, whether inquiry there is subscription record corresponding to described the 3rd mark; If do not inquired, identify in the corresponding relation identifying with content provider the subscription record that inquiry packet identifies containing the described the 3rd and state is effective status the subscriber who is designated major key with subscriber;
The second enquiry module 506, for when identifying described mark classification when content provider's classification, records in content provider's mark and content provider's subscription that in total corresponding relation, to inquire about subscription record corresponding to described the 3rd mark total.
Wherein, described device also comprises:
The second memory module 507, for the subscription record inquiring is stored in to buffer memory, and the subscription inquiring described in arranging is recorded in the effective time in described buffer memory.
Wherein, described device also comprises:
The 3rd receiver module 508, the request of cancelling subscriptions sending for receiving terminal, carries the 4th mark and the 5th mark corresponding to content provider corresponding to subscriber in described subscribe request;
The first change module 509, for be designated subscriber's mark of major key and the corresponding relation that content provider identifies with subscriber, inquiry packet identifies the subscription record of corresponding relation containing described the 4th mark and the described the 5th, and the state in the subscription record inquiring is changed to disarmed state;
The second change module 510, for be designated subscriber's mark of major key and the corresponding relation that content provider identifies with content provider, inquiry packet identifies the subscription record of corresponding relation containing described the 4th mark and the described the 5th, and the state in the subscription record inquiring is changed to disarmed state;
The second processing module 511, identifies corresponding subscription by the described the 5th and records sum and subtract an operation for record total corresponding relation in content provider mark and content provider's subscription.
Wherein, described device also comprises:
Update module 512,, content provider's mark and content provider's subscription are recorded in total corresponding relation to content provider and identify corresponding subscription and record sum and upgrade and revise according to the corresponding relation of subscriber's mark with content provider's mark that is designated major key with content provider for periodically.
In the embodiment of the present invention, add and subscribe to record and the process of the record that cancels subscriptions, in subscription information table corresponding to subscriber and in subscription information table corresponding to content provider, manage respectively respectively subscribing to record, and directly record total corresponding relation increase or delete each content provider's subscription sum in content provider's mark and content provider's subscription, to at directly query contents supplier's subscription sum in this subscription record of when inquiry, improved inquiry velocity.In addition, for fear of large data level, other adds to subscribe to record or cancel subscriptions and records in operating process the Data Update mistake easily occurring, also can periodically record total corresponding relation to content provider's mark and content provider's subscription and safeguard.
In addition, judge by the mark classification in the inquiry request for subscription information, in the time that mark classification is subscriber, in buffer memory, whether inquiry there is the subscription record of the first mark correspondence, if there is no in the corresponding relation that subscriber identifies and content provider identifies that is designated major key with subscriber, inquires about subscription record corresponding to the first mark; In mark classification while be content provider, record and in total corresponding relation, inquire about subscription corresponding to the first mark and record total in content provider's mark and content provider's subscription.These two kinds of inquiry modes for different classes of user, can distinguish query script and subscription and the ablation process cancelling subscriptions, and have improved the efficiency of query script, have reduced the time that query script consumes.
The invention described above embodiment sequence number, just to describing, does not represent the quality of embodiment.
One of ordinary skill in the art will appreciate that all or part of step that realizes above-described embodiment can complete by hardware, also can carry out the hardware that instruction is relevant by program completes, described program can be stored in a kind of computer-readable recording medium, the above-mentioned storage medium of mentioning can be ROM (read-only memory), disk or CD etc.
The foregoing is only preferred embodiment of the present invention, in order to limit the present invention, within the spirit and principles in the present invention not all, any amendment of doing, be equal to replacement, improvement etc., within all should being included in protection scope of the present invention.