WO2020034752A1 - 浮动收益计算方法、装置、设备及计算机可读存储介质 - Google Patents

浮动收益计算方法、装置、设备及计算机可读存储介质 Download PDF

Info

Publication number
WO2020034752A1
WO2020034752A1 PCT/CN2019/092231 CN2019092231W WO2020034752A1 WO 2020034752 A1 WO2020034752 A1 WO 2020034752A1 CN 2019092231 W CN2019092231 W CN 2019092231W WO 2020034752 A1 WO2020034752 A1 WO 2020034752A1
Authority
WO
WIPO (PCT)
Prior art keywords
interest
principal
balance
day
financial product
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Ceased
Application number
PCT/CN2019/092231
Other languages
English (en)
French (fr)
Inventor
陈超
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Alibaba Group Holding Ltd
Original Assignee
Alibaba Group Holding Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Publication of WO2020034752A1 publication Critical patent/WO2020034752A1/zh
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/02Banking, e.g. interest calculation or account maintenance
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/06Asset management; Financial planning or analysis

Definitions

  • Embodiments of the present disclosure relate to the field of Internet technologies, and in particular, to a method, an apparatus, a device, and a computer-readable storage medium for calculating floating income.
  • Floating income is the opposite of fixed income.
  • Fixed income means that when a financial product matures, the actual income is calculated based on a fixed rate of return.
  • Floating income financial products use daily compound interest calculation method to calculate income.
  • Compound interest calculation refers to the calculation of interest. The interest of the previous period is included in the interest of the next period.
  • Floating income compound interest and interest-bearing products refer to the calculation of daily compound interest for floating income financial products. Therefore, such financial products can be referred to simply as "floating income products".
  • Common such products include: currency funds, general open-end funds, stocks, regular open-type insurance, etc. Institutions will provide data on "ten thousand returns" or “daily gains and losses.” 10,000 copies of income refers to the income generated per 10,000 shares of the day.
  • Floating income products such as monetary funds and term open insurance usually use this method to calculate income.
  • the daily increase or decrease refers to the change in the latest net value or transaction price of the unit share on that day compared to the previous day.
  • General open-end funds, stocks and other floating income products usually use this method to calculate returns.
  • O (N) the complexity of the problem is O (N). That is, the time cost of this problem increases linearly with the number of days (N) in which revenue is calculated, and there is no guarantee that the results will be calculated in a limited time.
  • the first aspect of the present disclosure provides a method for calculating floating income, including:
  • a second aspect of the present disclosure provides a floating income calculation device, including:
  • a first calculation module configured to calculate an interest calculation period of the financial product from the start date to the end date according to a start date and an end date of a floating income calculation of the financial product
  • An obtaining module configured to obtain a principal and interest balance of the financial product on a day before the start date and a principal and interest balance on the end date;
  • a second calculation module configured to calculate a rate of return within the interest calculation period based on the principal and interest balance of the financial product on the day before the start date and the balance of principal and interest on the end date, thereby calculating the interest calculation period Income within.
  • a third aspect of the present disclosure provides an electronic device including a memory and a processor; wherein the memory is used to store one or more computer instructions, wherein the one or more computer instructions are executed by the processor to Implement the method as described in the first aspect.
  • a fourth aspect of the present disclosure provides a computer-readable storage medium having stored thereon computer instructions that, when executed by a processor, implement the method described in the first aspect.
  • an interest calculation period of the financial product from the start date to the end date is calculated by calculating a start date and an end date based on a floating income calculation of the financial product; obtaining the financial product before the start date The balance of principal and interest on one day and the balance of principal and interest on the end date; and calculating the rate of return in the interest calculation period based on the principal and interest balance of the financial product on the day before the start date and the principal and interest balance on the end date, Therefore, the time complexity can be reduced by changing the space for time by calculating the return in the interest calculation period. That is, for the problem of “calculating the returns of floating income financial products in any N days” with O (N) complexity, a solution with a time complexity of O (1) is proposed, which significantly improves the operating speed and Service time consuming stability.
  • FIG. 1 shows a flowchart of a floating income calculation method according to an embodiment of the present disclosure
  • FIG. 2 shows a structural block diagram of a floating income calculation device according to an embodiment of the present disclosure
  • FIG. 3 shows a structural block diagram of a device according to an embodiment of the present disclosure
  • FIG. 4 is a schematic structural diagram of a computer system suitable for implementing a floating income calculation method according to an embodiment of the present disclosure.
  • the solution to the problem of "calculating the returns of floating income financial products in any N days” is a solution with a time complexity of O (N).
  • An example scenario includes the following steps:
  • Another example scenario includes the following steps:
  • step 2 N times to obtain the ratio of the "sum of the principal and return of the Nth day” to the "opening principal of the 1st day” of the product, that is, the N-day yield of the product. Write this value to the database or cache, and then read it directly from the database or cache.
  • the time complexity of the solution for calculating the floating income in the N-day interest-bearing period is O (N), and the space complexity is O (1) or O (N).
  • the solution of the embodiment of the present disclosure for calculating the floating income in the N-day interest-bearing period has a time complexity of O (1) and a space complexity of O (N). Therefore, the results can be calculated in a limited time, which significantly improves the operating speed and the stability of time-consuming services.
  • FIG. 1 shows a flowchart of a floating income calculation method according to an embodiment of the present disclosure.
  • the method may include steps S101, S102, and S103.
  • step S101 the interest calculation period of the financial product from the start date to the end date is calculated based on the start and end dates of the floating income calculation of the financial product.
  • step S102 the principal and interest balance of the financial product on the day before the start date and the principal and interest balance on the end date are obtained.
  • step S103 the yield in the interest calculation period is calculated according to the principal and interest balance of the financial product on the day before the start date and the balance of the principal and interest on the end date, so as to calculate the return in the interest calculation period.
  • the interest accrual period refers to a start date to an end date to be calculated from a floating income of a financial product.
  • the interest calculation period can be a period of time intercepted from the entire life of a financial product.
  • step S102 includes:
  • b D is the principal and interest balance of the D day
  • D x is the start date
  • D x -1 is the day before the start date
  • D y is the end day
  • b D-1 Is the balance of principal and interest on day D-1
  • r D is the rise and fall of financial products on day D.
  • step S103 includes:
  • R x, y is the rate of return of financial products in the interest calculation period [D x , D y ], Is the principal and interest balance of the end date D y , Is the principal and interest balance of D x -1 the day before the start date.
  • step S103 includes:
  • step S102 includes:
  • the data on the D-1 day can be read, and then the principal and interest balance on the D day can be calculated and persisted.
  • the initial amount can be arbitrarily specified. For example, in the above algorithm description and actual implementation, 10000.00 yuan is selected as the initial amount.
  • the interest-bearing period [D x , D y ] of the product needs to be calculated first. Then read the data of D x -1 and D y days respectively. Since there is no dependency when reading, it can be read concurrently. After reading, according to with That is, the N-day return of the product can be calculated, and then the N-day return of the product can be calculated.
  • a relational database is used for persistence.
  • the b D data is related to the daily rise and fall data of the product. Because the product's D-day rise and fall data will not change, so the b D data will not change. By increasing the cache, the reading performance of b D data can be further improved.
  • the balance of principal and interest is calculated according to the formula D B D of day, before purchase of the product in D 0, the principal of 10,000.00 yuan.
  • the product has the principal and interest balance on the D day, which is set to b D , D ⁇ [D 0 , D 0 + n].
  • r i is the rise or fall of the financial product on the i-th day.
  • the product income R x, y in the interest calculation period [D x , D y ] can be calculated by the following formula (4):
  • the formula (4) in the related art is the same as the product revenue R x, y in the interest calculation period [D x , D y ] calculated by the formula (2) in the embodiment of the present disclosure.
  • the time complexity of calculating the product revenue R x, y in the related technology is O (N).
  • the time overhead leading to this problem increases linearly with the number of days (N) in which revenue is calculated. Calculate the results.
  • the time complexity of calculating the product revenue R x, y in the embodiment of the present disclosure is O (1), which can significantly improve the running speed and the stability of the time-consuming service.
  • an interest calculation period of the financial product from the start date to the end date is calculated by calculating a start date and an end date based on a floating income calculation of the financial product; obtaining the financial product before the start date The balance of principal and interest on one day and the balance of principal and interest on the end date; and calculating the rate of return in the interest calculation period based on the principal and interest balance of the financial product on the day before the start date and the principal and interest balance on the end date, Therefore, the time complexity can be reduced by changing the space for time by calculating the return in the interest calculation period. That is, for the problem of “calculating the returns of floating income financial products in any N days” with O (N) complexity, a solution with a time complexity of O (1) is proposed, which significantly improves the operating speed and Service time consuming stability.
  • FIG. 2 shows a structural block diagram of a floating income calculation device according to an embodiment of the present disclosure.
  • the floating income calculation apparatus shown in FIG. 2 includes a first calculation module 201, an acquisition module 202, and a second calculation module 203.
  • the first calculation module 201 is configured to calculate an interest calculation period from the start date to the end date of the financial product based on the start date and end date of the floating income calculation of the financial product.
  • the obtaining module 202 is configured to obtain the principal and interest balance of the financial product on the day before the start date and the principal and interest balance on the end date.
  • the second calculation module 203 is configured to calculate a rate of return in the interest calculation period based on the principal and interest balance of the financial product on the day before the start date and the balance of the principal and interest on the end date, thereby calculating the return in the interest calculation period.
  • the interest accrual period refers to a start date to an end date to be calculated from a floating income of a financial product.
  • the interest calculation period can be a period of time intercepted from the entire life of a financial product.
  • the obtaining module 202 is configured to:
  • b D is the principal and interest balance of the D day
  • D x is the start date
  • D x -1 is the day before the start date
  • D y is the end day
  • b D-1 Is the balance of principal and interest on day D-1
  • r D is the rise and fall of financial products on day D.
  • the second calculation module 203 is configured to:
  • R x, y is the rate of return of financial products in the interest calculation period [D x , D y ], Is the principal and interest balance of the end date D y , Is the principal and interest balance of D x -1 the day before the start date.
  • the second calculation module 203 is configured to:
  • the obtaining module 202 is configured to:
  • the data on the D-1 day can be read, and then the principal and interest balance on the D day can be calculated and persisted.
  • the initial amount can be arbitrarily specified. For example, in the above algorithm description and actual implementation, 10000.00 yuan is selected as the initial amount.
  • the interest-bearing period [D x , D y ] of the product needs to be calculated first. Then read the data of D x -1 and D y days respectively. Since there is no dependency when reading, it can be read concurrently. After reading, according to with That is, the N-day return of the product can be calculated, and then the N-day return of the product can be calculated.
  • a relational database is used for persistence.
  • the b D data is related to the daily rise and fall data of the product. Because the product's D-day rise and fall data will not change, so the b D data will not change. By increasing the cache, the reading performance of b D data can be further improved.
  • the first calculation module is configured to calculate an interest calculation period of the financial product from the start date to the end date according to a start date and an end date of a floating income calculation of the financial product; an acquisition module , Configured to obtain the principal and interest balance of the financial product on the day before the start date and the principal and interest balance on the end date; the second calculation module is configured to calculate the financial product based on the The balance of principal and interest and the balance of principal and interest on the end date are used to calculate the rate of return in the interest calculation period, so as to calculate the income in the interest calculation period.
  • the time complexity can be reduced by exchanging space for time. That is, for the problem of “calculating the returns of floating income financial products in any N days” with O (N) complexity, a solution with a time complexity of O (1) is proposed, which significantly improves the operating speed and Service time consuming stability.
  • the structure of the text content identification device may be implemented as a text content identification device.
  • the processing device 300 may include a processor. 301 and memory 302.
  • the memory 302 is configured to store a program that supports the text content identification device to execute the text content identification method in any one of the foregoing embodiments, and the processor 301 is configured to execute the program stored in the memory 302.
  • the memory 302 is configured to store one or more computer instructions, wherein the one or more computer instructions are executed by the processor 301.
  • the processor 301 is configured to execute all or part of the foregoing method steps.
  • the structure of the text content identification device may further include a communication interface, which is used for the text content identification device to communicate with other devices or a communication network.
  • An exemplary embodiment of the present disclosure also provides a computer storage medium for storing computer software instructions used by the text content identification device, which includes a program for executing a text content identification method in any one of the foregoing embodiments.
  • FIG. 4 is a schematic structural diagram of a computer system suitable for implementing a text content identification method according to an embodiment of the present disclosure.
  • the computer system 400 includes a central processing unit (CPU) 401 that can be loaded into a random access memory (RAM) 403 according to a program stored in a read-only memory (ROM) 402 or a program loaded from a storage section 408 Instead, various processes in the embodiment shown in FIG. 1 are executed.
  • RAM random access memory
  • ROM read-only memory
  • various programs and data required for the operation of the system 400 are also stored.
  • the CPU 401, the ROM 402, and the RAM 403 are connected to each other through a bus 404.
  • An input / output (I / O) interface 405 is also connected to the bus 404.
  • the following components are connected to the I / O interface 405: an input portion 406 including a keyboard, a mouse, and the like; an output portion 407 including a cathode ray tube (CRT), a liquid crystal display (LCD), and the speaker; a storage portion 408 including a hard disk and the like And a communication section 409 including a network interface card such as a LAN card, a modem, and the like.
  • the communication section 409 performs communication processing via a network such as the Internet.
  • the driver 410 is also connected to the I / O interface 405 as needed.
  • a removable medium 411 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 410 as needed, so that a computer program read therefrom is installed into the storage section 408 as needed.
  • the method described above with reference to FIG. 1 may be implemented as a computer software program.
  • embodiments of the present disclosure include a computer program product including a computer program tangibly embodied on a readable medium thereon, the computer program containing program code for performing the data processing method of FIG. 1.
  • the computer program may be downloaded and installed from a network through the communication section 409, and / or installed from a removable medium 411.
  • each block in the roadmap or block diagram may represent a module, program segment, or portion of code that contains one or more components that implement a specified logical function Executable instructions.
  • the functions noted in the blocks may also occur in a different order than those marked in the drawings. For example, two successively represented boxes may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved.
  • each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts can be implemented by a dedicated hardware-based system that performs the specified function or operation , And / or can be implemented with a combination of dedicated hardware and computer instructions.
  • the units or modules described in the embodiments of the present disclosure may be implemented by software, and may also be implemented by hardware.
  • the described units or modules may also be provided in the processor, and the names of these units or modules do not, in some cases, define the unit or module itself.
  • the present disclosure also provides a computer-readable storage medium.
  • the computer-readable storage medium may be a computer-readable storage medium included in the device described in the foregoing embodiments; Computer-readable storage media incorporated into a device.
  • the computer-readable storage medium stores one or more programs, which are used by one or more processors to perform the methods described in the present disclosure.

Landscapes

  • Business, Economics & Management (AREA)
  • Engineering & Computer Science (AREA)
  • Accounting & Taxation (AREA)
  • Finance (AREA)
  • Development Economics (AREA)
  • Technology Law (AREA)
  • Marketing (AREA)
  • Strategic Management (AREA)
  • Economics (AREA)
  • Physics & Mathematics (AREA)
  • General Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Entrepreneurship & Innovation (AREA)
  • Game Theory and Decision Science (AREA)
  • Human Resources & Organizations (AREA)
  • Operations Research (AREA)
  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)

Abstract

本公开实施例提供浮动收益计算方法、装置、设备及计算机可读存储介质。浮动收益计算方法包括:根据金融产品的浮动收益计算的开始日和结束日计算金融产品的从所述开始日至所述结束日的计息周期;获取所述金融产品在所述开始日前一日的本息余额以及在所述结束日的本息余额;根据所述金融产品在所述开始日前一日的本息余额以及在所述结束日的本息余额计算所述计息周期内的收益率,从而计算所述计息周期内的收益,可以通过以空间换时间的方式,降低时间复杂度。即,对于"计算浮动收益类金融产品在任意N日内的收益"这一复杂度为O(N)的问题,提出了一种时间复杂度为O(1)的方案,显著提升了运行速度以及服务耗时的稳定性。

Description

浮动收益计算方法、装置、设备及计算机可读存储介质 技术领域
本公开实施例涉及互联网技术领域,尤其涉及浮动收益计算方法、装置、设备及计算机可读存储介质。
背景技术
浮动收益是和固定收益相对的概念。固定收益是指在金融产品到期时,实际收益是根据固定的收益率计算得到。浮动收益类金融产品采用按日复利计息的方式计算收益。复利计息指的是在计算利息时,上一期的利息会计入下一期的计息本金。浮动收益类复利计息产品指的是对于浮动收益类金融产品,采取按日复利计息的方式计算收益。因此可以将这类金融产品简称为“浮动收益类产品”。常见的此类产品包括:货币基金、一般开放式基金、股票、定期开放型保险等。机构会提供“万份收益”或“日涨跌幅”数据。万份收益指的是当日每万份份额产生的收益。货币基金、定期开放型保险等浮动收益类产品通常采用该方式计算收益。日涨跌幅指的是当日单位份额的最新净值或成交价相较于上一日的变化。一般开放式基金、股票等浮动收益类产品通常采用该方式计算收益。当计算浮动收益产品在任意N日内的收益时,需要取出产品在N日内的“万份收益”或“日涨跌幅”数据,按日依次计算。因此,该问题的复杂度是O(N)的。即,该问题的时间开销是随着计算收益的天数(N)线性增长的,无法保证在有限时间内计算出结果。
发明内容
有鉴于此,本公开第一方面提供了一种浮动收益计算方法,包括:
根据金融产品的浮动收益计算的开始日和结束日计算金融产品的从所述开始日至所述结束日的计息周期;
获取所述金融产品在所述开始日前一日的本息余额以及在所述结束日的本息余额;
根据所述金融产品在所述开始日前一日的本息余额以及在所述结束日的本息余额计算所述计息周期内的收益率,从而计算所述计息周期内的收益。
本公开第二方面提供了一种浮动收益计算装置,包括:
第一计算模块,被配置为根据金融产品的浮动收益计算的开始日和结束日计算金融产品的从所述开始日至所述结束日的计息周期;
获取模块,被配置为获取所述金融产品在所述开始日前一日的本息余额以及在所述结束日的本息余额;
第二计算模块,被配置为根据所述金融产品在所述开始日前一日的本息余额以及在所述结束日的本息余额计算所述计息周期内的收益率,从而计算所述计息周期内的收益。
本公开第三方面提供了一种电子设备,包括存储器和处理器;其中,所述存储器用于存储一条或多条计算机指令,其中,所述一条或多条计算机指令被所述处理器执行以实现如第一方面所述的方法。
本公开第四方面提供了一种计算机可读存储介质,其上存储有计算机指令,该计算机指令被处理器执行时实现如第一方面所述的方法。
在本公开实施方式中,通过根据金融产品的浮动收益计算的开始日和结束日计算金融产品的从所述开始日至所述结束日的计息周期;获取所述金融产品在所述开始日前一日的本息余额以及在所述结束日的本息余额;根据所述金融产品在所述开始日前一日的本息余额以及在所述结束日的本息余额计算所述计息周期内的收益率,从而计算所述计息周期内的收益,可以通过以空间换时间的方式,降低时间复杂度。即,对于“计算浮动收益类金融产品在任意N日内的收益”这一复杂度为O(N)的问题,提出了一种时间复杂度为O(1)的方案,显著提升了运行速度以及服务耗时的稳定性。
本公开的这些方面或其他方面在以下实施例的描述中会更加简明易懂。
附图说明
为了更清楚地说明本公开实施例或相关技术中的技术方案,下面将对示例性实施例或相关技术描述中所需要使用的附图作一简单地介绍,显而易见地,下面描述中的附图是本公开的一些示例性实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1示出根据本公开一实施方式的浮动收益计算方法的流程图;
图2示出根据本公开一实施方式的浮动收益计算装置的结构框图;
图3示出根据本公开一实施方式的设备的结构框图;
图4是适于用来实现根据本公开一实施方式的浮动收益计算方法的计算机系统的结构示意图。
具体实施方式
为了使本技术领域的人员更好地理解本公开方案,下面将结合本公开示例性实施例中的附图,对本公开示例性实施例中的技术方案进行清楚、完整地描述。
在本公开的说明书和权利要求书及上述附图中的描述的一些流程中,包含了按照特定顺序出现的多个操作,但是应该清楚了解,这些操作可以不按照其在本文中出现的顺序来执行或并行执行,操作的序号如101、102等,仅仅是用于区分开各个不同的操作,序号本身不代表任何的执行顺序。另外,这些流程可以包括更多或更少的操作,并且这些操作可以按顺序执行或并行执行。需要说明的是,本文中的“第一”、“第二”等描述,是用于区分不同的消息、设备、模块等,不代表先后顺序,也不限定“第一”和“第二”是不同的类型。
下面将结合本公开示例性实施例中的附图,对本公开示例性实施例中的技术方案进行清楚、完整地描述,显然,所描述的示例性实施例仅仅是本公开一部分实施例,而不是全部的实施例。基于本公开中的实施例,本领域技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本公开保护的范围。.
在相关技术的一个实施方式中,解决“计算浮动收益类金融产品在任意N日内的收益”的问题采用的是时间复杂度是O(N)的方案。
一个示例的方案包括如下步骤:
1.取出N日的“万份收益”或“日涨跌幅”数据。
2.根据第n日的本金、以及第n日的“万份收益”或“日涨跌幅”数据,计算第n日的收益。第n日的收益和第n日的本金,共同作为第n+1日的本金。
3.将步骤2重复N次,得到产品的N日收益。
另一个示例的方案包括如下步骤:
1.取出N日的“万份收益”或“日涨跌幅”数据。
2.根据第n日的“万份收益”或“日涨跌幅”数据,计算“第n日的期末本金和收益之和”与“第n日的期初本金”的比值。将该比值,乘以第n-1日的结果,得到第 n日的结果。
3.将步骤2重复N次,得到产品“第N日的期末本金和收益之和”与“第1日的期初本金”的比值,即该产品的N日收益率。将该数值写入数据库或缓存,后续直接从数据库或缓存读取。
4.将产品的N日收益率乘以本金,即可得到产品的N日收益。
因此,相关技术中的的计算N日计息周期内的浮动收益的方案的时间复杂度是O(N)、空间复杂度是O(1)或者O(N)。
与相关技术系统,本公开实施方式的方案计算N日计息周期内的浮动收益的时间复杂度是O(1)、空间复杂度是O(N)。因此,可以在有限时间内计算出结果,显著提升了运行速度以及服务耗时的稳定性。
图1示出根据本公开一实施方式的浮动收益计算方法的流程图。该方法可以包括步骤S101、S102和S103。
在步骤S101中,根据金融产品的浮动收益计算的开始日和结束日计算金融产品的从开始日至结束日的计息周期。
在步骤S102中,获取金融产品在开始日前一日的本息余额以及在结束日的本息余额。
在步骤S103中,根据金融产品在开始日前一日的本息余额以及在结束日的本息余额计算计息周期内的收益率,从而计算计息周期内的收益。
在本公开的一个实施例中,计息周期指的是要对从金融产品的浮动收益进行计算的开始日至结束日。例如,计息周期可以是从金融产品的整个寿命中截取的一个时间段。
在本公开的一个实施例中,步骤S102包括:
利用下式(1)计算在开始日前一日的本息余额以及在结束日的本息余额,
b D=b D-1*(1+r D)      (1)
其中,b D是第D日的本息余额,D∈[D x-1,D y],D x是开始日,D x-1是开始日前一日,D y是结束日,b D-1是第D-1日的本息余额,r D是金融产品在第D日的涨跌幅。
在本公开的一个实施例中,步骤S103包括:
利用下式(2)计算计息周期内的收益率,
Figure PCTCN2019092231-appb-000001
其中,R x,y是金融产品在计息周期[D x,D y]内的收益率,
Figure PCTCN2019092231-appb-000002
是结束日D y的本息余额,
Figure PCTCN2019092231-appb-000003
是开始日前一日D x-1的本息余额。
在本公开的一个实施例中,步骤S103包括:
通过用D-1日的本息余额b D-1乘以所述金融产品在所述计息周期[D x,D y]内的收益率R x,y计算计息周期内的收益。
在本公开的一个实施例中,步骤S102包括:
对D日的本息余额b D进行持久化。
在本公开的一个实施例中,可以在获取金融产品的第D日涨跌幅时,读取第D-1日的数据,然后计算D日的本息余额并持久化。对于金融产品尚未同步过收益的情况,则需要首先构造第D-1日的初始数据并进行持久化。构造初始数据时,初始金额是可以随意指定的。例如,在上述算法说明以及实际实现时,选择10000.00元作为初始金额。计算产品的N日收益时,首先需要计算出产品的计息周期[D x,D y]。然后分别读取D x-1以及D y日的数据,由于读取时是没有依赖关系的,因此可以并发读取。读取完毕后,根据
Figure PCTCN2019092231-appb-000004
Figure PCTCN2019092231-appb-000005
即可以计算得到产品的N日收益率,进而计算得到产品的N日收益。
在本公开的一个实施例中,在对第D日的本息余额b D数据进行持久化时,使用了关系型数据库进行持久化。另外,b D数据和产品的日涨跌幅数据相关。由于产品的第D日涨跌幅数据是不会变化的,因此b D数据也是不会变化的。通过增加缓存的方式,可以进一步提升b D数据的读取性能。
在相关技术的一个实施例中,可以按照下式(3)计算第D日的本息余额b D,在第D 0日前购入产品,本金为10000.00元。此时,产品在第D日有本息余额,设为b D,D∈[D 0,D 0+n]。
Figure PCTCN2019092231-appb-000006
Figure PCTCN2019092231-appb-000007
其中,
Figure PCTCN2019092231-appb-000008
r i是金融产品在第i日的涨跌幅。
在相关技术的实施方式中,可以通过下式(4)计算产品在计息周期[D x,D y]内的产品收益R x,y
Figure PCTCN2019092231-appb-000009
实际上,相关技术中的式(4)与本公开实施方式中的式(2)计算出的产品在计息周期[D x,D y]内的产品收益R x,y相同。
从以上内容可知,相关技术中计算产品收益R x,y的时间复杂度是O(N),导致该问题的时间开销是随着计算收益的天数(N)线性增长的,无法保证在有限时间内计算出结果。相较而言,本公开实施方式中的计算计算产品收益R x,y的时间复杂度是O(1),可以显著提升运行速度以及服务耗时的稳定性。
在本公开实施方式中,通过根据金融产品的浮动收益计算的开始日和结束日计算金融产品的从所述开始日至所述结束日的计息周期;获取所述金融产品在所述开始日前一日的本息余额以及在所述结束日的本息余额;根据所述金融产品在所述开始日前一日的本息余额以及在所述结束日的本息余额计算所述计息周期内的收益率,从而计算所述计息周期内的收益,可以通过以空间换时间的方式,降低时间复杂度。即,对于“计算浮动收益类金融产品在任意N日内的收益”这一复杂度为O(N)的问题,提出了一种时间复杂度为O(1)的方案,显著提升了运行速度以及服务耗时的稳定性。
以下参照图2对本公开的浮动收益计算装置进行描述。
图2示出根据本公开一实施方式的浮动收益计算装置的结构框图。
如图2所示的浮动收益计算装置包括第一计算模块201、获取模块202和第二计算模块203。
第一计算模块201被配置为根据金融产品的浮动收益计算的开始日和结束日计算金融产品的从开始日至结束日的计息周期。
获取模块202被配置为获取金融产品在开始日前一日的本息余额以及在结束日的本息余额。
第二计算模块203被配置为根据金融产品在开始日前一日的本息余额以及在结束日的本息余额计算计息周期内的收益率,从而计算计息周期内的收益。
在本公开的一个实施例中,计息周期指的是要对从金融产品的浮动收益进行计算的开始日至结束日。例如,计息周期可以是从金融产品的整个寿命中截取的一个时间段。
在本公开的一个实施例中,获取模块202被配置为:
利用下式(1)计算在开始日前一日的本息余额以及在结束日的本息余额,
b D=b D-1*(1+r D)       (1)
其中,b D是第D日的本息余额,D∈[D x-1,D y],D x是开始日,D x-1是开始日前一日,D y是结束日,b D-1是第D-1日的本息余额,r D是金融产品在第D日的涨跌幅。
在本公开的一个实施例中,第二计算模块203被配置为:
利用下式(2)计算计息周期内的收益率,
Figure PCTCN2019092231-appb-000010
其中,R x,y是金融产品在计息周期[D x,D y]内的收益率,
Figure PCTCN2019092231-appb-000011
是结束日D y的本息余额,
Figure PCTCN2019092231-appb-000012
是开始日前一日D x-1的本息余额。
在本公开的一个实施例中,第二计算模块203被配置为:
通过用D-1日的本息余额b D-1乘以所述金融产品在所述计息周期[D x,D y]内的收益率R x,y计算计息周期内的收益。
在本公开的一个实施例中,获取模块202被配置为:
对D日的本息余额b D进行持久化。
在本公开的一个实施例中,可以在获取金融产品的第D日涨跌幅时,读取第D-1日的数据,然后计算D日的本息余额并持久化。对于金融产品尚未同步过收益的情况,则需要首先构造第D-1日的初始数据并进行持久化。构造初始数据时,初始金额是可以随意指定的。例如,在上述算法说明以及实际实现时,选择10000.00元作为初始金额。计算产品的N日收益时,首先需要计算出产品的计息周期[D x,D y]。然后分别读取D x-1以及D y日的数据,由于读取时是没有依赖关系的,因此可以并发读取。读取完毕后,根据
Figure PCTCN2019092231-appb-000013
Figure PCTCN2019092231-appb-000014
即可以计算得到产品的N日收益率,进而计算得到产品的N日收益。
在本公开的一个实施例中,在对第D日的本息余额b D数据进行持久化时,使用了关系型数据库进行持久化。另外,b D数据和产品的日涨跌幅数据相关。由于产品的第D日涨跌幅数据是不会变化的,因此b D数据也是不会变化的。通过增加缓存的方式,可以进一步提升b D数据的读取性能。
在本公开实施方式中,通过第一计算模块,被配置为根据金融产品的浮动收益计算的开始日和结束日计算金融产品的从所述开始日至所述结束日的计息周期;获取模块,被配置为获取所述金融产品在所述开始日前一日的本息余额以及在所述结束日的本息 余额;第二计算模块,被配置为根据所述金融产品在所述开始日前一日的本息余额以及在所述结束日的本息余额计算所述计息周期内的收益率,从而计算所述计息周期内的收益,可以通过以空间换时间的方式,降低时间复杂度。即,对于“计算浮动收益类金融产品在任意N日内的收益”这一复杂度为O(N)的问题,提出了一种时间复杂度为O(1)的方案,显著提升了运行速度以及服务耗时的稳定性。
以上描述了文本内容标识装置的内部功能和结构,在一个可能的设计中,该文本内容标识装置的结构可实现为文本内容标识设备,如图3中所示,该处理设备300可以包括处理器301以及存储器302。
所述存储器302用于存储支持文本内容标识装置执行上述任一实施例中文本内容标识方法的程序,所述处理器301被配置为用于执行所述存储器302中存储的程序。
所述存储器302用于存储一条或多条计算机指令,其中,所述一条或多条计算机指令被所述处理器301执行。
所述处理器301用于执行前述各方法步骤中的全部或部分步骤。
其中,所述文本内容标识设备的结构中还可以包括通信接口,用于文本内容标识设备与其他设备或通信网络通信。
本公开示例性实施例还提供了一种计算机存储介质,用于储存所述文本内容标识装置所用的计算机软件指令,其包含用于执行上述任一实施例中文本内容标识方法所涉及的程序。
图4是适于用来实现根据本公开一实施方式的文本内容标识方法的计算机系统的结构示意图。
如图4所示,计算机系统400包括中央处理单元(CPU)401,其可以根据存储在只读存储器(ROM)402中的程序或者从存储部分408加载到随机访问存储器(RAM)403中的程序而执行上述图1所示的实施方式中的各种处理。在RAM403中,还存储有系统400操作所需的各种程序和数据。CPU401、ROM402以及RAM403通过总线404彼此相连。输入/输出(I/O)接口405也连接至总线404。
以下部件连接至I/O接口405:包括键盘、鼠标等的输入部分406;包括诸如阴极射线管(CRT)、液晶显示器(LCD)等以及扬声器等的输出部分407;包括硬盘等的存储部分408;以及包括诸如LAN卡、调制解调器等的网络接口卡的通信部分409。通信部分409经由诸如因特网的网络执行通信处理。驱动器410也根据需要连接至I/O接口 405。可拆卸介质411,诸如磁盘、光盘、磁光盘、半导体存储器等等,根据需要安装在驱动器410上,以便于从其上读出的计算机程序根据需要被安装入存储部分408。
特别地,根据本公开的实施方式,上文参考图1描述的方法可以被实现为计算机软件程序。例如,本公开的实施方式包括一种计算机程序产品,其包括有形地包含在及其可读介质上的计算机程序,所述计算机程序包含用于执行图1的数据处理方法的程序代码。在这样的实施方式中,该计算机程序可以通过通信部分409从网络上被下载和安装,和/或从可拆卸介质411被安装。
附图中的流程图和框图,图示了按照本公开各种实施方式的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,路程图或框图中的每个方框可以代表一个模块、程序段或代码的一部分,所述模块、程序段或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个接连地表示的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或操作的专用的基于硬件的系统来实现,并且/或者可以用专用硬件与计算机指令的组合来实现。
描述于本公开实施方式中所涉及到的单元或模块可以通过软件的方式实现,也可以通过硬件的方式来实现。所描述的单元或模块也可以设置在处理器中,这些单元或模块的名称在某种情况下并不构成对该单元或模块本身的限定。
作为另一方面,本公开还提供了一种计算机可读存储介质,该计算机可读存储介质可以是上述实施方式中所述装置中所包含的计算机可读存储介质;也可以是单独存在,未装配入设备中的计算机可读存储介质。计算机可读存储介质存储有一个或者一个以上程序,所述程序被一个或者一个以上的处理器用来执行描述于本公开的方法。
以上描述仅为本公开的较佳实施例以及对所运用技术原理的说明。本领域技术人员应当理解,本公开中所涉及的发明范围,并不限于上述技术特征的特定组合而成的技术方案,同时也应涵盖在不脱离所述发明构思的情况下,由上述技术特征或其等同特征进行任意组合而形成的其它技术方案。例如上述特征与本公开中公开的(但不限于)具有类似功能的技术特征进行互相替换而形成的技术方案。

Claims (12)

  1. 一种浮动收益计算方法,其特征在于,包括:
    根据金融产品的浮动收益计算的开始日和结束日计算金融产品的从所述开始日至所述结束日的计息周期;
    获取所述金融产品在所述开始日前一日的本息余额以及在所述结束日的本息余额;
    根据所述金融产品在所述开始日前一日的本息余额以及在所述结束日的本息余额计算所述计息周期内的收益率,从而计算所述计息周期内的收益。
  2. 根据权利要求1所述的方法,其特征在于,所述获取所述金融产品在所述开始日前一日的本息余额以及在所述结束日的本息余额,包括:
    利用下式(1)计算在所述开始日前一日的本息余额以及在所述结束日的本息余额,
    b D=b D-1*(1+r D)  (1)
    其中,b D是第D日的本息余额,D∈[D x-1,D y],D x是开始日,D x-1是开始日前一日,D y是结束日,b D-1是第D-1日的本息余额,r D是所述金融产品在第D日的涨跌幅。
  3. 根据权利要求2所述的方法,其特征在于,所述根据所述金融产品在所述开始日前一日的本息余额以及在所述结束日的本息余额计算所述计息周期内的收益率,从而计算所述计息周期内的收益,包括:
    利用下式(2)计算所述计息周期内的收益率,
    Figure PCTCN2019092231-appb-100001
    其中,R x,y是所述金融产品在所述计息周期[D x,D y]内的收益率,
    Figure PCTCN2019092231-appb-100002
    是所述结束日D y的本息余额,
    Figure PCTCN2019092231-appb-100003
    是所述开始日前一日D x-1的本息余额。
  4. 根据权利要求3所述的方法,其特征在于,所述根据所述金融产品在所述开始日前一日的本息余额以及在所述结束日的本息余额计算所述计息周期内的收益率,从而计算所述计息周期内的收益,包括:
    通过用D-1日的本息余额b D-1乘以所述金融产品在所述计息周期[D x,D y]内的收益率R x,y计算所述计息周期内的收益。
  5. 根据权利要求2所述的方法,其特征在于,所述获取所述金融产品在所述开始日前一日的本息余额以及在所述结束日的本息余额,包括:
    对D日的本息余额b D进行持久化。
  6. 一种浮动收益计算装置,其特征在于,包括:
    第一计算模块,被配置为根据金融产品的浮动收益计算的开始日和结束日计算金融产品的从所述开始日至所述结束日的计息周期;
    获取模块,被配置为获取所述金融产品在所述开始日前一日的本息余额以及在所述结束日的本息余额;
    第二计算模块,被配置为根据所述金融产品在所述开始日前一日的本息余额以及在所述结束日的本息余额计算所述计息周期内的收益率,从而计算所述计息周期内的收益。
  7. 根据权利要求6所述的装置,其特征在于,所述获取模块被配置为:
    利用下式(1)计在所述开始日前一日的本息余额以及在所述结束日的本息余额,
    b D=b D-1*(1+r D)  (1)
    其中,b D是第D日的本息余额,D∈[D x-1,D y],D x是所述开始日,D x-1是所述开始日前一日,D y是所述结束日,b D-1是第D-1日的本息余额,r D是所述金融产品在第D日的涨跌幅。
  8. 根据权利要求7所述的装置,其特征在于,所述第二计算模块被配置为:
    利用下式(2)计算所述计息周期内的收益率,
    Figure PCTCN2019092231-appb-100004
    其中,R x,y是所述金融产品在所述计息周期[D x,D y]内的收益率,
    Figure PCTCN2019092231-appb-100005
    是所述结束日D y的本息余额,
    Figure PCTCN2019092231-appb-100006
    是所述开始日前一日D x-1的本息余额。
  9. 根据权利要求8所述的装置,其特征在于,所述第二计算模块被配置为:
    通过用D-1日的本息余额b D-1乘以所述金融产品在所述计息周期[D x,D y]内的收益率R x,y计算所述计息周期内的收益。
  10. 根据权利要求7所述的装置,其特征在于,所述获取模块被配置为:
    对D日的本息余额b D进行持久化。
  11. 一种电子设备,其特征在于,包括存储器和处理器;其中,所述存储器用于存储一条或多条计算机指令,其中,所述一条或多条计算机指令被所述处理器执行以实现如权利要求1-5任一项所述的方法。
  12. 一种计算机可读存储介质,其上存储有计算机指令,其特征在于,该计算机指令被处理器执行时实现如权利要求1-5任一项所述的方法。
PCT/CN2019/092231 2018-08-14 2019-06-21 浮动收益计算方法、装置、设备及计算机可读存储介质 Ceased WO2020034752A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201810927625.0 2018-08-14
CN201810927625.0A CN109308661A (zh) 2018-08-14 2018-08-14 浮动收益计算方法、装置、设备及计算机可读存储介质

Publications (1)

Publication Number Publication Date
WO2020034752A1 true WO2020034752A1 (zh) 2020-02-20

Family

ID=65223689

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/092231 Ceased WO2020034752A1 (zh) 2018-08-14 2019-06-21 浮动收益计算方法、装置、设备及计算机可读存储介质

Country Status (3)

Country Link
CN (1) CN109308661A (zh)
TW (1) TW202009846A (zh)
WO (1) WO2020034752A1 (zh)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109308661A (zh) * 2018-08-14 2019-02-05 阿里巴巴集团控股有限公司 浮动收益计算方法、装置、设备及计算机可读存储介质

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1264877A (zh) * 1999-12-07 2000-08-30 张植玉 计算利息元、角、分准确定位的简捷方法
US7801789B1 (en) * 2003-08-08 2010-09-21 Jpmorgan Chase Bank, N.A. Stabilized monte carlo technique and method and system of applying same to valuate assets including derivative securities
CN102243748A (zh) * 2011-08-04 2011-11-16 郁晓东 电子债务管理运营系统装置以及债权债务电子化金融商品化的实现方法
CN109308661A (zh) * 2018-08-14 2019-02-05 阿里巴巴集团控股有限公司 浮动收益计算方法、装置、设备及计算机可读存储介质

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1264877A (zh) * 1999-12-07 2000-08-30 张植玉 计算利息元、角、分准确定位的简捷方法
US7801789B1 (en) * 2003-08-08 2010-09-21 Jpmorgan Chase Bank, N.A. Stabilized monte carlo technique and method and system of applying same to valuate assets including derivative securities
CN102243748A (zh) * 2011-08-04 2011-11-16 郁晓东 电子债务管理运营系统装置以及债权债务电子化金融商品化的实现方法
CN109308661A (zh) * 2018-08-14 2019-02-05 阿里巴巴集团控股有限公司 浮动收益计算方法、装置、设备及计算机可读存储介质

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
COFOOL, 20 January 2016 (2016-01-20), Retrieved from the Internet <URL:http://licai.cofool.com/ask/qa_112549.html> *

Also Published As

Publication number Publication date
TW202009846A (zh) 2020-03-01
CN109308661A (zh) 2019-02-05

Similar Documents

Publication Publication Date Title
US11195023B2 (en) Feature generation pipeline for machine learning
US11288094B2 (en) Systems and methods for caching task execution
US20200104393A1 (en) Verifiable State Machines
CN110889754B (zh) 提高不可透支热点账户处理效率的方法
CN111427971B (zh) 用于计算机系统的业务建模方法、装置、系统和介质
US9600562B2 (en) Method and apparatus for asynchronized de-serialization of E-R model in a huge data trunk
US11704216B2 (en) Dynamically adjusting statistics collection time in a database management system
WO2020034752A1 (zh) 浮动收益计算方法、装置、设备及计算机可读存储介质
WO2019153483A1 (zh) 手续费确定方法、装置、终端设备及介质
CN111754329A (zh) 一种贷款利息结算方法、装置、电子设备和存储介质
CN111292186B (zh) 一种数据分析方法和数据分析装置
WO2025092447A1 (zh) 一种并行化策略优化方法、系统、设备及介质
US12499117B2 (en) Inline structured query language queries in a spreadsheet
US11941593B2 (en) Blockchain payment notification system
WO2019153489A1 (zh) 一种反洗钱模型的运算方法、存储介质、终端设备及装置
CN116342304A (zh) 一种数据处理方法、装置、电子设备、系统、介质及程序产品
JP5987024B2 (ja) 情報処理方法、情報処理装置、及び、プログラム
CN115237891A (zh) 数据源配置方法、装置、设备、介质和程序产品
CN111797616A (zh) 基于tf-idf词向量的银行名称批量校正方法及系统
US20200302550A1 (en) Cost allocation estimation using direct cost vectors and machine learning
US20250363064A1 (en) Updating a write-done pointer in a first-in-first-out queue on a parallelized device
CN110378609B (zh) 业务处理方法、业务处理装置、电子设备和介质
CN113129128A (zh) 用户贷款收益流数据生成方法、系统、电子设备及介质
US20220012663A1 (en) Hierarchical optimization for processing objectives sequentially and/or iteratively
CN115496363A (zh) 预算控制方法、装置、计算机设备和存储介质

Legal Events

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

Ref document number: 19849119

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19849119

Country of ref document: EP

Kind code of ref document: A1