Detailed Description
The invention is described in further detail below with reference to the drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting thereof.
It should be further noted that, for convenience of description, only some, but not all of the matters related to the present invention are shown in the accompanying drawings. Before discussing exemplary embodiments in more detail, it should be mentioned that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although a flowchart depicts operations (or steps) as a sequential process, many of the operations can be performed in parallel, concurrently, or at the same time. Furthermore, the order of the operations may be rearranged. The process may be terminated when its operations are completed, but may have additional steps not included in the figures. The processes may correspond to methods, functions, procedures, subroutines, and the like.
Example 1
Fig. 1 is a flowchart of a data conversion method according to an embodiment of the present invention, where the method may be applied to the case of automatic ticket desensitization, and the method may be performed by a data conversion apparatus according to an embodiment of the present invention, where the apparatus may be implemented by software and/or hardware, and the apparatus may be configured on an electronic computing device, for example, a terminal and/or a server. The method specifically comprises the following steps:
s110, acquiring a ticket number to be processed, wherein the ticket number to be processed comprises time information and flow information.
The ticket number to be processed can be a ticket number which needs desensitization processing and is a unique identifier of the ticket, and the ticket number to be processed can be composed of one or more of numbers, letters and symbols. For example, the ticket may include, but is not limited to, an electronic business draft, i.e., the pending ticket number may be the number of the electronic business draft. The electronic commercial draft is a commercial draft produced in the form of data telegraph text and is uniformly popularized by people banks, and the electronic commercial draft comprises a bank acceptance draft and a commercial acceptance draft according to different contractors. The ticket number to be processed includes, but is not limited to, time information and stream information. The time information may be information associated with the ticket such as ticket generation time or ticket discharge time, and may be, for example, ticket discharge registration date. The running information refers to the running number of the draft transaction, has uniqueness, and can realize the distinction of different to-be-processed ticket numbers according to the running information.
In the embodiment of the invention, one or more ticket numbers to be processed can be used, and if the number of the ticket numbers to be processed is multiple, the invention can perform desensitization processing on the ticket numbers to be processed in batches. The method for acquiring the ticket number to be processed comprises the steps of reading the ticket number to be processed from a preset file, wherein the preset file comprises a plurality of ticket numbers to be processed, the preset file can be stored in a remote server or a local terminal computer, the method is not limited, or the ticket number is extracted from the ticket in real time through a ticket number acquisition device, and the ticket number acquired in real time is used as the ticket number to be processed. The method for generating the ticket number to be processed is not limited.
On the basis of the embodiment, before the ticket number to be processed is acquired, the method further comprises clearing sequence information corresponding to the ticket number to be processed in each preset time.
The preset time refers to a period of time, for example, a day, a week, etc. The order information may be the serial number of the ticket corresponding to the ticket number to be processed, that is, the order information is the information of the serial number of the ticket.
The preset time may be, for example, one day, and the arrangement sequence numbers corresponding to the notes in the same day may be cleared, and the arrangement sequence numbers of the notes in each day are cleared, that is, the arrangement sequence numbers of the notes corresponding to all the dates are cleared, and the clearing is performed according to the day.
On the basis of the embodiment, after the to-be-processed ticket number is acquired, the method further comprises the step of extracting information of the to-be-processed ticket number based on the ticket number format to obtain time information and flow information corresponding to the to-be-processed ticket number.
The ticket number format refers to a composition structure of a ticket number to be processed in a ticket, the time information and the flow information are part of the composition of the ticket number to be processed, the ticket number format comprises position information of each composition part, for example, the ticket number to be processed can be composed of 30-bit Arabic numerals, and the time information is 14 th to 21 th bits of the ticket number to be processed.
Specifically, the time information and the flow information can be respectively extracted according to the position information of the time information and the flow information, so that the targeted extraction of the time information and the flow information is realized, the time information and the flow information corresponding to the ticket number to be processed are obtained, the processing time of the ticket number to be processed can be reduced, and the desensitization efficiency of the ticket number to be processed is improved.
S120, acquiring sequence information corresponding to the ticket number to be processed based on the time information.
The sequence information refers to the serial number of the ticket corresponding to the ticket number to be processed. The serial number of the ticket may be obtained according to the processing sequence of the ticket number to be processed, that is, the sequence information may be the processing sequence number of the ticket number to be processed.
It will be appreciated that any ticket number to be processed has unique corresponding sequence information, i.e. the ticket has a unique ranking sequence number. The time information may refer to a certain moment or a certain time period, and if the time information refers to a certain time period, the order information of the notes corresponding to one or more pending note numbers in the time period may be obtained. If the time information refers to a certain moment, the order information of the bills corresponding to one or more to-be-processed bill numbers at the moment can be acquired.
And S130, replacing the flow information based on the sequence information to obtain a desensitized ticket number corresponding to the ticket number to be processed.
The desensitization ticket number refers to the ticket number after the ticket is desensitized, and the desensitization ticket number corresponds to the ticket number to be processed one by one. The serial information is replaced by the sequence information, so that the desensitization of the ticket number to be processed is realized, key information in the ticket number to be processed can be protected from being leaked, the security of the ticket transaction is improved, and the method is simple and can improve the desensitization speed of the ticket number without a large amount of operations and only replacing data. In some embodiments, after obtaining the desensitized ticket number corresponding to the ticket number to be processed, the desensitized ticket number may also be written into a desensitized file to facilitate subsequent invocation of the desensitized ticket number, where the desensitized file is used to store the desensitized ticket number.
In the embodiment of the invention, the replacement method specifically comprises the steps of deleting the running water information in the ticket number to be processed and placing the sequence information at the position of the running water information. Optionally, the running water information is the same as the sequence information bit number. The number of bits of the serial information and the serial information are kept the same, after replacement, the structure of the ticket number to be processed is kept unchanged, and the problem that the data is inconsistent with rules after desensitization can be avoided.
The embodiment of the invention provides a data conversion method, which can avoid the problem that the sequence information is repeated in time information by acquiring the to-be-processed ticket number and acquiring the sequence information according to the time information in the to-be-processed ticket number.
Example two
Fig. 2 is a flowchart of a data conversion method according to a second embodiment of the present invention, where the "obtaining sequence information corresponding to the ticket number to be processed based on the time information" is further refined on the basis of the above embodiment. Reference may be made to the detailed description of the present technical solution for a specific implementation. Wherein, the technical terms identical to or corresponding to the above embodiments are not repeated herein. As shown in fig. 2, the method in the embodiment of the present invention specifically includes the following steps:
S210, acquiring a ticket number to be processed, wherein the ticket number to be processed comprises time information and flow information.
S220, matching the time information in a database to obtain historical sequence information.
The database refers to a database recorded with bill information, and the database can contain sequence information of a plurality of bills. The historical sequence information may be sequence information of notes that have been desensitized within a preset time, wherein the preset time may be within a day, a week, etc.
Specifically, according to the time information in the current ticket number to be processed, the sequence information of the tickets which have been desensitized in the time information is matched in the database. The time information in the current ticket number to be processed can be used for matching a plurality of ticket numbers to be processed which are subjected to desensitization in the time information in a database, and the number of the ticket numbers to be processed which are subjected to desensitization can be obtained, namely the arrangement sequence information of the tickets which are subjected to desensitization is obtained.
For example, if the time information is within a certain day, for example, the time information may be 2021, 12, 5, and if 4 tickets within 2021, 12, 5 are matched or queried in the database to have been desensitized, the acquired historical order information may be 00000004.
And S230, updating the historical sequence information to obtain sequence information corresponding to the ticket number to be processed.
In the embodiment of the invention, the updating of the historical sequence information is essentially to delete the historical sequence information, new sequence information is obtained on the basis of the historical sequence information, and the new sequence information is stored at the position of the historical sequence information, so that the situation that the sequence information repeatedly appears can be avoided, and each new sequence information is unique and has uniqueness.
On the basis of the embodiment, the updating of the historical sequence information to obtain the sequence information corresponding to the ticket number to be processed comprises the steps of accumulating the historical sequence information to obtain the sequence information corresponding to the ticket number to be processed.
The updating method adopted by the embodiment of the invention can be an accumulating method, namely, each time of ticket number desensitization processing is carried out, numerical addition is carried out once on the basis of historical sequence information, so that the sequence information corresponding to the obtained ticket number to be processed has uniqueness, and the situation that the sequence information is repeated can be avoided.
S240, replacing the flow information based on the sequence information, and updating the check code based on the bill type identification, the payment system information, the time information and the sequence information corresponding to the to-be-processed bill number to obtain a desensitized bill number corresponding to the to-be-processed bill number.
The ticket number to be processed further comprises a ticket type identifier, payment system information and a check code, wherein the ticket type identifier refers to an identifier corresponding to the ticket type, and the ticket type can comprise, but is not limited to, a bank acceptance draft and a business acceptance draft. The payment system information refers to line number information of a bank payment system. The verification code may be used to verify the correctness of the pending ticket number and may be automatically generated by the electronic commerce draft system.
Illustratively, the ticket number to be processed may be a 30-digit arabic number, and includes a ticket type identification, payment system information, time information, flow information, and a check code. The bill type identifier can be 1-bit Arabic number, can be used for representing a bank acceptance draft and can be used for representing a business acceptance draft by 1, the payment system information can be 12-bit Arabic number, can be a payment system line number of an issuer of the bill, the time information can be 8-bit Arabic number, can be a working day of successfully registering the bill information into an electronic business draft system, the running water information can be 8-bit Arabic number, can be a unique running water number of the electronic business draft system on the same day, and the check code can be 1-bit Arabic number and is positioned at the later position of the ticket number to be processed.
Specifically, a new check code can be generated according to a check code rule and based on the bill type identification, payment system information, time information and sequence information corresponding to the ticket number to be processed, and the new check code is used for replacing the check code in the ticket number to be processed to assemble a new ticket number, namely, a desensitized ticket number corresponding to the ticket number to be processed is generated. The check code rule can be a dual-mode check mechanism algorithm, and the bill type identification, payment system information, time information and sequence information corresponding to the ticket number to be processed can be brought into the dual-mode check mechanism algorithm model to obtain a new check code.
The embodiment of the invention provides a data conversion method, which is characterized in that a to-be-processed ticket number is obtained, historical sequence information is matched in a database according to time information in the to-be-processed ticket number, and the historical information is accumulated to obtain the sequence information with uniqueness, so that the problem that the sequence information is repeated in the time information can be avoided.
Example III
Fig. 3 is a schematic structural diagram of a data conversion device according to a third embodiment of the present invention, where the data conversion device according to the present embodiment may be implemented by software and/or hardware, and may be configured in a terminal and/or a server to implement a data conversion method according to the embodiment of the present invention. The apparatus may include a ticket number processing module 310, a sequence information acquisition module 320, and a desensitization ticket number generation module 330.
The ticket number processing module 310 is configured to obtain a ticket number to be processed, where the ticket number to be processed includes time information and running water information, the sequence information obtaining module 320 is configured to obtain sequence information corresponding to the ticket number to be processed based on the time information, and the desensitization ticket number generating module 330 is configured to replace the running water information based on the sequence information to obtain a desensitization ticket number corresponding to the ticket number to be processed.
The embodiment of the invention provides a data conversion device, which can avoid the problem that the sequence information is repeated in time information by acquiring the to-be-processed ticket number and acquiring the sequence information according to the time information in the to-be-processed ticket number.
On the basis of any optional technical scheme of the embodiment of the invention, optionally, the device is further used for:
and clearing sequence information corresponding to the ticket numbers to be processed in each preset time.
On the basis of any optional technical scheme of the embodiment of the invention, optionally, the device is further used for:
And extracting information from the ticket number to be processed based on the ticket number format to obtain time information and flow information corresponding to the ticket number to be processed.
On the basis of any optional technical scheme in the embodiment of the invention, optionally, the running water information is the same as the sequence information in number.
On the basis of any optional technical solution in the embodiment of the present invention, optionally, the sequence information obtaining module 320 includes:
The historical sequence information acquisition unit is used for matching the time information in the database to obtain historical sequence information;
And the sequence information updating unit is used for updating the historical sequence information to obtain sequence information corresponding to the ticket number to be processed.
On the basis of any optional technical solution in the embodiment of the present invention, optionally, the sequence information updating unit is further configured to:
and accumulating the historical sequence information to obtain sequence information corresponding to the ticket number to be processed.
On the basis of any optional technical scheme in the embodiment of the invention, optionally, the ticket number to be processed further comprises a ticket type identifier, payment system information and a check code, and the device is further used for:
And updating the check code based on the bill type identifier, the payment system information, the time information and the sequence information corresponding to the to-be-processed bill number.
The data conversion device provided by the embodiment of the invention can execute the data conversion method provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method.
Example IV
Fig. 4 is a schematic structural diagram of an electronic device according to a fourth embodiment of the present invention. Fig. 4 illustrates a block diagram of an exemplary electronic device 12 suitable for use in implementing embodiments of the present invention. The electronic device 12 shown in fig. 4 is merely an example and should not be construed as limiting the functionality and scope of use of embodiments of the present invention.
As shown in fig. 4, the electronic device 12 is in the form of a general purpose computing device. The components of the electronic 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 connects the various system components, including the system memory 28 and the processing units 16.
Bus 18 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor, and a local bus using any of a variety of bus architectures. By way of example, and not limitation, such architectures include 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.
Electronic device 12 typically includes a variety of computer system readable media. Such media can be any available media that is accessible by electronic 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. The electronic 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 or write to non-removable, nonvolatile magnetic media (not shown in FIG. 4, commonly referred to as a "hard disk drive"). Although not shown in fig. 4, a magnetic disk drive for reading from and writing to a removable non-volatile magnetic disk (e.g., a "floppy disk"), and an optical disk drive for reading from or writing to a removable non-volatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In such cases, each drive may be coupled to bus 18 through one or more data medium interfaces. The system memory 28 may include at least one program product having a set (e.g., at least one) of program modules configured to carry out the functions of the embodiments of the invention.
A program/utility 36 having a set (at least one) of program modules 26 may be stored in, for example, system memory 28, such program modules 26 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each or some combination of which may include an implementation of a network environment. Program modules 26 generally perform the functions and/or methods of the embodiments described herein.
The electronic device 12 may also communicate with one or more external devices 14 (e.g., keyboard, pointing device, display 24, etc.), one or more devices that enable a user to interact with the electronic device 12, and/or any devices (e.g., network card, modem, etc.) that enable the electronic device 12 to communicate with one or more other computing devices. Such communication may occur through an input/output (I/O) interface 22. Also, the electronic device 12 may communicate with one or more networks such as a Local Area Network (LAN), a Wide Area Network (WAN) and/or a public network, such as the Internet, through a network adapter 20. As shown in fig. 4, the network adapter 20 communicates with other modules of the electronic device 12 over the bus 18. It should be appreciated that although not shown in FIG. 4, other hardware and/or software modules may be used in connection with electronic device 12, including, but not limited to, microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, data backup storage systems, and the like.
The processing unit 16 executes various functional applications and data processing by running programs stored in the system memory 28, for example, to implement a data conversion method provided by an embodiment of the present invention.
Example five
A fifth embodiment of the present invention also provides a storage medium containing computer-executable instructions, which when executed by a computer processor, are for performing a data conversion method, the method comprising:
Acquiring a ticket number to be processed, wherein the ticket number to be processed comprises time information and flow information;
Acquiring sequence information corresponding to the ticket number to be processed based on the time information;
And replacing the flow information based on the sequence information to obtain a desensitized ticket number corresponding to the ticket number to be processed.
The computer storage media of embodiments of the invention may take the form of 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. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples (a non-exhaustive list) of the computer-readable storage medium include 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 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.
The computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. 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 embodiments of the present invention may be written in one or more programming languages, including an object oriented programming language such as Java, smalltalk, C ++ 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 kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider).
Note that the above is only a preferred embodiment of the present invention and the technical principle applied. 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, while the invention has been described in connection with the above embodiments, the invention is not limited to the embodiments, but may be embodied in many other equivalent forms without departing from the spirit or scope of the invention, which is set forth in the following claims.