CN109242682A - Monetary exchange rate conversion method, device, computer equipment and storage medium - Google Patents

Monetary exchange rate conversion method, device, computer equipment and storage medium Download PDF

Info

Publication number
CN109242682A
CN109242682A CN201810965512.XA CN201810965512A CN109242682A CN 109242682 A CN109242682 A CN 109242682A CN 201810965512 A CN201810965512 A CN 201810965512A CN 109242682 A CN109242682 A CN 109242682A
Authority
CN
China
Prior art keywords
time
data
value
field
time interval
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.)
Granted
Application number
CN201810965512.XA
Other languages
Chinese (zh)
Other versions
CN109242682B (en
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.)
Ping An Property and Casualty Insurance Company of China Ltd
Original Assignee
Ping An Property and Casualty Insurance Company of China 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 Ping An Property and Casualty Insurance Company of China Ltd filed Critical Ping An Property and Casualty Insurance Company of China Ltd
Priority to CN201810965512.XA priority Critical patent/CN109242682B/en
Publication of CN109242682A publication Critical patent/CN109242682A/en
Application granted granted Critical
Publication of CN109242682B publication Critical patent/CN109242682B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR 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/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange

Landscapes

  • Business, Economics & Management (AREA)
  • Accounting & Taxation (AREA)
  • Finance (AREA)
  • Engineering & Computer Science (AREA)
  • Development Economics (AREA)
  • Economics (AREA)
  • Marketing (AREA)
  • Strategic Management (AREA)
  • Technology Law (AREA)
  • Physics & Mathematics (AREA)
  • General Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The embodiment of the present application provides a kind of monetary exchange rate conversion method, device, computer equipment and storage medium.The described method includes: the embodiment of the present application passes through regular time corresponding to a plurality of data in analysis statistics table on exchange rates;Time interval field in table on exchange rates is revised as time field;If receiving conversion instruction, according to regular time, the conversion time for including in conversion instruction is converted to and the value of time field matched match time;The exchange rate is searched in table on exchange rates according to match time;Target value data is calculated further according to the exchange rate.Without carrying out non-equivalence judgement when the embodiment of the present application searches the exchange rate according to match time, the efficiency of the efficiency that the exchange rate is inquired in Hive data warehouse and conversion currency is so improved, while improving the experience of user.

Description

Monetary exchange rate conversion method, device, computer equipment and storage medium
Technical field
This application involves technical field of data processing more particularly to a kind of monetary exchange rate conversion method, device, computer to set Standby and storage medium.
Background technique
The exchange rate between different currency types is stored in table on exchange rates.As preserved former currency type, target goods in table on exchange rates The fields such as coin type, time interval, the exchange rate (exchange rate of the original currency type and target currency type in the time interval).Such as The data saved in table on exchange rates are as follows: Hongkong dollar, RMB, 2018.5-2018.6,0.8234, expression is arrived in 2018.5 months During 2018.6 months, the exchange rate between Hongkong dollar and RMB is 0.8234.When to inquire 2018.5 month Hongkong dollar and RMB The exchange rate, then needing to judge time=2018.5, if in some section in table on exchange rates, such as need to every in table on exchange rates A time interval is judged, such as judges 2018.5≤time≤2018.6, so to relate to the non-equivalence in tables of data The judgement of (be greater than, be less than).Table on exchange rates was stored in oracle database in the past, carries out differing in oracle database There is not obvious problem in value judgement.But data warehouse nowadays is used under big data environment, such as Hive data bins Library tool.Under Hive Tool for Data Warehouse, if there is a plurality of data to need to inquire the exchange rate, i.e., a plurality of data will carry out non-equivalence When judgement, performance is excessively poor, needs to occupy a large amount of system resource, greatly reduces the efficiency and switch target currency type of inquiry Efficiency.
Summary of the invention
The embodiment of the present application provides a kind of monetary exchange rate conversion method, device, computer equipment and storage medium, can be improved The efficiency of exchange rate inquiry and monetary exchange rate conversion.
In a first aspect, the embodiment of the present application provides a kind of monetary exchange rate conversion method, this method comprises:
A plurality of data in table on exchange rates are obtained, the time interval field that analysis counts in a plurality of data is described more to obtain The regular time of data;Obtain the first time in the table on exchange rates in time interval field corresponding to every data;It will Time interval field is revised as time field, using the first time in every data as time field described in the data Value;If receiving conversion instruction, data to be converted are obtained, the data to be converted include original amount data, original amount Former currency type, target currency type, conversion time corresponding to data;According to the regular time, by the conversion time It is converted to and the first time matched match time;According to the match time, the former currency type, the target goods Coin type is inquired in the table on exchange rates, and to obtain under the match time, the original currency type is relative to the mesh Mark exchange rate value corresponding to currency type;According to the exchange rate value, conversion calculating is carried out to the original amount data, to obtain Target value data.
Second aspect, the embodiment of the present application provide a kind of monetary exchange rate conversion equipment, which includes for executing State the corresponding unit of method described in first aspect.
The third aspect, the embodiment of the present application provide a kind of computer equipment, and the computer equipment includes memory, with And the processor being connected with the memory;
The memory is for storing computer program, and the processor is for running the calculating stored in the memory Machine program, to execute method described in above-mentioned first aspect.
Fourth aspect, the embodiment of the present application provide a kind of storage medium, and the storage medium is stored with computer program, When the computer program is executed by processor, method described in above-mentioned first aspect is realized.
The embodiment of the present application passes through regular time corresponding to a plurality of data in analysis statistics table on exchange rates;It will be in table on exchange rates Time interval field is revised as time field;If receiving conversion instruction, according to regular time, turn include in conversion instruction Changing the time is converted to and the value of time field matched match time;The exchange rate is searched in table on exchange rates according to match time;Root again Target value data is calculated according to the exchange rate.Without carrying out non-equivalence judgement when the embodiment of the present application searches the exchange rate according to match time, The efficiency of exchange rate inquiry and the efficiency of currency conversion are so improved, while improving the experience of user.
Detailed description of the invention
Technical solution in ord to more clearly illustrate embodiments of the present application, below will be to needed in embodiment description Attached drawing is briefly described, it should be apparent that, the accompanying drawings in the following description is some embodiments of the present application, general for this field For logical technical staff, without creative efforts, it is also possible to obtain other drawings based on these drawings.
Fig. 1 is the flow diagram of monetary exchange rate conversion method provided by the embodiments of the present application;
Fig. 2 is the sub-process schematic diagram of monetary exchange rate conversion method provided by the embodiments of the present application;
Fig. 3 is the sub-process schematic diagram of monetary exchange rate conversion method provided by the embodiments of the present application;
Fig. 4 is the schematic block diagram of monetary exchange rate conversion equipment provided by the embodiments of the present application;
Fig. 5 is the schematic block diagram of analysis statistic unit provided by the embodiments of the present application;
Fig. 6 is the schematic block diagram for the analysis statistic unit that another embodiment of the application provides;
Fig. 7 is a kind of schematic block diagram of computer equipment provided by the embodiments of the present application.
Specific embodiment
Below in conjunction with the attached drawing in the embodiment of the present application, technical solutions in the embodiments of the present application carries out clear, complete Site preparation description, it is clear that described embodiment is some embodiments of the present application, instead of all the embodiments.Based on this Shen Please in embodiment, every other implementation obtained by those of ordinary skill in the art without making creative efforts Example, shall fall in the protection scope of this application.
Fig. 1 is the flow diagram of monetary exchange rate conversion method provided by the embodiments of the present application.As shown in Figure 1, this method Including S101-S107.
S101, obtains a plurality of data in table on exchange rates, and analysis counts the time interval field in a plurality of data to obtain Regular time corresponding to a plurality of data.
The exchange rate between different currency types is preserved in table on exchange rates, such as preserves former currency type, target currency type, time The exchange rate between section and former currency type and target currency type.There are very more data in table on exchange rates.Obtain table on exchange rates In the purposes of a plurality of data be the rule in time interval field corresponding to a plurality of data in order to obtain, i.e. update table on exchange rates Rule, it is therefore desirable to obtain a plurality of data that corresponding time interval field is different value.Specifically, it obtains in table on exchange rates A plurality of data can be and obtain the same former currency type in table on exchange rates, a plurality of data corresponding to same target currency type. Wherein, a plurality of data of acquisition can be the same original currency type in table on exchange rates, institute corresponding to same target currency type There is the total data in data, is also possible to partial data.In order to enable the regular time that analysis statistics obtains is more acurrate, therefore If obtain the partial data in all data corresponding to the same former currency type, same target currency type, need to make The partial data that must be obtained reaches the whole in all data corresponding to the same former currency type, same target currency type The preset ratio of data, such as preset ratio are 5%.After obtaining a plurality of data, analysis counts the time zone in a plurality of data Between field to obtain regular time corresponding to a plurality of data.It should be noted that the time interval in a plurality of data There are regular time, the i.e. updates of table on exchange rates certain rule for field, is that technical scheme can solve technology and ask The precondition of topic.
In one embodiment, as shown in Fig. 2, step S101 includes the following steps S201-S202.
S201 obtains a plurality of data in table on exchange rates, the value of the time interval field in a plurality of data is input to pre- First in trained analysis statistical model.
S202, according to the analysis statistical model, analysis counts the time interval field in a plurality of data to obtain Regular time corresponding to a plurality of data.
Wherein, analysis statistical model can be any deep learning model.With the time number for being already provided with temporal regularity According to training the deep learning model.Such as 2018.11.1-2018.11.30;2017.12.1-2017.12.31;2018.1.1- 2018.1.31;2018.2.1-2018.2.28;2018.3.1-2018.3.31;2018.4.1-2018.4.30;... etc. data Between temporal regularity be one month;Such as 2017.11-2017.12;2017.12-2018.1;2018.1-2018.2;2018.2- 2018.3;... etc. temporal regularity between data be also one month;Such as 2017.11.1-2017.11.7;2017.11.8- 2017.11.14;2017.11.15-2017.11.21;2017.11.22-2017.11.28;2017.11.29- 2017.12.3;... etc. temporal regularity between data be a week.The data are only illustrated, in actual training process In, there are more different training datas.Again with trained deep learning model come for the time interval in a plurality of data The value of field analyzes and counts, to obtain regular time corresponding to the time interval field in a plurality of data, such as the rule Restraining the time is one month.The embodiment obtains regular time using analysis statistical model, so that the regular time obtained is more Accurately.
In one embodiment, as shown in figure 3, step S101 includes the following steps S301-S303.
S301 obtains a plurality of data in table on exchange rates, by former and later two in the time interval field in a plurality of data Time is subtracted each other, and is taken absolute value, to obtain multiple absolute values.Wherein, the absolute value include value corresponding to absolute value with And chronomere corresponding to absolute value.
S302 judges whether the absolute value is equal.It should be noted that not only needing to judge value corresponding to absolute value It is whether equal, it is also necessary to judge whether chronomere corresponding to absolute value is equal.If the absolute value is unequal, terminate;If The absolute value is equal, executes step S303.
S303, using the time corresponding to the absolute value as regular time.Wherein, regular time may include regular time Chronomere corresponding to corresponding value and regular time.
Wherein, judge whether the absolute value is equal, be to judge whether the update in the table on exchange rates is regular.If this is absolutely It is equal to being worth, then mean that the update of table on exchange rates is regular;If the absolute value is unequal, mean the update of table on exchange rates It is governed without rule.The regular update of table on exchange rates is premise item that technical scheme can solve technical problem Part.The embodiment is subtracted each other by former and later two times, is taken absolute value, and to obtain regular time, which obtains rule Time is simpler, fast.
In one embodiment, when the step S301 includes: corresponding to every data in the acquisition a plurality of data Between first time and the second time in interval field;By first time corresponding to every data in a plurality of data and Second time was subtracted each other, and was taken absolute value, to obtain multiple absolute values.
The value as corresponding to a plurality of data time interval field is respectively 2017.11-2017.12;2017.12-2018.1; 2018.1-2018.2;2018.2-2018.3;... etc..By first time (one time of front) in time interval field As at the first time, it regard second time (latter one time) in time interval field as the second time, such as 2017.11-2017.12 being at the first time 2017.11, the second time was 2017.12 months.Will at the first time and the second time into Row subtracts each other, and removes absolute value, i.e., | 2017.12-2017.11 |;|2018.1-2017.12|;|2018.2-2018.1|;|2018.3- 2018.2|;... obtaining value corresponding to absolute value is 1.Take in time interval field at the first time, it is the smallest in the second time Chronomere, the part the smallest chronomere is as chronomere corresponding to absolute value, the time as corresponding to the absolute value Unit is the moon.It is to be understood that the table on exchange rates of a update in month.It in other embodiments, can also will be in time interval field The latter one time as at the first time, before a time as the second time.
The value as corresponding to a plurality of data time interval field is respectively 2018.1.1-2018.1.5;2018.1.6- 2018.1.10;2018.1.11-2018.1.15;2018.1.16-2018.1.20, then when by the first of time interval field Between and the second time subtracted each other, take absolute value, i.e., | 2018.1.5-2018.1.1 |;|2018.1.10-2018.1.6|;| 2018.1.15-2018.1.11|;| 2018.1.20-2018.1.16 |, obtain 4 absolute values, value corresponding to 4 absolute values It is all 4.The smallest chronomere in first time, the second time in acquisition time interval field, the smallest time is single Position is as chronomere corresponding to absolute value.The smallest chronomere is in former and later two times in time interval field It/day.It is to be understood that updating table on exchange rates of a table on exchange rates or the update of every 5 day/day every 4 days/day.Carry out When former and later two times in " time interval " field are subtracted each other, function can use to realize.
In one embodiment, if a plurality of data are continuous a plurality of data, i.e., the described a plurality of data are the same originals Continuous a plurality of data in all data corresponding to currency type, same target currency type, the step S301 include: The first time of time interval field corresponding to latter data in the continuous a plurality of data of acquisition and adjacent previous item number According to the first time of corresponding time interval field;By the first time of time interval field corresponding to latter data and The first time of time interval field corresponding to adjacent previous data is subtracted each other, and is taken absolute value, multiple exhausted to obtain To value.
The value as corresponding to a plurality of data time interval field is respectively 2018.1.1-2018.1.5;2018.1.6- 2018.1.10;2018.1.11-2018.1.15;2018.1.16-2018.1.20 then the time corresponding to latter data The first time of time interval field corresponding to the first time of interval field and adjacent previous data is subtracted each other, and is taken Absolute value, i.e., | 2018.1.6-2018.1.1 |;|2018.1.11-2018.1.6|;|2018.1.16-2018.1.11|;Obtain 3 A absolute value, value corresponding to 3 absolute values is all 5.Obtain the smallest time in the first time in " time interval " field Unit, using the smallest chronomere as chronomere corresponding to absolute value.Chronomere corresponding to first time is It/day, corresponding, chronomere corresponding to absolute value is day/day, i.e., updates a table on exchange rates or every 5 every 4 days/day It/day update a table on exchange rates.If value corresponding to continuous 4 row time interval field is respectively as follows: 2018.1- in table on exchange rates 2018.2;2018.2-2018.3;2018.3-2018.4;208.4-2018.5 then corresponding, in continuous a plurality of data after The first time of " time interval " field corresponding to one data and " time interval " field corresponding to previous data Subtracted each other at the first time, then after taking absolute value, corresponding absolute value is 1.First in " time interval " field is obtained again The smallest chronomere is the moon in time, corresponding, and chronomere corresponding to absolute value is the moon, i.e., updates within one month primary converge Rate table.
S102 obtains the first time in the table on exchange rates in time interval field corresponding to every data.
Such as can be using the time before in time interval field as at the first time, the time as corresponding to 4 datas Value corresponding to interval field is respectively as follows: 2018.1.1-2018.1.5;2018.1.6-2018.1.10;2018.1.11- 2018.1.15;2018.1.16-2018.1.20, it is right to obtain the institute of " time interval " field corresponding to each row of data in table on exchange rates The first time that should be worth, if the value after obtaining is respectively 2018.1.1;2018.1.6;2018.1.11;2018.1.16.At other It, can also be using the latter one time in time interval field as at the first time in embodiment.
Time interval field is revised as time field by S103, using the first time in every data as the data Described in time field value.
Time interval field is specifically revised as time field by the value that the step has implemented in modification table on exchange rates, The first time value of time field in every data being revised as in the data.Specifically modification mode can pass through tune It is modified with default script, if data volume is less can also to pass through manual amendment etc..Wherein, default script includes SQL foot This.Preferably by default script is executed to modify, on the one hand prevents from malfunctioning, on the other hand, accelerate the speed of modification.
In one embodiment, if step S103 includes: to receive modification instruction, default script, the default script are called For time interval field will to be revised as to time field, when using the first time in every data as described in the data Between field value;The default script is executed, specifically, the default foot is executed in the database where the table on exchange rates This.Wherein, modification refers to the instruction of modification table on exchange rates.Default script includes SQL script, wherein SQL script can be preset It saves.SQL script can be to be write to obtain by user according to actual needs, is also possible to the field and selection selected according to user Grammer etc. automatically generate.SQL script includes modification sentence, query statement, assignment statement, and it is alter that it is corresponding, which to modify sentence, Table grammer, such as alter table rate rename column timeZones to time, wherein rate is the exchange rate Table name, timeZones are time interval field name, and time is time field name.Using the first time in every data as this The value of time field described in data, is assignment statement, and assignment statement can be with grammers such as update...set.Specifically Ground will converge such as update rate set time=2018.1.16where timeZones=2018.1.16-2018.1.20 2018.1.16-2018.1.20 value in rate table rate is changed to 2018.1.16.
Table on exchange rates is modified in above step S101-S103 realization, and the time interval field in table on exchange rates is modified For time field, and using the first time in former time interval field as value corresponding to time field.So looked into When inquiry, when according to the corresponding exchange rate of query time inquiry, it is not necessary to by multiple time intervals in the query time and table on exchange rates Data corresponding to field carry out non-equivalence calculating.
S104 obtains data to be converted if receiving conversion instruction, and the data to be converted include original amount number According to former currency type, target currency type, conversion time corresponding to, original amount data.
If detecting the similar push-botton operations such as click " conversion ", i.e. generation conversion instruction receives the conversion instruction.If connecing Conversion instruction is received, data to be converted are obtained.The data to be converted can be to be uploaded in system in the form of a file, corresponding , obtaining data to be converted is the data obtained in this document.Corresponding number to be converted can also be inputted in corresponding interface According to.The data to be converted can have a plurality of, can also there is one.Every data includes original amount data, original amount number According to corresponding former currency type, target currency type, the conversion time that need to convert.It is right that conversion time is interpreted as generation business institute The specific time answered.
The conversion time is converted to value matched with the time field according to the regular time by S105 With the time.
According to the value of regular time and time field, conversion time is converted into match time.Match time after conversion It is some the corresponding value of time field that can be inquired in table on exchange rates.It can be inquired in table on exchange rates according to match time A data corresponding to the match time, therefore it is not related to inequality inquiry when inquiry, and directly it is equation inquiry, it accelerates The efficiency of inquiry.
Specifically, step S105 includes: the value for obtaining a time field in the table on exchange rates;According to the time of acquisition The value and regular time of field are converted to the conversion time and the first time matched match time.
Wherein, the value of the time field of acquisition can be corresponding to a time field of recent renewal in table on exchange rates Value, such as 2018.3.If conversion time is 2018.1.20, the value of the time field of acquisition is 2018.3, corresponding to regular time Value be 1, chronomere corresponding to regular time is the moon.Judge chronomere corresponding to regular time and conversion time institute Whether corresponding chronomere is identical;If not identical, conversion time is converted to and chronomere's phase corresponding to regular time The same time, if the chronomere of conversion time 2018.1.20 is day/day, and chronomere corresponding to regular time is the moon, Conversion time is so converted into the time identical with chronomere corresponding to regular time, i.e. 2018.1.20 is converted to 2018.1;The conversion time after chronomere will be converted as match time;If chronomere corresponding to regular time with Chronomere corresponding to conversion time is identical, and it is attached to find conversion time according to the value of regular time and the time field of acquisition It is close with acquisition time field value matched two time, if the conversion time is 2018.1.20 days, the time word of acquisition The value of section is 2018.3.1, and value corresponding to regular time is 6 (regular time is the first time and the of time interval field Two times were subtracted each other and took absolute value to obtain, and indicated that each week updates a table on exchange rates), the time included by regular time Unit be day/day, then according to the value of regular time and the time field of acquisition obtain near conversion time with acquisition when Between field value matched two time, i.e., respectively 2018.1.18 and 2018.1.25;Whether judge matched two time It is identical as conversion time;If they are the same, then using one of them identical time as match time;If not identical, by matched two In a time with the current time interval farther away time as match time, i.e., match time is 2018.1.18 days.It can manage Xie Di is the time saved in table on exchange rates with matched match time at the first time, i.e., is existed according to the match time It is inquired in table on exchange rates, result can be inquired.
S106, according to the match time, the former currency type, the target currency type in the table on exchange rates into Row inquiry, to obtain under the match time, the original currency type is relative to the exchange rate corresponding to the target currency type Value.
The original currency type is relative to exchange rate value corresponding to the target currency type, including two kinds of situations: former goods Exchange rate value or target currency type exchange rate value relative to former currency type of the coin type relative to target currency type. So corresponding, the data stored in table on exchange rates also include both of these case.
S107 carries out conversion calculating to the original amount data according to the exchange rate value, to obtain target amount of money number According to.
It is m as inquired obtained former currency type relative to the exchange rate value of target currency type, original amount data are A, So target value data is A/m.It is n as inquired obtained target currency type relative to the exchange rate value of former currency type, it is former Beginning value data is B, then target value data is B*n.
Above step S104-S107 inquires the exchange rate according to data to be converted in table on exchange rates, and then basis checks out The exchange rate converts data to be converted, obtains target value data.Wherein, the conversion time in data to be converted is converted For match time, since match time is the time saved in table on exchange rates, when being inquired in table on exchange rates, It can be inquired according to equation judgement.In this way, avoiding more in conversion time and table on exchange rates corresponding to data to be converted Data corresponding to a time interval field carry out non-equivalence and calculate to be inquired.The efficiency of exchange rate inquiry is substantially increased, The time for having saved switch target value data improves the efficiency of switch target value data.
Fig. 4 is the schematic block diagram of monetary exchange rate conversion equipment provided by the embodiments of the present application.The device includes for holding Unit corresponding to the above-mentioned monetary exchange rate conversion method of row.As shown in figure 4, the device 40 includes analysis statistic unit 401, time Acquiring unit 402, modification unit 403, change data acquiring unit 404, matching converting unit 405, query unit 406, the amount of money Converting unit 407.
Statistic unit 401 is analyzed, for obtaining a plurality of data in table on exchange rates, analysis counts the time in a plurality of data Interval field is to obtain regular time corresponding to a plurality of data.
In one embodiment, as shown in figure 5, analysis statistic unit 401 includes obtaining the 501, first rule of input unit really Order member 502.Wherein, obtain input unit 501, for obtaining a plurality of data in table on exchange rates, by a plurality of data when Between the value of interval field be input in preparatory trained analysis statistical model.First regular determination unit 502, for according to institute Analysis statistical model is stated, analyzes and count the time interval field in a plurality of data to obtain corresponding to a plurality of data Regular time.
In one embodiment, as shown in fig. 6, analysis statistic unit 401 includes absolute value calculation unit 601, equal judgement The regular determination unit 603 of unit 602, second.Wherein, absolute value calculation unit 601, for obtaining a plurality of data in table on exchange rates, Former and later two times in time interval field in a plurality of data are subtracted each other, are taken absolute value, it is multiple exhausted to obtain To value.Equal judging unit 602, for judging whether the absolute value is equal.Second regular determination unit 603, if being used for institute State that absolute value is equal, using the time corresponding to the absolute value as regular time.
In one embodiment, absolute value calculation unit 601 includes: first time section acquiring unit, the first absolute value meter Calculate unit.Wherein, first time acquiring unit, for obtaining time interval corresponding to every data in a plurality of data First time and the second time in field.First absolute value calculation unit, for by every data in a plurality of data Corresponding first time and the second time is subtracted each other, and is taken absolute value, to obtain multiple absolute values.
In one embodiment, absolute value calculation unit 601 includes: the second time acquisition unit, the second absolute value calculating list Member.Wherein, the second time acquisition unit, for obtaining time interval word corresponding to the latter data in continuous a plurality of data The first time of time interval field corresponding to the first time of section and adjacent previous data.Second absolute value calculates single Member, when for by corresponding to the first time of time interval field corresponding to latter data and adjacent previous data Between first time of interval field subtracted each other, take absolute value, to obtain multiple absolute values.
Time acquisition unit 402, for obtaining in the table on exchange rates in time interval field corresponding to every data At the first time.
Unit 403 is modified, for time interval field to be revised as time field, the first time in every data is made For the value of time field described in the data.
In one embodiment, modification unit 403 includes script acquiring unit, script executing unit.Wherein, script obtains single Member, if calling default script for receiving modification instruction, the default script is used to time interval field being revised as the time Field, using the first time in every data as the value of time field described in the data.Script executing unit, for holding The row default script.Wherein, default script includes SQL script, and SQL script can preset preservation.
Change data acquiring unit 404, if obtaining data to be converted, the number to be converted for receiving conversion instruction According to including original amount data, former currency type, target currency type, conversion time corresponding to original amount data.
Converting unit 405 is matched, is used for according to the regular time, when the conversion time is converted to described first Between matched match time.
In one embodiment, converting unit 405 is matched, comprising: time value acquiring unit, match time converting unit.Its In, time value acquiring unit, for obtaining the value of a time field in the table on exchange rates.Match time converting unit is used In value and regular time according to the time field of acquisition, the conversion time is converted to and the first time matched With the time.
Query unit 406 is used for according to the match time, the former currency type, the target currency type in institute It states in table on exchange rates and is inquired, to obtain under the match time, the original currency type is relative to the target currency type Corresponding exchange rate value.
Amount of money converting unit 407 carries out conversion calculating to the original amount data, to obtain according to the exchange rate value Target value data.
It should be noted that it is apparent to those skilled in the art that, the tool of above-mentioned apparatus and each unit Body realizes process, can be no longer superfluous herein with reference to the corresponding description in preceding method embodiment, for convenience of description and succinctly It states.
Above-mentioned apparatus can be implemented as a kind of form of computer program, and computer program can be in meter as shown in Figure 7 It calculates and is run on machine equipment.
Fig. 7 is a kind of schematic block diagram of computer equipment provided by the embodiments of the present application.The equipment 70 includes passing through to be Processor 702, memory and the network interface 703 that bus 701 of uniting connects, wherein memory may include non-volatile memories Medium 704 and built-in storage 705.
The non-volatile memory medium 704 can storage program area 7041 and computer program 7042.This is non-volatile to deposit , it can be achieved that monetary exchange rate described above is converted when the computer program 7042 stored in storage media is executed by processor 702 Method.The processor 702 supports the operation of whole equipment 70 for providing calculating and control ability.The built-in storage 705 is non- The operation of computer program in volatile storage medium provides environment can make when the computer program is executed by processor 702 It obtains processor 702 and executes monetary exchange rate conversion method described above.The network interface 703 is for carrying out network communication.Ability Field technique personnel are appreciated that structure shown in Fig. 7, only the block diagram of part-structure relevant to application scheme, and The restriction for the equipment 70 being applied thereon to application scheme is not constituted, specific equipment 70 may include than as shown in the figure more More or less component perhaps combines certain components or with different component layouts.
Wherein, the processor 702 is for running computer program stored in memory, to realize following steps:
A plurality of data in table on exchange rates are obtained, the time interval field that analysis counts in a plurality of data is described more to obtain The regular time of data;Obtain the first time in the table on exchange rates in time interval field corresponding to every data;It will Time interval field is revised as time field, using the first time in every data as time field described in the data Value;If receiving conversion instruction, data to be converted are obtained, the data to be converted include original amount data, original amount Former currency type, target currency type, conversion time corresponding to data;According to the regular time, by the conversion time It is converted to and the first time matched match time;According to the match time, the former currency type, the target goods Coin type is inquired in the table on exchange rates, and to obtain under the match time, the original currency type is relative to the mesh Mark exchange rate value corresponding to currency type;According to the exchange rate value, conversion calculating is carried out to the original amount data, to obtain Target value data.
In one embodiment, the processor 702 a plurality of data in executing the acquisition table on exchange rates, are analyzed described in statistics It is specific to execute when time interval field in a plurality of data is to obtain the regular time of a plurality of data:
A plurality of data in table on exchange rates are obtained, the value of the time interval field in a plurality of data is input to preparatory training In good analysis statistical model;According to the analysis statistical model, analysis counts the time interval field in a plurality of data To obtain the regular time of a plurality of data.
In one embodiment, the processor 702 a plurality of data in executing the acquisition table on exchange rates, are analyzed described in statistics It is specific to execute when time interval field in a plurality of data is to obtain the regular time of a plurality of data:
Obtain table on exchange rates in a plurality of data, by former and later two times in the time interval field in a plurality of data into Row subtracts each other, and takes absolute value, to obtain multiple absolute values;Judge whether the absolute value is equal;If the absolute value is equal, by institute The time corresponding to absolute value is stated as regular time.
In one embodiment, the processor 702 is in executing the time interval field by a plurality of data Former and later two times subtracted each other, take absolute value, it is specific to execute to obtain multiple absolute values:
When obtaining first time in time interval field corresponding to every data in a plurality of data and second Between;First time corresponding to every data in a plurality of data and the second time are subtracted each other, taken absolute value, with To multiple absolute values.
In one embodiment, the processor 702 is described in the execution time by a plurality of data in execution Former and later two times in interval field are subtracted each other, and are taken absolute value, specific to execute when obtaining multiple absolute values:
Obtain first time of time interval field corresponding to the latter data in continuous a plurality of data and adjacent The first time of time interval field corresponding to previous data;By of time interval field corresponding to latter data The first time of time interval field corresponding to one time and adjacent previous data is subtracted each other, and is taken absolute value, with To multiple absolute values.
In one embodiment, the processor 702 execute it is described time interval field is revised as time field, will be every First time in data is specific to execute as described in the data when value of time field:
If receiving modification instruction, default script is called, time interval field for when being revised as by the default script Between field, using the first time in every data as the value of time field described in the data;Execute the default script.
In one embodiment, the processor 702 is described according to the regular time in execution, and the conversion time is turned It is specific to execute when being changed to match time matched with the first time:
Obtain the value of a time field in the table on exchange rates;According to the value and regular time of the time field of acquisition, The conversion time is converted to and the first time matched match time.
It should be appreciated that in the embodiment of the present application, alleged processor 702 can be central processing unit (Central Processing Unit, CPU), which can also be other general processors, digital signal processor (Digital Signal Processor, DSP), specific integrated circuit (application program lication Specific Integrated Circuit, ASIC), ready-made programmable gate array (Field-Programmable Gate Array, FPGA) or other can Programmed logic device, discrete gate or transistor logic, discrete hardware components etc..General processor can be microprocessor Or the processor is also possible to any conventional processor etc..
A kind of storage medium is provided in another embodiment of the application, the storage medium is stored with computer journey Sequence, the computer program perform the steps of when being executed by a processor
A plurality of data in table on exchange rates are obtained, the time interval field that analysis counts in a plurality of data is described more to obtain The regular time of data;Obtain the first time in the table on exchange rates in time interval field corresponding to every data;It will Time interval field is revised as time field, using the first time in every data as time field described in the data Value;If receiving conversion instruction, data to be converted are obtained, the data to be converted include original amount data, original amount Former currency type, target currency type, conversion time corresponding to data;According to the regular time, by the conversion time It is converted to and the first time matched match time;According to the match time, the former currency type, the target goods Coin type is inquired in the table on exchange rates, and to obtain under the match time, the original currency type is relative to the mesh Mark exchange rate value corresponding to currency type;According to the exchange rate value, conversion calculating is carried out to the original amount data, to obtain Target value data.
In one embodiment, the processor a plurality of data in executing the acquisition table on exchange rates, analysis statistics are described more When time interval field in data is to obtain the regular time of a plurality of data, specific implementation:
A plurality of data in table on exchange rates are obtained, the value of the time interval field in a plurality of data is input to preparatory training In good analysis statistical model;According to the analysis statistical model, analysis counts the time interval field in a plurality of data To obtain the regular time of a plurality of data.
In one embodiment, the processor a plurality of data in executing the acquisition table on exchange rates, analysis statistics are described more When time interval field in data is to obtain the regular time of a plurality of data, specific implementation:
Obtain table on exchange rates in a plurality of data, by former and later two times in the time interval field in a plurality of data into Row subtracts each other, and takes absolute value, to obtain multiple absolute values;Judge whether the absolute value is equal;If the absolute value is equal, by institute The time corresponding to absolute value is stated as regular time.
In one embodiment, the processor is before executing in the time interval field by a plurality of data Latter two time is subtracted each other, and is taken absolute value, when obtaining multiple absolute values, specific implementation:
When obtaining first time in time interval field corresponding to every data in a plurality of data and second Between;First time corresponding to every data in a plurality of data and the second time are subtracted each other, taken absolute value, with To multiple absolute values.
In one embodiment, the processor is before executing in the time interval field by a plurality of data Latter two time is subtracted each other, and is taken absolute value, when obtaining multiple absolute values, specific implementation:
Obtain first time of time interval field corresponding to the latter data in continuous a plurality of data and adjacent The first time of time interval field corresponding to previous data;By of time interval field corresponding to latter data The first time of time interval field corresponding to one time and adjacent previous data is subtracted each other, and is taken absolute value, with To multiple absolute values.
In one embodiment, the processor execute it is described time interval field is revised as time field, by every First time in data as described in the data when value of time field, specific implementation:
If receiving modification instruction, default script is called, time interval field for when being revised as by the default script Between field, using the first time in every data as the value of time field described in the data;Execute the default script.
In one embodiment, the processor is described according to the regular time in execution, and the conversion time is converted When for match time matched with the first time, specific implementation:
Obtain the value of a time field in the table on exchange rates;According to the value and regular time of the time field of acquisition, The conversion time is converted to and the first time matched match time.The storage medium includes computer-readable deposits Storage media, the storage medium can be the internal storage unit of terminal described in aforementioned any embodiment, such as terminal is hard Disk or memory.The storage medium is also possible to the grafting being equipped on the External memory equipment of the terminal, such as the terminal Formula hard disk, intelligent memory card (Smart Media Card, SMC), secure digital (Secure Digital, SD) card etc..Into one Step ground, the storage medium can also both including the terminal internal storage unit and also including External memory equipment.
In several embodiments provided herein, it should be understood that disclosed device, device and method, it can be with It realizes by another way.For example, the apparatus embodiments described above are merely exemplary, the division of the unit, Only a kind of logical function partition, there may be another division manner in actual implementation.Those skilled in the art can be with It is well understood, for convenience of description and succinctly, the specific work process of the device of foregoing description, equipment and unit can With with reference to the corresponding process in preceding method embodiment, details are not described herein.The above, the only specific embodiment party of the application Formula, but the protection scope of the application is not limited thereto, and anyone skilled in the art discloses in the application In technical scope, various equivalent modifications or substitutions can be readily occurred in, these modifications or substitutions should all cover the guarantor in the application Within the scope of shield.Therefore, the protection scope of the application should be subject to the protection scope in claims.

Claims (10)

1. a kind of monetary exchange rate conversion method, which is characterized in that the described method includes:
A plurality of data in table on exchange rates are obtained, analysis counts the time interval field in a plurality of data to obtain a plurality of number According to regular time;
Obtain the first time in the table on exchange rates in time interval field corresponding to every data;
Time interval field is revised as time field, using the first time in every data as the time described in the data The value of field;
If receiving conversion instruction, data to be converted are obtained, the data to be converted include original amount data, original amount Former currency type, target currency type, conversion time corresponding to data;
According to the regular time, the conversion time is converted to and the first time matched match time;
It is inquired in the table on exchange rates according to the match time, the former currency type, the target currency type, with It obtains under the match time, the original currency type is relative to exchange rate value corresponding to the target currency type;
According to the exchange rate value, conversion calculating is carried out to the original amount data, to obtain target value data.
2. the method according to claim 1, wherein a plurality of data in the acquisition table on exchange rates, analysis statistics institute The time interval field in a plurality of data is stated to obtain the regular time of a plurality of data, comprising:
A plurality of data in table on exchange rates are obtained, the value of the time interval field in a plurality of data are input to trained in advance It analyzes in statistical model;
According to the analysis statistical model, analysis counts the time interval field in a plurality of data to obtain a plurality of number According to regular time.
3. the method according to claim 1, wherein a plurality of data in the acquisition table on exchange rates, analysis statistics institute The time interval field in a plurality of data is stated to obtain the regular time of a plurality of data, comprising:
A plurality of data in table on exchange rates are obtained, former and later two times in the time interval field in a plurality of data are subjected to phase Subtract, take absolute value, to obtain multiple absolute values;
Judge whether the absolute value is equal;
If the absolute value is equal, using the time corresponding to the absolute value as regular time.
4. according to the method described in claim 3, it is characterized in that, in the time interval field by a plurality of data Former and later two times subtracted each other, take absolute value, to obtain multiple absolute values, comprising:
Obtain the first time and the second time in time interval field corresponding to every data in a plurality of data;
First time corresponding to every data in a plurality of data and the second time are subtracted each other, taken absolute value, with Obtain multiple absolute values.
5. according to the method described in claim 3, it is characterized in that, if time interval field corresponding to a plurality of data Value is continuously that former and later two times in the time interval field by a plurality of data subtract each other, and is taken absolutely Value, to obtain multiple absolute values, comprising:
Obtain first time of time interval field corresponding to the latter data in continuous a plurality of data and adjacent previous The first time of time interval field corresponding to data;
By the time corresponding to the first time of time interval field corresponding to latter data and adjacent previous data The first time of interval field is subtracted each other, and is taken absolute value, to obtain multiple absolute values.
6. being incited somebody to action the method according to claim 1, wherein described be revised as time field for time interval field Value of the first time as time field described in the data in every data, comprising:
If receiving modification instruction, default script is called, the default script is used to time interval field being revised as time word Section, using the first time in every data as the value of time field described in the data;
Execute the default script.
7. the method according to claim 1, wherein described according to the regular time, by the conversion time It is converted to and the first time matched match time, comprising:
Obtain the value of a time field in the table on exchange rates;
According to the value and regular time of the time field of acquisition, the conversion time is converted to matched with the first time Match time.
8. a kind of monetary exchange rate conversion equipment, which is characterized in that the monetary exchange rate conversion equipment includes for executing such as right It is required that the unit of any one of 1-7 the method.
9. a kind of computer equipment, which is characterized in that the computer equipment includes memory, and is connected with the memory Processor;
The memory is for storing computer program;The processor is for running the computer journey stored in the memory Sequence, to execute the method according to claim 1 to 7.
10. a kind of storage medium, which is characterized in that the storage medium is stored with computer program, the computer program quilt When processor executes, the method according to claim 1 to 7 is realized.
CN201810965512.XA 2018-08-23 2018-08-23 Currency exchange rate conversion method, currency exchange rate conversion device, computer equipment and storage medium Active CN109242682B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810965512.XA CN109242682B (en) 2018-08-23 2018-08-23 Currency exchange rate conversion method, currency exchange rate conversion device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810965512.XA CN109242682B (en) 2018-08-23 2018-08-23 Currency exchange rate conversion method, currency exchange rate conversion device, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN109242682A true CN109242682A (en) 2019-01-18
CN109242682B CN109242682B (en) 2023-05-02

Family

ID=65068398

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810965512.XA Active CN109242682B (en) 2018-08-23 2018-08-23 Currency exchange rate conversion method, currency exchange rate conversion device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN109242682B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111125134A (en) * 2019-12-19 2020-05-08 金蝶蝶金云计算有限公司 Foreign currency business statistical form generation method, system and related equipment

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20010011241A1 (en) * 1998-03-30 2001-08-02 Martin A. Nemzow Method and apparatus for localizing currency valuation independent of the original and objective currencies
US7328188B1 (en) * 1999-07-12 2008-02-05 Mainline Corporate Holdings Limited Dynamic currency conversion for card payment systems
US8121923B1 (en) * 2010-03-11 2012-02-21 Ruccolo Michael A Automated fulfilling of currency exchange requests over a computer network
CN105427161A (en) * 2015-11-20 2016-03-23 小米科技有限责任公司 Monetary exchange rate exchange method and device
CN105787789A (en) * 2015-12-23 2016-07-20 魅族科技(中国)有限公司 Method and apparatus for displaying currency exchange rate

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20010011241A1 (en) * 1998-03-30 2001-08-02 Martin A. Nemzow Method and apparatus for localizing currency valuation independent of the original and objective currencies
US7328188B1 (en) * 1999-07-12 2008-02-05 Mainline Corporate Holdings Limited Dynamic currency conversion for card payment systems
US8121923B1 (en) * 2010-03-11 2012-02-21 Ruccolo Michael A Automated fulfilling of currency exchange requests over a computer network
CN105427161A (en) * 2015-11-20 2016-03-23 小米科技有限责任公司 Monetary exchange rate exchange method and device
CN105787789A (en) * 2015-12-23 2016-07-20 魅族科技(中国)有限公司 Method and apparatus for displaying currency exchange rate

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111125134A (en) * 2019-12-19 2020-05-08 金蝶蝶金云计算有限公司 Foreign currency business statistical form generation method, system and related equipment

Also Published As

Publication number Publication date
CN109242682B (en) 2023-05-02

Similar Documents

Publication Publication Date Title
Gao et al. An M/G/1 retrial queue with general retrial times, working vacations and vacation interruption
US9195693B2 (en) Transaction prediction modeling method
US20160246852A1 (en) Systems and Methods for Quantile Estimation in a Distributed Data System
CN104885078A (en) Method for two-stage query optimization in massively parallel processing database clusters
CN106130972B (en) resource access control method and device
CN109447622A (en) Type of transaction recommended method and system, intelligent Trade terminal
CN109582289B (en) Method, system, storage medium and processor for processing rule flow in rule engine
CN107025137A (en) A kind of resource query method and device
CN108564255A (en) Matching Model construction method, orphan's list distribution method, device, medium and terminal
CN106326062A (en) Method and device for controlling running state of application program
CN108563776A (en) Off-line data acquisition methods and system, server and storage medium
CN108459965A (en) A kind of traceable generation method of software of combination user feedback and code dependence
CN109242682A (en) Monetary exchange rate conversion method, device, computer equipment and storage medium
CN110086894A (en) Personnel's related information method for digging, communication recommended method and relevant apparatus
CN105844519A (en) Dynamic business processing method and device
CN110442647A (en) Data consistency synchronous method, device and computer readable storage medium
CN111522840B (en) Label configuration method, device, equipment and computer readable storage medium
CN100395752C (en) Report data collection system and method
CN108256816A (en) A kind of commission data processing method, device and equipment
CN110008386B (en) Data generation, processing and evaluation method, device, equipment and medium
CN107688592A (en) The method and terminal of data cleansing
CN107506380B (en) A kind of method and server updating business data
CN109191214A (en) Transaction options matching process and system, intelligent Trade terminal
CN109451527A (en) A kind of mobile communication subscriber is lost day granularity prediction technique and device
CN110347122A (en) A kind of outbound moment determination, data determination method, device and its equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant