Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of the structures.
Example one
Fig. 1 is a flowchart of a processing method for real-time delivery of a billing mail according to an embodiment of the present invention, which is applicable to a situation of obtaining the billing mail, and the method can be executed by a processing device, and specifically includes the following steps:
s110, obtaining original bill data to be processed, and generating a bill data file according to the original bill data based on a set data format.
The original bill data can be business data which is not formatted and stylized, and the memory size of the original bill data is usually within 10K; the bill data file may be a file obtained by formatting the original bill data, that is, a file generated by analyzing, checking, and formatting various electronic bills to obtain bill data, and generally, the memory size of the bill data file is about 10K.
At the beginning of each month, the service system of the operator pushes the generated original bill data to the mail server, and when the mail server acquires the original bill data, the service system first acquires information such as the type, analysis configuration and the like of the bill data from a configuration center of the mail server. And if the relevant information cannot be acquired, reporting the abnormal information to an operator network server to feed back to the operator for configuration updating. After the mail server side receives the delivery request, UIN (user identity authentication code) information of each receiver is inquired, and UIN information lists and bill information lists of all users are sent to a bill storage of the mail server side.
And after the analysis configuration information is acquired, formatting the original bill data according to a bill standard configuration format, namely, performing processing such as checking, formatting and the like on various electronic bills to generate a bill data file.
When a mail server side receives an original data bill, firstly, acquiring analysis configuration information of the electronic bill from the mail server side, detecting the type of the bill data, then selecting a corresponding standard configuration format to carry out verification and format normalization processing according to the type of the original bill data, namely, carrying out verification comparison on the electronic bills of different types and the corresponding standard configuration format, if the electronic bills do not meet the requirements of the format standard configuration format, carrying out format normalization processing on the electronic bills, then carrying out verification until the electronic bills meet the requirements of the standard configuration format, and finally generating a bill data file.
The operator can be a communication operator such as mobile, Unicom and telecom, a bank (China bank, China construction bank, business-inviting bank, etc.) and an e-commerce (Jingdong, Payment Bao, etc.), and the technical scheme of the invention can also be applied when the information such as the repayment amount and the period of the credit card, the repayment amount and the period of the Jingdong white bar, etc. is sent to the user in the form of a mail.
For example, assuming that a subscriber uses a SIM card of a mobile communication carrier, the mobile communication carrier counts billing information consumed by the subscriber in 6 months at the beginning of 7 months. Wherein, the original bill data includes: user information and data information such as telephone charge consumption details, traffic usage details, remaining points, posting details (marketing activity return details) and total consumption of the user in the last half year, which are consumed by the user in 6 months. Suppose that the user consumed 150 dollars of telephone charges and 2G of traffic data in month 6, and the mobile operator's marketing campaign returned 20 dollars; wherein, in 150 yuan of charges, include specifically: 38 yuan package fee, 62 yuan calling fee, 20 yuan short and multimedia fee and 30 yuan flow fee.
When the mail server side acquires the type and the analysis configuration information of the account data, if the type and the analysis configuration information cannot be acquired, reporting abnormal information to an operator network server to feed back to an operator for configuration updating; if the acquired bill data type and the analysis configuration information are related information of the mobile operator, the original bill data is checked and compared according to the standard configuration format of the communication operator, whether the original bill data conforms to the standard configuration format of the communication operator is judged, if the original bill data does not conform to the standard configuration format of the communication operator, formatting and warping are carried out on the original bill data, and formatting and warping are carried out on the bill data again, so that a bill data file of the communication operator is generated.
The standard configuration formats of different operators are also different, that is, the standard configuration formats of communication operators, banks and e-merchants are different due to different user account information. For example, a 38 dollar package fee is listed in a tabular format, including: 4G _600M data package and 4G _180 minute voice package; the short and multimedia fees are also listed in the form of a table, including: consumption details such as the cost of sending the short message to the port, the point-to-point communication short message cost, the point-to-point mobile short message cost and the like are provided; the total consumption amount of the user in the last half year is represented by a bar chart, namely the user can clearly view the consumption trend of about 6 months and can be represented in the forms of a table, a bar chart and the like, but the representation form of the bill data information is not limited to the table and the bar chart, can also be in the forms of a pie chart and the like, and is subject to standard configuration formats of different operators, and finally, a bill data file corresponding to the original bill data is generated.
And S120, extracting user bill storage information from the bill data file to generate a bill index file.
It should be noted that, after the original bill data is generated into the bill data file based on the set data format, the bill storage information of the user is extracted from the bill data file, and the bill index file is generated. Wherein, bill storage information includes: user number, billing period, billing data file path, and billing offset.
Similarly, the generation of the bill index file will be described by taking the bill for consumption communicated by the user in month 6 as an example. After the original bill data such as the telephone charge consumption detail and the flow use detail of the user in 6 months are processed, a corresponding bill data file is generated, and the mobile phone number of the user, the billing period of the bill, the corresponding bill data file path and the offset of the bill in all bill data files are extracted from the bill data file. Suppose that the extracted mobile phone number of the user is 135 XXXXX 7292, the billing period of the bill is from 2016 (6 months, 01 days) to 2016 (6 months, 31 days), and the path of the bill data file ishttp://appmail.mail.10086.cnAnd the bill is offset in the bill data file by 26. And after the bill information is extracted, generating a bill index file.
And S130, respectively storing the bill data file and the bill index file into corresponding databases.
It should be noted that after the bill data file and the bill index file are obtained, the two files are put into a warehouse. Due to the fact that the data magnitude is large, a Hadoop (open source common big data framework) platform is used for managing data at the bottom layer of the mailbox system, and therefore storage of mass billing data can be achieved, and meanwhile fast data retrieval capacity can be provided.
Preferably, in order to better optimize the indexing capability during real-time packaging when the index values in the bill index table are put in storage, the bill data file is stored in the HDFS, and the bill index table is stored in the HBase database. The HDFS is a large data file system with high fault tolerance and can provide high throughput to access data of an application program; HBase is a distributed, column-oriented open-ended database. Meanwhile, when the bill data of the user is extracted, the user number and the bill period can be used as main keys to inquire the bill index file and obtain information such as a corresponding bill data file path, a bill offset and the like, so that the detailed data information of the bill data file of the user is positioned, and the function of quickly extracting the bill data is realized.
According to the technical scheme of the embodiment, the bill data file is generated according to the original bill data based on the set data format by acquiring the original bill data to be processed; extracting user bill storage information from the bill data file to generate a bill index file; the bill data file and the bill index file are respectively stored in the corresponding databases, so that the problem of concurrent pressure of batch processing of bill mails by a mailbox system is solved, real-time delivery of the on-line bill mails is realized, the delivery efficiency of the bill mails is improved, and the storage space of the bill mails is reduced.
Example two
Fig. 2 is a flowchart of a processing method for real-time delivery of a billing mail according to a second embodiment of the present invention, which is applicable to a situation of obtaining the billing mail, and the method can be executed by a processing device, and specifically includes the following steps:
s210, obtaining original bill data to be processed, and generating a bill data file according to the original bill data based on a set data format.
And S220, extracting user bill storage information from the bill data file to generate a bill index file.
And S230, respectively storing the bill data file and the bill index file into corresponding databases.
It should be noted that, in the technical solution of the present invention, the original bill data is processed to generate a bill data file and a bill index file, and the file is stored in a bill memory. That is, only the bill data file and the bill index file are stored in the bill storage, and the complete mail content is not stored, so that the number of times of disk IO (input/output) is effectively reduced, the transmission of the mail in the EML format in the mailbox system is omitted, and because the server side of the original mailbox system can only deliver one bill mail to the bill storage at one time, the mailbox system in the application can deliver bills in thousands of units to the bill storage at one time, and the delivery efficiency of the bill mail is effectively improved.
And S240, when receiving a mail receiving instruction triggered by a user, acquiring and returning bill data corresponding to the user information from the database according to the user information corresponding to the mail receiving instruction.
Preferably, when the user clicks to receive the mail at the mail client, the mail client initiates a mail synchronization request to the POP/IMAP service of the mailbox service provider, that is, when the mail server receives a mail receiving instruction triggered by the user, the mail client acquires a bill data file from the HBase database according to the user information corresponding to the mail receiving instruction, further processes the bill data file, and acquires bill data corresponding to the user information.
The bill data is delivered only when a mail receiving instruction triggered by a user is received, so that the bill mail of the user is better realized in real time. Meanwhile, when the user receives the mails, version library management is adopted for the bill data in the HBase database, namely, when the user motor checks the bill, the mailbox system firstly checks whether the delivered bill is changed, if so, the bill data is delivered again, real-time bill content is provided, and meanwhile, the delivered bill data is reserved; if not, the bill is not needed to be delivered again, and only the corresponding bill index file needs to be positioned, so that resources required by delivery are saved.
According to the technical scheme of the embodiment, when the mail server receives the mail receiving instruction triggered by the user, the bill data file of the user is obtained from the HBase database, and the bill data corresponding to the user information is returned, so that the problem of concurrence pressure of the bill mails is solved in batch by the mailbox system, real-time delivery of the online bill mails is realized, the delivery efficiency of the bill mails is improved, and the storage space of the bill mails is reduced.
EXAMPLE III
Fig. 3 is a flowchart of a processing method for real-time delivery of a billing mail according to a third embodiment of the present invention. In this embodiment, based on the second embodiment, the S240 is optimized, which specifically includes the following steps:
s241, when receiving a mail receiving instruction triggered by a user, reading corresponding user bill storage information from the bill index file according to user information corresponding to the mail receiving instruction;
it should be noted that, when the mail server receives a mail receiving instruction triggered by a user, the mail server queries a bill index file according to user information corresponding to the mail receiving instruction, and reads a corresponding user number, a bill period, a bill data file path, and a bill offset in the bill index file.
Firstly, when a user clicks to receive a mail at a mail server, a mail client initiates a mail synchronization request to a mail box service provider POP/IMAP service;
and then, after receiving the mail synchronization request, the POP/IMAP service of the mailbox service provider extracts the personal mail of the user according to the user information, simultaneously inquires the bill mail storage record of the user, judges whether new bill data are processed or not, and generates a new bill data file. If no new bill data file is added into the HBase database, the MID information (mail unique identification code) of the user mail is found through the mail serial number, and the UIN and the bill number of the user are extracted from the bill storage by taking the MID information as the basis; and then, searching a bill index file of the user through the UIN and the bill number, and reading corresponding bill storage information of the user according to the bill index file.
If a new bill data file is generated, reading template configuration from a configuration center according to the type of original bill data to be processed, carrying out verification and format normalization processing on the original bill data to generate a bill data file, extracting bill storage information from the bill data file to generate a bill index file, and then respectively storing the bill data file and the bill index file into an HDFS (Hadoop distributed file) and an HBase (HBase) database. And meanwhile, acquiring a bill index file from the HBase database according to the user information, and reading corresponding user bill storage information according to the index file.
S242, reading corresponding bill data from the bill data file based on the user bill storage information;
preferably, after acquiring the bill storage information such as the user number, the bill period, the bill data file path, the bill offset and the like from the bill index file, the corresponding bill data file is queried based on the bill storage information, and the corresponding bill data detail is read from the bill data file.
And S243, generating a user bill according to the bill data and a set template, and feeding back the user bill to an electronic mailbox corresponding to the mail receiving instruction in an electronic mail mode.
It should be noted that, in the technical scheme of the present invention, the mailbox system does not adopt the traditional mode of "drop first and see second" active delivery of the bill mail, but adopts the passive mode of "fetch on demand", that is, the original bill data to be processed is firstly analyzed, verified and formatted, and the bill data file with the standard configuration format is generated; and then, processing the bill data file according to a set template according to the requirements of the user to generate a user bill in an HTML format, packaging the user bill according to a standard mail protocol to generate an electronic bill mail in an EML format, and feeding back the packaged electronic bill mail to an electronic mailbox corresponding to the mail receiving instruction in an electronic mail mode. It should be noted that, when the electronic bill mail is obtained and the electronic bill mail is fed back to the electronic mailbox corresponding to the mail receiving instruction, the personal mail of the user, that is, the non-electronic bill mail, may also be obtained and fed back at the same time.
And processing the bill data file according to a set template, wherein the memory size of the generated user bill is about 400-500K. Therefore, in the technical scheme of the invention, the system directly stores the bill mails in the EML format at the bottom layer of the mailbox system, and the system does not directly store the bill mails in the EML format in the delivery of the original mailbox system in the prior art, thereby greatly reducing the storage pressure. Meanwhile, the original mailbox system fixedly generates the bill mails in the EML format of all users at the beginning of each month and pushes the bill mails to the users, and the original mailbox system occupies operating system resources in a large proportion in the delivery process. The mailbox system passively generates the bill mails in the EML format according to the requirements of the user, so that the problem of centralized mail processing time is avoided.
Meanwhile, in the technical scheme of the invention, the user can perform various flexible interactions on the electronic bill, including historical data query and consumption analysis, and based on the intelligent analysis capability of the mail server, the system has better timeliness to recommend more reasonable service links, and the effect of 'thousands of people and thousands of faces' of personalized bills is realized.
In the technical scheme of the invention, the mailbox system also supports the ability of the user to withdraw the mail and delete the mail, and the user can retrieve and read the state of the mail. For example, when user a sends a mail to user B, but the name of user B in the mail body is wrongly written due to the mistake of user a, user a may withdraw the mail by the function of withdrawing the mail and resend the mail. Meanwhile, the user A can check whether the user B reads the mail or not through the mail details, and the state of the user B reading the mail is tracked and synchronized, so that the personal interest of the user is guaranteed.
According to the technical scheme of the embodiment, the problems of analysis and storage processing of the bill data are solved by utilizing the big data processing capacity, and the original bill data of the business system is effectively processed to generate the bill data file. Meanwhile, the bill data of the internet user can be effectively managed by utilizing the mass storage and quick indexing capability of the big data, and the corresponding mail can be quickly positioned. Meanwhile, according to a mail receiving instruction triggered by the user, the bill data is generated into a bill of the user according to a set template, and the bill is fed back to the corresponding user, so that the aim of delivering the bill mail in real time on line is fulfilled.
Example four
Fig. 4 is a schematic structural diagram of a processing apparatus for real-time delivering a billing mail according to a fourth embodiment of the present invention, where the present embodiment is applicable to a situation of obtaining a billing mail, and the processing apparatus specifically includes: a first generation module 310, a second generation module 320, and a storage module 330.
The first generation module 310 is configured to obtain original bill data to be processed, and generate a bill data file according to the original bill data based on a set data format;
the second generating module 320 is configured to extract user bill storage information from the bill data file to generate a bill index file;
the saving module 330 is configured to save the bill data file and the bill index file to corresponding databases respectively.
Further, the processing apparatus further includes:
the obtaining module 340 is configured to, when receiving a mail receiving instruction triggered by a user, obtain and return billing data corresponding to user information from the database according to the user information corresponding to the mail receiving instruction.
Further, the obtaining module 340 includes:
the first reading unit is used for reading corresponding user bill storage information from the bill index file according to user information corresponding to a mail receiving instruction when the mail receiving instruction triggered by a user is received;
the second reading unit is used for reading corresponding bill data from the bill data file based on the bill storage information of the user;
and the feedback unit is used for generating a user bill according to the bill data and feeding the bill data back to the electronic mailbox corresponding to the mail receiving instruction in an electronic mail mode.
Further, the saving module 330 specifically includes: and respectively storing the bill data file and the bill index table into an HDFS (Hadoop distributed File) database and an HBase database.
The processing device for the real-time delivery bill mail can execute the processing method for the real-time delivery bill mail provided by any embodiment of the invention, and has corresponding functional modules and beneficial effects of the execution method.
EXAMPLE five
Fig. 5 is a schematic structural diagram of an apparatus according to a fifth embodiment of the present invention. FIG. 5 illustrates a block diagram of an exemplary computer device 12 suitable for use in implementing embodiments of the present invention. The computer device 12 shown in FIG. 5 is only an example and should not bring any limitations to the functionality or scope of use of embodiments of the present invention.
As shown in FIG. 5, computer device 12 is in the form of a general purpose computing device. The components of computer device 12 may include, but are not limited to: one or more processors or processing units 16, a system memory 28, and a bus 18 that couples various system components including the system memory 28 and the processing unit 16.
Bus 18 represents one or more of any of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, and a processor or local bus using any of a variety of bus architectures. By way of example, such architectures include, but are not limited to, Industry Standard Architecture (ISA) bus, micro-channel architecture (MAC) bus, enhanced ISA bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
Computer device 12 typically includes a variety of computer system readable media. Such media may be any available media that is accessible by computer device 12 and includes both volatile and nonvolatile media, removable and non-removable media.
The system memory 28 may include computer system readable media in the form of volatile memory, such as Random Access Memory (RAM)30 and/or cache memory 32. Computer device 12 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 34 may be used to read from and write to non-removable, nonvolatile magnetic media (not shown in FIG. 5, and commonly referred to as a "hard drive"). Although not shown in FIG. 5, a magnetic disk drive for reading from and writing to a removable, nonvolatile magnetic disk (e.g., a "floppy disk") and an optical disk drive for reading from or writing to a removable, nonvolatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to bus 18 by one or more data media interfaces. Memory 28 may include at least one program product having a set (e.g., at least one) of program modules that are configured to carry out the functions of embodiments of the invention.
A program/utility 40 having a set (at least one) of program modules 42 may be stored, for example, in memory 28, such program modules 42 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which examples or some combination thereof may comprise an implementation of a network environment. Program modules 42 generally carry out the functions and/or methodologies of the described embodiments of the invention.
Computer device 12 may also communicate with one or more external devices 14 (e.g., keyboard, pointing device, display 24, etc.), with one or more devices that enable a user to interact with computer device 12, and/or with any devices (e.g., network card, modem, etc.) that enable computer device 12 to communicate with one or more other computing devices. Such communication may be through an input/output (I/O) interface 22. Also, computer device 12 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network such as the Internet) via network adapter 20. As shown, network adapter 20 communicates with the other modules of computer device 12 via bus 18. It should be understood that although not shown in the figures, other hardware and/or software modules may be used in conjunction with computer device 12, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
The processing unit 16 executes various functional applications and data processing by executing programs stored in the system memory 28, for example, implementing the processing method of real-time delivery billing mail provided by the embodiment of the present invention:
acquiring original bill data to be processed, and generating a bill data file according to the original bill data based on a set data format;
extracting user bill storage information from the bill data file to generate a bill index file;
and respectively storing the bill data file and the bill index file into corresponding databases.
Further, after the storing the bill file and the bill index file to the corresponding databases respectively, the method further includes:
and when receiving a mail receiving instruction triggered by a user, acquiring and returning bill data corresponding to the user information from the database according to the user information corresponding to the mail receiving instruction.
Further, when receiving a mail receiving instruction triggered by a user, obtaining and returning bill data corresponding to the user information from the database according to the user information corresponding to the mail receiving instruction, including:
when a mail receiving instruction triggered by a user is received, reading corresponding user bill storage information from the bill index file according to user information corresponding to the mail receiving instruction;
reading corresponding bill data from the bill data file based on the user bill storage information;
and generating a user bill according to the bill data according to a set template, and feeding back the user bill to an electronic mailbox corresponding to the mail receiving instruction in an electronic mail mode.
EXAMPLE six
The sixth embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the method for processing a real-time delivery bill mail, provided in all the embodiments of the present invention:
acquiring original bill data to be processed, and generating a bill data file according to the original bill data based on a set data format;
extracting user bill storage information from the bill data file to generate a bill index file;
and respectively storing the bill data file and the bill index file into corresponding databases.
Computer storage media for embodiments of the invention may employ any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.