A kind of method and device for sending information configuration file
Technical field
The present invention relates to field of computer technology, more particularly to a kind of method and device for sending information configuration file.
Background technology
With the development of computer technology, the appearance of online voice and video platform greatly enriches the life of user, should
Platform provides a user the content of multimedia such as video frequency program or audio program.In online voice and video platform, class of subscriber is to order
The user for the person of readding by the user of content provider can subscribe to its content of multimedia provided to class of subscriber.Content provider
User in use, can by Subscriber to subscribe to its provide content of multimedia subscriber user send out
Prompt message is sent, to initiate to point out to the user of subscriber.For example:The renewal time of issuing multimedia contents or content advance notice.
Subscriber is in the order for the transmission prompt message that the user for receiving content provider sends, according to the life
Acquisition in the subscriber identity that store from itself of content provider identification that order is carried and the corresponding relation of content provider identification
The corresponding subscriber identity of the content provider identification, and believed according to the prompting for being sent to each subscriber carried in order
Breath, the subscriber identity got and the subscriber identity are corresponding for generating relevant information (example in information configuration file
Such as:Content of multimedia mark, prompt message signature, prompt message expired time etc.) generation information configuration file.Subscriber
The information configuration file is sent to the given server of special transmission information, and the information configuration is parsed by the given server
File, and prompt message is sent to the user of each subscriber according to the subscriber identity after information configuration document analysis.
Inventor has found that prior art at least has problems with:
Because the number of users of subscriber is numerous, therefore the order of magnitude of the subscriber identity got can be very big, so that raw
Into information configuration file capacity it is larger, and then the overlong time of the information configuration file to given server is sent, in net
The time can be longer used in the peak time of network flow, reduces the efficiency for sending prompt message.
The content of the invention
In order to solve problem of the prior art, the embodiments of the invention provide it is a kind of send information configuration file method and
Device.The technical scheme is as follows:
On the one hand there is provided a kind of method for sending information configuration file, methods described includes:
In the corresponding relation of subscriber identity and content provider identification, specifying for first predetermined number is obtained in batches
The corresponding subscriber identity of content provider identification;
The prompt message sent according to the content provider specified to subscriber, generation is per a collection of subscriber identity couple
The information configuration file answered;
Default compression algorithm is called to enter to described per the corresponding information configuration file of a collection of subscriber identity got
Row compression is handled, and the information configuration file after compression is handled is sent to given server, so that the given server pair
Described information configuration file carries out decompression, and the subscriber identity in the information configuration file after decompression
Prompt message is sent to subscriber.
Optionally, the corresponding subscriber's mark of the content provider identification specified that the first predetermined number is obtained in batches
Know, including:
The corresponding subscriber identity of the content provider identification specified of the second predetermined number is obtained every time;
Second predetermined number is less than or equal to first predetermined number.
Optionally, the prompt message sent according to the content provider specified to subscriber, generation is per a collection of
The corresponding information configuration file of subscriber identity, including:
Obtain the prompt message that the content provider specified sends to subscriber;
Obtain the corresponding relevant information for generating needed for information configuration file per a collection of subscriber identity;
According to the prompt message, the relevant information and every a collection of subscriber identity generate described per a collection of
The corresponding information configuration file of subscriber identity.
Optionally, it is described compression is handled after information configuration file be sent to given server, including:
Information configuration file synchronization after compression is handled by HTTP http agreements is sent to specified clothes
The prompt message being engaged in device sends process.
On the other hand there is provided a kind of device for sending information configuration file, described device includes:
Acquisition module, in the corresponding relation of subscriber identity and content provider identification, first being obtained in batches pre-
If the corresponding subscriber identity of the content provider identification specified of quantity;
Generation module, for the prompt message sent according to the content provider specified to subscriber, is generated each
Criticize the corresponding information configuration file of subscriber identity;
Compression module, for calling default compression algorithm to described per the corresponding letter of a collection of subscriber identity got
Breath configuration file is compressed processing;
Sending module, for compression to be handled after information configuration file be sent to given server so that it is described specify
Server carries out decompression, and ordering in the information configuration file after decompression to described information configuration file
The person of readding identifies to subscriber and sends prompt message.
Optionally, the acquisition module specifically for:
The corresponding subscriber identity of the content provider identification specified of the second predetermined number is obtained every time;
Second predetermined number is less than or equal to first predetermined number.
Optionally, the generation module, including:
First acquisition unit, for obtaining the prompt message that the content provider specified sends to subscriber;
Second acquisition unit, for obtaining be used for generate information configuration file needed for corresponding per a collection of subscriber identity
Relevant information;
Generation unit, for according to the prompt message, the relevant information and described per a collection of subscriber identity, life
Into described per the corresponding information configuration file of a collection of subscriber identity.
Optionally, the sending module specifically for:
Information configuration file synchronization after compression is handled by HTTP http agreements is sent to specified clothes
The prompt message being engaged in device sends process.
The beneficial effect that technical scheme provided in an embodiment of the present invention is brought is:
The corresponding subscriber identity of content provider specified by obtaining in batches, generation correspondence per a collection of subscriber identity
Information configuration file, and each information configuration file of generation is compressed processing.Each information is reduced first
The capacity of configuration file;The mode of information configuration file is sent in batches in addition, on the one hand due to the appearance of each information configuration file
Amount is small, and the time that can reduce transmission improves the efficiency of transmission, and another aspect given server receives each information configuration text
Parsing can be just carried out after part to it and performs the flow for sending prompt message, the information configuration files whole without receiving enter again
Row is sent, and improves the transmitting efficiency of prompt message.
Brief description of the drawings
Technical scheme in order to illustrate the embodiments of the present invention more clearly, makes required in being described below to embodiment
Accompanying drawing is briefly described, it should be apparent that, drawings in the following description are only some embodiments of the present invention, for
For those of ordinary skill in the art, on the premise of not paying creative work, other can also be obtained according to these accompanying drawings
Accompanying drawing.
Fig. 1 is the method flow diagram for the transmission information configuration file that the embodiment of the present invention one is provided;
Fig. 2 is the method flow diagram for the transmission information configuration file that the embodiment of the present invention two is provided;
Fig. 3 is the apparatus structure schematic diagram for the transmission information configuration file that the embodiment of the present invention three is provided.
Embodiment
To make the object, technical solutions and advantages of the present invention clearer, below in conjunction with accompanying drawing to embodiment party of the present invention
Formula is described in further detail.
Embodiment one
The embodiments of the invention provide a kind of method for sending information configuration file, referring to Fig. 1.
It should be noted that the implement scene for 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, and the class of subscriber of teacher carries for content
Donor, student can watch the online course that the teacher of subscription provides in the online education platform;Used in audio-visual amusement platform
The class of subscriber at family is subscriber, and the class of subscriber of main broadcaster is content provider, and user can see in the audio-visual amusement platform
See the content of multimedia that the main broadcaster of subscription provides.
The corresponding relation of subscriber identity and content provider identification are pre-saved in Subscriber, can be passed through
Obtained in the corresponding subscription information table of subscriber or the corresponding subscription information table of content provider.
Wherein, the subscriber identity being stored with the corresponding subscription information table of subscriber using subscriber identity as major key with it is interior
Holding in every in the corresponding relation of supplier's mark, the corresponding subscription information table of subscriber subscription record to preserve
This is subscribed to and records corresponding state, and the validity of record, i.e. effective status or disarmed state are subscribed to for identifying this;May be used also
To preserve the change time of this record.Wherein, using subscriber identity as the major key of the table, it is being by subscriber identity then
When search key is inquired about, inquiry velocity in the table can be improved.
The subscriber identity being stored with the corresponding subscription information table of content provider using subscriber identity as major key with it is interior
Holding in every in the corresponding relation of supplier's mark, the corresponding subscription information table of subscriber subscription record to preserve
This is subscribed to and records corresponding state, and the validity of record, i.e. effective status or disarmed state are subscribed to for identifying this;May be used also
To preserve the change time of this record.Wherein, the major key of the table is designated with content provider, then is provided by content
When person is designated search key and inquired about, inquiry velocity in the table can be improved.
Subscriber can receive the transmission prompting of user's issue of content provider before execution of the embodiment of the present invention
The order of information, carries content provider identification and needs the prompt message of transmission in the order.For to subscribe to the content
The subscriber that supplier identifies the content of multimedia that corresponding user provides sends prompt message.
Wherein, this method flow includes:
101:In the corresponding relation of subscriber identity and content provider identification, the finger of the first predetermined number is obtained in batches
The corresponding subscriber identity of fixed content provider identification;
102:The prompt message sent according to specified content provider to subscriber, generation is per a collection of subscriber identity couple
The information configuration file answered;
103:Default compression algorithm is called to entering per the corresponding information configuration file of a collection of subscriber identity got
Row compression is handled, and the information configuration file after compression is handled is sent to given server, so that given server is to information
Configuration file carries out decompression, and subscriber identity in the information configuration file after decompression is to subscriber
Send prompt message.
The corresponding subscriber identity of content provider that the embodiment of the present invention is specified by obtaining in batches, generation is ordered per a collection of
The person of readding identifies corresponding information configuration file, and each information configuration file of generation is compressed into processing.Reduce first
The capacity of each information configuration file;The mode of information configuration file is sent in batches in addition, on the one hand due to each information
The capacity of configuration file is small, and the time that can reduce transmission improves the efficiency of transmission, and another aspect given server receives each
Parsing can be just carried out after individual information configuration file to it and performs the flow for sending prompt message, whole information without receiving
Configuration file is transmitted again, improves the transmitting efficiency of prompt message.
Embodiment two
The embodiments of the invention provide a kind of method for sending information configuration file, referring to Fig. 2.
It should be noted that Subscriber can receive user's hair of content provider before execution of the embodiment of the present invention
The order of the transmission prompt message of cloth, carries content provider identification and needs the prompt message of transmission in the order.For
Prompt message is sent to the subscriber for subscribing to the content of multimedia that the corresponding user of the content provider identification provides.
Wherein, this method flow includes:
201:In the corresponding relation of subscriber identity and content provider identification, the finger of the first predetermined number is obtained in batches
The corresponding subscriber identity of fixed content provider identification.
Wherein, content provider identification is at least carried in the event;The content of prompt message;Content identification;Specify user
Scope identifier is (such as:Online user;Login user;Online+login user).Subscriber obtains content according to the event and provided
Person identifies corresponding subscriber identity.
Wherein, the process for obtaining the corresponding subscriber identity of content provider identification is in batches in subscriber identity and content
The subscriber identity of the first predetermined number is obtained in the corresponding relation of supplier's mark.For example:Content provider identification is corresponding
The sum of subscriber identity is 100,000, and the first predetermined number is 10,000, therefore it is then to divide 10 to obtain the process of subscriber identity
Batch, per 10,000 subscriber identities of a collection of acquisition.
Optionally, because the sum of the first predetermined number subscriber identity corresponding with content provider is not necessarily again
Number relation, such as:The sum of the corresponding subscriber identity of content provider identification is 100,000, and the first predetermined number is 30,000, then
Quantity in first three batch per a collection of subscriber identity got is 30,000, and the 4th batch can not then get 30,000 subscriber's marks
Know.Therefore, in the case where being unsatisfactory for getting the subscriber identity of the first predetermined number, the embodiment of the present invention is then by following
Step is handled:
The corresponding subscriber identity of the content provider identification specified of the second predetermined number is obtained every time;Second present count
Amount is less than or equal to the first predetermined number.
Wherein, when obtaining subscriber identity in the corresponding relation of subscriber identity and content provider identification, if nothing
When method gets the subscriber identity of the first predetermined number, then the subscriber identity for obtaining volume residual is the second predetermined number
Subscriber identity.
202:The prompt message sent according to specified content provider to subscriber, generation is per a collection of subscriber identity couple
The information configuration file answered.
Comprising all kinds of configuration parameters for being used to send prompt message in information configuration file, Subscriber is generating the letter
Cease after configuration file, the information configuration file is sent to given server, given server is then parsing the information configuration
After file, prompt message is sent to each subscriber according to the subscriber identity included in information configuration file.
Wherein, information configuration file is assisted with XML (Extensible Markup Language, extensible markup language)
The file generated for standard is discussed, wherein containing a variety of field informations.
It can include:
Type fields, the type of prompt message;
App_id fields, the mark of content;
Msg_id fields, the mark of system information;
Receiver_count, the sum of subscriber identity;
Fingerprint, the signature of prompting message;
User_set, all subscriber identities;
Message, prompt message to be sent;
Time_from, the transmission time of prompt message;
Time_to, the expired time of prompt message;
Status, the range of transmission of prompt message.
Subscriber can be that generation is corresponding per a collection of subscriber identity after getting per a collection of subscriber identity
Information configuration file.
Wherein, the process of information configuration file is generated in step 202 to be carried out by step 2021- steps 2023:
2021:Obtain the prompt message that the content provider specified sends to subscriber.
Wherein, by obtaining the prompt message in the event for sending prompt message to subscriber.
2022:Obtain the corresponding relevant information for generating needed for information configuration file per a collection of subscriber identity.
Wherein, relevant information is included in above-mentioned information configuration file except prompt message and subscriber identity the two fields
The content in other fields in addition.
Wherein, the type of prompt message, the mark of content, the mark of system information, the transmission time of prompt message, prompting
The expired time of information, the range of transmission of prompt message these parameters are that Subscriber sends prompt message according to subscriber
Event get.The sum of subscriber identity is then the first predetermined number or the second present count that are got according to this batch
What amount was determined.The signature of prompting message is generated according to MD5 algorithms, and wherein the signature can be obtained by the following formula:
Fingerprint=MD5 (app_id, msg_id, time_from, message body, key);
2023:According to prompt message, relevant information and per a collection of subscriber identity, generation is per a collection of subscriber identity couple
The information configuration file answered.
The relevant information needed for the above-mentioned generation information configuration file got is added as default each field is respectively
In empty information configuration file, it can both generate per the corresponding information configuration file of a collection of subscriber identity.
203:Default compression algorithm is called to entering per the corresponding information configuration file of a collection of subscriber identity got
Row compression is handled, and the information configuration file after compression is handled is sent to given server, so that given server is to information
Configuration file carries out decompression, and subscriber identity in the information configuration file after decompression is to subscriber
Send prompt message.
Wherein, in the user_set fields in information configuration file, each subscriber identity is by default label
It is spaced, for example:<uid>UID1</uid><uid>UID2</uid><uid>UID3</uid>.Wherein UID subscribes to for each
Person identifies.Substantial amounts of redundancy label is there is in the user_set fields, i.e.,<uid>With</uid>Label.Information configuration
Capacity is larger also in that there is quantity extremely huge subscriber identity and redundancy label in file, in order to by information configuration
The capacity of file, to improve the transmission speed of information configuration file.
Selected default compression algorithm is in embodiments of the present invention:Zlib algorithms, by the algorithm by XML file
In string content be compressed, can play reduction information configuration file size effect.Wherein, zlib algorithms are being set
Configuration when, quality can be arranged as required to preferably or the configuration parameter such as volume priority.
Further, for compression is handled after information configuration file be sent to the transmission process of given server,
It is specially in the embodiment of the present invention:
After by http (Hypertext transfer protocol, HTTP) agreement, compression is handled
Information configuration file synchronization be sent to prompt message in given server and send process.
204:Given server is received per the corresponding information configuration file of a collection of subscriber identity, and to per a collection of subscriber
Identify corresponding information configuration file and carry out decompression, each after decompression in information configuration file
Subscriber identity, prompt message is sent to subscriber.
Wherein, the mode of synchronized transmission is that given server needs to be received entirely after information configuration file, just can be with
Decompression and follow-up parsing information configuration file and the process for sending prompt message are carried out to it.
Due to obtaining subscriber identity in batches, therefore generating the corresponding information configuration text per a collection of subscriber identity
After part, then the information configuration file is sent to given server by Subscriber.Without waiting for the subscription of other batches
Person identifies corresponding information configuration file generated and finished, therefore this mode for generating information configuration file in batches, and then specifies
Server can carry out decompression and follow-up parsing information configuration text after each information configuration file is received
Part and the process for sending prompt message.It is further to reduce the time transmitted for information configuration file, improve transmission and carry
Show the efficiency of information.
The corresponding subscriber identity of content provider that the embodiment of the present invention is specified by obtaining in batches, generation is ordered per a collection of
The person of readding identifies corresponding information configuration file, and each information configuration file of generation is compressed into processing.Reduce first
The capacity of each information configuration file;The mode of information configuration file is sent in batches in addition, on the one hand due to each information
The capacity of configuration file is small, and the time that can reduce transmission improves the efficiency of transmission, and another aspect given server receives each
Parsing can be just carried out after individual information configuration file to it and performs the flow for sending prompt message, whole information without receiving
Configuration file is transmitted again, improves the transmitting efficiency of prompt message.
Embodiment three
The embodiments of the invention provide a kind of device for sending information configuration file, referring to Fig. 3, the device includes:
Acquisition module 301, in the corresponding relation of subscriber identity and content provider identification, first to be obtained in batches
The corresponding subscriber identity of the content provider identification specified of predetermined number;
Generation module 302, for the prompt message sent according to the content provider specified to subscriber, generation is per a collection of
The corresponding information configuration file of subscriber identity;
Compression module 303, for calling default compression algorithm to per the corresponding letter of a collection of subscriber identity got
Breath configuration file is compressed processing;
Sending module 304, for compression to be handled after information configuration file be sent to given server so that specify clothes
Device be engaged in information configuration file progress decompression, and subscriber's mark in the information configuration file after decompression
Know to subscriber and send prompt message.
Wherein, acquisition module 301 specifically for:
The corresponding subscriber identity of the content provider identification specified of the second predetermined number is obtained every time;
Second predetermined number is less than or equal to the first predetermined number.
Wherein, generation module 302, including:
First acquisition unit, for obtaining the prompt message that the content provider specified sends to subscriber;
Second acquisition unit, for obtaining be used for generate information configuration file needed for corresponding per a collection of subscriber identity
Relevant information;
Generation unit, for according to prompt message, relevant information and per a collection of subscriber identity, generation to be subscribed to per a collection of
Person identifies corresponding information configuration file.
Wherein, sending module 304 specifically for:
Information configuration file synchronization after compression is handled by HTTP http agreements is sent to specified clothes
The prompt message being engaged in device sends process.
The corresponding subscriber identity of content provider that the embodiment of the present invention is specified by obtaining in batches, generation is ordered per a collection of
The person of readding identifies corresponding information configuration file, and each information configuration file of generation is compressed into processing.Reduce first
The capacity of each information configuration file;The mode of information configuration file is sent in batches in addition, on the one hand due to each information
The capacity of configuration file is small, and the time that can reduce transmission improves the efficiency of transmission, and another aspect given server receives each
Parsing can be just carried out after individual information configuration file to it and performs the flow for sending prompt message, whole information without receiving
Configuration file is transmitted again, improves the transmitting efficiency of prompt message.
The embodiments of the present invention are for illustration only, and the quality of embodiment is not represented.
One of ordinary skill in the art will appreciate that realizing that all or part of step of above-described embodiment can be by hardware
To complete, the hardware of correlation can also be instructed to complete by program, described program can be stored in a kind of computer-readable
In storage medium, storage medium mentioned above can be read-only storage, disk or CD etc..
The foregoing is only presently preferred embodiments of the present invention, be not intended to limit the invention, it is all the present invention spirit and
Within principle, any modification, equivalent substitution and improvements made etc. should be included in the scope of the protection.