WO2019001125A1 - Method and device for processing transaction files, storage medium, and computer apparatus - Google Patents

Method and device for processing transaction files, storage medium, and computer apparatus Download PDF

Info

Publication number
WO2019001125A1
WO2019001125A1 PCT/CN2018/084841 CN2018084841W WO2019001125A1 WO 2019001125 A1 WO2019001125 A1 WO 2019001125A1 CN 2018084841 W CN2018084841 W CN 2018084841W WO 2019001125 A1 WO2019001125 A1 WO 2019001125A1
Authority
WO
WIPO (PCT)
Prior art keywords
transaction
file
parsing
database
type
Prior art date
Application number
PCT/CN2018/084841
Other languages
French (fr)
Chinese (zh)
Inventor
刘星
仝西乐
姜胜文
蒋波
Original Assignee
平安科技(深圳)有限公司
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 平安科技(深圳)有限公司 filed Critical 平安科技(深圳)有限公司
Publication of WO2019001125A1 publication Critical patent/WO2019001125A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/64Protecting data integrity, e.g. using checksums, certificates or signatures

Definitions

  • the present application relates to a transaction finger file processing method, apparatus, storage medium and computer device.
  • the traditional transaction file processing method is to process each transaction file in the order of receiving time of the transaction file, including parsing the received transaction file to obtain transaction data, and using the transaction data.
  • a transaction file processing method is provided.
  • a transaction file processing method includes: receiving an uploaded batch transaction file; creating a corresponding file parsing asynchronous task for each of the transaction files; performing each of the file parsing asynchronous tasks in parallel; and executing each of the files Parsing the asynchronous task includes: acquiring a transaction type of the transaction file; if the transaction type matches the pre-stored transaction type, obtaining a file parsing method corresponding to the transaction type in the database; and according to the file parsing method Parsing the transaction file and saving the parsed transaction data to the database.
  • a transaction file processing device includes: a transaction file receiving module, configured to receive an uploaded batch transaction file; a file parsing asynchronous task creation module, configured to create a corresponding file parsing asynchronous task for each of the transaction files; a task execution module, configured to execute each of the file parsing asynchronous tasks in parallel; the file parsing asynchronous task execution module is configured to acquire a transaction type of the transaction file; if the transaction type matches a pre-stored transaction type, the Obtaining a file parsing method corresponding to the transaction type in the database; and parsing the transaction file according to the file parsing method, and saving the parsed transaction data to a database.
  • One or more non-transitory computer readable storage mediums storing computer readable instructions, when executed by one or more processors, cause one or more processors to perform the steps of: receiving an uploaded batch Transaction file; creating a corresponding file parsing asynchronous task for each of the transaction files; executing each of the file parsing asynchronous tasks in parallel; performing each of the parsing of the asynchronous tasks, including: acquiring a transaction of the transaction file a type; if the transaction type matches the pre-stored transaction type, obtaining a file parsing method corresponding to the transaction type in the database; and parsing the transaction file according to the file parsing method, and parsing the obtained transaction data Save to the database.
  • a computer device comprising a memory and one or more processors having stored therein computer readable instructions, the computer readable instructions being executable by the processor to cause the one or more processors to execute The following steps: receiving the uploaded bulk transaction file; creating a corresponding file parsing asynchronous task for each of the transaction files; performing each of the file parsing asynchronous tasks in parallel; and executing each of the file parsing asynchronous tasks, including: Obtaining a transaction type of the transaction file; if the transaction type is successfully matched with the pre-stored transaction type, obtaining a file parsing method corresponding to the transaction type in a database; and parsing the transaction file according to the file parsing method, The parsed transaction data is saved to the database.
  • FIG. 1 is an application environment diagram of a transaction file processing method in accordance with one or more embodiments.
  • FIG. 2 is a diagram showing the internal structure of a server in accordance with one or more embodiments.
  • FIG. 3 is a flow diagram of a method of processing a transaction file in accordance with one or more embodiments.
  • FIG. 4 is a flow diagram of a method of verifying a transaction file in accordance with still another embodiment.
  • FIG. 5 is a flow diagram of a method of performing transaction data in accordance with one or more embodiments.
  • FIG. 6 is a block diagram showing the structure of a transaction file processing apparatus in accordance with one or more embodiments.
  • the transaction file processing method provided by the embodiment of the present application can be applied to the environment as shown in FIG. 1.
  • the server 102 can receive the bulk transaction file uploaded by the terminal 104 and process the transaction file. Specifically, the server 102 communicates with the terminal 104 through the network, the server 102 receives the uploaded batch transaction file, creates a corresponding file parsing asynchronous task for each of the transaction files, and executes each of the file parsing asynchronous tasks in parallel, Executing each of the file parsing asynchronous tasks includes: acquiring a transaction type of the transaction file, and if the transaction type matches the pre-stored transaction type, obtaining a file parsing method corresponding to the transaction type in the database, according to The file parsing method parses the transaction file and saves the parsed transaction data to a database or the like.
  • Terminals herein include, but are not limited to, various personal computers, notebook computers, smart phones, tablets, portable wearable devices, and the like.
  • a server including a processor connected through a system bus, a non-volatile storage medium, an internal memory, a network connection port, and non-volatile storage.
  • An operating system and computer readable instructions are stored in the medium, and the computer readable instructions are used to implement a transaction file processing method applicable to the terminal provided in the embodiments of the present application.
  • the non-volatile storage medium can be a non-transitory computer readable storage medium.
  • This processor is used to improve computing and control capabilities and support the operation of the entire server.
  • the internal memory is used to provide an environment for the operation of operating systems and computer readable instructions in a non-volatile storage medium.
  • the network interface is used for network communication with the terminal.
  • FIG. 2 is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the server to which the solution of the present application is applied.
  • the server may include a ratio. More or fewer components are shown in the figures, or some components are combined, or have different component arrangements.
  • a transaction file processing method is provided, which is applied to the server as shown in FIG. 2, and includes:
  • Step 302 Receive an uploaded batch transaction file.
  • the transaction file is a data file formed by the user performing various operations in the commodity trading system, such as applying for registration of an account, modifying account information, and purchasing goods.
  • Transaction documents are distinguished by transaction type, such as account opening documents, account modification documents, purchase documents, and subscription documents.
  • the server can receive bulk transaction files uploaded by the user through the commodity trading system.
  • Each transaction file corresponds to a transaction type, and the transaction file processing method provided in this embodiment is based on a plurality of transaction file processing methods.
  • Step 304 Create a corresponding file parsing asynchronous task for each transaction file.
  • An asynchronous task refers to a task that executes a subsequent task without waiting for the current task to finish executing, but directly performs a subsequent operation, that is, an asynchronous task is used to execute multiple tasks at the same time.
  • the server After the bulk transaction file is received, the server creates a corresponding file parsing asynchronous task for each received transaction file, which is used to quickly parse each transaction file.
  • step 306 each file parsing asynchronous task is executed in parallel.
  • the file parsing asynchronous task is created according to the number of file parsing asynchronous tasks and the preset maximum task processing number.
  • the created file parsing asynchronous task can be directly assigned to the server that currently creates the file parsing asynchronous task; when the number of file parsing asynchronous tasks is greater than the preset maximum
  • the first ratio of the number of file parsing asynchronous tasks to the preset maximum number of task processing may be calculated, and the first ratio is rounded up to obtain a second ratio, and then the file parsing asynchronous task is assigned to the number of files.
  • the number of file parsing asynchronous tasks is 18 (that is, the number of received batch transaction files is 18), and the preset maximum number of task processing is 7, the asynchronous task is assigned to 3 servers are executed, and the number of file parsing asynchronous tasks allocated by the three servers can be 7, 7, 4 (that is, according to the preset maximum number of task processing), or it can be 6, 6, and 6 (ie, Average allocation) and so on.
  • Step 3062 Obtain a transaction type of the transaction file.
  • Transaction documents are divided by transaction type.
  • the transaction type may be, but is not limited to, an account opening document, an account modification file, a purchase document, and a subscription document.
  • the transaction file can be directly parsed to obtain the transaction type, or the transaction file can be parsed first to obtain the file source (such as PC-side system, WeChat platform, etc.), and then the transaction type of the transaction file is obtained according to the file source.
  • the file source such as PC-side system, WeChat platform, etc.
  • Step 3064 If the transaction type matches the pre-stored transaction type, the file parsing method corresponding to the transaction type is obtained in the database.
  • the file parsing method is a method pre-existing in the database for parsing files.
  • the transaction type of the received transaction file needs to be matched with the pre-stored transaction type to filter out the misplaced file of the terminal. If the matching is successful, the file parsing method corresponding to the transaction type is obtained in the database, that is, the file parsing method is pre-stored in the database, so that the template of the subsequent transaction file is changed, and the corresponding new file parsing method can directly replace the database.
  • the original file parsing method in the file reduces operations such as connection tests that are stored in the program in the program.
  • Step 3066 parsing the transaction file according to the file parsing method, and saving the parsed transaction data to the database.
  • the server parses the transaction file according to the parsing method corresponding to the transaction file to obtain the transaction data
  • the transaction data is saved to the database for subsequent use.
  • each file parsing asynchronous task obtains the corresponding file parsing method directly from the database according to the transaction type of the respective transaction file, thereby realizing parallel parsing of the transaction file and improving The processing efficiency of the transaction file.
  • the method before step 304, the method further includes verifying the security of the bulk transaction file; if the bulk transaction file is verified to be secure, the step of creating a corresponding file parsing asynchronous task for each transaction file is entered.
  • the security identifier of each transaction file can be obtained, and if the security identifier is consistent with the preset security identifier, the transaction file is verified to be secure.
  • the corresponding field of the security identifier is “safety signs”
  • the default value of “safety signs” is “DEAL-R”
  • the value corresponding to “safety signs” in the received transaction file is also “DEAL-R”. ", then the transaction file is verified to be secure.
  • the security of the transaction file is ensured by adding security verification steps to the received batch transaction file.
  • a file verification method of the transaction file is further provided, and the method further includes:
  • Step 402 If the transaction type matches the pre-stored transaction type, the file verification method corresponding to the transaction type is obtained in the database.
  • File verification methods include physical and logical verification of files.
  • the physical check is used to verify the encoding of the file and the integrity of the data.
  • the commonly used data integrity check can be a Cyclic Redundancy Check (CRC), including CRC8, CRC16 and CRC32, and a secure hash algorithm. (Secure Hash Algorithm, SHA, including SHA1, SHA256, SHA384, SHA512) or Message Digest Algorithm (including MD2, MD4, MD5), etc.; logic check is used to check the logic of the data, such as the same field. Whether the repeated input is consistent, whether the sequential execution order of the data conforms to the preset logic, and the like.
  • the file verification method corresponding to the pre-stored transaction type is pre-stored in the database, and after obtaining the transaction type of the transaction file, the corresponding file verification method can be easily found.
  • Step 404 verifying the transaction file according to the file verification method.
  • the transaction file is verified by the file verification method corresponding to the transaction file type, and if the verification is passed, the subsequent step of obtaining the file parsing corresponding to the transaction type in the database is entered; if the verification fails, the processing of the transaction file is terminated. .
  • the illegal file is filtered out, and the data integrity of the transaction file is guaranteed.
  • the method further includes:
  • Step 502 Determine whether the transaction type of the batch transaction file is the same transaction type. If yes, proceed to step 504, otherwise proceed to step 508.
  • Step 504 creating a corresponding transaction request asynchronous task for each transaction file.
  • a transaction request asynchronous task is an execution request task of transaction data in a transaction file.
  • the task efficiency can be improved by creating multiple task threads.
  • Step 506 executing each transaction request asynchronous task in parallel.
  • the created transaction request asynchronous task can be allocated according to the number of the transaction request asynchronous task and the preset maximum task processing number, and then all the created transaction request asynchronous tasks are executed in parallel. Execute each transaction to request an asynchronous task, including:
  • Step 5062 Obtain transaction data corresponding to the transaction file from the database.
  • the transaction data is data for the user to perform arbitrary operations on the transaction system, including but not limited to the login account of the transaction system, the login password, and the purchased product information.
  • transaction data is executed.
  • the transaction data is executed in the preset logical order of the transaction type, thereby completing the entire transaction application.
  • the server obtains the fund type and the number of funds selected by the user in the fund subscription application form, and obtains the fund unit price, handling fee, discount, etc. corresponding to the fund type in the fund information table, according to The preset calculation rule calculates the fee that the user needs to pay, obtains the payment information of the user for the fee, and generates a corresponding fund subscription order, thereby realizing the complete process of the fund subscription.
  • Step 508 Acquire corresponding transaction data from the database in sequence according to a preset transaction logic sequence, and execute the transaction data.
  • the preset transaction logic is set according to the pre-stored transaction type, such as processing the account opening file, the account modification file, the purchase document and the subscription file in turn. This can be achieved by setting different processing priorities for transaction files of different transaction types.
  • the batch transaction file creates a transaction request asynchronous task and executes the transaction request asynchronous task, including: obtaining the corresponding transaction data from the database in turn according to the preset transaction logic order, executing the transaction data, and improving the execution efficiency of the transaction data.
  • the parsing of each transaction file and the execution process of the transaction data are separated, which reduces the dependence of the use and execution of the transaction data on the parsing of the transaction file, and improves the stability of the use and execution functions of the transaction data.
  • the above embodiment is for a batch transaction to be processed for a single batch (here, the batch transaction to be processed refers to a batch transaction in which the batch transaction file has been parsed and stored in the database but has not been executed according to the preset execution logic).
  • the batch transaction to be processed refers to a batch transaction in which the batch transaction file has been parsed and stored in the database but has not been executed according to the preset execution logic.
  • a corresponding transaction request asynchronous task is created for each batch of batch transactions to be processed, and each transaction is executed in parallel. Apply for an asynchronous task. Executing an asynchronous task for each transaction, including: determining whether the transaction type of the batch transaction file in a batch is the same transaction type, and if so, creating a corresponding transaction request for each batch transaction file in the same batch.
  • Subtask then execute each transaction request asynchronous subtask in parallel, and execute each transaction request asynchronous subtask, including: obtaining transaction data corresponding to the transaction file from the database, executing the transaction data; if not, according to the preset
  • the transaction logic sequence sequentially obtains the corresponding transaction data from the database and executes the transaction data.
  • step 502 before step 502, it further comprises detecting whether the batch transaction file has been parsed, and if so, entering the step of determining whether the transaction type of the bulk transaction file is of the same transaction type.
  • FIGS. 3-5 are sequentially displayed as indicated by the arrows, these steps are not necessarily performed in the order indicated by the arrows. Except as explicitly stated herein, the execution of these steps is not strictly limited, and the steps may be performed in other orders. Moreover, at least some of the steps in FIGS. 3-5 may include a plurality of sub-steps or stages, which are not necessarily performed at the same time, but may be executed at different times, these sub-steps or stages The order of execution is not necessarily performed sequentially, but may be performed alternately or alternately with at least a portion of other steps or sub-steps or stages of other steps.
  • a transaction file processing apparatus including: a transaction file receiving module 602, configured to receive an uploaded bulk transaction file; and a file parsing asynchronous task creation module 604, configured to Each transaction file creates a corresponding file parsing asynchronous task; a file parsing asynchronous task execution module 606 is configured to execute each file parsing asynchronous task in parallel; and a file parsing asynchronous task executing module 606 is configured to obtain a transaction type of the transaction file; If the type matches the pre-stored transaction type successfully, the file parsing method corresponding to the transaction type is obtained in the database; the transaction file is parsed according to the file parsing method, and the parsed transaction data is saved in the database.
  • the file parsing asynchronous task execution module 606 is further configured to verify the security of the bulk transaction file; and if the bulk transaction file is verified to be secure, enter the step of creating a corresponding file parsing asynchronous task for each transaction file. .
  • the file parsing asynchronous task execution module 606 is further configured to obtain a file verification method corresponding to the transaction type in the database; verify the transaction file according to the file verification method; and if the verification passes, Enter the step of obtaining a file parsing method corresponding to the transaction type in the database.
  • the apparatus further includes a transaction type determining module, configured to determine whether the transaction type of the batch transaction file is the same transaction type; if yes, create a corresponding transaction request asynchronous task for each transaction file; Each transaction applies for an asynchronous task, and each transaction requests an asynchronous task, including: obtaining transaction data corresponding to the transaction file from the database; executing the transaction data; and if not, acquiring the transaction data in order according to a preset business logic sequence Corresponding transaction data, executing transaction data.
  • a transaction type determining module configured to determine whether the transaction type of the batch transaction file is the same transaction type; if yes, create a corresponding transaction request asynchronous task for each transaction file; Each transaction applies for an asynchronous task, and each transaction requests an asynchronous task, including: obtaining transaction data corresponding to the transaction file from the database; executing the transaction data; and if not, acquiring the transaction data in order according to a preset business logic sequence Corresponding transaction data, executing transaction data.
  • the transaction type judging module is further configured to detect whether the bulk transaction file is parsed; and if so, enter a step of determining whether the transaction type of the bulk transaction file is the same transaction type.
  • Each of the above-described transaction file processing devices may be implemented in whole or in part by software, hardware, and combinations thereof.
  • Each of the above modules may be embedded in or independent of the processor in the computer device, or may be stored in a memory in the computer device in a software form, so that the processor invokes the operations corresponding to the above modules.
  • One or more non-transitory computer readable storage mediums storing computer readable instructions, when executed by one or more processors, cause one or more processors to perform the steps of: receiving an uploaded batch Transaction file; create corresponding file parsing asynchronous task for each transaction file; execute each file parsing asynchronous task in parallel; execute each file parsing asynchronous task, including: obtaining the transaction type of the transaction file; if the transaction type matches the pre-stored transaction type If successful, the file parsing method corresponding to the transaction type is obtained in the database; and the transaction file is parsed according to the file parsing method, and the parsed transaction data is saved in the database.
  • the method when the computer readable instructions are executed by the processor, before performing the step of creating a corresponding file parsing asynchronous task for each transaction file, the method further comprises the step of: verifying the security of the bulk transaction file; If the bulk transaction file is verified to be secure, then the step of creating a corresponding file parsing asynchronous task for each transaction file is entered.
  • the method when the computer readable instructions are executed by the processor, before performing the step of obtaining a file parsing method corresponding to the transaction type in the database, the method further comprises the step of: obtaining, in the database, corresponding to the transaction type The file verification method; the transaction file is verified according to the file verification method; and if the verification is passed, the file parsing method corresponding to the transaction type is obtained in the database.
  • the computer readable instructions are further executed by the processor to: determine whether the transaction type of the bulk transaction file is the same transaction type; if so, create a corresponding transaction request asynchronous task for each transaction file Parallel execution of each transaction request asynchronous task, executing each transaction request asynchronous task, including: obtaining transaction data corresponding to the transaction file from the database; executing the transaction data; and if not, proceeding according to the preset transaction logic order The corresponding transaction data is obtained in the database, and the transaction data is executed.
  • the method when the computer readable instructions are executed by the processor, before performing the step of determining whether the transaction type of the batch transaction file is the same transaction type, the method further comprises the step of: detecting whether the batch transaction file is parsed; And if so, enter the step of determining whether the transaction type of the bulk transaction file is the same transaction type.
  • a computer device comprising a memory and one or more processors, the memory storing computer readable instructions, the computer readable instructions being executed by the processor, causing the one or more processors to perform the step of: receiving the uploaded bulk transaction File; create a corresponding file parsing asynchronous task for each transaction file; execute each file parsing asynchronous task in parallel; execute each file parsing asynchronous task, including: obtaining the transaction type of the transaction file; if the transaction type matches the pre-stored transaction type successfully , the file parsing method corresponding to the transaction type is obtained in the database; and the transaction file is parsed according to the file parsing method, and the parsed transaction data is saved in the database.
  • the method further comprises the step of: verifying the security of the bulk transaction file; If the batch transaction file is verified to be secure, then the step of creating a corresponding file parsing asynchronous task for each transaction file is entered.
  • the method when the processor executes the computer readable instructions, before executing the file parsing method corresponding to the transaction type in the database, the method further includes: performing the following steps: obtaining a file check corresponding to the transaction type in the database Method; verifying the transaction file according to the file verification method; if the verification is passed, entering the step of obtaining a file parsing method corresponding to the transaction type in the database.
  • the processor executes the computer readable instructions to: determine whether the transaction type of the batch transaction file is the same transaction type; if so, create a corresponding transaction request asynchronous task for each transaction file; Execute each transaction request asynchronous task in parallel, execute each transaction request asynchronous task, including: obtaining transaction data corresponding to the transaction file from the database; executing the transaction data; and if not, proceeding from the database according to the preset transaction logic order Obtain the corresponding transaction data and execute the transaction data.
  • the method further comprises the step of: detecting whether the batch transaction file is parsed; and If so, the step of determining whether the transaction type of the bulk transaction file is the same transaction type is entered.
  • Non-volatile memory can include read only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory.
  • Volatile memory can include random access memory (RAM) or external cache memory.
  • RAM is available in a variety of formats, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronization chain.
  • SRAM static RAM
  • DRAM dynamic RAM
  • SDRAM synchronous DRAM
  • DDRSDRAM double data rate SDRAM
  • ESDRAM enhanced SDRAM
  • Synchlink DRAM SLDRAM
  • Memory Bus Radbus
  • RDRAM Direct RAM
  • DRAM Direct Memory Bus Dynamic RAM
  • RDRAM Memory Bus Dynamic RAM

Abstract

A method for processing transaction files, comprising: receiving uploaded batch transaction files; creating a corresponding file parsing asynchronous task for each transaction file; and executing each file parsing asynchronous task in parallel, wherein executing each file parsing asynchronous task comprises: obtaining the transaction type of the transaction file; if the transaction type matches a pre-stored transaction type successfully, obtaining a file parsing method corresponding to the transaction type from a database; and storing transaction data obtained by parsing in the database.

Description

交易文件处理方法、装置、存储介质和计算机设备Transaction file processing method, device, storage medium and computer device
本申请要求于2017年06月26日提交中国专利局,申请号为2017104954614,申请名称为“交易文件处理方法、装置、存储介质和计算机设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese Patent Application entitled "Transaction Document Processing Method, Apparatus, Storage Medium, and Computer Equipment", filed on June 26, 2017, filed at the Chinese Patent Office No. 2017104954614, the entire contents of Combined in this application.
技术领域Technical field
本申请涉及一种交易指文件处理方法、装置、存储介质和计算机设备。The present application relates to a transaction finger file processing method, apparatus, storage medium and computer device.
背景技术Background technique
传统的交易文件处理方法是按照交易文件的接收时间的先后顺序处理每一个交易文件,包括解析接收到的交易文件得到交易数据,使用这些交易数据。The traditional transaction file processing method is to process each transaction file in the order of receiving time of the transaction file, including parsing the received transaction file to obtain transaction data, and using the transaction data.
然而,发明人意识到,当同一批次的交易文件中出现某一个文件的解析过程发生异常,传统的这种文件处理方法只有先将该文件的异常问题解决掉,才能解析同一批次中的其他交易文件,进而使用其他交易数据,使得文件的处理效率低。However, the inventor realized that when the parsing process of a certain file in the same batch of transaction files is abnormal, the conventional such file processing method can only resolve the abnormal problem of the file before parsing the same batch. Other transaction files, and in turn use other transaction data, make the file processing inefficient.
发明内容Summary of the invention
根据本申请公开的各种实施例,提供一种交易文件处理方法、装置、存储介质和计算机设备。According to various embodiments disclosed herein, a transaction file processing method, apparatus, storage medium, and computer device are provided.
一种交易文件处理方法,包括:接收上传的批量交易文件;为每一个所述交易文件创建对应的文件解析异步任务;并行执行每一个所述文件解析异步任务;所述执行每一个所述文件解析异步任务,包括:获取所述交易文件的交易类型;若所述交易类型与预存交易类型匹配成功,则在数据库中获取与所述交易类型对应的文件解析方法;及根据所述文件解析方法解析所述交 易文件,并将解析得到的交易数据保存至数据库中。A transaction file processing method includes: receiving an uploaded batch transaction file; creating a corresponding file parsing asynchronous task for each of the transaction files; performing each of the file parsing asynchronous tasks in parallel; and executing each of the files Parsing the asynchronous task includes: acquiring a transaction type of the transaction file; if the transaction type matches the pre-stored transaction type, obtaining a file parsing method corresponding to the transaction type in the database; and according to the file parsing method Parsing the transaction file and saving the parsed transaction data to the database.
一种交易文件处理装置,包括:交易文件接收模块,用于接收上传的批量交易文件;文件解析异步任务创建模块,用于为每一个所述交易文件创建对应的文件解析异步任务;文件解析异步任务执行模块,用于并行执行每一个所述文件解析异步任务;所述文件解析异步任务执行模块用于获取所述交易文件的交易类型;若所述交易类型与预存交易类型匹配成功,则在数据库中获取与所述交易类型对应的文件解析方法;及根据所述文件解析方法解析所述交易文件,并将解析得到的交易数据保存至数据库中。A transaction file processing device includes: a transaction file receiving module, configured to receive an uploaded batch transaction file; a file parsing asynchronous task creation module, configured to create a corresponding file parsing asynchronous task for each of the transaction files; a task execution module, configured to execute each of the file parsing asynchronous tasks in parallel; the file parsing asynchronous task execution module is configured to acquire a transaction type of the transaction file; if the transaction type matches a pre-stored transaction type, the Obtaining a file parsing method corresponding to the transaction type in the database; and parsing the transaction file according to the file parsing method, and saving the parsed transaction data to a database.
一个或多个存储有计算机可读指令的非易失性计算机可读存储介质,计算机可读指令被一个或多个处理器执行时,使得一个或多个处理器执行以下步骤:接收上传的批量交易文件;为每一个所述交易文件创建对应的文件解析异步任务;并行执行每一个所述文件解析异步任务;所述执行每一个所述文件解析异步任务,包括:获取所述交易文件的交易类型;若所述交易类型与预存交易类型匹配成功,则在数据库中获取与所述交易类型对应的文件解析方法;及根据所述文件解析方法解析所述交易文件,并将解析得到的交易数据保存至数据库中。One or more non-transitory computer readable storage mediums storing computer readable instructions, when executed by one or more processors, cause one or more processors to perform the steps of: receiving an uploaded batch Transaction file; creating a corresponding file parsing asynchronous task for each of the transaction files; executing each of the file parsing asynchronous tasks in parallel; performing each of the parsing of the asynchronous tasks, including: acquiring a transaction of the transaction file a type; if the transaction type matches the pre-stored transaction type, obtaining a file parsing method corresponding to the transaction type in the database; and parsing the transaction file according to the file parsing method, and parsing the obtained transaction data Save to the database.
一种计算机设备,包括存储器和一个或多个处理器,所述存储器中储存有计算机可读指令,所述计算机可读指令被所述处理器执行时,使得所述一个或多个处理器执行以下步骤:接收上传的批量交易文件;为每一个所述交易文件创建对应的文件解析异步任务;并行执行每一个所述文件解析异步任务;所述执行每一个所述文件解析异步任务,包括:获取所述交易文件的交易类型;若所述交易类型与预存交易类型匹配成功,则在数据库中获取与所述交易类型对应的文件解析方法;及根据所述文件解析方法解析所述交易文件,并将解析得到的交易数据保存至数据库中。A computer device comprising a memory and one or more processors having stored therein computer readable instructions, the computer readable instructions being executable by the processor to cause the one or more processors to execute The following steps: receiving the uploaded bulk transaction file; creating a corresponding file parsing asynchronous task for each of the transaction files; performing each of the file parsing asynchronous tasks in parallel; and executing each of the file parsing asynchronous tasks, including: Obtaining a transaction type of the transaction file; if the transaction type is successfully matched with the pre-stored transaction type, obtaining a file parsing method corresponding to the transaction type in a database; and parsing the transaction file according to the file parsing method, The parsed transaction data is saved to the database.
本申请的一个或多个实施例的细节在下面的附图和描述中提出。本申请的其它特征和优点将从说明书、附图以及权利要求书变得明显。Details of one or more embodiments of the present application are set forth in the accompanying drawings and description below. Other features and advantages of the present invention will be apparent from the description, drawings and claims.
附图说明DRAWINGS
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the embodiments or the prior art description will be briefly described below. Obviously, the drawings in the following description are only It is a certain embodiment of the present application, and other drawings can be obtained according to the drawings without any creative work for those skilled in the art.
图1为根据一个或多个实施例中交易文件处理方法的应用环境图。1 is an application environment diagram of a transaction file processing method in accordance with one or more embodiments.
图2为根据一个或多个实施例中服务器的内部结构图。2 is a diagram showing the internal structure of a server in accordance with one or more embodiments.
图3为根据一个或多个实施例中交易文件处理方法的流程图。3 is a flow diagram of a method of processing a transaction file in accordance with one or more embodiments.
图4为根据又一个或多个实施例中交易文件校验方法的流程图。4 is a flow diagram of a method of verifying a transaction file in accordance with still another embodiment.
图5为根据一个或多个实施例中交易数据执行方法的流程图。FIG. 5 is a flow diagram of a method of performing transaction data in accordance with one or more embodiments.
图6为根据一个或多个实施例中交易文件处理装置的结构框图。FIG. 6 is a block diagram showing the structure of a transaction file processing apparatus in accordance with one or more embodiments.
具体实施方式Detailed ways
为了使本申请的技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处所描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。In order to make the technical solutions and advantages of the present application more clear, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It is understood that the specific embodiments described herein are merely illustrative of the application and are not intended to be limiting.
本申请实施例提供的交易文件处理方法可应用于如图1所示的环境中。参考图1所示,服务器102可接收终端104上传的批量交易文件并处理该交易文件。具体的,服务器102通过网络与终端104进行通信,服务器102接收上传的批量交易文件,为每一个所述交易文件创建对应的文件解析异步任务,并行执行每一个所述文件解析异步任务,所述执行每一个所述文件解析异步任务,包括:获取所述交易文件的交易类型,若所述交易类型与预存交易类型匹配成功,则在数据库中获取与所述交易类型对应的文件解析方法,根据所述文件解析方法解析所述交易文件,并将解析得到的交易数据保存至数据库中等。这里的终端包括但不限于各种个人计算机、笔记本电脑、智能手机、平板电脑、便携式穿戴设备等。The transaction file processing method provided by the embodiment of the present application can be applied to the environment as shown in FIG. 1. Referring to FIG. 1, the server 102 can receive the bulk transaction file uploaded by the terminal 104 and process the transaction file. Specifically, the server 102 communicates with the terminal 104 through the network, the server 102 receives the uploaded batch transaction file, creates a corresponding file parsing asynchronous task for each of the transaction files, and executes each of the file parsing asynchronous tasks in parallel, Executing each of the file parsing asynchronous tasks includes: acquiring a transaction type of the transaction file, and if the transaction type matches the pre-stored transaction type, obtaining a file parsing method corresponding to the transaction type in the database, according to The file parsing method parses the transaction file and saves the parsed transaction data to a database or the like. Terminals herein include, but are not limited to, various personal computers, notebook computers, smart phones, tablets, portable wearable devices, and the like.
在其中一个实施例中,如图2所示,还提供了一种服务器,该服务器包 括通过系统总线连接的处理器、非易失性存储介质、内存储器、网络连接口,非易失性存储介质中存储有操作系统和计算机可读指令,该计算机可读指令用于实现本申请实施例中提供的适用于终端的一种交易文件处理方法。该非易失性存储介质可以是非易失性计算机可读存储介质。该处理器用于提高计算和控制能力,支撑整个服务器的运行。内存储器用于为非易失性存储介质中的操作系统和计算机可读指令的运行提供环境。网络接口用于与终端进行网络通信。本领域技术人员可以理解,图2中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的服务器的限定,具体地服务器可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。In one embodiment, as shown in FIG. 2, there is also provided a server including a processor connected through a system bus, a non-volatile storage medium, an internal memory, a network connection port, and non-volatile storage. An operating system and computer readable instructions are stored in the medium, and the computer readable instructions are used to implement a transaction file processing method applicable to the terminal provided in the embodiments of the present application. The non-volatile storage medium can be a non-transitory computer readable storage medium. This processor is used to improve computing and control capabilities and support the operation of the entire server. The internal memory is used to provide an environment for the operation of operating systems and computer readable instructions in a non-volatile storage medium. The network interface is used for network communication with the terminal. It will be understood by those skilled in the art that the structure shown in FIG. 2 is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the server to which the solution of the present application is applied. Specifically, the server may include a ratio. More or fewer components are shown in the figures, or some components are combined, or have different component arrangements.
在其中一个实施例中,如图3所示,提供了一种交易文件处理方法,该方法以应用于如图2中的服务器进行说明,包括:In one embodiment, as shown in FIG. 3, a transaction file processing method is provided, which is applied to the server as shown in FIG. 2, and includes:
步骤302,接收上传的批量交易文件。Step 302: Receive an uploaded batch transaction file.
交易文件是用户在商品交易系统中进行各种操作,如申请注册账户,修改账户信息、购买商品等操作,而形成的数据文件。交易文件以交易类型区分,如开户文件,账户修改文件、申购文件和认购文件等。服务器可以接收用户通过商品交易系统上传的批量交易文件。The transaction file is a data file formed by the user performing various operations in the commodity trading system, such as applying for registration of an account, modifying account information, and purchasing goods. Transaction documents are distinguished by transaction type, such as account opening documents, account modification documents, purchase documents, and subscription documents. The server can receive bulk transaction files uploaded by the user through the commodity trading system.
每一个交易文件对应一种交易类型,本实施例中提供的交易文件处理方法是基于多个交易文件的处理方法。Each transaction file corresponds to a transaction type, and the transaction file processing method provided in this embodiment is based on a plurality of transaction file processing methods.
步骤304,为每一个交易文件创建对应的文件解析异步任务。Step 304: Create a corresponding file parsing asynchronous task for each transaction file.
异步任务是指执行当前任务时,不需要等到该当前任务执行结束才执行后续任务,而是直接执行后续操作的任务,即异步任务用于同时执行多个任务。An asynchronous task refers to a task that executes a subsequent task without waiting for the current task to finish executing, but directly performs a subsequent operation, that is, an asynchronous task is used to execute multiple tasks at the same time.
批量交易文件接收完毕后,服务器为每一个接收到的交易文件创建对应的文件解析异步任务,用于快速解析每一个交易文件。After the bulk transaction file is received, the server creates a corresponding file parsing asynchronous task for each received transaction file, which is used to quickly parse each transaction file.
步骤306,并行执行每一个文件解析异步任务。In step 306, each file parsing asynchronous task is executed in parallel.
文件解析异步任务创建完成后,根据文件解析异步任务的个数和预设最 大任务处理个数分配创建的文件解析异步任务。当文件解析异步任务的个数不超过预设最大任务处理个数时,创建的文件解析异步任务可直接分配给当前创建文件解析异步任务的服务器;当文件解析异步任务的个数大于预设最大任务处理个数时,可计算文件解析异步任务的个数与预设最大任务处理个数的第一比值,将该第一比值向上取整得到第二比值,再将文件解析异步任务分配给台数为第二比值的服务器,比如文件解析异步任务的个数为18(即接收到的批量交易文件的个数为18),预设的最大任务处理个数为7,则将前述异步任务分配给3台服务器进行执行,3台服务器分配的文件解析异步任务的个数可以是7,7,4(即按照预设的最大任务处理个数进行分配),也可以是6,6,6(即平均分配)等。After the file parsing asynchronous task is created, the file parsing asynchronous task is created according to the number of file parsing asynchronous tasks and the preset maximum task processing number. When the number of file parsing asynchronous tasks does not exceed the preset maximum task processing number, the created file parsing asynchronous task can be directly assigned to the server that currently creates the file parsing asynchronous task; when the number of file parsing asynchronous tasks is greater than the preset maximum When the number of tasks is processed, the first ratio of the number of file parsing asynchronous tasks to the preset maximum number of task processing may be calculated, and the first ratio is rounded up to obtain a second ratio, and then the file parsing asynchronous task is assigned to the number of files. For the second ratio server, for example, the number of file parsing asynchronous tasks is 18 (that is, the number of received batch transaction files is 18), and the preset maximum number of task processing is 7, the asynchronous task is assigned to 3 servers are executed, and the number of file parsing asynchronous tasks allocated by the three servers can be 7, 7, 4 (that is, according to the preset maximum number of task processing), or it can be 6, 6, and 6 (ie, Average allocation) and so on.
文件解析异步任务分配完成后,并行执行所有创建的文件解析异步任务。执行每一个文件解析异步任务的步骤,包括:File parsing After the asynchronous task assignment is completed, all created file parsing asynchronous tasks are executed in parallel. The steps to perform each file parsing asynchronous task, including:
步骤3062,获取交易文件的交易类型。Step 3062: Obtain a transaction type of the transaction file.
交易文件以交易类型划分。例如,交易类型可以是但不限于开户文件,账户修改文件、申购文件和认购文件等。可直接解析交易文件获取交易类型,也可先解析交易文件得到文件来源(如PC端系统、微信平台等),再根据文件来源获取交易文件的交易类型。Transaction documents are divided by transaction type. For example, the transaction type may be, but is not limited to, an account opening document, an account modification file, a purchase document, and a subscription document. The transaction file can be directly parsed to obtain the transaction type, or the transaction file can be parsed first to obtain the file source (such as PC-side system, WeChat platform, etc.), and then the transaction type of the transaction file is obtained according to the file source.
步骤3064,若交易类型与预存交易类型匹配成功,则在数据库中获取与交易类型对应的文件解析方法。Step 3064: If the transaction type matches the pre-stored transaction type, the file parsing method corresponding to the transaction type is obtained in the database.
文件解析方法是预存在数据库中的用于解析文件的方法。本实施例中,需要将接收到的交易文件的交易类型与预存交易类型进行匹配,以过滤掉终端错传的文件。若匹配成功,则在数据库中获取与交易类型对应的文件解析方法,即文件解析方法预先存储在数据库中,以便后续交易文件的模板发生变更,与之对应的新的文件解析方法可直接替换数据库中的原有的文件解析方法,减少了存储在程序中方法重写带来的连接测试等操作。The file parsing method is a method pre-existing in the database for parsing files. In this embodiment, the transaction type of the received transaction file needs to be matched with the pre-stored transaction type to filter out the misplaced file of the terminal. If the matching is successful, the file parsing method corresponding to the transaction type is obtained in the database, that is, the file parsing method is pre-stored in the database, so that the template of the subsequent transaction file is changed, and the corresponding new file parsing method can directly replace the database. The original file parsing method in the file reduces operations such as connection tests that are stored in the program in the program.
步骤3066,根据文件解析方法解析交易文件,并将解析得到的交易数据保存至数据库中。 Step 3066, parsing the transaction file according to the file parsing method, and saving the parsed transaction data to the database.
服务器根据交易文件对应的解析方法解析交易文件得到交易数据后,将交易数据保存至数据库,以便后续使用。After the server parses the transaction file according to the parsing method corresponding to the transaction file to obtain the transaction data, the transaction data is saved to the database for subsequent use.
由于同一个批次的每一个交易文件对应一个文件解析异步任务,每一个文件解析异步任务根据各自交易文件的交易类型,直接从数据库获取对应的文件解析方法,从而实现交易文件的并行解析,提高了交易文件的处理效率。Since each transaction file of the same batch corresponds to a file parsing asynchronous task, each file parsing asynchronous task obtains the corresponding file parsing method directly from the database according to the transaction type of the respective transaction file, thereby realizing parallel parsing of the transaction file and improving The processing efficiency of the transaction file.
在其中一个实施例中,上述步骤304之前,还包括验证批量交易文件的安全性;若批量交易文件验证为安全,则进入为每一个交易文件创建对应的文件解析异步任务的步骤。In one embodiment, before step 304, the method further includes verifying the security of the bulk transaction file; if the bulk transaction file is verified to be secure, the step of creating a corresponding file parsing asynchronous task for each transaction file is entered.
可通过获取每一个交易文件的安全标识,若该安全标识与预设安全标识对比一致,则交易文件验证为安全。例如,安全标识对应的字段为“safety signs”,“safety signs”的预设值为“DEAL-R”,而接收到的交易文件中,“safety signs”对应的值同样是是“DEAL-R”,则该交易文件验证为安全。本实施例中,通过对接收到的批量交易文件增加安全性验证的步骤,保证了交易文件的安全性。The security identifier of each transaction file can be obtained, and if the security identifier is consistent with the preset security identifier, the transaction file is verified to be secure. For example, the corresponding field of the security identifier is “safety signs”, the default value of “safety signs” is “DEAL-R”, and the value corresponding to “safety signs” in the received transaction file is also “DEAL-R”. ", then the transaction file is verified to be secure. In this embodiment, the security of the transaction file is ensured by adding security verification steps to the received batch transaction file.
在其中一个实施例中,如图4所示,在数据库中获取与交易类型对应的文件解析方法之前,还提供了一种交易文件的文件校验方法,还包括:In one embodiment, as shown in FIG. 4, before the file parsing method corresponding to the transaction type is obtained in the database, a file verification method of the transaction file is further provided, and the method further includes:
步骤402,若交易类型与预存交易类型匹配成功,则在数据库中获取与交易类型对应的文件校验方法。Step 402: If the transaction type matches the pre-stored transaction type, the file verification method corresponding to the transaction type is obtained in the database.
文件校验方法包括文件的物理校验和逻辑校验。物理校验用于校验文件的编码和数据的完整性,常用的数据完整性校验可以是循环冗余校验算法(Cyclic Redundancy Check,CRC,包括CRC8、CRC16和CRC32)、安全哈希算法(Secure Hash Algorithm,SHA,包括SHA1、SHA256、SHA384、SHA512)或是消息摘要算法(Message Digest Algorithm,包括MD2、MD4、MD5)等;逻辑校验用于校验数据的逻辑性,如相同字段的重复输入是否一致,数据的先后执行顺序是否符合预设逻辑等。File verification methods include physical and logical verification of files. The physical check is used to verify the encoding of the file and the integrity of the data. The commonly used data integrity check can be a Cyclic Redundancy Check (CRC), including CRC8, CRC16 and CRC32, and a secure hash algorithm. (Secure Hash Algorithm, SHA, including SHA1, SHA256, SHA384, SHA512) or Message Digest Algorithm (including MD2, MD4, MD5), etc.; logic check is used to check the logic of the data, such as the same field. Whether the repeated input is consistent, whether the sequential execution order of the data conforms to the preset logic, and the like.
数据库中预先存储了与预存交易类型相对应的文件校验方法,在获取了交易文件的交易类型后,便可轻易找出与之对应的文件校验方法。The file verification method corresponding to the pre-stored transaction type is pre-stored in the database, and after obtaining the transaction type of the transaction file, the corresponding file verification method can be easily found.
步骤404,根据文件校验方法校验交易文件。 Step 404, verifying the transaction file according to the file verification method.
利用与交易文件类型相对应的文件校验方法验证交易文件,若验证通过则进入后续的在数据库中获取与交易类型对应的文件解析的步骤;若验证不通过,则终止对该交易文件的处理。The transaction file is verified by the file verification method corresponding to the transaction file type, and if the verification is passed, the subsequent step of obtaining the file parsing corresponding to the transaction type in the database is entered; if the verification fails, the processing of the transaction file is terminated. .
通过对接收到的交易文件进行校验,过滤掉了非法的文件,保证了交易文件的数据完整性。By verifying the received transaction file, the illegal file is filtered out, and the data integrity of the transaction file is guaranteed.
在其中一个实施例中,如图5所示,在步骤306之后,还包括:In one embodiment, as shown in FIG. 5, after step 306, the method further includes:
步骤502,判断批量交易文件的交易类型是否为同一个交易类型,若是则进入步骤504,若否则进入步骤508。Step 502: Determine whether the transaction type of the batch transaction file is the same transaction type. If yes, proceed to step 504, otherwise proceed to step 508.
步骤504,为每一个交易文件创建对应的交易申请异步任务。 Step 504, creating a corresponding transaction request asynchronous task for each transaction file.
交易申请异步任务是交易文件中的交易数据的执行请求任务。当接收到的同一批次的交易文件的交易类型相同,如均为开户文件,则可通过创建多个任务线程来提高任务的运行效率。A transaction request asynchronous task is an execution request task of transaction data in a transaction file. When the transaction types of the same batch of transaction files received are the same, such as opening an account file, the task efficiency can be improved by creating multiple task threads.
步骤506,并行执行每一个交易申请异步任务。 Step 506, executing each transaction request asynchronous task in parallel.
与步骤306类似,交易申请异步任务创建完成后,可根据交易申请异步任务的个数和预设最大任务处理个数分配创建的交易申请异步任务,再并行执行所有创建的交易申请异步任务。执行每一个交易申请异步任务,包括:Similar to step 306, after the transaction request asynchronous task is created, the created transaction request asynchronous task can be allocated according to the number of the transaction request asynchronous task and the preset maximum task processing number, and then all the created transaction request asynchronous tasks are executed in parallel. Execute each transaction to request an asynchronous task, including:
步骤5062,从数据库中获取与交易文件对应的交易数据。Step 5062: Obtain transaction data corresponding to the transaction file from the database.
交易文件在解析后将对应的解析数据存储到数据库中,所以当需要使用交易数据时,直接从数据库中获取便可。交易数据为用户在交易系统进行任意操作的数据,包括但不限于交易系统的登录账号、登录密码、购买的商品信息等。After the transaction file is parsed, the corresponding parsed data is stored in the database, so when the transaction data needs to be used, it can be directly obtained from the database. The transaction data is data for the user to perform arbitrary operations on the transaction system, including but not limited to the login account of the transaction system, the login password, and the purchased product information.
步骤5064,执行交易数据。At step 5064, transaction data is executed.
在数据库中获取了与交易文件对应的交易数据后,按照交易类型的预设逻辑顺序执行交易数据,从而完成整个交易申请。例如,对于一种基金认购文件,服务器在基金认购申请表中获取用户选择购买的基金类型和基金数量,在基金信息表中获取与上述基金类型对应的基金单价、手续费、优惠折扣等, 根据预设的计算规则计算出用户需要支付的费用,获取用户对该笔费用的支付信息,并生成相应的基金认购订单,从而实现基金认购的完整流程。After the transaction data corresponding to the transaction file is obtained in the database, the transaction data is executed in the preset logical order of the transaction type, thereby completing the entire transaction application. For example, for a fund subscription document, the server obtains the fund type and the number of funds selected by the user in the fund subscription application form, and obtains the fund unit price, handling fee, discount, etc. corresponding to the fund type in the fund information table, according to The preset calculation rule calculates the fee that the user needs to pay, obtains the payment information of the user for the fee, and generates a corresponding fund subscription order, thereby realizing the complete process of the fund subscription.
步骤508,按照预设的交易逻辑顺序依次从数据库中获取对应的交易数据,执行交易数据。Step 508: Acquire corresponding transaction data from the database in sequence according to a preset transaction logic sequence, and execute the transaction data.
预设的交易逻辑是根据预存的交易类型进行设置的,如依次处理开户文件、账户修改文件、申购文件和认购文件。可通过对不同交易类型的交易文件设置不同的处理优先级来实现。The preset transaction logic is set according to the pre-stored transaction type, such as processing the account opening file, the account modification file, the purchase document and the subscription file in turn. This can be achieved by setting different processing priorities for transaction files of different transaction types.
通过对同一批次交易文件的交易类型的相同与否进行判断,若相同,则为每一个交易文件创建对应的交易申请异步任务,再并行执行每一个交易申请异步任务;若不相同,则为批量交易文件创建交易申请异步任务并执行交易申请异步任务,包括:按照预设的交易逻辑顺序依次从数据库中获取对应的交易数据,执行交易数据,提高了交易数据的执行效率。同时,将每一个交易文件的解析和交易数据的执行过程分开,减少了交易数据的使用和执行对于交易文件解析的依赖性,提高了交易数据的使用和执行功能的稳定性。By judging whether the transaction type of the same batch of transaction files is the same or not, if the same, creating a corresponding transaction request asynchronous task for each transaction file, and then executing each transaction request asynchronous task in parallel; if not, then The batch transaction file creates a transaction request asynchronous task and executes the transaction request asynchronous task, including: obtaining the corresponding transaction data from the database in turn according to the preset transaction logic order, executing the transaction data, and improving the execution efficiency of the transaction data. At the same time, the parsing of each transaction file and the execution process of the transaction data are separated, which reduces the dependence of the use and execution of the transaction data on the parsing of the transaction file, and improves the stability of the use and execution functions of the transaction data.
上述实施例是针对单个批次的待处理批量交易(这里的待处理批量交易是指批量交易文件已经过解析并存储到数据库中,但还未按照预设的执行逻辑进行执行的批量交易)的方案,在其他实施例中,若存在两个及两个以上批次的待处理的批量交易,为待处理的每个批次的批量交易创建对应的交易申请异步任务,再并行执行每一个交易申请异步任务。执行每一个交易申请异步任务,包括:判断一个批次中的批量交易文件的交易类型是否为同一个交易类型,若是,则为同一个批次中的每一个批量交易文件创建对应的交易申请异步子任务,再并行执行每一个交易申请异步子任务,以及执行每一个交易申请异步子任务,包括:从数据库中获取与交易文件对应的交易数据,执行交易数据;若否,则按照预设的交易逻辑顺序依次从数据库中获取对应的交易数据,执行交易数据。The above embodiment is for a batch transaction to be processed for a single batch (here, the batch transaction to be processed refers to a batch transaction in which the batch transaction file has been parsed and stored in the database but has not been executed according to the preset execution logic). In other embodiments, if there are two or more batches of batch transactions to be processed, a corresponding transaction request asynchronous task is created for each batch of batch transactions to be processed, and each transaction is executed in parallel. Apply for an asynchronous task. Executing an asynchronous task for each transaction, including: determining whether the transaction type of the batch transaction file in a batch is the same transaction type, and if so, creating a corresponding transaction request for each batch transaction file in the same batch. Subtask, then execute each transaction request asynchronous subtask in parallel, and execute each transaction request asynchronous subtask, including: obtaining transaction data corresponding to the transaction file from the database, executing the transaction data; if not, according to the preset The transaction logic sequence sequentially obtains the corresponding transaction data from the database and executes the transaction data.
在其中一个实施例中,在步骤502之前,还包括检测批量交易文件是否解析完毕,若是,则进入判断批量交易文件的交易类型是否为同一个交易类 型的步骤。In one of the embodiments, before step 502, it further comprises detecting whether the batch transaction file has been parsed, and if so, entering the step of determining whether the transaction type of the bulk transaction file is of the same transaction type.
可遍历文件明细表(包括批次号,文件编码、交易类型、文件来源、文件状态,文件状态初始值为“待处理”)中与批次号对应的多个文件处理状态,若文件处理状态均为“解析完成”,则该批次交易文件解析完成。It can traverse the file processing status corresponding to the batch number in the file list (including batch number, file encoding, transaction type, file source, file status, initial status of the file status), if the file processing status If the analysis is completed, the batch transaction file is parsed.
应该理解的是,虽然图3-5的流程图中的各个步骤按照箭头的指示依次显示,但是这些步骤并不是必然按照箭头指示的顺序依次执行。除非本文中有明确的说明,这些步骤的执行并没有严格的顺序限制,这些步骤可以以其它的顺序执行。而且,图3-5中的至少一部分步骤可以包括多个子步骤或者多个阶段,这些子步骤或者阶段并不必然是在同一时刻执行完成,而是可以在不同的时刻执行,这些子步骤或者阶段的执行顺序也不必然是依次进行,而是可以与其它步骤或者其它步骤的子步骤或者阶段的至少一部分轮流或者交替地执行。It should be understood that although the various steps in the flowcharts of FIGS. 3-5 are sequentially displayed as indicated by the arrows, these steps are not necessarily performed in the order indicated by the arrows. Except as explicitly stated herein, the execution of these steps is not strictly limited, and the steps may be performed in other orders. Moreover, at least some of the steps in FIGS. 3-5 may include a plurality of sub-steps or stages, which are not necessarily performed at the same time, but may be executed at different times, these sub-steps or stages The order of execution is not necessarily performed sequentially, but may be performed alternately or alternately with at least a portion of other steps or sub-steps or stages of other steps.
在其中一个实施例中,如图6所示,提供了一种交易文件处理装置,包括:交易文件接收模块602,用于接收上传的批量交易文件;文件解析异步任务创建模块604,用于为每一个交易文件创建对应的文件解析异步任务;文件解析异步任务执行模块606,用于并行执行每一个文件解析异步任务;及文件解析异步任务执行模块606用于获取交易文件的交易类型;若交易类型与预存交易类型匹配成功,则在数据库中获取与交易类型对应的文件解析方法;根据文件解析方法解析交易文件,并将解析得到的交易数据保存至数据库中。In one embodiment, as shown in FIG. 6, a transaction file processing apparatus is provided, including: a transaction file receiving module 602, configured to receive an uploaded bulk transaction file; and a file parsing asynchronous task creation module 604, configured to Each transaction file creates a corresponding file parsing asynchronous task; a file parsing asynchronous task execution module 606 is configured to execute each file parsing asynchronous task in parallel; and a file parsing asynchronous task executing module 606 is configured to obtain a transaction type of the transaction file; If the type matches the pre-stored transaction type successfully, the file parsing method corresponding to the transaction type is obtained in the database; the transaction file is parsed according to the file parsing method, and the parsed transaction data is saved in the database.
在其中一个实施例中,文件解析异步任务执行模块606还用于验证批量交易文件的安全性;及若批量交易文件验证为安全,则进入为每一个交易文件创建对应的文件解析异步任务的步骤。In one embodiment, the file parsing asynchronous task execution module 606 is further configured to verify the security of the bulk transaction file; and if the bulk transaction file is verified to be secure, enter the step of creating a corresponding file parsing asynchronous task for each transaction file. .
在其中一个实施例中,文件解析异步任务执行模块606还用于在数据库中获取与交易类型对应的文件校验方法;根据文件校验方法校验所述交易文件;及若校验通过,则进入在数据库中获取与交易类型对应的文件解析方法的步骤。In one embodiment, the file parsing asynchronous task execution module 606 is further configured to obtain a file verification method corresponding to the transaction type in the database; verify the transaction file according to the file verification method; and if the verification passes, Enter the step of obtaining a file parsing method corresponding to the transaction type in the database.
在其中一个实施例中,该装置还包括交易类型判断模块,用于判断批量交易文件的交易类型是否为同一个交易类型;若是,则为每一个交易文件创建对应的交易申请异步任务;并行执行每一个交易申请异步任务,执行每一个交易申请异步任务,包括:从数据库中获取与交易文件对应的交易数据;执行交易数据;及若否,则按照预设的业务逻辑顺序依次从数据库中获取对应的交易数据,执行交易数据。In one embodiment, the apparatus further includes a transaction type determining module, configured to determine whether the transaction type of the batch transaction file is the same transaction type; if yes, create a corresponding transaction request asynchronous task for each transaction file; Each transaction applies for an asynchronous task, and each transaction requests an asynchronous task, including: obtaining transaction data corresponding to the transaction file from the database; executing the transaction data; and if not, acquiring the transaction data in order according to a preset business logic sequence Corresponding transaction data, executing transaction data.
在其中一个实施例中,交易类型判断模块还用于检测批量交易文件是否解析完毕;及若是,则进入判断批量交易文件的交易类型是否为同一个交易类型的步骤。In one embodiment, the transaction type judging module is further configured to detect whether the bulk transaction file is parsed; and if so, enter a step of determining whether the transaction type of the bulk transaction file is the same transaction type.
关于交易文件处理装置的具体限定可以参见上文中对于交易文件处理方法的限定,在此不再赘述。上述交易文件处理装置中的各个模块可全部或部分通过软件、硬件及其组合来实现。上述各模块可以硬件形式内嵌于或独立于计算机设备中的处理器中,也可以以软件形式存储于计算机设备中的存储器中,以便于处理器调用执行以上各个模块对应的操作。For the specific definition of the transaction file processing device, reference may be made to the above description of the transaction file processing method, and details are not described herein again. Each of the above-described transaction file processing devices may be implemented in whole or in part by software, hardware, and combinations thereof. Each of the above modules may be embedded in or independent of the processor in the computer device, or may be stored in a memory in the computer device in a software form, so that the processor invokes the operations corresponding to the above modules.
一个或多个存储有计算机可读指令的非易失性计算机可读存储介质,计算机可读指令被一个或多个处理器执行时,使得一个或多个处理器执行以下步骤:接收上传的批量交易文件;为每一个交易文件创建对应的文件解析异步任务;并行执行每一个文件解析异步任务;执行每一个文件解析异步任务,包括:获取交易文件的交易类型;若交易类型与预存交易类型匹配成功,则在数据库中获取与交易类型对应的文件解析方法;及根据文件解析方法解析交易文件,并将解析得到的交易数据保存至数据库中。One or more non-transitory computer readable storage mediums storing computer readable instructions, when executed by one or more processors, cause one or more processors to perform the steps of: receiving an uploaded batch Transaction file; create corresponding file parsing asynchronous task for each transaction file; execute each file parsing asynchronous task in parallel; execute each file parsing asynchronous task, including: obtaining the transaction type of the transaction file; if the transaction type matches the pre-stored transaction type If successful, the file parsing method corresponding to the transaction type is obtained in the database; and the transaction file is parsed according to the file parsing method, and the parsed transaction data is saved in the database.
在其中一个实施例中,计算机可读指令被处理器执行时,在执行为每一个交易文件创建对应的文件解析异步任务的步骤之前,还包括执行以下步骤:验证批量交易文件的安全性;及若批量交易文件验证为安全,则进入为每一个交易文件创建对应的文件解析异步任务的步骤。In one of the embodiments, when the computer readable instructions are executed by the processor, before performing the step of creating a corresponding file parsing asynchronous task for each transaction file, the method further comprises the step of: verifying the security of the bulk transaction file; If the bulk transaction file is verified to be secure, then the step of creating a corresponding file parsing asynchronous task for each transaction file is entered.
在其中一个实施例中,计算机可读指令被处理器执行时,在执行在数据库中获取与交易类型对应的文件解析方法的步骤之前,还包括执行以下步骤: 在数据库中获取与交易类型对应的文件校验方法;根据文件校验方法校验交易文件;及若校验通过,则进入在数据库中获取与交易类型对应的文件解析方法。In one embodiment, when the computer readable instructions are executed by the processor, before performing the step of obtaining a file parsing method corresponding to the transaction type in the database, the method further comprises the step of: obtaining, in the database, corresponding to the transaction type The file verification method; the transaction file is verified according to the file verification method; and if the verification is passed, the file parsing method corresponding to the transaction type is obtained in the database.
在其中一个实施例中,计算机可读指令被处理器执行时还执行以下步骤:判断批量交易文件的交易类型是否为同一个交易类型;若是,则为每一个交易文件创建对应的交易申请异步任务;并行执行每一个交易申请异步任务,执行每一个交易申请异步任务,包括:从数据库中获取与交易文件对应的交易数据;执行交易数据;及若否,则按照预设的交易逻辑顺序依次从数据库中获取对应的交易数据,执行交易数据。In one embodiment, the computer readable instructions are further executed by the processor to: determine whether the transaction type of the bulk transaction file is the same transaction type; if so, create a corresponding transaction request asynchronous task for each transaction file Parallel execution of each transaction request asynchronous task, executing each transaction request asynchronous task, including: obtaining transaction data corresponding to the transaction file from the database; executing the transaction data; and if not, proceeding according to the preset transaction logic order The corresponding transaction data is obtained in the database, and the transaction data is executed.
在其中一个实施例中,计算机可读指令被处理器执行时,在执行判断批量交易文件的交易类型是否为同一个交易类型的步骤之前,还包括执行以下步骤:检测批量交易文件是否解析完毕;及若是,则进入判断批量交易文件的交易类型是否为同一个交易类型的步骤。In one embodiment, when the computer readable instructions are executed by the processor, before performing the step of determining whether the transaction type of the batch transaction file is the same transaction type, the method further comprises the step of: detecting whether the batch transaction file is parsed; And if so, enter the step of determining whether the transaction type of the bulk transaction file is the same transaction type.
一种计算机设备,包括存储器和一个或多个处理器,存储器中储存有计算机可读指令,计算机可读指令被处理器执行时,使得一个或多个处理器执行以下步骤:接收上传的批量交易文件;为每一个交易文件创建对应的文件解析异步任务;并行执行每一个文件解析异步任务;执行每一个文件解析异步任务,包括:获取交易文件的交易类型;若交易类型与预存交易类型匹配成功,则在数据库中获取与交易类型对应的文件解析方法;及根据文件解析方法解析交易文件,并将解析得到的交易数据保存至数据库中。A computer device comprising a memory and one or more processors, the memory storing computer readable instructions, the computer readable instructions being executed by the processor, causing the one or more processors to perform the step of: receiving the uploaded bulk transaction File; create a corresponding file parsing asynchronous task for each transaction file; execute each file parsing asynchronous task in parallel; execute each file parsing asynchronous task, including: obtaining the transaction type of the transaction file; if the transaction type matches the pre-stored transaction type successfully , the file parsing method corresponding to the transaction type is obtained in the database; and the transaction file is parsed according to the file parsing method, and the parsed transaction data is saved in the database.
在其中一个实施例中,处理器执行计算机可读指令时,在执行为每一个交易文件创建对应的文件解析异步任务的步骤之前,还包括执行以下步骤:验证批量交易文件的安全性;及若批量交易文件验证为安全,则进入为每一个交易文件创建对应的文件解析异步任务的步骤。In one of the embodiments, when the processor executes the computer readable instructions, before performing the step of creating a corresponding file parsing asynchronous task for each transaction file, the method further comprises the step of: verifying the security of the bulk transaction file; If the batch transaction file is verified to be secure, then the step of creating a corresponding file parsing asynchronous task for each transaction file is entered.
在其中一个实施例中,处理器执行计算机可读指令时,在执行在数据库中获取与交易类型对应的文件解析方法之前,还包括执行以下步骤:在数据库中获取与交易类型对应的文件校验方法;根据文件校验方法校验交易文件; 若校验通过,则进入在数据库中获取与交易类型对应的文件解析方法的步骤。In one embodiment, when the processor executes the computer readable instructions, before executing the file parsing method corresponding to the transaction type in the database, the method further includes: performing the following steps: obtaining a file check corresponding to the transaction type in the database Method; verifying the transaction file according to the file verification method; if the verification is passed, entering the step of obtaining a file parsing method corresponding to the transaction type in the database.
在其中一个实施例中,处理器执行计算机可读指令时还执行以下步骤:判断批量交易文件的交易类型是否为同一个交易类型;若是,则为每一个交易文件创建对应的交易申请异步任务;并行执行每一个交易申请异步任务,执行每一个交易申请异步任务,包括:从数据库中获取与交易文件对应的交易数据;执行交易数据;及若否,则按照预设的交易逻辑顺序依次从数据库中获取对应的交易数据,执行交易数据。In one embodiment, the processor executes the computer readable instructions to: determine whether the transaction type of the batch transaction file is the same transaction type; if so, create a corresponding transaction request asynchronous task for each transaction file; Execute each transaction request asynchronous task in parallel, execute each transaction request asynchronous task, including: obtaining transaction data corresponding to the transaction file from the database; executing the transaction data; and if not, proceeding from the database according to the preset transaction logic order Obtain the corresponding transaction data and execute the transaction data.
在其中一个实施例中,处理器执行计算机可读指令时,在执行判断批量交易文件的交易类型是否为同一个交易类型的步骤之前,还包括执行以下步骤:检测批量交易文件是否解析完毕;及若是,则进入判断批量交易文件的交易类型是否为同一个交易类型的步骤。In one embodiment, when the processor executes the computer readable instructions, before performing the step of determining whether the transaction type of the batch transaction file is the same transaction type, the method further comprises the step of: detecting whether the batch transaction file is parsed; and If so, the step of determining whether the transaction type of the bulk transaction file is the same transaction type is entered.
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机可读指令来指令相关的硬件来完成,所述的计算机可读指令可存储于一非易失性计算机可读取存储介质中,该计算机可读指令在执行时,可包括如上述各方法的实施例的流程。本申请所提供的各实施例中所使用的对存储器、存储、数据库或其它介质的任何引用,均可包括非易失性和/或易失性存储器。非易失性存储器可包括只读存储器(ROM)、可编程ROM(PROM)、电可编程ROM(EPROM)、电可擦除可编程ROM(EEPROM)或闪存。易失性存储器可包括随机存取存储器(RAM)或者外部高速缓冲存储器。作为说明而非局限,RAM以多种形式可得,诸如静态RAM(SRAM)、动态RAM(DRAM)、同步DRAM(SDRAM)、双数据率SDRAM(DDRSDRAM)、增强型SDRAM(ESDRAM)、同步链路(Synchlink)DRAM(SLDRAM)、存储器总线(Rambus)直接RAM(RDRAM)、直接存储器总线动态RAM(DRDRAM)、以及存储器总线动态RAM(RDRAM)等。One of ordinary skill in the art can understand that all or part of the process of implementing the above embodiments can be completed by computer readable instructions, which can be stored in a non-volatile computer. The readable storage medium, which when executed, may include the flow of an embodiment of the methods as described above. Any reference to a memory, storage, database, or other medium used in the various embodiments provided herein can include non-volatile and/or volatile memory. Non-volatile memory can include read only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of formats, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronization chain. Synchlink DRAM (SLDRAM), Memory Bus (Rambus) Direct RAM (RDRAM), Direct Memory Bus Dynamic RAM (DRDRAM), and Memory Bus Dynamic RAM (RDRAM).
以上所述实施例的各技术特征可以进行任意的组合,为使描述简洁,未对上述实施例中的各个技术特征所有可能的组合都进行描述,然而,只要这些技术特征的组合不存在矛盾,都应当认为是本说明书记载的范围。The technical features of the above-described embodiments may be arbitrarily combined. For the sake of brevity of description, all possible combinations of the technical features in the above embodiments are not described. However, as long as there is no contradiction between the combinations of these technical features, All should be considered as the scope of this manual.
以上所述实施例仅表达了本申请的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对发明专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本申请构思的前提下,还可以做出若干变形和改进,这些都属于本申请的保护范围。因此,本申请专利的保护范围应以所附权利要求为准。The above-mentioned embodiments are merely illustrative of several embodiments of the present application, and the description thereof is more specific and detailed, but is not to be construed as limiting the scope of the invention. It should be noted that a number of variations and modifications may be made by those skilled in the art without departing from the spirit and scope of the present application. Therefore, the scope of the invention should be determined by the appended claims.

Claims (20)

  1. 一种交易文件处理方法,包括:A transaction file processing method, comprising:
    接收上传的批量交易文件;Receive uploaded bulk transaction files;
    为每一个所述交易文件创建对应的文件解析异步任务;Creating a corresponding file parsing asynchronous task for each of the transaction files;
    并行执行每一个所述文件解析异步任务;Executing each of the file parsing asynchronous tasks in parallel;
    所述执行每一个所述文件解析异步任务,包括:The performing each of the file parsing asynchronous tasks includes:
    获取所述交易文件的交易类型;Obtaining the transaction type of the transaction file;
    若所述交易类型与预存交易类型匹配成功,则在数据库中获取与所述交易类型对应的文件解析方法;及If the transaction type is successfully matched with the pre-stored transaction type, obtaining a file parsing method corresponding to the transaction type in the database; and
    根据所述文件解析方法解析所述交易文件,并将解析得到的交易数据保存至数据库中。The transaction file is parsed according to the file parsing method, and the parsed transaction data is saved in a database.
  2. 根据权利要求1所述的方法,其特征在于,在所述为每一个所述交易文件创建对应的文件解析异步任务之前,还包括:The method according to claim 1, wherein before the creating a corresponding file parsing asynchronous task for each of the transaction files, the method further comprises:
    验证所述批量交易文件的安全性;及Verifying the security of the bulk transaction file; and
    若所述批量交易文件验证为安全,则进入为每一个所述交易文件创建对应的文件解析异步任务的步骤。If the batch transaction file is verified to be secure, a step of creating a corresponding file parsing asynchronous task for each of the transaction files is entered.
  3. 根据权利要求1所述的方法,其特征在于,在所述在数据库中获取与所述交易类型对应的文件解析方法之前,还包括:The method according to claim 1, wherein before the obtaining the file parsing method corresponding to the transaction type in the database, the method further comprises:
    在数据库中获取与所述交易类型对应的文件校验方法;Obtaining a file verification method corresponding to the transaction type in a database;
    根据所述文件校验方法校验所述交易文件;及Verifying the transaction file according to the file verification method; and
    若校验通过,则进入所述在数据库中获取与所述交易类型对应的文件解析方法的步骤。If the verification passes, the process proceeds to the step of obtaining a file parsing method corresponding to the transaction type in the database.
  4. 根据权利要求1所述的方法,其特征在于,所述方法还包括:The method of claim 1 further comprising:
    判断所述批量交易文件的交易类型是否为同一个交易类型;Determining whether the transaction type of the batch transaction file is the same transaction type;
    若是,则为每一个交易文件创建对应的交易申请异步任务;并行执行所述每一个所述交易申请异步任务,所述执行所述每一个所述交易申请异步任务,包括:从数据库中获取与所述交易文件对应的交易数据;执行所述交易 数据;及If yes, create a corresponding transaction request asynchronous task for each transaction file; execute each of the transaction request asynchronous tasks in parallel, and execute each of the transaction request asynchronous tasks, including: obtaining from the database Transaction data corresponding to the transaction file; executing the transaction data; and
    若否,则按照预设的业务逻辑顺序依次从数据库中获取对应的交易数据,执行所述交易数据。If not, the corresponding transaction data is sequentially acquired from the database according to a preset business logic sequence, and the transaction data is executed.
  5. 根据权利要求4所述的方法,其特征在于,在所述判断所述批量交易文件的交易类型是否为同一个交易类型之前,还包括:The method according to claim 4, further comprising: before determining whether the transaction type of the batch transaction file is the same transaction type, further comprising:
    检测所述批量交易文件是否解析完毕;及Detecting whether the batch transaction file is parsed; and
    若是,则进入判断所述批量交易文件的交易类型是否为同一个交易类型的步骤。If yes, a step is entered to determine whether the transaction type of the bulk transaction file is the same transaction type.
  6. 一种交易文件处理装置,包括:A transaction file processing device comprising:
    交易文件接收模块,用于接收上传的批量交易文件;a transaction file receiving module, configured to receive the uploaded batch transaction file;
    文件解析异步任务创建模块,用于为每一个所述交易文件创建对应的文件解析异步任务;及a file parsing asynchronous task creation module, configured to create a corresponding file parsing asynchronous task for each of the transaction files; and
    文件解析异步任务执行模块,用于并行执行每一个所述文件解析异步任务;a file parsing asynchronous task execution module, configured to execute each of the file parsing asynchronous tasks in parallel;
    所述文件解析异步任务执行模块用于获取所述交易文件的交易类型;若所述交易类型与预存交易类型匹配成功,则在数据库中获取与所述交易类型对应的文件解析方法;根据所述文件解析方法解析所述交易文件,并将解析得到的交易数据保存至数据库中。The file parsing asynchronous task execution module is configured to obtain a transaction type of the transaction file; if the transaction type matches the pre-stored transaction type, the file parsing method corresponding to the transaction type is obtained in the database; The file parsing method parses the transaction file and saves the parsed transaction data to a database.
  7. 根据权利要求6所述的装置,其特征在于,所述文件解析异步任务创建模块还用于验证所述批量交易文件的安全性;及若所述批量交易文件验证为安全,则进入为每一个所述交易文件创建对应的文件解析异步任务的步骤。The device according to claim 6, wherein the file parsing asynchronous task creation module is further configured to verify security of the bulk transaction file; and if the bulk transaction file is verified to be secure, enter each for each The transaction file creates a step of parsing an asynchronous task for the corresponding file.
  8. 根据权利要求6所述的装置,其特征在于,所述文件解析异步任务执行模块还用于在数据库中获取与所述交易类型对应的文件校验方法;根据所述文件校验方法校验所述交易文件;及若校验通过,则进入所述在数据库中获取与所述交易类型对应的文件解析方法的步骤。The apparatus according to claim 6, wherein the file parsing asynchronous task execution module is further configured to acquire a file verification method corresponding to the transaction type in a database; and verify the location according to the file verification method. Transmitting the transaction file; and if the verification is passed, entering the step of obtaining a file parsing method corresponding to the transaction type in the database.
  9. 根据权利要求6所述的装置,其特征在于,所述装置还包括交易类型判断模块,用于判断所述批量交易文件的交易类型是否为同一个交易类型; 若是,则为每一个交易文件创建对应的交易申请异步任务;并行执行所述每一个所述交易申请异步任务,所述执行所述每一个所述交易申请异步任务,包括:从数据库中获取与所述交易文件对应的交易数据;执行所述交易数据;及若否,则按照预设的业务逻辑顺序依次从数据库中获取对应的交易数据,执行所述交易数据。The device according to claim 6, wherein the device further comprises a transaction type judging module, configured to determine whether the transaction type of the bulk transaction file is the same transaction type; if yes, create for each transaction file Corresponding transaction application asynchronous task; executing each of the transaction request asynchronous tasks in parallel, and executing each of the transaction request asynchronous tasks comprises: obtaining transaction data corresponding to the transaction file from a database; Executing the transaction data; and if not, acquiring corresponding transaction data from the database in sequence according to a preset business logic sequence, and executing the transaction data.
  10. 根据权利要求9所述的装置,其特征在于,所述交易类型判断模块还用于检测所述批量交易文件是否解析完毕;及若是,则进入判断所述批量交易文件的交易类型是否为同一个交易类型的步骤。The device according to claim 9, wherein the transaction type judging module is further configured to detect whether the batch transaction file is parsed; and if so, enter whether the transaction type of the bulk transaction file is the same The steps for the transaction type.
  11. 一个或多个存储有计算机可读指令的非易失性计算机可读存储介质,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器执行以下步骤:One or more non-transitory computer readable storage mediums storing computer readable instructions, when executed by one or more processors, cause the one or more processors to perform the following steps:
    接收上传的批量交易文件;Receive uploaded bulk transaction files;
    为每一个所述交易文件创建对应的文件解析异步任务;Creating a corresponding file parsing asynchronous task for each of the transaction files;
    并行执行每一个所述文件解析异步任务;Executing each of the file parsing asynchronous tasks in parallel;
    所述执行每一个所述文件解析异步任务,包括:The performing each of the file parsing asynchronous tasks includes:
    获取所述交易文件的交易类型;Obtaining the transaction type of the transaction file;
    若所述交易类型与预存交易类型匹配成功,则在数据库中获取与所述交易类型对应的文件解析方法;及If the transaction type is successfully matched with the pre-stored transaction type, obtaining a file parsing method corresponding to the transaction type in the database; and
    根据所述文件解析方法解析所述交易文件,并将解析得到的交易数据保存至数据库中。The transaction file is parsed according to the file parsing method, and the parsed transaction data is saved in a database.
  12. 根据权利要求11所述的存储介质,其特征在于,所述计算机可读指令被所述处理器执行时,在所执行的所述为每一个所述交易文件创建对应的文件解析异步任务的步骤之前,还包括执行以下步骤:The storage medium of claim 11 wherein said computer readable instructions are executed by said processor, said step of creating a corresponding file parsing asynchronous task for each of said transaction files executed Previously, it also included the following steps:
    验证所述批量交易文件的安全性;及Verifying the security of the bulk transaction file; and
    若所述批量交易文件验证为安全,则进入为每一个所述交易文件创建对应的文件解析异步任务的步骤。If the batch transaction file is verified to be secure, a step of creating a corresponding file parsing asynchronous task for each of the transaction files is entered.
  13. 根据权利要求11所述的存储介质,其特征在于,所述计算机可读指 令被所述处理器执行时,在所执行的所述在数据库中获取与所述交易类型对应的文件解析方法的步骤之前,还包括执行以下步骤:A storage medium according to claim 11, wherein when said computer readable instructions are executed by said processor, said step of obtaining said file parsing method corresponding to said transaction type in said database is executed Previously, it also included the following steps:
    在数据库中获取与所述交易类型对应的文件校验方法;Obtaining a file verification method corresponding to the transaction type in a database;
    根据所述文件校验方法校验所述交易文件;及Verifying the transaction file according to the file verification method; and
    若校验通过,则进入所述在数据库中获取与所述交易类型对应的文件解析方法的步骤。If the verification passes, the process proceeds to the step of obtaining a file parsing method corresponding to the transaction type in the database.
  14. 根据权利要求11所述的存储介质,其特征在于,所述计算机可读指令被所述处理器执行时还执行以下步骤:The storage medium of claim 11 wherein said computer readable instructions, when executed by said processor, further perform the following steps:
    判断所述批量交易文件的交易类型是否为同一个交易类型;Determining whether the transaction type of the batch transaction file is the same transaction type;
    若是,则为每一个交易文件创建对应的交易申请异步任务;并行执行所述每一个所述交易申请异步任务,所述执行所述每一个所述交易申请异步任务,包括:从数据库中获取与所述交易文件对应的交易数据;执行所述交易数据;及If yes, create a corresponding transaction request asynchronous task for each transaction file; execute each of the transaction request asynchronous tasks in parallel, and execute each of the transaction request asynchronous tasks, including: obtaining from the database Transaction data corresponding to the transaction file; executing the transaction data; and
    若否,则按照预设的业务逻辑顺序依次从数据库中获取对应的交易数据,执行所述交易数据。If not, the corresponding transaction data is sequentially acquired from the database according to a preset business logic sequence, and the transaction data is executed.
  15. 根据权利要求14所述的存储介质,其特征在于,所述计算机可读指令被所述处理器执行时,在所执行的所述判断所述批量交易文件的交易类型是否为同一个交易类型的步骤之前,还包括执行以下步骤:The storage medium according to claim 14, wherein when said computer readable instructions are executed by said processor, said at said execution determines whether said transaction type of said bulk transaction file is of the same transaction type Before the step, it also includes the following steps:
    检测所述批量交易文件是否解析完毕;及Detecting whether the batch transaction file is parsed; and
    若是,则进入判断所述批量交易文件的交易类型是否为同一个交易类型的步骤。If yes, a step is entered to determine whether the transaction type of the bulk transaction file is the same transaction type.
  16. 一种计算机设备,包括存储器及一个或多个处理器,所述存储器中储存有计算机可读指令,所述计算机可读指令被所述一个或多个处理器执行时,使得所述一个或多个处理器执行以下步骤:A computer device comprising a memory and one or more processors having stored therein computer readable instructions, the computer readable instructions being executed by the one or more processors to cause the one or more The processors perform the following steps:
    接收上传的批量交易文件;Receive uploaded bulk transaction files;
    为每一个所述交易文件创建对应的文件解析异步任务;Creating a corresponding file parsing asynchronous task for each of the transaction files;
    并行执行每一个所述文件解析异步任务;Executing each of the file parsing asynchronous tasks in parallel;
    所述执行每一个所述文件解析异步任务,包括:The performing each of the file parsing asynchronous tasks includes:
    获取所述交易文件的交易类型;Obtaining the transaction type of the transaction file;
    若所述交易类型与预存交易类型匹配成功,则在数据库中获取与所述交易类型对应的文件解析方法;及If the transaction type is successfully matched with the pre-stored transaction type, obtaining a file parsing method corresponding to the transaction type in the database; and
    根据所述文件解析方法解析所述交易文件,并将解析得到的交易数据保存至数据库中。The transaction file is parsed according to the file parsing method, and the parsed transaction data is saved in a database.
  17. 根据权利要求16所述的计算机设备,其特征在于,所述处理器执行所述计算机可读指令时,在所执行的所述为每一个所述交易文件创建对应的文件解析异步任务的步骤之前,还包括执行以下步骤:A computer apparatus according to claim 16 wherein said processor executes said computer readable instructions prior to said step of creating said corresponding file parsing asynchronous task for each of said transaction files Also includes the following steps:
    验证所述批量交易文件的安全性;及Verifying the security of the bulk transaction file; and
    若所述批量交易文件验证为安全,则进入为每一个所述交易文件创建对应的文件解析异步任务的步骤。If the batch transaction file is verified to be secure, a step of creating a corresponding file parsing asynchronous task for each of the transaction files is entered.
  18. 根据权利要求16所述的计算机设备,其特征在于,所述处理器执行所述计算机可读指令时,在所执行的所述在数据库中获取与所述交易类型对应的文件解析方法的步骤之前,还包括执行以下步骤:A computer apparatus according to claim 16, wherein said processor executes said computer readable instructions prior to said step of obtaining said file parsing method corresponding to said transaction type in said database Also includes the following steps:
    在数据库中获取与所述交易类型对应的文件校验方法;Obtaining a file verification method corresponding to the transaction type in a database;
    根据所述文件校验方法校验所述交易文件;及Verifying the transaction file according to the file verification method; and
    若校验通过,则进入所述在数据库中获取与所述交易类型对应的文件解析方法的步骤。If the verification passes, the process proceeds to the step of obtaining a file parsing method corresponding to the transaction type in the database.
  19. 根据权利要求16所述的计算机设备,其特征在于,所述处理器执行所述计算机可读指令时还执行以下步骤:The computer apparatus according to claim 16, wherein said processor further performs the following steps when said computer readable instructions are executed:
    判断所述批量交易文件的交易类型是否为同一个交易类型;Determining whether the transaction type of the batch transaction file is the same transaction type;
    若是,则为每一个交易文件创建对应的交易申请异步任务;并行执行所述每一个所述交易申请异步任务,所述执行所述每一个所述交易申请异步任务,包括:从数据库中获取与所述交易文件对应的交易数据;执行所述交易数据;及If yes, create a corresponding transaction request asynchronous task for each transaction file; execute each of the transaction request asynchronous tasks in parallel, and execute each of the transaction request asynchronous tasks, including: obtaining from the database Transaction data corresponding to the transaction file; executing the transaction data; and
    若否,则按照预设的业务逻辑顺序依次从数据库中获取对应的交易数据, 执行所述交易数据。If not, the corresponding transaction data is sequentially acquired from the database according to a preset business logic sequence, and the transaction data is executed.
  20. 根据权利要求19所述的计算机设备,其特征在于,所述处理器执行所述计算机可读指令时,在所执行的所述判断所述批量交易文件的交易类型是否为同一个交易类型的步骤之前,还包括执行以下步骤:The computer apparatus according to claim 19, wherein said step of determining whether said transaction type of said bulk transaction file is the same transaction type is performed when said processor executes said computer readable instruction Previously, it also included the following steps:
    检测所述批量交易文件是否解析完毕;及Detecting whether the batch transaction file is parsed; and
    若是,则进入判断所述批量交易文件的交易类型是否为同一个交易类型的步骤。If yes, a step is entered to determine whether the transaction type of the bulk transaction file is the same transaction type.
PCT/CN2018/084841 2017-06-26 2018-04-27 Method and device for processing transaction files, storage medium, and computer apparatus WO2019001125A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710495461.4 2017-06-26
CN201710495461.4A CN107797854B (en) 2017-06-26 2017-06-26 Transaction file processing method and device, storage medium and computer equipment

Publications (1)

Publication Number Publication Date
WO2019001125A1 true WO2019001125A1 (en) 2019-01-03

Family

ID=61531062

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/084841 WO2019001125A1 (en) 2017-06-26 2018-04-27 Method and device for processing transaction files, storage medium, and computer apparatus

Country Status (2)

Country Link
CN (1) CN107797854B (en)
WO (1) WO2019001125A1 (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107797854B (en) * 2017-06-26 2020-08-11 平安科技(深圳)有限公司 Transaction file processing method and device, storage medium and computer equipment
CN108537528B (en) * 2018-04-10 2021-08-06 平安科技(深圳)有限公司 Batch file auditing and payment-for-delivery method and system
CN109086330A (en) * 2018-07-03 2018-12-25 深圳鼎盛电脑科技有限公司 A kind of document handling method, device, equipment and storage medium
CN109359147B (en) * 2018-09-27 2021-01-26 北京京东尚科信息技术有限公司 Business component processing method, component server and system
CN111859205A (en) * 2020-07-14 2020-10-30 上海悦易网络信息技术有限公司 Analytic method and equipment for batch processing tasks
CN112433994A (en) * 2020-11-24 2021-03-02 北京神州数字科技有限公司 File processing method
CN112597228A (en) * 2020-12-26 2021-04-02 中国农业银行股份有限公司 File processing method and system

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102571720A (en) * 2010-12-27 2012-07-11 中国移动通信集团辽宁有限公司 Method and device for processing heterogeneous information contents
US20150371293A1 (en) * 2014-06-19 2015-12-24 Lexmark International, Inc. Systems and Methods for Monitoring and Valuating Transactions for Document Processes
CN106055315A (en) * 2016-05-19 2016-10-26 乐视控股(北京)有限公司 Method and system for processing batched tasks
CN107797854A (en) * 2017-06-26 2018-03-13 平安科技(深圳)有限公司 Transaction file processing method, device, storage medium and computer equipment

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6990466B1 (en) * 2000-08-08 2006-01-24 International Business Machines Corporation Method and system for integrating core banking business processes
US7925551B2 (en) * 2004-06-09 2011-04-12 Syncada Llc Automated transaction processing system and approach
CN102509238A (en) * 2011-11-29 2012-06-20 成都安朗电气自控设备有限公司 Bank non-cash business processing method, apparatus and system
CN105389209B (en) * 2015-12-25 2019-04-26 中国建设银行股份有限公司 A kind of asynchronous batch tasks processing method and system
CN105894366A (en) * 2016-04-22 2016-08-24 上海瀚之友信息技术服务有限公司 Seckilling type transaction processing system and method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102571720A (en) * 2010-12-27 2012-07-11 中国移动通信集团辽宁有限公司 Method and device for processing heterogeneous information contents
US20150371293A1 (en) * 2014-06-19 2015-12-24 Lexmark International, Inc. Systems and Methods for Monitoring and Valuating Transactions for Document Processes
CN106055315A (en) * 2016-05-19 2016-10-26 乐视控股(北京)有限公司 Method and system for processing batched tasks
CN107797854A (en) * 2017-06-26 2018-03-13 平安科技(深圳)有限公司 Transaction file processing method, device, storage medium and computer equipment

Also Published As

Publication number Publication date
CN107797854B (en) 2020-08-11
CN107797854A (en) 2018-03-13

Similar Documents

Publication Publication Date Title
WO2019001125A1 (en) Method and device for processing transaction files, storage medium, and computer apparatus
CN109474578B (en) Message checking method, device, computer equipment and storage medium
CN108462760B (en) Electronic device, automatic cluster access domain name generation method and storage medium
WO2019114134A1 (en) Loan application review method, device and equipment, and computer-readable storage medium
WO2019041753A1 (en) Information modification method, apparatus, computer device and computer-readable storage medium
WO2020024419A1 (en) Testing method for service scenario, electronic device and readable storage medium
TW201802731A (en) Electronic payment service processing and electronic payment method and device
CN109039751B (en) Method, device, computer equipment and storage medium for configuring route
WO2019127893A1 (en) Electronic signature method, electronic device, and computer readable storage medium
CN111598575B (en) Business process control method, business process control device, electronic equipment and readable storage medium
CN107993053B (en) Claims data auditing method and device, computer equipment and storage medium
US20210042150A1 (en) Method-call-chain tracking method, electronic device, and computer readable storage medium
WO2021121407A1 (en) Capacity changing method and apparatus for virtual machine
WO2019041759A1 (en) Server, blockchain signature verification decoding method and storage medium
WO2019041819A1 (en) Accreditation method and apparatus, and computer device and storage medium
WO2019033741A1 (en) Investment commodity resource processing method, device, storage medium and computer apparatus
CN111273891A (en) Business decision method and device based on rule engine and terminal equipment
CN109033818B (en) Terminal, authentication method, and computer-readable storage medium
CN110781134A (en) Data processing method and device, computer storage medium and electronic equipment
US8910260B2 (en) System and method for real time secure image based key generation using partial polygons assembled into a master composite image
US20240031166A1 (en) Web-side data signature method and apparatus and computer device
WO2019145799A1 (en) System and method for decentralized validation of data exchange in a computer network
US10997539B2 (en) Supplier analysis and verification system and method
CN111897728B (en) Interface debugging method and related equipment
CN114398678A (en) Registration verification method and device for preventing electronic file from being tampered, electronic equipment and medium

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 18824651

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205 DATED 20/05/2020)

122 Ep: pct application non-entry in european phase

Ref document number: 18824651

Country of ref document: EP

Kind code of ref document: A1