A kind of method and device of processing subscription information
Technical field
The present invention relates to field of computer technology, more particularly to a kind of method and device of processing subscription information.
Background technology
With the development of computer technology, the appearance of online voice and video platform greatly enriches the life of user,
In provide a user the multimedia content such as video frequency program or audio program in the platform.In online voice and video platform, user class
Its multimedia provided is not subscribed to by the user that the user of subscriber's classification can be content provider's classification to class of subscriber
Content.The user of subscriber's classification or the user of content provider's classification oneself can be subscribed to more by the mark inquiry of itself
Media content or the subscription record sum for inquiring the multimedia content that itself is provided.
It is specially stored with subscription information table in the database of Subscriber, is provided with content for storing subscriber identity
The correspondence of person's mark.When the user of subscriber's classification inquires the subscription record of itself subscription, existed according to subscriber identity
Inquiry includes subscriber identity and the subscription record that state is effective status in subscription information table;In the use of content provider's classification
When the query subscription record sum of family, inquired comprising content provider identification in subscription information table according to content provider identification
Record is subscribed to, and the quantity of the subscription record inquired is added up and obtains subscribing to record sum.
The inventor finds that the existing technology has at least the following problems:
Since the user base number of online voice and video platform is extremely huge, the inquiry carried out in subscription information table is grasped
Make and user is to other operations conducted in the subscription information table, such as:Subscription operation and operation is unsubscribed, can given
Subscriber causes greatly to bear.
Invention content
In order to solve problems in the prior art, an embodiment of the present invention provides a kind of methods and dress of processing subscription information
It sets.The technical solution is as follows:
On the one hand, a kind of method of processing subscription information is provided, the method includes:
The subscription request that terminal is sent is received, the corresponding first identifier of subscriber and content are carried in the subscription request
The corresponding second identifier of supplier;
Record is subscribed to using the correspondence of the first identifier and the second identifier as one, is stored respectively in order
Reader is identified as the subscriber identity of major key and the correspondence of content provider identification and is identified as major key with content provider
Subscriber identity and content provider identification correspondence in;
By the second identifier in the correspondence of the subscription record sum of content provider identification and content provider
Corresponding subscription record sum carries out plus an operation.
Optionally, the method includes:
The inquiry request for subscription information that terminal is sent is received, carrying identified category and the in the inquiry request
Three marks;Wherein, in subscription information include subscription between the user of subscriber's classification and the user of content provider's classification
Record;
When it is subscriber's classification to identify the identified category, then inquiry is identified with the presence or absence of the third in the buffer
Corresponding subscription record;If do not inquired, marked by the subscriber identity of major key and content provider of subscriber identity
In the correspondence of knowledge, the subscription that inquiry is identified comprising the third and state is effective status records;
When it is content provider's classification to identify the identified category, then in content provider identification and content provider
Subscription record sum correspondence in inquire the third to identify corresponding subscriptions record total.
Optionally, described using subscriber identity as the correspondence of the subscriber identity of major key and content provider identification
In, after inquiry is comprising the subscription record that the third identifies and state is effective status, the method further includes:
By the subscription record storage inquired in caching, and the subscription inquired described in setting is recorded in the caching
Effective time.
Optionally, the method further includes:
Receive that terminal sends unsubscribes request, in the subscriptions request carrying subscriber the corresponding 4th identify and
Corresponding 5th mark of content provider;
In using subscriber identity as the correspondence of the subscriber identity of major key and content provider identification, inquiry includes
4th mark and the described 5th identifies the subscription record of correspondence, and the state in the subscription record inquired is changed
For invalid state;
It is being identified as in the subscriber identity of major key and the correspondence of content provider identification, is being inquired with content provider
State in the subscription record that includes the subscription record of the 4th mark and the 5th mark correspondence, and will inquire
It is changed to invalid state;
The described 5th is identified in the correspondence of the subscription record sum of content provider identification and content provider
Corresponding subscription record sum carries out subtracting one operation.
Optionally, the method further includes:
It is periodically corresponding with content provider identification according to the subscriber identity for being identified as major key with content provider
Relationship, it is corresponding with content provider identification in the correspondence of the subscription record sum of content provider to content provider identification
Subscription record sum be updated and correct.
On the other hand, a kind of device of processing subscription information is provided, described device includes:
First receiving module, the subscription request for receiving terminal transmission carry subscriber in the subscription request and correspond to
First identifier and the corresponding second identifier of content provider;
First memory module, for subscribing to note using the correspondence of the first identifier and the second identifier as one
Record is stored respectively in using subscriber identity as the correspondence of the subscriber identity of major key and content provider identification and with content
Supplier is identified as in the subscriber identity of major key and the correspondence of content provider identification;
First processing module, for the correspondence in content provider identification and the subscription record sum of content provider
It is middle to carry out the corresponding subscription record sum of the second identifier to add an operation.
Optionally, described device further includes:
Second receiving module, the inquiry request for subscription information for receiving terminal transmission, in the inquiry request
Carry identified category and third mark;Wherein, include user and the content provider's class of subscriber's classification in subscription information
Subscription record between other user;
First enquiry module, for when it is subscriber's classification to identify the identified category, then inquiry to be in the buffer
It is no that there are the thirds to identify corresponding subscription record;If do not inquired, using subscriber identity as the subscriber of major key
Mark is remembered with the subscription that in the correspondence of content provider identification, inquiry is identified comprising the third and state is effective status
Record;
Second enquiry module, for when it is content provider's classification to identify the identified category, then being provided in content
It is total that person identifies subscription record corresponding with the third mark is inquired in the correspondence of the subscription record sum of content provider
Number.
Optionally, described device further includes:
Second memory module, the subscription record storage for will inquire is in caching, and what is inquired described in setting orders
Read the effective time being recorded in the caching.
Optionally, described device further includes:
Third receiving module, the request that unsubscribes for receiving terminal transmission carry subscriber in the subscription request
Corresponding 4th mark and corresponding 5th mark of content provider;
First change module, for using subscriber identity as pair of the subscriber identity of major key and content provider identification
In should being related to, inquiry identifies the subscription record of correspondence comprising the 4th mark and the described 5th, and is ordered what is inquired
The state read in record is changed to invalid state;
Second change module, in the subscriber identity and content provider identification for being identified as major key with content provider
Correspondence in, inquiry identifies the subscription record of correspondence comprising the 4th mark and the described 5th, and will inquire
Subscription record in state be changed to invalid state;
Second processing module, for the correspondence in content provider identification and the subscription record sum of content provider
It is middle by the described 5th identify corresponding subscriptions and record sum carry out subtracting one operation.
Optionally, described device further includes:
Update module, for periodically being provided with content according to the subscriber identity for being identified as major key with content provider
The correspondence of person's mark puies forward content in the correspondence of the subscription record sum of content provider identification and content provider
Donor identifies corresponding subscription record sum and is updated and corrects.
The advantageous effect that technical solution provided in an embodiment of the present invention is brought is:
By that will subscribe to, record will be respectively stored in the corresponding subscription information table of subscriber and content provider is corresponding
It is managed respectively in subscription information table, and pair directly total in the subscription record of content provider identification and content provider
It should be related to the subscription sum for increasing each content provider, so that directly inquiry content provides in subscription record in inquiry
The subscription sum of person, improves inquiry velocity.In addition, in order to avoid record is subscribed in the addition of big data rank or unsubscribes note
The data update mistake being susceptible in record operating process, can also be periodically to content provider identification and content provider
The correspondence for subscribing to record sum is safeguarded.
Description of the drawings
To describe the technical solutions in the embodiments of the present invention more clearly, make required in being described below to embodiment
Attached drawing is briefly described, it should be apparent that, drawings in the following description are only some embodiments of the invention, for
For those of ordinary skill in the art, without creative efforts, other are can also be obtained according to these attached drawings
Attached drawing.
Fig. 1 is the method flow diagram for the processing subscription information that the embodiment of the present invention one provides;
Fig. 2 is the method flow that record is subscribed in addition in the method provided by Embodiment 2 of the present invention for handling subscription information
Figure;
Fig. 3 be the embodiment of the present invention three provide processing subscription information method in query subscription record method flow
Figure;
Fig. 4 be the processing subscription information that the embodiment of the present invention four provides method in unsubscribe the method flow of record
Figure;
Fig. 5 is the apparatus structure schematic diagram for the processing subscription information that the embodiment of the present invention five provides.
Specific implementation mode
To make the object, technical solutions and advantages of the present invention clearer, below in conjunction with attached drawing to embodiment party of the present invention
Formula is described in further detail.
Embodiment one
An embodiment of the present invention provides a kind of methods of processing subscription information, and referring to Fig. 1, method flow includes:
101:The subscription request that terminal is sent is received, subscribes to and carries the corresponding first identifier of subscriber and content in request
The corresponding second identifier of supplier;
102:Record is subscribed to using the correspondence of first identifier and second identifier as one, is stored respectively in subscriber
It is identified as the subscriber identity of major key and the correspondence of content provider identification and ordering for major key is identified as with content provider
Reader identifies in the correspondence with content provider identification;
103:By second identifier in the correspondence of the subscription record sum of content provider identification and content provider
Corresponding subscription record sum carries out plus an operation.
The implement scene of the embodiment of the present invention can include but is not limited to:Online education platform, audio-visual amusement platform.
Wherein, the class of subscriber of online education platform middle school student is subscriber's classification, and the class of subscriber of teacher is content provider's classification,
Student can watch the online course that the teacher of subscription provides in the online education platform;The use of user in audio-visual amusement platform
Family classification is subscriber's classification, and the class of subscriber of main broadcaster is content provider's classification, and user can be in the audio-visual amusement platform
The multimedia content that the main broadcaster that viewing is subscribed to provides.
Wherein, three tables, the respectively corresponding subscription letter of subscriber have been pre-saved in the database of Subscriber
Cease table, the corresponding subscription information table of content provider and the corresponding subscription count table of content provider.
It is stored in the corresponding subscription information table of subscriber and is carried with content using subscriber identity as the subscriber identity of major key
The correspondence of donor mark, this can also be preserved by subscribing in record for every in the corresponding subscription information table of the subscriber
Subscription records corresponding state, and the validity of record, i.e. effective status or invalid state are subscribed to for identifying this;It can also protect
There is the change time of this record.Wherein, then it is being retrieval by subscriber identity with the major key that subscriber identity is the table
When keyword is inquired, inquiry velocity in the table can be improved.
Be stored in the corresponding subscription information table of content provider using subscriber identity as the subscriber identity of major key with it is interior
Hold the correspondence of supplier's mark, every in the corresponding subscription information table of the subscriber subscribes to and can also be preserved in record
This subscribes to and records corresponding state, and the validity of record, i.e. effective status or invalid state are subscribed to for identifying this;May be used also
To preserve the change time of this record.Wherein, it is identified as the major key of the table with content provider, then is provided by content
When person is identified as search key and inquires, inquiry velocity in the table can be improved.
Content provider is corresponding to subscribe to the subscription note that content provider identification and content provider are stored in count table
Record the correspondence of sum.
The process of record is subscribed in addition in the embodiment of the present invention, will be subscribed to record and is respectively stored in the corresponding subscription of subscriber
Managed respectively in information table and in the corresponding subscription information table of content provider, and directly content provider identification with
The correspondence of the subscription record sum of content provider increases the subscription sum of each content provider, so as to straight in inquiry
It is connected on the subscription sum of inquiry content provider in subscription record, improves inquiry velocity.In addition, in order to avoid big data grade
Other addition subscribes to record or unsubscribes the data update mistake being susceptible in record operating process, can also be periodically right
The correspondence of the subscription record sum of content provider identification and content provider is safeguarded.
Embodiment two
An embodiment of the present invention provides the methods that record is subscribed in addition in a kind of method of processing subscription information, referring to Fig. 2,
Method flow includes:
201:The subscription request that terminal is sent is received, subscribes to and carries the corresponding first identifier of subscriber and content in request
The corresponding second identifier of supplier.
202:Record is subscribed to using the correspondence of the first identifier and the second identifier as one, is stored respectively in
It is identified as using subscriber identity as the correspondence of the subscriber identity of major key and content provider identification and with content provider
In the subscriber identity of major key and the correspondence of content provider identification.
The correspondence of first identifier and second identifier is stored in the corresponding subscription information table of subscriber, and this is right
It should be related to that the state in the subscription record being stored in the corresponding subscription information table of subscriber is set as effective status, and will change
Time is set as the current time.
The correspondence of first identifier and second identifier is stored in the corresponding subscription information table of subscribed person, and should
State in the subscription record that correspondence is stored in the corresponding subscription information table of subscriber is set as effective status, and will more
Change the time that the time is set as current.
203:By second identifier in the correspondence of the subscription record sum of content provider identification and content provider
Corresponding subscription record sum carries out plus an operation.
Preferably, it is carried out in the corresponding subscription information table of subscriber and the corresponding subscription information table of content provider
Addition is subscribed in the operating process for recording and unsubscribing record, content caused by order to avoid excessive due to operating process
Record sum error is subscribed in the corresponding subscription count table of supplier, is also provided in the embodiment of the present invention a kind of to content provider
The corresponding method subscribed to count table and safeguarded, this method step are not restricted to the time sequencing in the above process.
204:Periodically according to the subscriber identity's and content provider identification for being identified as major key with content provider
Correspondence, to content provider identification in the correspondence of the subscription record sum of content provider identification and content provider
Corresponding subscription record sum is updated and corrects.
The process of record is subscribed in addition in the embodiment of the present invention, will be subscribed to record and is respectively stored in the corresponding subscription of subscriber
Managed respectively in information table and in the corresponding subscription information table of content provider, and directly content provider identification with
The correspondence of the subscription record sum of content provider increases the subscription sum of each content provider, so as to straight in inquiry
It is connected on the subscription sum of inquiry content provider in subscription record, improves inquiry velocity.In addition, in order to avoid big data grade
Other addition subscribes to record or unsubscribes the data update mistake being susceptible in record operating process, can also be periodically right
The correspondence of the subscription record sum of content provider identification and content provider is safeguarded.
Embodiment three
An embodiment of the present invention provides the methods that query subscription in a kind of method of processing subscription information records, referring to Fig. 3,
Method flow includes:
301:The inquiry request for subscription information that terminal is sent is received, carrying identified category and the in inquiry request
Three marks;Wherein, in subscription information include subscription between the user of subscriber's classification and the user of content provider's classification
Record.
302:When it is subscriber's classification to identify identified category, then inquiry is corresponded to the presence or absence of third mark in the buffer
Subscription record.
Wherein, the subscription record that subscriber is inquired before preset effective time is stored in caching, in the buffer
The subscription record of storage includes the correspondence of subscriber identity and content provider identification, and each is subscribed to record and can all be set
It is set effective the time, can then delete subscription record in the buffer when reaching effective time.
303:If inquired in the buffer, there are thirds to identify corresponding subscription record, which is remembered
Record returns to terminal as query result.
304:If do not inquired, using subscriber identity as the subscriber identity of major key and content provider identification
In correspondence, the subscription that inquiry is identified comprising third and state is effective status records.
Query process is to be inquired in the corresponding subscription information table of subscriber, and search key is identified as with third,
Inquiry includes the subscription record of third mark in the correspondence of subscriber identity and content provider identification.
305:If in using subscriber identity as the correspondence of the subscriber identity of major key and content provider identification
It includes third mark and the subscription record that state is effective status to inquire, then by the subscription inquired record as query result
Return to terminal.
306:By the subscription record storage inquired in caching, and subscription record the having in the buffer inquired is set
Imitate the time.
When being reached between when active, then the subscription record being stored in caching is deleted.
307:When it is content provider's classification to identify identified category, then in content provider identification and content provider
Subscription record sum correspondence in inquiry third to identify corresponding subscriptions record total.
Query process is to be inquired in the corresponding subscription count table of content provider.
308:The subscription inquired record sum is returned into terminal as query result.
The embodiment of the present invention is judged by the identified category in the inquiry request for subscription information, in identified category
For subscriber's classification when, inquiry in the buffer identifies corresponding subscriptions with the presence or absence of third and records, if there is no then to order
Reader is identified as inquiry third in the subscriber identity of major key and the correspondence of content provider identification and identifies corresponding subscription
Record;When identified category is content provider's classification, sum is recorded in the subscription of content provider identification and content provider
Correspondence in inquiry third to identify corresponding subscriptions record total.Both are directed to the inquiry mode of different classes of user,
Query process and the ablation process subscribed to and unsubscribed can be distinguished, improve the efficiency of query process, reduce and look into
The time of inquiry process consumption.
Example IV
An embodiment of the present invention provides unsubscribing the method for record in a kind of method of processing subscription information, referring to Fig. 4,
Method flow includes:
401:Receive that terminal sends unsubscribes request, subscribe to carried in request subscriber the corresponding 4th identify and
Corresponding 5th mark of content provider.
402:In using subscriber identity as the correspondence of the subscriber identity of major key and content provider identification, inquiry
Include the subscription record of the 4th mark and the 5th mark correspondence, and the state in the subscription record inquired is changed to nothing
Effect state.
Wherein, in the corresponding subscription information table of subscriber, and correspondence will be identified comprising the 4th mark and the 5th
It subscribes to the state in record and is set as invalid state, and set the change time to the current time.
403:It is being identified as in the subscriber identity of major key and the correspondence of content provider identification with content provider,
Subscription record of the inquiry comprising the 4th mark and the 5th mark correspondence, and the state in the subscription record inquired is changed
For invalid state.
Wherein, in the corresponding subscription information table of subscribed person, and will include the 4th mark and the 5th mark correspondence
Subscription record in state be set as invalid state, and set the change time to the current time.
404:By the 5th mark in the correspondence of the subscription record sum of content provider identification and content provider
Corresponding subscription record sum carries out subtracting one operation.
The corresponding subscription record of the 5th mark of inquiry in the corresponding subscription count table of content provider, and remember in the subscription
Carry out subtracting one operation during the 5th mark corresponding subscriptions record in record is total.
The process for unsubscribing record in the embodiment of the present invention will be subscribed to record and be believed respectively in the corresponding subscription of subscriber
It is managed respectively in breath table and in the corresponding subscription information table of content provider.And directly content provider identification with it is interior
The correspondence for holding the subscription record sum of supplier deletes the subscription sum of each content provider, so as to direct in inquiry
The subscription sum of inquiry content provider, improves inquiry velocity in subscription record.
Embodiment five
An embodiment of the present invention provides a kind of devices of processing subscription information, and referring to Fig. 5, which includes:
First receiving module 501, the subscription request for receiving terminal transmission carry subscriber couple in the subscription request
The corresponding second identifier of first identifier and content provider answered;
First memory module 502, for being ordered the correspondence of the first identifier and the second identifier as one
Read record, be stored respectively in using subscriber identity as the correspondence of the subscriber identity of major key and content provider identification and with
Content provider identification is in the subscriber identity of major key and the correspondence of content provider identification;
First processing module 503, for corresponding with the subscription record sum of content provider in content provider identification
The corresponding subscription record sum of the second identifier is carried out in relationship plus one operates.
Wherein, described device further includes:
Second receiving module 504, the inquiry request for subscription information for receiving terminal transmission, the inquiry request
Middle carrying identified category and third mark;Wherein, include the user and content provider of subscriber's classification in subscription information
Subscription record between the user of classification;
First enquiry module 505, for when it is subscriber's classification to identify the identified category, then inquiring in the buffer
Corresponding subscription record is identified with the presence or absence of the third;If do not inquired, using subscriber identity as the subscription of major key
Person identifies in the correspondence with content provider identification, the subscription that inquiry is identified comprising the third and state is effective status
Record;
Second enquiry module 506, for when it is content provider's classification to identify the identified category, then being carried in content
Donor identifies subscription corresponding with the third mark is inquired in the correspondence of the subscription record sum of content provider and records
Sum.
Wherein, described device further includes:
Second memory module 507, subscription record storage for will inquire inquire in caching, and described in being arranged
Subscribe to the effective time being recorded in the caching.
Wherein, described device further includes:
Third receiving module 508, the request that unsubscribes for receiving terminal transmission are carried in the subscription request and are subscribed to
Corresponding 4th mark of person and corresponding 5th mark of content provider;
First change module 509, for using subscriber identity as the subscriber identity of major key and content provider identification
Correspondence in, inquiry identifies the subscription record of correspondence comprising the 4th mark and the described 5th, and will inquire
Subscription record in state be changed to invalid state;
Second change module 510, in the subscriber identity and content provider for being identified as major key with content provider
In the correspondence of mark, inquiry identifies the subscription record of correspondence comprising the 4th mark and the described 5th, and will look into
State in the subscription record ask is changed to invalid state;
Second processing module 511, for corresponding with the subscription record sum of content provider in content provider identification
By the described 5th corresponding subscriptions is identified in relationship record sum carry out subtracting one operation.
Wherein, described device further includes:
Update module 512, for periodically according to subscriber identity and the content for being identified as major key with content provider
The correspondence of supplier's mark, in the correspondence of the subscription record sum of content provider identification and content provider
Hold the corresponding subscription record sum of supplier's mark to be updated and correct.
Addition subscribes to record and unsubscribes the process of record in the embodiment of the present invention, will subscribe to record and is subscribing to respectively
It is managed respectively in the corresponding subscription information table of person and in the corresponding subscription information table of content provider, and directly in content
Supplier identifies the subscription for increasing or deleting each content provider with the correspondence of the subscription record sum of content provider
Sum improves inquiry velocity so that directly the subscription of inquiry content provider is total in subscription record in inquiry.Separately
Outside, in order to avoid record is subscribed in the addition of big data rank or unsubscribes the data update being susceptible in record operating process
Mistake can also periodically tie up the correspondence of the subscription record sum of content provider identification and content provider
Shield.
It is to subscribe in identified category in addition, being judged by the identified category in the inquiry request for subscription information
When person, inquiry in the buffer is recorded with the presence or absence of corresponding subscriptions of first identifier, if there is no being with subscriber identity then
The subscriber identity of major key subscription corresponding with first identifier is inquired in the correspondence of content provider identification records;It is identifying
When classification is content provider, inquired in the correspondence of the subscription record sum of content provider identification and content provider
The corresponding subscription record sum of first identifier.Both be directed to different classes of user inquiry mode, can by query process with
The ablation process subscribed to and unsubscribed distinguishes, and improves the efficiency of query process, reduces the time of query process consumption.
The embodiments of the present invention are for illustration only, can not represent the quality of embodiment.
One of ordinary skill in the art will appreciate that realizing that all or part of step of above-described embodiment can pass through hardware
It completes, relevant hardware can also be instructed to complete by program, the program can be stored in a kind of computer-readable
In storage medium, storage medium mentioned above can be read-only memory, disk or CD etc..
The foregoing is merely presently preferred embodiments of the present invention, is not intended to limit the invention, it is all the present invention spirit and
Within principle, any modification, equivalent replacement, improvement and so on should all be included in the protection scope of the present invention.