Disclosure of Invention
The invention aims to solve the defects in the prior art, and provides a tax data conversion method and a tax data conversion system, which improve the conversion efficiency of converting tax data into tax bureau data.
In order to realize the purpose, the invention adopts the following technical scheme:
a tax data conversion method comprises the following steps:
step S10: configuring the attribute of the tax bureau message data by using a report form format;
step S20: defining a message protocol meeting the transmission of general data;
step S30: data conversion;
step S40: and carrying out concurrent processing by utilizing the mq message queue, and carrying out message data caching processing by utilizing a redis storage system.
Preferably, the step S10 includes: calculating each unit grid value of the tax bureau report by using a formula engine to form a one-to-one correspondence relationship between report data and attribute data, thereby obtaining the attribute of the tax bureau message data; and manufacturing a report template by using a report tool, configuring tax bureau report format attributes into the report template, and configuring declaration attributes, initialization attributes and declaration write-back attributes.
Preferably, the step S20 includes: and (2) performing data acquisition operation through the cloud platform system (the data acquisition is the function of the cloud account system, and the tax amount is calculated from the financial data through formula calculation), converting the cloud platform system data or external data into tax data, enabling the tax data to be in one-to-one correspondence with the report attributes, and filling the tax data into report cells to form message data.
1. Preferably, in the step S20, by customizing different tax tables and different tax bureau message processing modes, a taskloup name attribute is added to each message, and a function of free configuration and flexible change can be implemented corresponding to each processing program of the client. taskGroup: the tax declaring clients can execute the grouping of program operations, and each tasksroup can directly execute one type of program operations.
Preferably, the step S30 includes: and taking out the message data, taking out the tax report attribute configured by the report, and converting the message data into a message meeting the tax bureau attribute format in an xml conversion mode.
Preferably, the step S40 includes: and realizing concurrent data processing and peak clipping processing through an mq message queue, and performing message data caching processing and processed data caching through a redis storage system.
According to another aspect of the present invention, there is also provided a tax data conversion system, including an attribute configuration module, a cloud platform system, a data conversion module, a concurrency processing module, and a cache processing module, where the attribute configuration module is configured to configure attributes of tax bureau message data using a report format; the cloud platform system is used for defining a message protocol meeting the requirement of general data transmission; the data conversion module is used for converting the tax message data of the enterprise into tax bureau message data meeting the attribute format of the tax bureau; the concurrent processing module is used for utilizing the mq message queue to perform concurrent processing, and the cache processing module is used for utilizing the redis storage system to perform message data cache processing.
Preferably, the attribute configuration module is configured to calculate each unit grid value of the tax office report by using a formula engine, and form a one-to-one correspondence relationship between report data and attribute data, so as to obtain the attribute of the tax office message data; the method is also used for manufacturing a report template by using a report tool, configuring the attribute of the tax bureau report format into the report template, and configuring the declaration attribute, the initialization attribute and the declaration write-back attribute.
Preferably, the cloud platform system is configured to perform a data fetching operation, convert the cloud platform system data or external data into tax data, enable the tax data to correspond to the report attributes one to one, and fill the tax data into the report cells to form message data.
Preferably, the data conversion module is configured to take out the message data and the tax report attribute configured by the report, and convert the tax message data of the enterprise into tax office message data meeting the tax office attribute format in an xml conversion manner.
Compared with the prior art, the invention has the following beneficial effects: the conversion efficiency of converting tax data into tax bureau data is improved, the tax data processing speed, the stability of a processing system and the data conversion performance are greatly improved, free configuration and flexible change can be realized, and the problems of complex format, large workload, long execution time and the like of the traditional tax declaration process are solved.
Detailed Description
In order to further understand the objects, structures, features and functions of the present invention, the following embodiments are described in detail.
Referring to fig. 1 and fig. 2 in combination, fig. 1 is a step diagram of a tax data conversion method according to embodiment 1 of the present invention; fig. 2 is an overall flowchart of a tax data conversion method according to embodiment 1 of the present invention.
The tax data conversion method of the embodiment 1 of the invention comprises the following steps:
step S10: configuring the attribute of the tax bureau message data by using a report form format; the product obtains attributes from a tax bureau, the attributes are directly imported into and generate excel format data, report templates are generated through excel, information such as access formulas of each report model is configured, and configuration is simple, accurate and efficient.
Step S20: defining a message protocol meeting the transmission of general data;
step S30: data conversion;
step S40: and carrying out concurrent processing by utilizing the mq message queue, and carrying out message data caching processing by utilizing a redis storage system.
Preferably, step S10 includes: the method comprises the steps that a formula engine (the formula engine is used for customizing cloud account formula functions by an open source calculation tool, each formula is an execution function and is mainly used for calculating tax amount and other effective data according to financial data, for example, UDEF _ ZB ($ ZTDM $, $ KJND $, $ KJQJ $, $ 33001002',' declaration form ',' II, # tax calculation # #21@ current number # # goods and labor ', 0) + UDEF _ ZB ($ ZTDM $, $ KKKKQJ $, # 33001002', 'declaration', 'II, # tax calculation # # tax calculation, # current prepaid amount # #21 @currentnumber # # service, real estate and intangible asset', 0) is used for calculating the formula name, the formula obtained is a tax value corresponding to each tax data unit, and each report data and each tax data in the report form a report data unit, so that each tax data and each report data form an attribute of the tax data and each report data; the invention adopts the Sail soft report tool to make the report template, which provides editing software and can conveniently make the tax form style of the tax bureau and fill in various attributes.
The step S20 includes: performing data acquisition operation through a cloud platform system, wherein the data acquisition is a function of the cloud account cloud platform system, calculating tax amount of financial data mainly through formula calculation, converting cloud platform system data or external data into tax data, enabling the tax data to be in one-to-one correspondence with report attributes, and filling the tax data into report cells to form message data; step S20 adds the taskGroup name attribute to each message by self-defining different tax tables and different tax bureau message processing modes, and can realize free configuration and flexible change functions corresponding to each processing program of the client. The cloud platform system provides an interface platform which is open to the outside, so that external data can be acquired.
Step S30 includes: and taking out the message data, taking out the tax report attribute configured by the report, matching the message attribute of the report with the calculated tax value in each unit cell in an xml conversion mode to form data in an xml format with each message attribute and value, and converting the message data into a message meeting the attribute format of a tax bureau.
The step S40 includes: and realizing concurrent data processing and peak clipping processing through the mq message queue, preventing a large amount of concurrent impact on the system, carrying out flow control processing, and carrying out message data caching processing and data caching after processing through a redis storage system.
MQ (message queue) is a method of communicating by applications to applications that communicate by writing and retrieving queued data (messages) to the applications without requiring a dedicated connection to link them; message passing refers to the communication between programs by sending data in a message, rather than communicating with each other by direct invocation, which is typically a technique used for remote procedure calls, for example; queuing refers to applications communicating through a queue; the use of queues removes the requirement that the receiving and sending applications execute simultaneously. The tax data conversion method realizes concurrent data processing and peak clipping processing through the mq message queue, and can greatly improve the data processing speed, the system stability and the data conversion performance.
Redis is an open source log-type and Key-Value database which is written by using ANSI C language, supports network, can be based on memory and can also be persistent, provides an API (Application Programming Interface) of multiple languages, and has the characteristics of high query speed, large data storage quantity and high concurrency support. Similar to the Memcached (set of distributed cache systems), it supports relatively more value types to store, including string, list, set, zset, and hash. These data types all support push/pop, add/remove, intersection union and difference, and richer operations, and these operations are atomic (atomicity of a program means that all operations in the whole program are either completely completed or not completely completed and cannot be stalled in a middle link. On this basis, redis supports various different ways of ordering. Like memcached, data is cached in memory to ensure efficiency. The difference is that the redis can periodically write updated data into a disk or write modification operation into an additional recording file, and master-slave synchronization is realized on the basis of the update. The tax data conversion method of the invention performs message data caching processing and processed data caching through the redis storage system, has the performance characteristics of high query speed, large data storage amount and high concurrency support, and can improve the data processing speed and the data conversion performance.
Referring to fig. 2, fig. 2 is an overall flowchart of a tax data conversion method according to embodiment 1 of the present invention, and a flow of the tax data conversion method according to embodiment 1 of the present invention (calculating a tax amount from financial data by a formula calculation through a cloud account cloud platform access function) is as follows:
(1) Judging whether a redis lock (a caching tool) can be acquired; if the redis lock can be acquired, executing the next operation; if the redis lock cannot be acquired, the program is ended;
(2) Judging whether the message can be obtained from the cache or not, if so, returning the message to end; if the message can not be obtained from the cache, carrying out template obtaining operation;
(3) If the acquired template exists, comparing the template with a form sleeve template (form sample) to determine whether the version numbers are consistent, and if the comparison result is consistent, acquiring the template successfully; if the template does not exist or the comparison version number of the template and a form sleeve template (form sample) is inconsistent, generating the template, circulating a sheet page, circulating coordinates in the sheet page, acquiring index codes and cell attributes according to the coordinates, and encapsulating the template according to the index codes of the sheet coordinate, the cell, the r coordinate and the c coordinate, so that the template is successfully acquired;
(4) After the template is obtained, all index values under the table set are obtained, the index values are circulated, the ranks to which the index values belong are positioned according to the index codes in the index values, and special treatment is collected according to conditions while and after the template is filled;
(5) And putting the message into a cache.
According to another aspect of the present invention, there is provided a tax data conversion system; referring to fig. 3, fig. 3 is a structural diagram of a tax data conversion system according to embodiment 1 of the present invention. The tax data conversion system in embodiment 1 of the present invention includes an attribute configuration module 1, a cloud platform system 2, a data conversion module 3, a concurrent processing module 4, and a cache processing module 5, where the attribute configuration module 1 is configured to configure tax office message data attributes by using a report format; the cloud platform system 2 is used for defining a message protocol meeting the requirement of general data transmission, and meanwhile, the cloud platform system 2 provides an interface platform which is open to the outside so as to acquire external data; the data conversion module 3 is used for converting the tax message data of the enterprise into tax bureau message data meeting the attribute format of the tax bureau; the concurrency processing module 4 is configured to perform concurrency processing by using the mq message queue, and the cache processing module 5 is configured to perform message data cache processing by using a redis storage system.
Preferably, the attribute configuration module 1 is configured to calculate each unit grid value of the tax office report by using a formula engine, and form a one-to-one correspondence relationship between report data and attribute data, so as to obtain the attribute of the tax office message data; the method is also used for manufacturing a report template by using a report tool, configuring the attribute of the tax bureau report format into the report template, and configuring the declaration attribute, the initialization attribute and the declaration write-back attribute.
Preferably, the cloud platform system 2 is configured to perform a data fetching operation, convert cloud platform system data or external data into tax data, enable the tax data to correspond to the report attributes one to one, and fill the report cells with the tax data to form message data.
Preferably, the data conversion module 3 is configured to take out the message data and the tax report attribute configured by the report, and convert the tax message data of the enterprise into tax office message data meeting the tax office attribute format in an xml conversion manner.
In summary, the invention provides a method and a system for converting tax data, which improve the conversion efficiency of the tax data to the tax bureau data, greatly improve the processing speed of the tax data, the stability of the processing system and the data conversion performance, can realize free configuration and flexible change, and solve the problems of complex format, large workload, long execution time and the like of the traditional tax declaration process.
The present invention has been described in relation to the above embodiments, which are only exemplary of the implementation of the present invention. It should be noted that the disclosed embodiments do not limit the scope of the invention. Rather, it is intended that the invention be covered by the appended claims without departing from the spirit and scope of the invention.