Voucher automatic construction method and device based on change exchange rate, and medium
Through the automated voucher construction method, the problem of reliance on manual operations on exchange rate adjustment and exchange profit and loss calculation in traditional foreign currency transaction processing is solved, real-time and accurate exchange profit and loss calculation and voucher generation are realized, and the enterprise's response ability and financial response to exchange rate fluctuations are improved. Management efficiency.
Patent Information
- Application Number
- CN202411152810.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-21
- Publication Date
- 2025-01-07
AI Technical Summary
In traditional foreign currency transaction processing processes, exchange rate adjustment and exchange profit and loss calculation rely on manual operations, resulting in slow processing speed, low efficiency, easy errors, and increased enterprise operation costs.
The automatic construction method of vouchers based on changing exchange rates is adopted, real-time exchange rate data is collected regularly, exchange rate differences are determined, documents to be updated, exchange profit and loss data are calculated, and current vouchers are generated. The entire process is highly automated and manual intervention is reduced.
Real-time and accuracy of foreign exchange profit and loss calculations are achieved, work efficiency is improved, human errors are reduced, operating costs are reduced, and financial data is enhanced and the company's ability to manage foreign exchange risks is enhanced.
Smart Images

Figure CN119273348A_ABST
Abstract
Description
Technical Field
[0001] The present specification relates to the field of data processing technology, and in particular to a method, device and medium for automatically constructing a voucher based on a variable exchange rate. Background Art
[0002] The scale of foreign currency transactions faced by enterprises continues to expand, and exchange rate fluctuations have become one of the important factors affecting the financial stability of enterprises. In the traditional foreign currency transaction processing process, the adjustment of exchange rates and the calculation of exchange gains and losses mainly rely on manual operations, which not only requires financial personnel to have a high degree of professionalism and keen market insight, but is also often accompanied by heavy manual calculations and voucher entry work.
[0003] As the foreign exchange market becomes increasingly complex and volatile, especially when exchange rates fluctuate drastically, this traditional method has exposed many drawbacks: first, it is inefficient and unable to respond to market changes in a timely manner, which may cause companies to miss the best opportunity to adjust exchange rates; second, it is prone to high error rates, and omissions are inevitable in the manual calculation and entry process, affecting the accuracy and reliability of financial data; third, it is costly, and frequent manual operations increase the operating burden of the company.
[0004] Therefore, in the traditional foreign currency transaction processing flow, the adjustment of exchange rates, the calculation of exchange gains and losses, and the generation of exchange vouchers often rely on manual operations, resulting in slow processing speed and low processing efficiency. Summary of the invention
[0005] One or more embodiments of the present specification provide a method, device and medium for automatically constructing vouchers based on variable exchange rates, which are used to solve the following technical problems: In the traditional foreign currency transaction processing process, the adjustment of exchange rates, the calculation of exchange gains and losses, and the generation of exchange vouchers often rely on manual operations, resulting in slow processing speed and low processing efficiency.
[0006] One or more embodiments of this specification adopt the following technical solutions:
[0007] One or more embodiments of the present specification provide a method for automatically constructing vouchers based on variable exchange rates, the method comprising: collecting real-time exchange rate data according to a preset timed collection task, and determining exchange rate differences based on the real-time exchange rate data; under a specified trigger, matching in a business system through the exchange rate differences to determine at least one document to be updated, so as to obtain document information corresponding to each document to be updated, wherein the document information includes foreign currency account data and foreign currency account debit and credit directions; determining exchange gain and loss data corresponding to each document to be updated based on the document information corresponding to each document to be updated and the exchange rate differences; generating a current voucher corresponding to each document to be updated through a pre-acquired voucher template and the exchange gain and loss data corresponding to each document to be updated.
[0008] Furthermore, before collecting real-time exchange rate data according to a preset scheduled collection task, the method also includes: obtaining a historical exchange rate time series data set corresponding to a plurality of historical exchange rate data, and determining a historical change time period corresponding to two adjacent exchange rate changes based on the historical exchange rate time series data set; determining a real-time exchange rate data collection period through the historical change time period, so as to set the scheduled collection task according to the real-time exchange rate data collection period and a data collection period configured by the user.
[0009] Furthermore, under a specified trigger, the exchange rate difference is used to match in the business system, and before determining at least one document to be updated, the method also includes: according to each of the historical change time periods, counting the historical document financial result data corresponding to the business system; determining at least one specified historical change time period through the historical document financial result data and a preset financial fluctuation reference threshold; based on the historical exchange rate time series data set, determining multiple change exchange rates within the specified historical change time period to determine the corresponding exchange rate change index; setting the exchange rate change threshold through the exchange rate change index, so as to set the trigger condition threshold according to the exchange rate change threshold.
[0010] Furthermore, under a specified trigger, the exchange rate difference is matched in the business system to determine at least one document to be updated, specifically including: when the exchange rate difference meets the trigger condition threshold, determining the corresponding changed foreign currency type according to the exchange rate difference; screening is performed in the business system according to the changed foreign currency type to determine multiple matching foreign currency documents, and obtaining the current document status of the foreign currency documents, wherein the current document status includes a completed status and an unfinished status; screening is performed among the multiple foreign currency documents according to the current document status of each of the foreign currency documents to determine at least one specified foreign currency document that meets the preset requirements, and determine the document to be updated.
[0011] Furthermore, based on the document information corresponding to each of the documents to be updated and the exchange rate difference, the exchange gain / loss data corresponding to each of the documents to be updated is determined, specifically including: obtaining the document information corresponding to each of the documents to be updated, wherein the document information includes the document transaction amount; calculating the exchange gain / loss data corresponding to each of the documents to be updated through the document information corresponding to each of the documents to be updated and the exchange rate difference, wherein the exchange gain / loss data includes any one of exchange gain data and exchange loss data.
[0012] Furthermore, a current voucher corresponding to each of the documents to be updated is generated through a pre-acquired voucher template and the exchange gain and loss data corresponding to each of the documents to be updated, specifically including: obtaining the accounting subject type corresponding to each of the documents to be updated, and matching the templates in a pre-defined voucher template library according to the accounting subject type to determine the corresponding voucher template; extracting data according to the exchange gain and loss data corresponding to each of the documents to be updated to determine the template requirement data; filling in the voucher template to generate a current voucher corresponding to each of the documents to be updated, wherein the current voucher includes a voucher identifier, a transaction summary, a debit account or a credit account, an adjustment amount, and exchange gain and loss data.
[0013] Furthermore, after filling in the voucher template and generating a current voucher corresponding to each of the documents to be updated, the method also includes: automatically verifying the current voucher to determine the automatic verification result, wherein the automatic verification includes an amount balance check and an account code validity check; when the automatic verification result is a passed check, it is sent to the user terminal to receive the manual auxiliary verification data triggered by the user terminal to determine the verification result of the current voucher.
[0014] Furthermore, after filling in the voucher template and generating a current voucher corresponding to each of the documents to be updated, the method also includes: determining the corresponding subject storage area in a pre-constructed voucher pool according to the subject to which each of the current vouchers belongs; determining the construction timestamp of each of the current vouchers, and setting the voucher node identifier according to the construction timestamp; storing the current voucher in the voucher pool according to the subject storage area and the voucher node identifier.
[0015] One or more embodiments of the present specification provide a device for automatically constructing a voucher based on a variable exchange rate, including:
[0016] at least one processor; and,
[0017] a memory communicatively connected to the at least one processor; wherein,
[0018] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the above method.
[0019] One or more embodiments of the present specification provide a non-volatile computer storage medium storing computer executable instructions, wherein the computer executable instructions are configured to execute the above method.
[0020] At least one of the above technical solutions adopted in the embodiments of this specification can achieve the following beneficial effects: through the above technical solution, by regularly collecting real-time exchange rate data, the exchange rate changes can be quickly captured, thereby ensuring the real-time and accuracy of exchange gains and losses calculation, which helps enterprises to timely reflect the impact of exchange rate changes on financial conditions and make more accurate financial decisions. The entire process is highly automated, from data collection, exchange rate difference determination, document matching, exchange gain and loss calculation to voucher generation, no or only a small amount of manual intervention is required, which greatly saves human resources, improves work efficiency, and reduces the possibility of human errors; timely identification and processing of exchange rate differences help enterprises better manage foreign exchange risks, through automated processes, they can quickly respond to exchange rate fluctuations, adjust foreign currency accounts and perform necessary financial operations, thereby effectively controlling potential exchange losses.; The data involved in the entire process (such as real-time exchange rates, document information, exchange gain and loss data, etc.) are all automatically processed by the system to ensure the consistency and accuracy of the data; by generating detailed current vouchers, the source and amount of each exchange gain and loss can be clearly understood, which enhances financial transparency and helps communication and collaboration between various departments within the enterprise. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the technical solutions in the embodiments of this specification or the prior art, the following briefly introduces the drawings required for use in the embodiments or the prior art description. Obviously, the drawings described below are only some embodiments recorded in this specification. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative labor. In the drawings:
[0022] Figure 1 A flowchart of a method for automatically constructing a voucher based on a variable exchange rate provided in an embodiment of this specification;
[0023] Figure 2 A schematic diagram of the structure of a device for automatically constructing vouchers based on variable exchange rates provided in an embodiment of this specification. DETAILED DESCRIPTION
[0024] In order to enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below in conjunction with the drawings in the embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this specification, not all of the embodiments. Based on the embodiments of this specification, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of this specification.
[0025] The scale of foreign currency transactions faced by enterprises continues to expand, and exchange rate fluctuations have become one of the important factors affecting the financial stability of enterprises. In the traditional foreign currency transaction processing process, the adjustment of exchange rates and the calculation of exchange gains and losses mainly rely on manual operations, which not only requires financial personnel to have a high degree of professionalism and keen market insight, but is also often accompanied by heavy manual calculations and voucher entry work.
[0026] As the foreign exchange market becomes increasingly complex and volatile, especially when exchange rates fluctuate drastically, this traditional method has exposed many drawbacks: first, it is inefficient and unable to respond to market changes in a timely manner, which may cause companies to miss the best opportunity to adjust exchange rates; second, it is prone to high error rates, and omissions are inevitable in the manual calculation and entry process, affecting the accuracy and reliability of financial data; third, it is costly, and frequent manual operations increase the operating burden of the company.
[0027] Therefore, in the traditional foreign currency transaction processing flow, the adjustment of exchange rates, the calculation of exchange gains and losses, and the generation of exchange vouchers often rely on manual operations, resulting in slow processing speed and low processing efficiency.
[0028] The embodiment of this specification provides a method for automatically constructing a voucher based on a variable exchange rate. It should be noted that the execution subject in the embodiment of this specification can be a server or any device with data processing capabilities. Figure 1 A flow chart of a method for automatically constructing a voucher based on a variable exchange rate provided in an embodiment of this specification, such as Figure 1 As shown, it mainly includes the following steps:
[0029] Step S101, collecting real-time exchange rate data according to a preset timed collection task, and determining the exchange rate difference based on the real-time exchange rate data.
[0030] Before collecting real-time exchange rate data according to the preset scheduled collection task, the method also includes: obtaining a historical exchange rate time series data set corresponding to a plurality of historical exchange rate data, and determining a historical change time period corresponding to two adjacent exchange rate changes based on the historical exchange rate time series data set; determining a real-time exchange rate data collection period through the historical change time period, and setting the scheduled collection task according to the real-time exchange rate data collection period and a data collection period configured by the user.
[0031] In one embodiment of the present specification, under the condition of obtaining authorization from a financial data source, historical exchange rate data of multiple currency pairs are collected from a reliable financial data source, including information such as timestamps and exchange rate values. Duplicate, erroneous or missing data points are removed, and all timestamps are ensured to be in a unified format, such as UTC time, to construct a historical exchange rate time series data set corresponding to multiple historical exchange rate data. According to the historical data in the historical exchange rate time series data set, the average time interval between two adjacent exchange rate changes, i.e., the historical change time period, is calculated. It should be noted that the exchange rate change here means that as long as the two exchange rates are not the same, it is considered to be an exchange rate change process. The real-time exchange rate data collection period is determined by the historical change time period, and the real-time exchange rate data collection period is determined here by the average value of the historical change time period. According to the real-time exchange rate data collection period and the user-configured data collection period, the scheduled collection task is set. Use a tool or programming language (such as Python, Java) to write a data collection script and configure the required data source authentication information; according to the determined real-time exchange rate data collection period, use a system task scheduler (such as Linux's Cron job, Windows's task scheduler) or an application-level scheduled task framework (such as Spring's @Scheduled annotation) to set a scheduled collection task. A user interface or configuration file is provided to allow the user to adjust the data collection cycle according to needs while ensuring that the adjustment of the data collection cycle is within a reasonable range.
[0032] In one embodiment of this specification, real-time exchange rate data is collected according to a preset timed collection task, and the exchange rate difference is determined based on the real-time exchange rate data and the current exchange rate data. It should be noted that different currency objects have different corresponding exchange rates, and this specification embodiment is described with one exchange rate.
[0033] Step S102: Under a specified trigger, matching is performed in the business system through the exchange rate difference to determine at least one document to be updated, so as to obtain document information corresponding to each document to be updated.
[0034] Among them, the document information includes foreign currency account data and foreign currency account debit and credit directions.
[0035] Under a specified trigger, the exchange rate difference is used to match in the business system, and before determining at least one document to be updated, the method also includes: according to each historical change time period, statistics are collected on the historical document financial result data corresponding to the business system; at least one specified historical change time period is determined through the historical document financial result data and a preset financial fluctuation reference threshold; based on the historical exchange rate time series data set, a plurality of change exchange rates within the specified historical change time period are determined to determine the corresponding exchange rate change index; through the exchange rate change index, an exchange rate change threshold is set, so as to set a trigger condition threshold according to the exchange rate change threshold.
[0036] In one embodiment of the present specification, for each historical change time period, the corresponding business system document financial result data, such as total income, total expenditure, net income, etc., are counted. For each historical change time period, the volatility or standard deviation of the financial results and other statistical indicators are calculated; the calculated financial fluctuation is compared with the preset financial fluctuation reference threshold, and the period in which the financial fluctuation exceeds the threshold is selected as the specified historical change time period. All exchange rate data within the specified historical change time period are extracted from the historical exchange rate time series data set, and the exchange rate change rate, standard deviation and other change indicators within the period are calculated. According to the historical distribution of the exchange rate change indicator, a reasonable exchange rate change threshold is set, and the threshold can be set based on a statistical method (such as mean plus standard deviation) or business experience. Define a trigger condition, which is based on the exchange rate change threshold, such as when the real-time exchange rate changes exceed the threshold, and integrate the trigger condition check logic in the real-time exchange rate data acquisition system. When the trigger condition is met, the preset voucher self-purchase construction operation is executed, and an early warning message can also be sent to adjust the transaction strategy.
[0037] Under a specified trigger, the exchange rate difference is used to match in the business system to determine at least one document to be updated, specifically including: when the exchange rate difference meets the trigger condition threshold, the corresponding changed foreign currency type is determined according to the exchange rate difference; according to the changed foreign currency type, screening is performed in the business system to determine multiple matching foreign currency documents, and the current document status of the foreign currency document is obtained, wherein the current document status includes a completed status and an uncompleted status; according to the current document status of each of the foreign currency documents, the multiple foreign currency documents are screened to determine at least one specified foreign currency document that meets the preset requirements, and the document to be updated is determined.
[0038] In one embodiment of the present specification, if the exchange rate difference meets (such as exceeds or falls below) the trigger condition threshold, the subsequent foreign currency document screening and processing process is triggered. The specific conditions for meeting the conditions can be determined according to the actual application scenario of the foreign currency and are related to the debit and credit direction of the foreign currency account. Consider the debit and credit direction of the foreign currency account. For example, when the exchange rate of a certain foreign currency depreciates by more than a certain threshold, it may be beneficial to the borrower (debit) and detrimental to the lender (credit); and vice versa. The sensitivity of the debit and credit directions of different foreign currency accounts to exchange rate changes. For example, some accounts may be more concerned about exchange rate appreciation, while other accounts may be more concerned about exchange rate depreciation.
[0039] Based on the triggered exchange rate change, determine the type of foreign currency affected, usually by comparing which currency pairs have changed exchange rates. Use database query statements or API calls to retrieve all foreign currency documents related to the identified changed foreign currency types from the business system. For each retrieved foreign currency document, query the status field of the document to obtain its current status (completed or unfinished). Based on business needs, define which document statuses meet the preset requirements. Only consider documents in an unfinished state. Among all foreign currency documents, filter out at least one specified foreign currency document based on the current document status. The specified foreign currency document is a document with an unfinished document status. For each specified foreign currency document filtered out, mark it as a pending update status. You can add a flag field to the document record or put it into a pending queue.
[0040] Through the above technical solution, by real-time monitoring of exchange rate changes and setting trigger conditions, it is possible to respond quickly to exchange rate fluctuations and reduce financial risks caused by exchange rate changes; automatically screen and process foreign currency documents, reduce manual intervention, and improve work efficiency and accuracy; timely update and process foreign currency documents affected by exchange rate changes, which helps companies better manage exchange rate risks and protect financial interests; trigger conditions and preset requirements can be flexibly set according to different business needs, while supporting subsequent functional expansion and optimization.
[0041] Step S103, determining the exchange gain / loss data corresponding to each document to be updated according to the document information and the exchange rate difference corresponding to each document to be updated.
[0042] According to the document information corresponding to each document to be updated and the exchange rate difference, the exchange gain / loss data corresponding to each document to be updated is determined, specifically including: obtaining the document information corresponding to each document to be updated, wherein the document information includes the document transaction amount; calculating the exchange gain / loss data corresponding to each document to be updated through the document information corresponding to each document to be updated and the exchange rate difference, wherein the exchange gain / loss data includes any one of exchange gain data and exchange loss data.
[0043] In one embodiment of the present specification, for each document to be updated, the corresponding document information is queried in the database of the business system through its unique identifier (such as the document number). The transaction amount of the document is extracted from the query result. The base exchange rate is the exchange rate when the document is created or the transaction occurs, which is usually stored in the document information or can be obtained by querying the historical exchange rate data. The current exchange rate refers to the exchange rate when the exchange gain and loss calculation is triggered, that is, the current real-time exchange rate or the exchange rate currently set by the system. The exchange gain and loss is calculated using the following formula: Exchange gain and loss = (current exchange rate - base exchange rate) × transaction amount. According to the positive or negative value of the calculation result, it is determined whether it is an exchange gain (positive value) or an exchange loss (negative value). The calculated exchange gain and loss data (including exchange gain or exchange loss) is recorded in the document information, or stored in a separate exchange gain and loss record table. As needed, the status of the document is updated to reflect the processing of the exchange gain and loss.
[0044] Through the above technical solution, by combining the document transaction amount and exchange rate difference, the exchange gains and losses of each document can be accurately calculated, providing accurate data support for the company's financial management; automatic calculation of exchange gains and losses reduces manual intervention and improves the efficiency and accuracy of financial management; timely calculation and recording of exchange gains and losses helps companies better manage exchange rate risks and avoid potential financial losses. Accurate exchange gain and loss data provides an important basis for the company's financial decision-making; by recording and notifying the calculation results of exchange gains and losses, the transparency of financial management is increased, making it easier for relevant personnel to understand and monitor financial conditions.
[0045] Step S104, generating a current voucher corresponding to each document to be updated by using the pre-acquired voucher template and the exchange gain / loss data corresponding to each document to be updated.
[0046] The current voucher corresponding to each document to be updated is generated by using the pre-acquired voucher template and the exchange gain and loss data corresponding to each document to be updated, specifically including: obtaining the accounting subject type corresponding to each document to be updated, and matching the template in the pre-defined voucher template library according to the accounting subject type to determine the corresponding voucher template; extracting data according to the exchange gain and loss data corresponding to each document to be updated to determine the template requirement data; filling in the voucher template to generate the current voucher corresponding to each document to be updated, wherein the current voucher includes the voucher identification, transaction summary, debit account or credit account, adjustment amount, and exchange gain and loss data.
[0047] In one embodiment of the present specification, for each document to be updated, the corresponding accounting subject type is queried in the database of the business system through its unique identifier. A voucher template library is predefined, which contains voucher templates corresponding to multiple accounting subject types. Each template defines the basic structure of the voucher, such as the generation rules of the voucher identifier, the default text of the transaction summary, the placeholders of the debit and credit accounts, the fields of the adjustment amount and the exchange gain and loss data, etc. According to the accounting subject type of the document to be updated, a match is made in the voucher template library to find the corresponding voucher template.
[0048] Extract exchange gain and loss data from the relevant data of the document to be updated, including the specific amount of exchange gain or loss. Prepare all the data that needs to be filled in according to the structure and requirements of the voucher template, including fixed text (such as the default text of the transaction summary), dynamic data (such as the amount of exchange gain and loss), etc. Fill the prepared data into the corresponding voucher template. This usually involves replacing the placeholders or blank fields in the template with actual data values. Generate a unique identifier for each current voucher according to the voucher identifier generation rules defined in the template.
[0049] Through the above technical solution, by automatically matching voucher templates and filling data, the automation and standardization of voucher generation are realized, which reduces manual intervention and errors, speeds up the generation of vouchers, improves the efficiency of financial management, ensures that the voucher data is consistent with the document data in the business system, and maintains the consistency and accuracy of the data; the design of the voucher template library allows enterprises to flexibly define and adjust voucher templates according to business needs to adapt to different accounting policies and accounting requirements. The generated vouchers contain detailed transaction information and exchange gain and loss data, which is convenient for subsequent audits and inquiries, improves the traceability of financial management, and enhances the compliance of corporate financial management by following predefined voucher templates and accounting standards.
[0050] After filling in the voucher template and generating the current voucher corresponding to each document to be updated, the method also includes: automatically verifying the current voucher and determining the automatic verification result, wherein the automatic verification includes an amount balance check and an account code validity check; when the automatic verification result is a passed check, sending it to the user terminal to receive the manual auxiliary verification data triggered by the user terminal to determine the verification result of the current voucher.
[0051] In one embodiment of the present specification, the current voucher is automatically verified, including the amount balance check, programming logic is written, each record in the voucher is traversed, the debit and credit amounts are accumulated respectively, and finally the two are compared to see if they are equal. Check whether the sum of the amounts of all debit accounts in the voucher is equal to the sum of the amounts of all credit accounts to ensure that each transaction maintains a balanced amount. Check whether all accounting account codes used in the voucher exist in the company's accounting account chart and meet the hierarchical structure and attribute requirements of the accounting accounts. Maintain a reference table or database of accounting account codes, and verify the validity of the account codes in the voucher by querying the table. At the same time, it is also possible to check whether the hierarchy and attributes of the account codes comply with the company's accounting policies. If both the amount balance check and the account code validity check are passed, the automatic verification result is "verification passed"; if any of the checks fail, the automatic verification result is "verification failed".
[0052] When the automatic verification result is "verification passed", the system sends a notification to the designated financial personnel or auditors through the user terminal (such as a computer, mobile phone, etc.), informing them that the current voucher is ready for manual assisted verification. The notification can include summary information of the current voucher, such as voucher identification, transaction summary, main subjects and amount, so that users can quickly understand the content of the voucher. The user terminal provides a user interface for displaying detailed information of the current voucher and allows users to enter or select verification results, remarks or other necessary audit data. After the user completes the verification, the manual assisted verification data is submitted to the system through the user interface. The automatic verification results and the manual assisted verification data are comprehensively judged to finally determine the verification result of the current voucher. If both pass, the voucher verification is successful; if any link fails, the voucher verification fails.
[0053] The dual guarantee of automatic verification and manual verification greatly improves the accuracy of voucher processing and reduces errors and omissions. Automatic verification can quickly complete a large amount of repetitive and standardized verification work, while manual verification focuses on handling complex or special situations. The combination of the two improves overall efficiency. Strict verification procedures ensure the compliance of vouchers, comply with accounting standards and the company's financial management requirements. The notification and interface design of the user terminal enable financial personnel or auditors to participate in voucher verification work quickly and easily, improving the user experience.
[0054] After filling in the voucher template and generating the current voucher corresponding to each document to be updated, the method also includes: determining the corresponding subject storage area in a pre-constructed voucher pool according to the subject to which each current voucher belongs; determining the construction timestamp of each current voucher, and setting the voucher node identifier according to the construction timestamp; storing the current voucher in the voucher pool according to the subject storage area and the voucher node identifier.
[0055] In one embodiment of the present specification, first, according to the accounting subject system of the enterprise, the corresponding subject storage area is pre-constructed in the voucher pool, which can be a physical storage partition or a logical data structure (such as a table in a database, a folder in a file system, etc.) for storing the vouchers belonging to the subject. For each current voucher, according to the accounting subject to which it belongs, the mapping relationship between the accounting subject code and the predefined area in the voucher pool is found, and the corresponding subject storage area is found in the voucher pool. A construction timestamp is generated for each current voucher, which can be accurate to seconds or even milliseconds to ensure the time sequence relationship between the vouchers. The generation of the timestamp can rely on the system clock or be implemented by a specific timestamp generation algorithm. Combined with the construction timestamp and possible other identifiers (such as the unique number of the voucher, the business serial number, etc.), a unique node identifier is set for each voucher. This node identifier must be unique in the voucher pool so that the specific voucher can be quickly located later. It should be noted that the same foreign currency account may correspond to multiple nodes, one node for each timestamp. According to the previously determined subject storage area and voucher node identifier, the current voucher is stored in the corresponding position in the voucher pool. The stored procedure may involve insert operations into the database, write operations to the file system, etc., depending on how the credential pool is implemented. In order to facilitate subsequent credential retrieval and query, it may be necessary to create an index in the stored procedure. The index can be based on fields such as subject, timestamp, credential node identifier, etc. to improve retrieval efficiency.
[0056] As the number of credentials increases, the performance of the credential pool may be affected. Therefore, the credential pool needs to be maintained regularly, such as cleaning up expired or invalid credentials, optimizing index structures, adjusting storage strategies, etc. In order to prevent data loss or damage, the credential pool needs to be securely backed up regularly. The backup data can be stored on external storage media, and recovery tests are performed regularly to ensure the recoverability of the data. The credentials are stored in order according to the subject and construction timestamp to facilitate subsequent query and management. The credential pool has a clear structure and is easy to manage, which facilitates regular maintenance and optimization. Through the use of unique identifiers and indexes, the problems of duplicate storage of credentials and data inconsistency can be effectively avoided.
[0057] Through the above technical solution, by regularly collecting real-time exchange rate data, the exchange rate changes can be quickly captured, thereby ensuring the real-time and accuracy of exchange gains and losses calculation, which helps enterprises to timely reflect the impact of exchange rate changes on financial conditions and make more accurate financial decisions. The entire process is highly automated, from data collection, exchange rate difference determination, document matching, exchange gain and loss calculation to voucher generation, no or only a small amount of manual intervention is required, which greatly saves human resources, improves work efficiency, and reduces the possibility of human errors; timely identification and processing of exchange rate differences help enterprises better manage foreign exchange risks. Through automated processes, they can quickly respond to exchange rate fluctuations, adjust foreign currency accounts and perform necessary financial operations, thereby effectively controlling potential exchange losses. ; The data involved in the entire process (such as real-time exchange rates, document information, exchange gain and loss data, etc.) are automatically processed by the system to ensure the consistency and accuracy of the data; by generating detailed current vouchers, the source and amount of each exchange gain and loss can be clearly understood, which enhances financial transparency and helps communication and collaboration between various departments within the enterprise.
[0058] The embodiment of this specification also provides a device for automatically constructing vouchers based on variable exchange rates, such as Figure 2 As shown, the device includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the above method.
[0059] The embodiments of the present specification also provide a non-volatile computer storage medium storing computer executable instructions, wherein the computer executable instructions are configured to execute the above method.
[0060] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device, equipment, and non-volatile computer storage medium embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0061] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0062] The devices and media provided in the embodiments of this specification correspond one-to-one to the methods. Therefore, the devices and media also have similar beneficial technical effects as the corresponding methods. Since the beneficial technical effects of the methods have been described in detail above, the beneficial technical effects of the devices and media will not be repeated here.
[0063] Those skilled in the art will appreciate that the embodiments of this specification may be provided as methods, systems, or computer program products. Therefore, this specification may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, this specification may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0064] This specification is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of this specification. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0065] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0066] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0067] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0068] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0069] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules 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 disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0070] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0071] The above description is only one or more embodiments of this specification and is not intended to limit this specification. For those skilled in the art, one or more embodiments of this specification may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of one or more embodiments of this specification shall be included in the scope of the claims of this specification.
Claims
1. A method for automatically constructing vouchers based on variable exchange rates, characterized in that: The method comprises: Collecting real-time exchange rate data according to a preset timed collection task, and determining exchange rate differences based on the real-time exchange rate data; Under a specified trigger, matching is performed in the business system through the exchange rate difference to determine at least one document to be updated, so as to obtain document information corresponding to each document to be updated, wherein the document information includes foreign currency account data and foreign currency account debit and credit directions; Determine the exchange gain / loss data corresponding to each of the documents to be updated according to the document information corresponding to each of the documents to be updated and the exchange rate difference; The current voucher corresponding to each of the documents to be updated is generated by using the pre-acquired voucher template and the exchange gain / loss data corresponding to each of the documents to be updated.
2. The method for automatically constructing vouchers based on variable exchange rates according to claim 1, characterized in that: Before collecting the real-time exchange rate data according to the preset timed collection task, the method further includes: Acquire a historical exchange rate time series data set corresponding to a plurality of historical exchange rate data, and determine a historical change time period corresponding to two adjacent exchange rate changes based on the historical exchange rate time series data set; The real-time exchange rate data collection period is determined by the historical change time period, so as to set the scheduled collection task according to the real-time exchange rate data collection period and the data collection period configured by the user.
3. The method for automatically constructing vouchers based on variable exchange rates according to claim 2, characterized in that: Under a specified trigger, before matching in the business system through the exchange rate difference and determining at least one document to be updated, the method further includes: According to each of the historical change time periods, statistics are collected on the historical document financial result data corresponding to the corresponding business system; Determine at least one designated historical change time period through the historical document financial result data and a preset financial fluctuation reference threshold; Based on the historical exchange rate time series data set, determining a plurality of exchange rates within the specified historical change time period to determine a corresponding exchange rate change indicator; An exchange rate change threshold is set by using the exchange rate change indicator, and a trigger condition threshold is set according to the exchange rate change threshold.
4. The method for automatically constructing vouchers based on variable exchange rates according to claim 3, characterized in that: Under the specified trigger, the exchange rate difference is matched in the business system to determine at least one document to be updated, including: When the exchange rate difference meets the trigger condition threshold, determining the corresponding changed foreign currency type according to the exchange rate difference; According to the changed foreign currency type, screening is performed in the business system to determine a plurality of matching foreign currency documents, and the current document status of the foreign currency documents is obtained, wherein the current document status includes a completed status and an uncompleted status; According to the current document status of each of the foreign currency documents, the multiple foreign currency documents are screened to determine at least one designated foreign currency document that meets the preset requirements, and the document to be updated is determined.
5. The method for automatically constructing vouchers based on variable exchange rates according to claim 1, characterized in that: Determining the exchange gain / loss data corresponding to each of the documents to be updated according to the document information corresponding to each of the documents to be updated and the exchange rate difference, specifically includes: Obtaining document information corresponding to each of the documents to be updated, wherein the document information includes the transaction amount of the document; The exchange gain / loss data corresponding to each of the documents to be updated is calculated based on the document information corresponding to each of the documents to be updated and the exchange rate difference, wherein the exchange gain / loss data includes any one of exchange gain data and exchange loss data.
6. The method for automatically constructing vouchers based on variable exchange rates according to claim 1, characterized in that: Generating a current voucher corresponding to each of the documents to be updated by using the pre-acquired voucher template and the exchange gain / loss data corresponding to each of the documents to be updated, specifically including: Acquire the accounting subject type corresponding to each of the documents to be updated, and perform template matching in a predefined voucher template library according to the accounting subject type to determine the corresponding voucher template; Extract data based on the exchange gain / loss data corresponding to each document to be updated, and determine template requirement data; Filling is performed in the voucher template to generate a current voucher corresponding to each document to be updated, wherein the current voucher includes a voucher identifier, a transaction summary, a debit account or a credit account, an adjustment amount, and exchange gain and loss data.
7. The method for automatically constructing vouchers based on variable exchange rates according to claim 6, characterized in that: After filling in the voucher template and generating a current voucher corresponding to each of the documents to be updated, the method further includes: Automatically verify the current voucher and determine the automatic verification result, wherein the automatic verification includes amount balance verification and account code validity verification; When the automatic verification result is that the verification is passed, it is sent to the user terminal to receive the manual auxiliary verification data triggered by the user terminal to determine the verification result of the current credential.
8. The method for automatically constructing vouchers based on variable exchange rates according to claim 6, characterized in that: After filling in the voucher template and generating a current voucher corresponding to each of the documents to be updated, the method further includes: According to the subject to which each current voucher belongs, determining the corresponding subject storage area in the pre-built voucher pool; Determine a build timestamp of each current credential, and set a credential node identifier according to the build timestamp; According to the subject storage area and the voucher node identifier, the current voucher is stored in a voucher pool.
9. A device for automatically constructing vouchers based on variable exchange rates, characterized in that: The device comprises: at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can perform the method according to any one of claims 1 to 8.
10. A non-volatile computer storage medium storing computer executable instructions, characterized in that: The computer executable instructions are configured to execute the method according to any one of claims 1 to 8.