CN107092607B - Ticket storage method and device - Google Patents

Ticket storage method and device Download PDF

Info

Publication number
CN107092607B
CN107092607B CN201610091904.9A CN201610091904A CN107092607B CN 107092607 B CN107092607 B CN 107092607B CN 201610091904 A CN201610091904 A CN 201610091904A CN 107092607 B CN107092607 B CN 107092607B
Authority
CN
China
Prior art keywords
ticket
length
unit
file
variable
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201610091904.9A
Other languages
Chinese (zh)
Other versions
CN107092607A (en
Inventor
申凯
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Mobile Group Anhui Co Ltd
Original Assignee
China Mobile Group Anhui Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Mobile Group Anhui Co Ltd filed Critical China Mobile Group Anhui Co Ltd
Priority to CN201610091904.9A priority Critical patent/CN107092607B/en
Publication of CN107092607A publication Critical patent/CN107092607A/en
Application granted granted Critical
Publication of CN107092607B publication Critical patent/CN107092607B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/25Integrating or interfacing systems involving database management systems
    • G06F16/258Data format conversion from or to a database

Abstract

The invention discloses a ticket warehousing method and a device, wherein the method comprises the following steps: reading a ticket file; acquiring an interface number of the ticket file, and inquiring configuration information of the ticket file according to the interface number to determine whether the ticket file is a variable-length ticket; if the ticket file is a variable-length ticket, acquiring configuration information of the ticket file, wherein the configuration information at least comprises M, N, wherein M, N is a constant, M represents a fixed-length part of the ticket, and N is a basic unit of the variable-length part; determining the total length L of the call ticket file; determining the repetition number k according to the L-M + k N; and analyzing the M and each N in the ticket file, mapping the M to a first database T1, and mapping each N to a second data table T2.

Description

Ticket storage method and device
Technical Field
The invention relates to a call ticket storage technology, in particular to a call ticket storage method and a call ticket storage device.
Background
In the big data era, the call ticket is one of the most important data sources of operators, and the storage of the call ticket is the basis of subsequent analysis. The existing ticket warehousing System introduces the Next Generation service Operation Support System (NGBOSS) ticket file through a special interface machine, and then analyzes, stores and warehouses the ticket file. Specifically, the method comprises the following steps: for a fixed-length ticket, the prior art scheme is based on a fixed format of the ticket, and then analyzes words one by one and stores the words. And reserving a field with enough length for the variable-length ticket, and then warehousing in batches.
The prior art discloses a call ticket processing method, which comprises the following steps: 1) a ticket data reading module reads ticket data in a ticket file; 2) the ticket data analysis module analyzes the ticket data read by the ticket data reading module according to preset analysis configuration information and generates analysis result data in a preset format; 3) and the ticket data analysis module analyzes the analysis result data according to preset analysis configuration information and generates analysis result data. The prior art also discloses a call ticket format conversion method, which comprises the following steps: 1) sorting and preprocessing the received fixed-length format call ticket, and converting the processed fixed-length format call ticket into a variable-length format call ticket; 2) carrying out pricing and account combination processing on the variable-length format call ticket, and converting the processed variable-length format call ticket into a fixed-length format call ticket; 3) and warehousing the bill with the fixed length format after pricing and closing accounts. In the processing process of the method, a plurality of fields can be reserved in the call ticket according to the needs, so that different requirements are met. The prior art also discloses a system and a method for ticket storage, wherein the method comprises the following steps: 1) the ticket format conversion interface is used for downloading an original ticket from the service processor and converting the format of the original ticket; 2) the call ticket batch storage interface is used for guiding call tickets into an intermediate library, and the intermediate library is used for storing the guided call tickets; 3) the query analysis library is used for storing the extracted call ticket.
The prior art mainly has the following two defects when processing a 'variable-length call ticket' and entering a library: 1) the storage space is wasted; because the call ticket lengths are different, the existing method usually reserves a field space long enough to accommodate the maximum length call ticket. Most of the shorter call tickets occupy the originally unnecessary space for field alignment, thereby causing the waste of storage space. 2) Impact query performance; because the call ticket is lengthened, the prior art is difficult to statically analyze the start bit and the end bit of the call ticket, therefore, the call ticket lengthening part is not divided but put in storage as a whole, and thus, when a specific field of the lengthening part needs to be inquired, temporary division (such as invoking a substr function) is needed. The temporary field division brings performance overhead, and is not beneficial to fine-grained query analysis, so that the query and analysis efficiency of analysts is reduced.
Disclosure of Invention
In view of this, embodiments of the present invention provide a method and an apparatus for storing a ticket in a database to solve at least one problem in the prior art, which can align fields by splitting a fixed-length part and a variable-length part of a variable-length ticket and storing the fixed-length part and the variable-length part in a data table, respectively, thereby saving a storage space.
The technical scheme of the embodiment of the invention is realized as follows:
in a first aspect, an embodiment of the present invention provides a method for storing a ticket, where the method includes:
reading a ticket file;
acquiring an interface number of the ticket file, and inquiring configuration information of the ticket file according to the interface number to determine whether the ticket file is a variable-length ticket;
if the ticket file is a variable-length ticket, acquiring configuration information of the ticket file, wherein the configuration information at least comprises M, N, wherein M, N is a constant, M represents a fixed-length part of the ticket, and N is a basic unit of the variable-length part;
determining the total length L of the call ticket file;
determining the repetition number k according to the L-M + k N;
and analyzing the M and each N in the ticket file, mapping the M to a first database T1, and mapping each N to a second data table T2.
In one embodiment of the present invention, said mapping said M to a first database T1, mapping each said N to a second data table T2, comprises:
mapping an instance of the M to a record of T1, and adding a line number field as a primary key; mapping an instance of each said N correspondingly to k records of T2, each record being augmented with a row number field as a primary key, said row number being used to subsequently associate said M with each said N.
In one embodiment of the invention, the method further comprises:
collecting a piece of call ticket data from a call ticket database;
and generating the ticket data into a ticket file according to a preset rule, wherein the preset rule is that the left side of the ticket file is a fixed-length part, and the right side of the ticket file is a variable-length part.
In an embodiment of the present invention, querying configuration information of the ticket file according to the interface number to determine whether the ticket file is a variable length ticket, includes:
inquiring the analysis information of the configuration information of the ticket file according to the interface number;
and judging whether the length of the ticket file is a variable-length ticket or not according to the analysis information.
In one embodiment of the invention, the method further comprises:
if the call ticket is a fixed-length call ticket, acquiring analysis information and warehousing information of the call ticket file, and performing format conversion on the call ticket file according to the analysis information;
and mapping the ticket file after format conversion to a first data table T1 according to the warehousing information.
In a second aspect, an embodiment of the present invention provides a device for storing a ticket, where the device includes a reading unit, a first obtaining unit, an inquiring unit, a second obtaining unit, a first determining unit, a second determining unit, an analyzing unit, and a mapping unit, where:
the reading unit is used for reading the ticket file;
the first obtaining unit is used for obtaining an interface number of the call ticket file;
the query unit is used for querying the configuration information of the ticket file according to the interface number to determine whether the ticket file is a variable-length ticket;
the second obtaining unit is configured to obtain configuration information of the ticket file if the ticket file is a variable length ticket, where the configuration information at least includes M, N, where M, N is a constant, M represents a fixed length part of the ticket, and N is a basic unit of the variable length part;
the first determining unit is used for determining the total length L of the call ticket file;
the second determining unit is used for determining the repetition number k according to the L-M + k N;
the analysis unit is used for analyzing the M and each N in the ticket file;
the mapping unit is used for mapping the M to a first database T1 and mapping each N to a second data table T2.
In an embodiment of the present invention, the mapping unit includes a first mapping subunit and a second mapping subunit, where:
the first mapping subunit is used for mapping one instance of the M to T1 record, and adding a line number field as a primary key;
the second mapping subunit is configured to map one instance of each N to k records of T2, where each record is incremented by a row number field as a primary key, and the row number is used to subsequently associate M with each N.
In an embodiment of the invention, the apparatus further comprises an acquisition unit and a generation unit, wherein:
the collection unit is used for collecting a piece of call ticket data from the call ticket database;
the generating unit is used for generating the ticket file from the ticket data according to a preset rule, wherein the preset rule is that the left side of the ticket file is a fixed-length part, and the right side of the ticket file is a variable-length part.
In an embodiment of the present invention, the query unit includes a query submodule and a judgment submodule, wherein:
the query submodule is used for querying the analysis information of the configuration information of the ticket file according to the interface number;
and the judging submodule is used for judging whether the length of the ticket file is a variable-length ticket according to the analysis information.
In an embodiment of the present invention, the apparatus further includes a third obtaining unit and a saving unit, wherein:
the third obtaining unit is used for obtaining the analysis information and the warehousing information of the ticket file if the ticket is a fixed-length ticket, and performing format conversion on the ticket file according to the analysis information;
and the storage unit is used for mapping the ticket file after format conversion to a first data table T1 according to the warehousing information.
The embodiment of the invention provides a method and a device for storing call tickets, wherein, a call ticket file is read; acquiring an interface number of the ticket file, and inquiring configuration information of the ticket file according to the interface number to determine whether the ticket file is a variable-length ticket; if the ticket file is a variable-length ticket, acquiring configuration information of the ticket file, wherein the configuration information at least comprises M, N, wherein M, N is a constant, M represents a fixed-length part of the ticket, and N is a basic unit of the variable-length part; determining the total length L of the call ticket file; determining the repetition number k according to the L-M + k N; analyzing the M and each N in the ticket file, mapping the M to a first database T1, and mapping each N to a second data table T2; therefore, the fields are aligned by splitting the fixed length part and the variable length part of the variable length ticket and respectively storing the fixed length part and the variable length part in the data table, thereby saving the storage space.
Drawings
Fig. 1 is a schematic diagram of an implementation flow of a ticket warehousing method according to an embodiment of the present invention;
fig. 2-1 is a schematic structural diagram of a second-word warehousing device according to an embodiment of the present invention;
fig. 2-2 is a schematic flow chart illustrating an implementation of a double-call ticket warehousing method according to an embodiment of the present invention;
fig. 3 is a schematic diagram of a composition structure of a third ticket warehousing device according to an embodiment of the present invention.
Detailed Description
The technical solution of the present invention is further elaborated below with reference to the drawings and the specific embodiments.
Example one
In order to solve the problems in the foregoing background art, an embodiment of the present invention provides a method for storing a ticket, where the method is applied to a computing device, and a function implemented by the method may be implemented by a processor in the computing device calling a program code, where the program code may be stored in a computer storage medium.
Fig. 1 is a schematic view of an implementation flow of a ticket warehousing method according to an embodiment of the present invention, and as shown in fig. 1, the information processing method includes:
step S101, reading a ticket file;
step S102, obtaining an interface number of the ticket file, and inquiring configuration information of the ticket file according to the interface number to determine whether the ticket file is a variable-length ticket;
here, the configuration information generally includes parsing information and warehousing information, where the parsing information includes information such as whether a ticket is lengthened, a start bit, an end bit, a data type, and M, N, and is used to mainly complete format conversion; the warehousing information comprises a corresponding database, a table, field names and the like, and is used for being stored in the target database by the warehousing unit.
Step S103, if the ticket file is a variable-length ticket, acquiring configuration information of the ticket file, wherein the configuration information at least comprises M, N, wherein M, N is a constant, M represents a fixed-length part of the ticket, and N is a basic unit of the variable-length part;
step S104, determining the total length L of the call ticket file;
here, the total length L of the ticket file may be determined according to the start bit and the end bit of the ticket file.
Step S105, determining a repetition number k according to L + k × N;
step S106, analyzing the M and each N in the ticket file, mapping the M to a first database T1, and mapping each N to a second data table T2.
Here, said mapping said M to a first database T1 and mapping each said N to a second data table T2 includes:
mapping an instance of said M to a T1 record with a Rowid field added as a primary key; one instance of each of said N is correspondingly mapped to k records of T2, each record being augmented with a row number (rowid) field for subsequent association of said M with each of said N.
In the embodiment of the present invention, the method further includes:
step S107, collecting a piece of call ticket data from a call ticket database;
and S108, generating the ticket data into a ticket file according to a preset rule, wherein the preset rule is that the left side of the ticket file is a fixed-length part, and the right side of the ticket file is a variable-length part.
In the embodiment of the present invention, querying the configuration information of the ticket file according to the interface number to determine whether the ticket file is a variable length ticket, includes:
inquiring the analysis information of the configuration information of the ticket file according to the interface number;
and judging whether the length of the ticket file is a variable-length ticket or not according to the analysis information.
In the embodiment of the present invention, the method further includes:
if the call ticket is a fixed-length call ticket, acquiring analysis information and warehousing information of the call ticket file, and performing format conversion on the call ticket file according to the analysis information;
and mapping the ticket file after format conversion to a first data table T1 according to the warehousing information.
In the embodiment of the invention, a ticket file is read; acquiring an interface number of the ticket file, and inquiring configuration information of the ticket file according to the interface number to determine whether the ticket file is a variable-length ticket; if the ticket file is a variable-length ticket, acquiring configuration information of the ticket file, wherein the configuration information at least comprises M, N, wherein M, N is a constant, M represents a fixed-length part of the ticket, and N is a basic unit of the variable-length part; determining the total length L of the call ticket file; determining the repetition number k according to the L-M + k N; analyzing the M and each N in the ticket file, mapping the M to a first database T1, and mapping each N to a second data table T2; therefore, the fields are aligned by splitting the fixed length part and the variable length part of the variable length ticket and respectively storing the fixed length part and the variable length part in the data table, thereby saving the storage space.
EXAMPLE III
The present embodiment provides a method for storing a call ticket, in order to solve the above problems, where the call ticket includes a fixed-length call ticket and a variable-length call ticket, where: the call ticket with variable length is characterized in that: and L is M + k N, wherein M, N is a constant, k is variable, M represents a fixed length part of the call ticket, k N represents a variable length part of the call ticket, N is a basic unit of the variable length part, k is the repetition number of N, and L represents the total length of the variable length call ticket.
Fig. 2-1 is a schematic structural diagram of a ticket warehousing device according to an embodiment of the present invention, as shown in fig. 2-1, the device includes a ticket acquisition module, a ticket warehousing module, and a ticket analysis module, where:
and the ticket collection module is used for collecting and generating a ticket file from the NGBOSS. The call ticket file line represents a piece of call ticket data. The call ticket data is distributed with a unique interface number according to the service type format, and the call ticket attribute can be quickly inquired from the interface number. Particularly, the left side of the appointed ticket is a fixed-length part, and the right side of the appointed ticket is an optional variable-length part; the call ticket collection module needs to meet the convention of the variable length format when generating the variable length call ticket.
The ticket storage module is used for reading the ticket file, caching the ticket data and analyzing and storing the ticket data in a storage, and specifically comprises the following steps: the device comprises a configuration information unit, an analysis unit and a storage unit. Wherein the content of the first and second substances,
the configuration information includes a correspondence between the parsing format and the warehousing structure. The configuration information is divided into two types, namely analysis information and warehousing information, wherein the analysis information comprises whether a call ticket is lengthened, the start bit, the end bit, the data type and the like of each field, and format conversion is mainly completed; the storage information comprises corresponding database, table, field name, etc., and is supplied to the storage unit and stored in the target database. Because the fixed-length call ticket and the variable-length call ticket are distinguished and processed, all fields are aligned, and the storage space is saved.
Firstly, a configuration information unit is used for inquiring a corresponding field of configuration information according to an interface number to obtain a result of whether the length of a call ticket is a fixed value or not, wherein the configuration information comprises a field which is used for indicating whether the length of the call ticket is the fixed value or not, and if the length of the call ticket is the fixed value, the call ticket is indicated to be a fixed-length call ticket; if the length of the call ticket is not a fixed value, the call ticket is a variable length call ticket. If the length of the call ticket is fixed, the analysis information (such as the start bit, the end bit, the data type and the like of each field) of each field is obtained from the configuration unit according to the interface number, and then the fields are segmented line by line and mapped to the corresponding fields of the database table. If the call ticket length is variable, further obtaining the configuration information M, N of the variable length call ticket through the interface number, and dynamically calculating the repetition times k of the variable length part as (L-M)/N according to the length L of the file line;
the following analysis was performed: and the analysis unit is used for analyzing the left M part (the start bit, the end bit and the data type of each field forming M) and then circularly analyzing the right N part (the start bit, the end bit and the data type of each field forming N) for k times.
After the parsing is completed, a storage unit is used for recording the line number and generating a main key (rowid), and mapping M and N to tables T1 and T2 of the database respectively. The specific mapping method is as follows: where one instance of M maps to T1 a record with the addition of a row number (rowid) field as the primary key; where one instance of N maps to another data table T2, corresponding to k records, each of which is augmented with a row number (rowid) field for subsequent association. Generally, the row number is unique, so the row number can be used as the identification information of the call ticket, and certainly can be used as the key value of the call ticket. In another embodiment of the present invention, the primary key may also be generated based on the line number and a predetermined rule, for example, the primary key is generated by using the line number and a number indicating the date, or the primary key is a sum of the line number and 1.
And the call ticket analysis module is used for being responsible for call ticket analysis. Three query usages are mainly supported: 1) querying fields of the fixed-length portion; 2) inquiring the field of the variable-length part; 3) the fields of the fixed-length and variable-length parts are queried simultaneously. After the call ticket is put in storage, the query can be detailed into the field, so that the query efficiency is improved.
The following describes a specific flow of a method and a system for storing call tickets in conjunction with fig. 2-1, where fig. 2-2 is a schematic flow diagram of an implementation of a method for storing call tickets in a second embodiment of the present invention, and as shown in fig. 2-2, the flow includes:
step S201: reading a ticket file;
here, the file name of the ticket file includes an interface number of the file.
Step S202: through the interface number of the file, the call ticket is judged to be lengthened firstly.
Here, different processing modes are respectively carried out on the fixed-length call ticket and the variable-length call ticket. For the fixed-length ticket, the analysis information (such as the start bit, the end bit, the data type and the like of each field) of each field is obtained from the configuration unit according to the interface number, and then the fields are segmented line by line to complete format conversion. For the variable-length ticket, the configuration information M, N of the variable-length ticket is further obtained through the interface number, and the number of times k of repetition of the variable-length part is dynamically calculated to be (L-M)/N according to the length L of the file line, and then the following analysis is performed: and resolving the M part firstly, and then resolving the N part for k times in a circulating manner to complete format conversion.
Step S203: the fixed length format is mapped to a database table T1, and the process is the same as the traditional call ticket storage method. The variable length format maps to tables T1 and T2 of the database.
Here, the specific mapping method is as follows: where one instance of M maps to T1 a record; where one instance of N maps to another data table T2, corresponding to k records. Because the fixed-length and variable-length telephone bills are distinguished and processed, the fields of the databases T1 and T2 are aligned, and the storage space is saved.
Step S204: and (4) taking charge of ticket analysis.
Here, three query usages are mainly supported: 1) querying fields of the fixed-length portion; 2) inquiring the field of the variable-length part; 3) the fields of the fixed-length and variable-length parts are queried simultaneously. After the call ticket is put in storage, the query can be detailed into the field, so that the query efficiency is improved.
And ending the process of putting the call ticket into the warehouse at one time, and putting the next call ticket into the warehouse.
The technical characteristics of the embodiment of the invention different from the prior art comprise: 1) and defining the format characteristics of the variable-length call ticket. 2) The method has the characteristic of saving storage space for the analysis and the storage processing of the variable-length call ticket. 3) After the call ticket is put in storage, subsequent inquiry is detailed to a field, and the inquiry efficiency can be improved.
As can be seen from the above embodiments, in step S302, the fixed-length ticket and the variable-length ticket are distinguished and analyzed; and combining the static configuration and the dynamic length to complete format conversion aiming at the variable-length ticket. In step S303, the fixed-length call ticket and the variable-length call ticket are put in storage; the fixed-length part and the variable-length part are split and are respectively stored in different tables of the database, so that the fields are aligned, and the storage space is saved. In step S304, the query on the variable-length ticket can directly locate the field of the variable-length portion without temporary division (without repeatedly calling the substr function). Compared with the prior art, the embodiment of the invention has the following technical advantages: 1) the embodiment establishes a file format of the variable-length call ticket, and can distinguish the variable-length attribute of the call ticket; 2) the embodiment saves the storage space aiming at the analysis and storage of the variable-length ticket; 3) the ticket entry fields in the embodiment are regular, and the query efficiency is favorably improved.
EXAMPLE III
Based on the foregoing embodiments, embodiments of the present invention provide a ticket warehousing apparatus, where each unit included in the ticket warehousing apparatus and each sub-unit included in each unit may be implemented by a processor in a computing device, and certainly may also be implemented by a specific logic circuit; in the course of a particular embodiment, the processor may be a Central Processing Unit (CPU), a Microprocessor (MPU), a Digital Signal Processor (DSP), a Field Programmable Gate Array (FPGA), or the like. In the process of specific implementation, the computing device may be any electronic device with computing capability, such as a personal computer, a server, a notebook computer, etc.;
fig. 3 is a schematic diagram of a composition structure of a third ticket warehousing device according to an embodiment of the present invention, and as shown in fig. 3, the device 300 includes a reading unit 301, a first obtaining unit 302, an inquiring unit 303, a second obtaining unit 304, a first determining unit 305, a second determining unit 306, an analyzing unit 307, and a mapping unit 308, where:
the reading unit 301 is configured to read a ticket file;
the first obtaining unit 302 is configured to obtain an interface number of the ticket file;
the query unit 303 is configured to query the configuration information of the ticket file according to the interface number to determine whether the ticket file is a variable length ticket;
the second obtaining unit 304 is configured to obtain configuration information of the ticket file if the ticket file is a variable length ticket, where the configuration information at least includes M, N, where M, N is a constant, M represents a fixed length part of the ticket, and N is a basic unit of the variable length part;
the first determining unit 305 is configured to determine a total length L of the ticket file;
the second determining unit 306 is configured to determine a repetition number k according to L ═ M + k × N;
the parsing unit 307 is configured to parse the M and each N in the ticket file;
the mapping unit 308 is used for mapping the M to a first database T1 and mapping each N to a second data table T2.
In this embodiment of the present invention, the mapping unit includes a first mapping subunit and a second mapping subunit, where:
the first mapping subunit is used for mapping an instance of the M to a record of T1, and meanwhile, adding a rowid field as a main key;
the second mapping subunit is configured to map one instance of each N to k records of T2, where each record is incremented by a rowid field, and the rowid is used to subsequently associate M with each N.
In the embodiment of the present invention, the apparatus further includes an acquisition unit and a generation unit, wherein:
the collection unit is used for collecting a piece of call ticket data from the call ticket database;
the generating unit is used for generating the ticket file from the ticket data according to a preset rule, wherein the preset rule is that the left side of the ticket file is a fixed-length part, and the right side of the ticket file is a variable-length part.
In the embodiment of the present invention, the query unit includes a query submodule and a judgment submodule, wherein:
the query submodule is used for querying the analysis information of the configuration information of the ticket file according to the interface number;
and the judging submodule is used for judging whether the length of the ticket file is a variable-length ticket according to the analysis information.
In the embodiment of the present invention, the apparatus further includes a third obtaining unit and a saving unit, where:
the third obtaining unit is used for obtaining the analysis information and the warehousing information of the ticket file if the ticket is a fixed-length ticket, and performing format conversion on the ticket file according to the analysis information;
and the storage unit is used for mapping the ticket file after format conversion to a first data table T1 according to the warehousing information.
Here, it should be noted that: the above description of the embodiment of the apparatus is similar to the above description of the embodiment of the method, and has similar beneficial effects to the embodiment of the method, and therefore, the description thereof is omitted. For technical details that are not disclosed in the embodiments of the apparatus of the present invention, please refer to the description of the embodiments of the method of the present invention for understanding, and therefore, for brevity, will not be described again.
It should be appreciated that reference throughout this specification to "one embodiment" or "an embodiment" means that a particular feature, structure or characteristic described in connection with the embodiment is included in at least one embodiment of the present invention. Thus, the appearances of the phrases "in one embodiment" or "in an embodiment" in various places throughout this specification are not necessarily all referring to the same embodiment. Furthermore, the particular features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. It should be understood that, in various embodiments of the present invention, the sequence numbers of the above-mentioned processes do not mean the execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention. The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. The above-described device embodiments are merely illustrative, for example, the division of the unit is only a logical functional division, and there may be other division ways in actual implementation, such as: multiple units or components may be combined, or may be integrated into another system, or some features may be omitted, or not implemented. In addition, the coupling, direct coupling or communication connection between the components shown or discussed may be through some interfaces, and the indirect coupling or communication connection between the devices or units may be electrical, mechanical or other forms.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units; can be located in one place or distributed on a plurality of network units; some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, all the functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may be separately regarded as one unit, or two or more units may be integrated into one unit; the integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional unit.
Those of ordinary skill in the art will understand that: all or part of the steps for realizing the method embodiments can be completed by hardware related to program instructions, the program can be stored in a computer readable storage medium, and the program executes the steps comprising the method embodiments when executed; and the aforementioned storage medium includes: various media that can store program codes, such as a removable Memory device, a Read Only Memory (ROM), a magnetic disk, or an optical disk.
Alternatively, the integrated unit of the present invention may be stored in a computer-readable storage medium if it is implemented in the form of a software functional module and sold or used as a separate product. Based on such understanding, the technical solutions of the embodiments of the present invention may be essentially implemented or a part contributing to the prior art may be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the methods described in the embodiments of the present invention. And the aforementioned storage medium includes: a removable storage device, a ROM, a magnetic or optical disk, or other various media that can store program code.
The above description is only for the specific embodiments of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present invention, and all the changes or substitutions should be covered within the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the appended claims.

Claims (10)

1. A method for storing call tickets is characterized in that the method comprises the following steps:
reading a ticket file;
acquiring an interface number of the ticket file, and inquiring configuration information of the ticket file according to the interface number to determine whether the ticket file is a variable-length ticket;
if the ticket file is the variable-length ticket, acquiring configuration information of the ticket file, wherein the configuration information at least comprises M, N, wherein M, N is a constant, M represents a fixed-length part of the ticket, and N is a basic unit of the variable-length part;
determining the total length L of the call ticket file;
determining a repetition number k according to the L + k N, wherein the M and the k N support independent query and simultaneous query, and the k N represents a variable-length part of the call ticket;
and analyzing the M and each N in the ticket file, mapping the M to a first data table T1, mapping each N to a second data table T2, and aligning fields of the T1 and the T2.
2. The method of claim 1, wherein said mapping said M to a first data table T1 and each said N to a second data table T2 comprises:
mapping an instance of the M to a record of T1, and adding a line number field as a primary key; mapping an instance of each said N correspondingly to k records of T2, each record being augmented with a row number field as a primary key, said row number being used to subsequently associate said M with each said N.
3. The method of claim 1, further comprising:
collecting a piece of call ticket data from a call ticket database;
and generating the ticket data into a ticket file according to a preset rule, wherein the preset rule is that the left side of the ticket file is a fixed-length part, and the right side of the ticket file is a variable-length part.
4. The method according to any one of claims 1 to 3, wherein querying the configuration information of the ticket file according to the interface number to determine whether the ticket file is a variable length ticket comprises:
inquiring the analysis information of the configuration information of the ticket file according to the interface number;
and judging whether the length of the ticket file is a variable-length ticket or not according to the analysis information.
5. The method according to any one of claims 1 to 3, further comprising:
if the call ticket is a fixed-length call ticket, acquiring analysis information and warehousing information of the call ticket file, and performing format conversion on the call ticket file according to the analysis information;
and mapping the ticket file after format conversion to a first data table T1 according to the warehousing information.
6. The utility model provides a bill storage device which characterized in that, the device includes reading unit, first acquisition unit, inquiry unit, second acquisition unit, first determining element, second determining element, analysis unit and mapping unit, wherein:
the reading unit is used for reading the ticket file;
the first obtaining unit is used for obtaining an interface number of the call ticket file;
the query unit is used for querying the configuration information of the ticket file according to the interface number to determine whether the ticket file is a variable-length ticket;
the second obtaining unit is configured to obtain configuration information of the ticket file if the ticket file is the variable length ticket, where the configuration information at least includes M, N, where M, N is a constant, M represents a fixed length part of the ticket, and N is a basic unit of the variable length part;
the first determining unit is used for determining the total length L of the call ticket file;
the second determining unit is used for determining the repetition times k according to the L-M + k-N, wherein the M and the k-N support independent query and simultaneous query, and the k-N represents the variable-length part of the call ticket;
the analysis unit is used for analyzing the M and each N in the ticket file;
the mapping unit is used for mapping the M to a first data table T1, mapping each N to a second data table T2, and aligning the fields of the T1 and the T2.
7. The apparatus of claim 6, wherein the mapping unit comprises a first mapping subunit, a second mapping subunit, and wherein:
the first mapping subunit is used for mapping one instance of the M to T1 record, and adding a line number field as a primary key;
the second mapping subunit is configured to map one instance of each N to k records of T2, where each record is incremented by a row number field as a primary key, and the row number is used to subsequently associate M with each N.
8. The apparatus of claim 6, further comprising an acquisition unit and a generation unit, wherein:
the collection unit is used for collecting a piece of call ticket data from the call ticket database;
the generating unit is used for generating the ticket file from the ticket data according to a preset rule, wherein the preset rule is that the left side of the ticket file is a fixed-length part, and the right side of the ticket file is a variable-length part.
9. The apparatus according to any one of claims 6 to 8, wherein the query unit comprises a query submodule and a determination submodule, wherein:
the query submodule is used for querying the analysis information of the configuration information of the ticket file according to the interface number;
and the judging submodule is used for judging whether the length of the ticket file is a variable-length ticket according to the analysis information.
10. The apparatus according to any one of claims 6 to 8, further comprising a third acquisition unit and a saving unit, wherein:
the third obtaining unit is used for obtaining the analysis information and the warehousing information of the ticket file if the ticket is a fixed-length ticket, and performing format conversion on the ticket file according to the analysis information;
and the storage unit is used for mapping the ticket file after format conversion to a first data table T1 according to the warehousing information.
CN201610091904.9A 2016-02-18 2016-02-18 Ticket storage method and device Active CN107092607B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610091904.9A CN107092607B (en) 2016-02-18 2016-02-18 Ticket storage method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610091904.9A CN107092607B (en) 2016-02-18 2016-02-18 Ticket storage method and device

Publications (2)

Publication Number Publication Date
CN107092607A CN107092607A (en) 2017-08-25
CN107092607B true CN107092607B (en) 2021-04-23

Family

ID=59648647

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610091904.9A Active CN107092607B (en) 2016-02-18 2016-02-18 Ticket storage method and device

Country Status (1)

Country Link
CN (1) CN107092607B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110868499B (en) * 2018-08-27 2022-05-10 中国移动通信有限公司研究院 Ticket generating and checking method, device and equipment and storage medium
CN112181427B (en) * 2020-09-24 2022-10-11 乐思灯具(上海)有限公司 Code creating method, device, system and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101754155A (en) * 2008-12-17 2010-06-23 中国移动通信集团山东有限公司 Call bill format conversion method and device and call bill processing method and system
CN102542026A (en) * 2011-12-22 2012-07-04 深圳市赛格导航科技股份有限公司 Mass global position system (GPS) data access method and system
CN104615736A (en) * 2015-02-10 2015-05-13 上海创景计算机系统有限公司 Quick analysis and storage method of big data based on database

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103870492B (en) * 2012-12-14 2017-08-04 腾讯科技(深圳)有限公司 A kind of date storage method and device based on key row sequence

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101754155A (en) * 2008-12-17 2010-06-23 中国移动通信集团山东有限公司 Call bill format conversion method and device and call bill processing method and system
CN102542026A (en) * 2011-12-22 2012-07-04 深圳市赛格导航科技股份有限公司 Mass global position system (GPS) data access method and system
CN104615736A (en) * 2015-02-10 2015-05-13 上海创景计算机系统有限公司 Quick analysis and storage method of big data based on database

Also Published As

Publication number Publication date
CN107092607A (en) 2017-08-25

Similar Documents

Publication Publication Date Title
CN102779140B (en) A kind of keyword acquisition methods and device
CN111506559B (en) Data storage method, device, electronic equipment and storage medium
CN110866091B (en) Data retrieval method and device
CN105354256A (en) Data pagination query method and apparatus
CN110781183A (en) Method and device for processing incremental data in Hive database and computer equipment
CN112052733A (en) Database construction method, face recognition device and electronic equipment
CN111552704A (en) Data report generation method and device, computer equipment and storage medium
CN107092607B (en) Ticket storage method and device
CN112182174A (en) Business question-answer knowledge query method and device, computer equipment and storage medium
CN102508884A (en) Method and device for acquiring hotpot events and real-time comments
CN107169103A (en) A kind of universal architecture data store query method and system
CN112307318A (en) Content publishing method, system and device
CN104915435A (en) Data query method and device
CN109697234B (en) Multi-attribute information query method, device, server and medium for entity
CN110990692A (en) Data processing method and device based on portrait analysis
CN115221874A (en) Construction method of inverted index, list screening method and device, and electronic equipment
CN111488327B (en) Data standard management method and system
CN112131215B (en) Bottom-up database information acquisition method and device
CN110019544B (en) Data query method and system
CN113239039A (en) Dynamic data storage method, query method, management method and management system
CN106126633A (en) The processing method of noble metal data, device and system
CN111311329B (en) Tag data acquisition method, device, equipment and readable storage medium
CN112559674A (en) Method for inquiring content of legal item in referee document and related device
CN109145081A (en) A kind of financial data search method and system
CN117112846B (en) Multi-information source license information management method, system and medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant