Disclosure of Invention
The application aims to provide a day-to-day data verification method, a day-to-day data verification device and electronic equipment, the day-to-day data verification can be achieved under a development environment, namely the day-to-day data verification can be achieved on line, real transaction data are not needed, the requirements of all projects can be met, offline test data can cover all business scenes, the reliability of the day-to-day data verification can be guaranteed, when the day-to-day data verification fails, problems can be found in time and adjusted, and online faults are avoided.
In order to solve the above technical problem, the embodiment of the present application is implemented as follows:
in a first aspect, a method for daily cutting data verification is provided, including:
recording accounting dates corresponding to target accounting record data and target accounting entry data in a development environment database as a first virtual accounting date;
deleting dirty data in the development environment database;
when a daily cutting operation command is received, performing daily cutting operation, wherein the daily cutting date of the daily cutting operation is the first virtual accounting date, and the daily cutting data of the daily cutting operation is the target accounting record data and the target accounting entry data;
after the daily cutting operation is completed, verifying the target accounting record data and the target accounting entry data.
In a second aspect, an apparatus for daily cutting data verification is provided, which includes:
the date recording unit is used for recording the target accounting record data in the development environment database and the accounting date corresponding to the target accounting entry data as a first virtual accounting date;
a dirty data deleting unit that deletes dirty data in the development environment database;
a daily cutting unit, configured to perform daily cutting operation when a daily cutting operation command is received, where the daily cutting date of the daily cutting operation is the first virtual accounting date, and the daily cutting data of the daily cutting operation is the target accounting record data and the target accounting entry data;
and the verification unit is used for verifying the target accounting record data and the target accounting entry data after the daily cutting operation is finished.
In a third aspect, an electronic device is provided, including:
a processor; and
a memory arranged to store computer executable instructions that when executed use the processor to perform the following:
recording accounting dates corresponding to target accounting record data and target accounting entry data in a development environment database as a first virtual accounting date;
deleting dirty data in the development environment database;
when a daily cutting operation command is received, performing daily cutting operation, wherein the daily cutting date of the daily cutting operation is the first virtual accounting date, and the daily cutting data of the daily cutting operation is the target accounting record data and the target accounting entry data;
after the daily cutting operation is completed, verifying the target accounting record data and the target accounting entry data.
In a fourth aspect, a computer-readable medium is provided that stores one or more programs that, when executed by an electronic device that includes a plurality of application programs, cause the electronic device to:
recording accounting dates corresponding to target accounting record data and target accounting entry data in a development environment database as a first virtual accounting date;
deleting dirty data in the development environment database;
when a daily cutting operation command is received, performing daily cutting operation, wherein the daily cutting date of the daily cutting operation is the first virtual accounting date, and the daily cutting data of the daily cutting operation is the target accounting record data and the target accounting entry data;
after the daily cutting operation is completed, verifying the target accounting record data and the target accounting entry data.
As can be seen from the above technical solutions provided by the embodiments of the present application, in the embodiments of the present application, by recording accounting dates corresponding to target accounting record data and target accounting entry data in a development environment database as a first virtual accounting date, deleting dirty data in the development environment database, performing a daily cutting operation with the first virtual accounting date as a daily cutting date and the target accounting record data and the target accounting entry data as daily cutting data when a daily cutting operation command is received, and verifying the target accounting record data and the target accounting entry data after the daily cutting operation is completed, daily cutting data verification can be implemented in a development environment, that is, daily cutting data can be implemented on line, real transaction data is not required, requirements of all projects can be met, test data under line can cover all business scenarios, and reliability of daily cutting data verification can be ensured, when the daily data verification fails, the problems can be found and adjusted in time, and online faults are avoided.
Detailed Description
In order to make those skilled in the art better understand the technical solutions in the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
In the embodiment of the present invention, the development environment database refers to a database corresponding to the development environment. The development environment refers to the environment in the process of developing and testing projects on line, and is isolated from codes and databases in a pre-release environment and a production environment. The data of the development environment can be modified at will, and the data of the development environment is not real data on line. The data of the development environment can cover all business scenarios of the project.
In embodiments of the invention, accounting record data refers to data that records financial type transactions from account dimensions. The accounting record data may record data such as account numbers of both parties who have performed the financial transaction, a date when the financial transaction is completed, and a specific amount of money involved in the financial transaction. The accounting entry data can be called accounting entry or entry for short, and refers to the record of the corresponding relationship between accounts according to the requirements of retest accounting by the account name, accounting direction and amount of money for each financial transaction (economic business).
In the embodiment of the invention, the accounting date refers to the accounting date, and the accounting date is usually different from the actual date.
FIG. 1 is a flow diagram of a method of daily tangential data validation according to one embodiment of the present application. The method 100 of fig. 1 is performed by an apparatus for daily cut data validation.
As illustrated in fig. 1, at S102, accounting dates corresponding to the target accounting record data and the target accounting entry data in the development environment database are recorded as a first virtual accounting date.
It is to be understood that recording the accounting date corresponding to the target accounting record data and the target accounting entry data as the first virtual accounting date is actually modifying the accounting date corresponding to the target accounting record data and the target accounting entry data as the first virtual accounting date. For example, the actual accounting date corresponding to the target accounting record data and the target accounting entry data is 2017, 11 and 10 days, and the first virtual accounting date is 2017, 11 and 11 days, at which time the accounting date corresponding to the target accounting record data and the target accounting entry data needs to be modified to 2017, 11 and 11 days.
Optionally, in some embodiments, the target accounting record data and the target accounting entry data in the development environment database need to be retrieved before an accounting date corresponding to the target accounting record data and the target accounting entry data is recorded as the first virtual accounting date. The specific method for fishing out the target accounting record data and the target accounting entry data may be as follows: acquiring an accounting record identifier of a target accounting type transaction corresponding to the target accounting record data and the target accounting entry data; and according to the financial record identification, fishing target accounting record data and target accounting entry data from a development environment database.
Taking the target financial transaction as the recharging transaction as an example, the financial record identifier of the recharging transaction can be obtained according to information such as a recharging bill number, the financial record data and the meeting score data corresponding to the recharging transaction are retrieved from the development environment database according to the financial record identifier of the recharging transaction, and the accounting date corresponding to the retrieved financial record data and the meeting score data is modified into the first virtual accounting date.
Specifically, in some embodiments, the target financial transaction is a transaction completed through a test account in the development environment, and a real transaction is not required in the development environment, so that the requirements of all projects can be met.
Optionally, in some embodiments, the target financial transaction may be multiple transactions completed through one test account in the development environment, or multiple transactions completed through multiple test accounts in the development environment, which is not limited in this embodiment of the present invention.
Optionally, in some embodiments, after acquiring the financial record identifier of the target accounting record data, writing the financial record identifier into the configuration file, and recording an accounting date corresponding to the financial record identifier as the first virtual accounting date. Therefore, when daily data verification is required, the financial record identifier corresponding to the first virtual accounting date is acquired from the configuration file, and then the target accounting record data and the target accounting entry data are obtained according to the financial record identifier.
At S104, the dirty data in the development environment database is deleted.
It is to be understood that dirty data refers to data that is not generated strictly in accordance with the on-line specification at S104. For example, data inserted directly by manual means or test data in a development environment, etc.
Specifically, in some embodiments, deleting dirty data in the development environment database comprises: deleting all the daily cutting records in the development environment database; and deleting other accounting record data and other accounting entry data of which the corresponding accounting date is the first virtual accounting date in the development environment database. Here, the date-cut record is generally used to record the date-cut date of the latest date-cut operation and the date-cut state, and the date-cut state is used to describe whether the previous date-cut operation was successful. After deleting these dirty data, it can be guaranteed that the daily cutting data of the daily cutting operation is only the target accounting record data and the target accounting entry data described above. The problem that the daily data cannot be verified in a development environment due to the cross-day problem of dirty data can be avoided.
It should be noted that, when deleting dirty data in the development environment database, all daily cutting records in the development environment database may be deleted first, and then other accounting record data and other accounting entry data whose corresponding accounting date is the first virtual accounting date in the development environment database may be deleted; or deleting other accounting record data and other accounting entry data of which the corresponding accounting date is the first virtual accounting date in the database of the development environment, and then deleting all daily cutting records in the database of the development environment. The deletion order is not limited in the embodiments of the present invention.
At S106, when a daily cutting operation command is received, a daily cutting operation is performed, the daily cutting date of the daily cutting operation is a first virtual accounting date, and the daily cutting data of the daily cutting operation is target accounting record data and target accounting entry data.
Specifically, in some embodiments, before the switching operation command is received, a target switching record is generated, the switching date corresponding to the target switching record is a second virtual accounting date, the second virtual accounting date is the day before the first virtual accounting date, and the switching status corresponding to the target switching record is switching success. Therefore, the date of the day-to-day operation triggered by the received day-to-day operation command can be ensured to be the first virtual accounting date.
At S108, after the daily cutting operation is completed, the target accounting record data and the target accounting entry data are verified.
Specifically, in some embodiments, verifying that the target accounting record data and the target accounting entry are actually verifying that the target accounting record data and the target accounting entry data match. When the target accounting record data is matched with the target accounting entry data, determining that the verification is successful; determining that the verification fails when the target accounting record data and the target accounting entry data do not match.
For example, taking a financial transaction as an example of a transaction through a paymate account transfer, if 100 pieces of money are transferred to a paymate account B through the paymate account a in 11 months and 11 days in 2017, if 100 pieces of money are paid out from the paymate account a in 11 months and 11 days in 2017, 100 pieces of money are collected in the paymate account B, and 100 pieces of money are transferred to the paymate account B from the paymate account a in 11 months and 11 days in 2017, after the daily cutting operation is completed, when the accounting record data and the accounting entry data are verified, the accounting record data and the accounting entry data are considered to be consistent, and the verification is successful. Otherwise, if the account record data record 2017 indicates that the bank account number a paid 11 months 11 days indicates 100 pieces of money, the bank account number B takes in 80 pieces of money, and the accounting entry data record 2017 records that the bank account number a paid 11 months 11 days transfers 100 pieces of money to the bank account number B, after the daily cutting operation is completed, when the account record data and the accounting entry data are verified, the account record data and the accounting entry data are considered to be inconsistent, and the verification fails. Under the condition of verification failure, the reason of the verification failure needs to be checked and analyzed, and a compensation measure is taken to repair the problem in time.
Fig. 2 is a schematic flow chart of a method for generating a daily cut data validation according to an embodiment of the present application, where the method 200 of fig. 2 is executed by a device for generating a daily cut data validation, and fig. 2 is described by taking an accounting type transaction as a top-up transaction, which is merely an example.
As shown in fig. 2, at S202, a recharge operation is performed using the test account in the development environment.
Optionally, multiple recharging operations may be performed through one test account, or one or more recharging operations may be performed through each of multiple test accounts, so as to generate multiple recharge bill numbers and corresponding accounting record data and meeting record data.
At S204, the accounting record data in the development environment database is retrieved according to the voucher number, and the accounting record transaction number thereof is recorded.
It is to be understood that in S204, the accounting record transaction number is equivalent to the accounting record identification in the method shown in fig. 1.
At S206, the accounting record number is recorded into the configuration file and a virtual daily accounting date is specified.
For example, if the date planned to perform the daily cutting data verification is 2017, month 1 and day 1, the accounting date corresponding to the account record object number may be recorded in the configuration file as 20170101.
At S208, all the japanese-cut records in the development environment database are deleted.
At S210, other accounting record data and meeting record data corresponding to the specified virtual daily accounting date in the development environment database are deleted.
It should be noted that, although the above embodiment has been described with the step S210 being disposed after the step S208 for convenience of description, the execution order of these two steps may be changed according to the actual situation, that is, the other accounting record data and meeting score record data corresponding to the guide virtual daily accounting date in the development environment database are deleted first, and then all the daily accounting records in the development environment database are deleted.
At S212, a daily success record is inserted in the development environment database.
Wherein, the date cutting date corresponding to the date cutting success record is the previous accounting date of the appointed virtual date cutting accounting date. Therefore, the daily cutting operation corresponding to the appointed virtual daily cutting accounting date can be directly initiated when the daily cutting operation is triggered next time.
At S214, the accounting date corresponding to the accounting record transaction number and the accounting date corresponding to the accounting record data are modified to the designated virtual daily accounting date according to the accounting record transaction number.
Specifically, if the accounting date corresponding to the accounting record transaction number and the accounting date corresponding to the accounting record data are originally the designated virtual daily accounting date, step S214 may not be executed. And if the accounting date corresponding to the accounting record transaction number and the accounting date corresponding to the accounting record data are not originally the appointed virtual daily accounting date, modifying the accounting date corresponding to the accounting record transaction number and the accounting date corresponding to the accounting record data from the original accounting date to the appointed virtual daily accounting date.
At S216, upon receiving the daily cut operation command, the daily cut operation is performed.
Specifically, at S216, the date-cut date of the date-cut operation is the designated virtual date-cut accounting date, and the date-cut data of the date-cut operation is the accounting record data and the accounting record data corresponding to the accounting record transaction number. That is, the daily cutting operation can realize daily cutting only on the designated accounting record data and meeting record data.
At S218, after the daily cutting operation is completed, the daily cutting result is checked.
Specifically, the checking of the daily cutting result is to check the accounting record data and the accounting record data obtained by the daily cutting operation, check whether corresponding data in the two data are matched, if so, the daily cutting is successful, otherwise, the daily cutting is failed.
Furthermore, if the daily cutting fails, the reason of the daily cutting failure is examined and analyzed, and a compensation measure is taken, so that the problem is solved in a development environment, the service of a production environment is not influenced, and the fault after the project is on line is avoided.
According to the technical scheme provided by the embodiment of the application, dirty data in a development environment database are deleted, when a daily cutting operation command is received, designated virtual daily cutting accounting date is taken as the daily cutting date, designated accounting record data and target accounting entry data are taken as the daily cutting data to perform daily cutting operation, and after the daily cutting operation is completed, daily cutting results are checked, daily cutting data verification can be achieved under the development environment, that is, the daily cutting data can be achieved on line, real transaction data is not needed, the requirements of all projects can be met, offline test data can cover all service scenes, the reliability of the daily cutting data verification can be guaranteed, when the daily cutting data verification fails, problems can be found in time and adjusted, and online faults are avoided.
The method for verifying the japanese cut data according to the embodiment of the present application is described in detail above with reference to fig. 1 and 2. An electronic device according to an embodiment of the present application will be described in detail below with reference to fig. 3. Referring to fig. 3, at a hardware level, the electronic device includes a processor, optionally an internal bus, a network interface, and a memory. The Memory may include a Memory, such as a Random-Access Memory (RAM), and may further include a non-volatile Memory, such as at least 1 disk Memory. Of course, the electronic device may also include hardware required for other services.
The processor, the network interface, and the memory may be interconnected by an internal bus, which may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, an Extended ISA (EISA) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one double-headed arrow is shown in FIG. 3, but this does not indicate only one bus or one type of bus.
And the memory is used for storing programs. In particular, the program may include program code comprising computer operating instructions. The memory may include both memory and non-volatile storage and provides instructions and data to the processor.
The processor reads the corresponding computer program from the nonvolatile memory into the memory and then runs the computer program to form a device for verifying the daily cutting data on a logic level. The processor is used for executing the program stored in the memory and is specifically used for executing the following operations:
recording accounting dates corresponding to target accounting record data and target accounting entry data in a development environment database as a first virtual accounting date;
deleting dirty data in the development environment database;
when a daily cutting operation command is received, performing daily cutting operation, wherein the daily cutting date of the daily cutting operation is the first virtual accounting date, and the daily cutting data of the daily cutting operation is the target accounting record data and the target accounting entry data;
after the daily cutting operation is completed, verifying the target accounting record data and the target accounting entry data.
The method performed by the apparatus for verifying japanese-cut data disclosed in the embodiments of fig. 1 and fig. 2 of the present application may be applied to or implemented by a processor. The processor may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware in a processor or instructions in the form of software. The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but also Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components. The various methods, steps, and logic blocks disclosed in the embodiments of the present application may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of the method disclosed in connection with the embodiments of the present application may be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software modules in the decoding processor. The software module may be located in ram, flash memory, rom, prom, or eprom, registers, etc. storage media as is well known in the art. The storage medium is located in a memory, and a processor reads information in the memory and completes the steps of the method in combination with hardware of the processor.
The electronic device may further execute the method shown in fig. 1 and fig. 2, and implement the functions of the apparatus for daily data verification in the embodiments shown in fig. 1 and fig. 2, which are not described herein again in the embodiments of the present application.
Of course, besides the software implementation, the electronic device of the present application does not exclude other implementations, such as a logic device or a combination of software and hardware, and the like, that is, the execution subject of the following processing flow is not limited to each logic unit, and may also be hardware or a logic device.
Embodiments of the present application also propose a computer-readable storage medium storing one or more programs, the one or more programs including instructions, which when executed by an electronic device including a plurality of application programs, enable the electronic device to perform the method of the embodiment shown in fig. 1 and 2, and in particular to perform the following method:
recording accounting dates corresponding to target accounting record data and target accounting entry data in a development environment database as a first virtual accounting date;
deleting dirty data in the development environment database;
when a daily cutting operation command is received, performing daily cutting operation, wherein the daily cutting date of the daily cutting operation is the first virtual accounting date, and the daily cutting data of the daily cutting operation is the target accounting record data and the target accounting entry data;
after the daily cutting operation is completed, verifying the target accounting record data and the target accounting entry data.
Fig. 4 is a schematic structural diagram of an apparatus for daily cutting data verification according to an embodiment of the present application. Referring to fig. 4, in a software implementation, an apparatus 400 for daily cut data verification may include: a date recording unit 401, a dirty data deleting unit 402, a date cutting unit 403, and a verifying unit 404, wherein,
a date recording unit 401, which records the target accounting record data in the development environment database and the accounting date corresponding to the target accounting entry data as a first virtual accounting date;
a dirty data deleting unit 402 that deletes dirty data in the development environment database;
a daily cutting unit 403, configured to perform daily cutting operation when receiving a daily cutting operation command, where a daily cutting date of the daily cutting operation is the first virtual accounting date, and daily cutting data of the daily cutting operation is the target accounting record data and the target accounting entry data;
a verification unit 404, configured to verify the target accounting record data and the target accounting entry data after the daily cutting operation is completed.
According to the device for verifying the daily cutting data, dirty data in the development environment database can be deleted, so that the daily cutting operation can be performed by taking the target accounting record data and the target accounting entry data as the daily cutting data, taking the virtual accounting date as the daily cutting date and verifying the daily cutting data after the daily cutting operation is completed when the daily cutting operation command is received. Therefore, the device for daily data verification can achieve daily data verification under a development environment, namely daily data verification can be achieved on line, real transaction data are not needed, the requirements of all projects can be met, test data under the line can cover all service scenes, the reliability of daily data verification can be guaranteed, when the daily data verification fails, problems can be found and adjusted in time, and online faults are avoided.
Optionally, as an embodiment, the dirty data deleting unit 402:
deleting all the daily cutting records in the development environment database;
deleting other accounting record data and other accounting entry data of which the corresponding accounting date in the development environment database is the first virtual accounting date.
Optionally, as an embodiment, after deleting dirty data in the development environment database and before receiving a command to trigger a daily cut operation, the daily cut unit 403:
and generating a target daily cutting record, wherein the daily cutting date corresponding to the target daily cutting record is a second virtual accounting date, the second virtual accounting date is the day before the first virtual accounting date, and the daily cutting state corresponding to the target daily cutting record is a successful daily cutting.
Alternatively, as an embodiment, before the recording of the accounting date corresponding to the target accounting record data and the target accounting entry data in the development environment database as the first virtual accounting date, the date recording unit 401:
acquiring an accounting record identifier of a target accounting type transaction corresponding to the target accounting record data and the target accounting entry data;
and according to the accounting record identification, the target accounting record data and the target accounting entry data are fished from the development environment database.
Optionally, as an embodiment, before the target accounting record data and the target accounting entry data are retrieved from the development environment database according to the accounting record identifier, the date recording unit 401:
writing the accounting record identification into a configuration file, and recording an accounting date corresponding to the financial record identification as the first virtual accounting date.
Optionally, as an embodiment, the verification unit 404:
determining that verification is successful when the target accounting record data matches the target accounting entry data;
determining that validation failed when the target accounting record data and the target accounting entry data do not match.
Optionally, as one embodiment, the target accounting class transaction is a transaction completed by a test account number in a development environment.
The device 400 for verifying the daily cut data can also execute the method in the embodiment shown in fig. 1 and fig. 2, and implement the functions of the device for verifying the daily cut data in the embodiment shown in fig. 1 and fig. 2, which are not described herein again.
In short, the above description is only a preferred embodiment of the present application, and is not intended to limit the scope of the present application. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application shall be included in the protection scope of the present application.
The systems, devices, modules or units illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product with certain functions. One typical implementation device is a computer. In particular, the computer may be, for example, a personal computer, a laptop computer, a cellular telephone, a camera phone, a smartphone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the system embodiment, since it is substantially similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.