Data system conversion method and device, electronic equipment and storage medium

Through analog vertical division and multiplication, the integer and decimal data are converted and merged, and the problem of insufficient conversion accuracy of decimal type data in the existing technology is solved, and the accuracy and user experience of the fractional conversion are improved.

CN119248224APending Publication Date: 2025-01-03SHANDONG YUNHAI GUOCHUANG CLOUD COMPUTING EQUIP IND INNOVATION CENT CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411149652.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-21
Publication Date
2025-01-03

AI Technical Summary

Technical Problem

In the prior art, there is a lack of a binary conversion method for decimal type data, resulting in damage to the accuracy of the data binary conversion and reducing the user's user experience.

Method used

Through analog vertical division and analog vertical multiplication, the integer data and decimal data are converted respectively, and the converted results are combined to determine the data conversion result of the original data to be converted, and the accuracy of the calculation is improved.

Benefits of technology

It improves the accuracy of data division conversion, improves the user experience, and solves the accuracy problem during decimal data conversion.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119248224A_ABST
    Figure CN119248224A_ABST
Patent Text Reader

Abstract

The invention provides a data system conversion method and apparatus, an electronic device and a storage medium. The method comprises the steps of obtaining original to-be-converted data; determining integer data to be converted and decimal data to be converted according to the original data to be converted; performing data system conversion according to the original data to be converted, the integer data to be converted, the simulated vertical division and the simulated vertical multiplication, and determining target integer data; performing data system conversion according to the original data to be converted, the decimal data to be converted and the simulated vertical multiplication, and determining target decimal data; and merging the target integer data and the target decimal data to obtain a data system conversion result corresponding to the original to-be-converted data. According to the technical scheme, the to-be-converted data of the integer data and the to-be-converted data of the decimal data are converted through the simulation vertical division method and the simulation vertical multiplication method, the converted results of the integer data and the converted results of the decimal data are combined, the data system conversion result corresponding to the original to-be-converted data is determined, and the system conversion precision is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data system conversion, and in particular to a data system conversion method, device, electronic equipment and storage medium. Background Art

[0002] In computer science, a number system (also called a number system or number base) is a system used to represent numbers. Base conversion refers to the process of changing the digit weight of a number when using different bases. Base conversion is widely needed in the field of computer science. Due to the specific architecture of computers, the implementation of many computer technologies requires conversion of data between multiple bases.

[0003] Currently, in the prior art, base conversion is usually limited to processing the default 64-bit data, that is, the data is of integer type, and there is a lack of base conversion methods for decimal data, resulting in the loss of accuracy of data base conversion and reducing the user experience. Summary of the invention

[0004] The present invention provides a data base conversion method, device, electronic device and storage medium, which are used to solve the problem that there is a lack of base conversion method for data with decimal type in the prior art, which leads to impaired accuracy of data base conversion and reduced user experience. For the data to be converted that has integer data and decimal data in the original data to be converted, the integer data and decimal data to be converted are converted by simulated vertical division and simulated vertical multiplication respectively, and finally the converted results of the integer data and the decimal data are merged to determine the data base conversion result corresponding to the original data to be converted, thereby improving the base conversion accuracy and enhancing the user experience.

[0005] The present invention provides a data system conversion, comprising the following steps.

[0006] Get the original data to be converted.

[0007] The integer data to be converted and the decimal data to be converted are determined according to the original data to be converted.

[0008] The data base is converted based on the original data to be converted, the integer data to be converted, the simulated vertical division and the simulated vertical multiplication to determine the target integer data; and the data base is converted based on the original data to be converted, the decimal data to be converted and the simulated vertical multiplication to determine the target decimal data.

[0009] The target integer data and the target decimal data are combined to obtain the data base conversion result corresponding to the original data to be converted.

[0010] According to a data base conversion method provided by the present invention, integer data to be converted and decimal data to be converted are determined based on original data to be converted, including: data segmentation of the original data to be converted to determine integer data to be converted and decimal data to be converted; converting the character type of the integer data to be converted to determine the integer data to be converted; and converting the character type of the decimal data to be converted to determine the decimal data to be converted.

[0011] According to a data base conversion method provided by the present invention, data base conversion is performed according to original data to be converted, integer data to be converted, simulated vertical division and simulated vertical multiplication to determine target integer data, including: performing power calculation according to the integer data to be converted and simulated vertical multiplication to determine a decimal integer; performing power calculation according to the integer data to be converted of the original data to be converted and simulated vertical multiplication to determine a target integer base; performing division and remaindering according to the decimal integer, the target integer base and simulated vertical division to determine the target integer data.

[0012] According to a data base conversion method provided by the present invention, a base division and remainder are taken according to a decimal integer, a target integer base and simulated vertical division to determine target integer data, including: base division and remainder are taken according to a decimal integer, a target integer base and simulated vertical division to determine a remainder result and a quotient result; the remainder result is recorded, and base division and remainder are taken according to the quotient result, the target integer base and simulated vertical division until the quotient result is 0; all recorded remainder results are sorted in reverse order to determine the target integer data.

[0013] According to a data base conversion method provided by the present invention, data base conversion is performed according to original data to be converted, decimal data to be converted and simulated vertical multiplication to determine target decimal data, including: performing power calculation according to the decimal data to be converted and simulated vertical multiplication to determine the decimal; performing power calculation according to the decimal data to be converted of the original data to be converted and simulated vertical multiplication to determine the target decimal base; performing product rounding according to the decimal, the target decimal base and the product rounding method to determine the target decimal data.

[0014] According to a data system conversion method provided by the present invention, product rounding is performed according to a decimal number, a target decimal system base and a product rounding method to determine target decimal data, including: product rounding is performed according to the decimal number, the target decimal system base and the product rounding method to determine an integer result and a decimal result; the integer result is recorded, and the product rounding is performed according to the decimal result, the target decimal system base and the product rounding method until the decimal result is 0; all recorded integer results are sorted in order to determine the target decimal data.

[0015] According to a data base conversion method provided by the present invention, after obtaining the data base conversion result corresponding to the original data to be converted, the method further includes: determining whether the data base conversion result meets the preset result; if the data base conversion result meets the preset result, saving the data base conversion result; if the data base conversion result does not meet the preset result, outputting an error message; wherein the error message is used to prompt that an error occurs in the data base conversion result.

[0016] The present invention also provides a data system conversion device, comprising the following modules.

[0017] The data acquisition module is used to acquire the original data to be converted.

[0018] The data determination module is used to determine integer data to be converted and decimal data to be converted according to the original data to be converted.

[0019] The base conversion module is used to convert the data base according to the original data to be converted, the integer data to be converted, the simulated vertical division and the simulated vertical multiplication to determine the target integer data; and to convert the data base according to the original data to be converted, the decimal data to be converted and the simulated vertical multiplication to determine the target decimal data.

[0020] The data merging module is used to merge the target integer data and the target decimal data to obtain the data base conversion result corresponding to the original data to be converted.

[0021] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements any of the above-mentioned data system conversion methods when executing the computer program.

[0022] The present invention also provides a non-transitory computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the method for converting data bases as described above is implemented.

[0023] The present invention also provides a computer program product, including a computer program, which implements any of the above-mentioned data system conversion methods when executed by a processor.

[0024] The present invention provides a data system conversion method, device, electronic device and storage medium, which obtains original data to be converted; determines integer data to be converted and decimal data to be converted according to the original data to be converted; performs data system conversion according to the original data to be converted, the integer data to be converted, simulated vertical division and simulated vertical multiplication to determine target integer data; and performs data system conversion according to the original data to be converted, the decimal data to be converted and simulated vertical multiplication to determine target decimal data; merges the target integer data and the target decimal data to obtain a data system conversion result corresponding to the original data to be converted. The technical solution of the present invention is used to solve the problem that there is a lack of base conversion method for data with decimal type in the prior art, which leads to the loss of accuracy of data base conversion and reduces the user experience. It realizes that for the original data to be converted that contains integer data and decimal data, the integer data and decimal data to be converted are converted by simulated vertical division and simulated vertical multiplication respectively, and finally the converted results of the integer data and the decimal data are merged to determine the data base conversion result corresponding to the original data to be converted, thereby improving the base conversion accuracy and enhancing the user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0026] Figure 1 This is one of the flow charts of the data conversion method provided by the present invention.

[0027] Figure 2 This is the second flow chart of the data conversion method provided by the present invention.

[0028] Figure 3 It is a structural schematic diagram of a data system conversion device provided by the present invention.

[0029] Figure 4 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION

[0030] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0031] Combine the following Figure 1-Figure 2 The data system conversion method provided by the present invention is described. The data system conversion method provided by the present invention can be applicable to the conversion of high-precision data systems. The executor of the method can be an electronic device or a data system conversion device arranged in the electronic device. The data system conversion device can be implemented by software, hardware or a combination of both. Figure 1 It is one of the flow charts of the data conversion method provided by the present invention, such as Figure 1 As shown, the method includes the following steps.

[0032] Step 101: Obtain original data to be converted.

[0033] In this step, the original data to be converted is the original data that needs to be converted into a base. The original data to be converted may be, for example, 16200.25, which is not limited in this embodiment.

[0034] Specifically, the original data to be converted is read from a designated position, where the designated position is a preset position for reading the original data to be converted, and includes a plurality of data to be converted.

[0035] Step 102: Determine integer data to be converted and decimal data to be converted according to the original data to be converted.

[0036] In this step, the integer data to be converted is the integer part of the original data to be converted, and the decimal data to be converted is the decimal part of the original data to be converted.

[0037] Specifically, after obtaining the original data to be converted, the original data to be converted is first saved, and then the original data to be converted is divided into an integer part and a decimal part, and the integer part is determined as the integer data to be converted, and the decimal part is determined as the decimal data to be converted.

[0038] Exemplarily, the original data to be converted may be, for example, 16200.25. After segmentation, it is determined that the integer data to be converted is 16200 and the decimal data to be converted is 0.25.

[0039] The advantage of this setting is that the original data to be converted is decomposed into integer data to be converted and decimal data to be converted, which is convenient for subsequent processing and reduces the time complexity of the processing process. At the same time, it satisfies the processing of special data for the original data to be converted, thereby improving the processing efficiency of special data for the original data to be converted.

[0040] Step 103, convert the data base according to the original data to be converted, the integer data to be converted, the simulated vertical division and the simulated vertical multiplication to determine the target integer data; and convert the data base according to the original data to be converted, the decimal data to be converted and the simulated vertical multiplication to determine the target decimal data.

[0041] In this step, the simulated vertical division is used to obtain the remainder of the division base, and the simulated vertical multiplication is used to obtain the integer of the product.

[0042] Specifically, according to the original data to be converted and the integer data to be converted, firstly, by simulating vertical multiplication, the data base of the original data to be converted and the integer data to be converted is converted to determine the decimal integer of the original data to be converted and the decimal integer of the integer data to be converted, and then the decimal integer of the original data to be converted and the decimal integer of the integer data to be converted are divided by radix and remainder by simulating vertical division to obtain target integer data; and according to the original data to be converted and the decimal data to be converted, the data base is converted to determine the decimal integer of the original data to be converted and the decimal integer of the integer data to be converted, and then the decimal integer of the original data to be converted and the decimal integer of the integer data to be converted are multiplied and rounded by simulating vertical multiplication to obtain target decimal data.

[0043] Exemplarily, the integer data 16200 to be converted is converted to determine that the target integer data is 213141, and the decimal data to be converted is converted to determine that the target decimal data is 0.1310014340322421131002.

[0044] Step 104: merge the target integer data and the target decimal data to obtain a data base conversion result corresponding to the original data to be converted.

[0045] In this step, the data base conversion result is the result of merging the target integer data and the target decimal data.

[0046] Specifically, after determining the target integer data and the target decimal data, the target integer data and the target decimal data are merged to obtain a data base conversion result corresponding to the original data to be converted.

[0047] Exemplarily, the target integer data is determined to be 213141, and the target decimal data is determined to be 0.1310014340322421131002. After merging the target integer data 213141 and the target decimal data 0.1310014340322421131002, the data base conversion result corresponding to the original data to be converted is 213141.1310014340322421131002.

[0048] In a specific embodiment, after obtaining the data base conversion result corresponding to the original data to be converted, it also includes: determining whether the data base conversion result meets the preset result; if the data base conversion result meets the preset result, saving the data base conversion result; if the data base conversion result does not meet the preset result, outputting an error message; wherein the error message is used to prompt that an error occurs in the data base conversion result.

[0049] In this step, the preset result is a preset result used to determine whether there is an abnormality in the data conversion result. The preset result includes a preset data format.

[0050] Specifically, after obtaining the data base conversion result corresponding to the original data to be converted, determine whether the data base conversion result meets the preset result, that is, determine whether the data format of the data base conversion result is consistent with the data format of the preset result. If it is determined that the data format of the data base conversion result is consistent with the data format of the preset result, then the data base conversion result is determined to meet the preset result. If the data base conversion result meets the preset result, save the data base conversion result; if it is determined that the data format of the data base conversion result is inconsistent with the data format of the preset result, then determine that the data base conversion result does not meet the preset result. If the data base conversion result does not meet the preset result, output an error message; wherein the error message is used to prompt that an error occurs in the data base conversion result.

[0051] In a specific embodiment, checking the data base conversion result can be to determine whether there are any redundant zero errors generated during the processing of the integer part of the data base conversion result. If so, it is determined that the data base conversion result does not meet the preset result, and an error message is output; wherein the error message is used to prompt that an error occurs in the data base conversion result.

[0052] The advantage of this setting is that the data base conversion results can be checked in time to improve the accuracy of the data base conversion results.

[0053] In a specific embodiment, when the data base conversion result meets the preset result, after saving the data base conversion result, it also includes outputting the data base conversion result to a specified location and printing it for viewing, and the data base conversion result can be permanently saved according to user needs to enhance the user experience.

[0054] The present invention provides a data system conversion method, which comprises the following steps: obtaining original data to be converted; determining integer data to be converted and decimal data to be converted according to the original data to be converted; performing data system conversion according to the original data to be converted, the integer data to be converted, simulated vertical division and simulated vertical multiplication to determine target integer data; and performing data system conversion according to the original data to be converted, the decimal data to be converted and simulated vertical multiplication to determine target decimal data; merging the target integer data and the target decimal data to obtain a data system conversion result corresponding to the original data to be converted. On the basis of the above embodiments, the technical solution of the present invention is used to solve the problem that there is a lack of base conversion method for data with decimal type in the prior art, which results in impaired accuracy of data base conversion and reduced user experience. For the original data to be converted that contains integer data and decimal data, the integer data and decimal data to be converted are converted by simulated vertical division and simulated vertical multiplication respectively. Finally, the converted results of the integer data and the decimal data are merged to determine the data base conversion result corresponding to the original data to be converted, thereby improving the base conversion accuracy, reducing the time complexity of the processing process, and improving the user experience.

[0055] Figure 2 This is the second flow chart of the data system conversion method provided by the present invention. The data system conversion method provided by the present invention is applicable to the conversion of high-precision data systems. The execution subject of this method can be an electronic device or a data system conversion device set in the electronic device. The data system conversion device can be implemented by software, hardware or a combination of the two. Figure 2 As shown, further determining integer data to be converted and decimal data to be converted based on original data to be converted, converting data base based on original data to be converted, integer data to be converted, simulated vertical division and simulated vertical multiplication, determining target integer data, and converting data base based on original data to be converted, decimal data to be converted and simulated vertical multiplication, determining target decimal data for optimization, the method includes the following steps.

[0056] Step 201: Obtain original data to be converted.

[0057] Specifically, the original data to be converted is read from a designated position, where the designated position is a preset position for reading the original data to be converted, and includes a plurality of data to be converted.

[0058] Step 202: segment the original data to be converted to determine integer data to be converted and decimal data to be converted.

[0059] Specifically, after obtaining the original data to be converted, the original data to be converted is first saved, and then the original data to be converted is divided into an integer part and a decimal part, and the integer part is determined as the integer data to be converted, and the decimal part is determined as the decimal data to be converted.

[0060] Step 203: convert the character type of the integer data to be converted to determine the integer data to be converted; and convert the character type of the decimal data to be converted to determine the decimal data to be converted.

[0061] In this step, the integer data to be converted is the data after the character type numbers in the string of the integer data to be converted are converted to integer numbers. For example, if the actual data value of character 0 is 48, it needs to be converted to 0. The decimal data to be converted is the data after the character type numbers of the decimal data to be converted are converted to integer numbers.

[0062] Specifically, the character type of the integer data to be converted is converted to determine the integer data to be converted; and the character type of the decimal data to be converted is converted to determine the decimal data to be converted.

[0063] The advantage of this setting is that all characters of the integer data to be converted and the decimal data to be converted are converted into corresponding integers, which facilitates subsequent simulation calculations and improves calculation efficiency.

[0064] Step 204: Perform power calculation based on the integer data to be converted and simulated vertical multiplication to determine a decimal integer.

[0065] Specifically, the integer data to be converted is introduced into the simulated vertical multiplication, and the integer data to be converted is exponentially calculated by the simulated vertical multiplication to convert the integer data to be converted into a decimal integer.

[0066] Step 205: Perform exponentiation calculation based on the integer data to be converted of the original data to be converted and simulated vertical multiplication to determine the target integer base.

[0067] Specifically, the integer data to be converted of the original data to be converted is introduced into the simulated vertical multiplication, and the integer data to be converted of the original data to be converted is exponentially calculated by the simulated vertical multiplication to convert the integer data to be converted of the original data to be converted into the target integer base.

[0068] Step 206: Perform division and remainder calculation based on the decimal integer, the target integer base and simulated vertical division to determine the target integer data.

[0069] Specifically, the decimal integer and the target integer base are introduced into the simulated vertical division, and the decimal integer and the target integer base are divided by the simulated vertical division to obtain the target integer data.

[0070] In a specific implementation, the specific implementation steps of performing radix division and remainder calculation based on a decimal integer, a target integer radix, and simulated vertical division to determine the target integer data include: performing radix division and remainder calculation based on a decimal integer, a target integer radix, and simulated vertical division to determine a remainder result and a quotient result; recording the remainder result, and performing radix division and remainder calculation based on the quotient result, the target integer radix, and simulated vertical division until the quotient result is 0; sorting all recorded remainder results in reverse order to determine the target integer data.

[0071] Specifically, the decimal integer and the target integer base are imported into the simulated vertical division, and the decimal integer and the target integer base are divided by the simulated vertical division to obtain the remainder result and the quotient result; the remainder result is recorded, and the base is divided by the remainder result according to the quotient result, the target integer base and the simulated vertical division until the quotient result is 0; all the recorded remainder results are sorted in reverse order to determine the target integer data.

[0072] Exemplarily, when it is determined that the decimal integer is 7296 and the target integer base 3 is 3, the decimal integer 7296 and the target integer base 3 are introduced into the simulated vertical division, and the decimal integer 7296 and the target integer base 3 are divided and remaindered by the simulated vertical division, and the first layer obtains a remainder result of 0, and the first layer quotient result is 2432; the first layer quotient result 2432 and the target integer base 3 are continued to be divided and remaindered, and the second layer obtains a remainder result of 2, and the second layer quotient result is 810; the second layer quotient result 810 and the target integer base 3 are continued to be divided and remaindered, and the third layer obtains a remainder result of 0, and the third layer quotient result is 270; the third layer quotient result 270 and the target integer base 3 are continued to be divided and remaindered, and the fourth layer obtains a remainder result. The result is 0, and the quotient of the fourth layer is 90; continue to divide the quotient result of the fourth layer 90 by the target integer base 3 to obtain the remainder, and the remainder result of the fifth layer is 0, and the quotient result of the fifth layer is 30; continue to divide the quotient result of the fifth layer 30 by the target integer base 3 to obtain the remainder, and the remainder result of the sixth layer is 0, and the quotient result of the sixth layer is 10; continue to divide the quotient result of the sixth layer 10 by the target integer base 3 to obtain the remainder, and the remainder result of the seventh layer is 1, and the quotient result of the seventh layer is 3; continue to divide the quotient result of the seventh layer 3 by the target integer base 3 to obtain the remainder, and the remainder result of the eighth layer is 0, and the quotient result of the eighth layer is 1; continue to divide the quotient result of the eighth layer 1 by the target integer base 3 to obtain the remainder, and the remainder result of the eighth layer is 1, and the quotient result of the eighth layer is 0. At this time, all the recorded remainder results are sorted in reverse order, and the quotient result of the reverse order is 101000020, and the target integer data 101000020 is determined.

[0073] Step 207: Perform power calculation based on the decimal data to be converted and simulated vertical multiplication to determine the decimal.

[0074] Specifically, the decimal data to be converted is introduced into the simulated vertical multiplication, and the decimal data to be converted is exponentially calculated by the simulated vertical multiplication to convert the decimal data into a decimal.

[0075] Step 208: Perform exponentiation calculation based on the decimal data to be converted of the original data to be converted and simulated vertical multiplication to determine the target decimal base.

[0076] Specifically, the decimal data to be converted of the original data to be converted is introduced into the simulated vertical multiplication, and the decimal data to be converted of the original data to be converted is exponentially calculated by the simulated vertical multiplication to convert the decimal data to be converted into the target decimal base.

[0077] Step 209: perform product rounding according to the decimal, the target decimal base and the product rounding method to determine the target decimal data.

[0078] Specifically, the decimal number and the target decimal base are introduced into the product rounding method, and the decimal number and the target decimal base are multiplied and rounded by the product rounding method to determine the target decimal data.

[0079] In a specific implementation, the specific implementation method of determining the target decimal data by rounding the product according to the decimal, the target decimal base and the product rounding method includes: rounding the product according to the decimal, the target decimal base and the product rounding method to determine the integer result and the decimal result; recording the integer result, and rounding the product according to the decimal result, the target decimal base and the product rounding method until the decimal result is 0; sorting all the recorded integer results in order to determine the target decimal data.

[0080] Specifically, the decimal and the target decimal base are introduced into the product rounding method, and the decimal and the target decimal base are multiplied and rounded by the product rounding method to determine the integer result and the decimal result; the integer result is recorded, and the product is rounded according to the decimal result, the target decimal base and the product rounding method until the decimal result is 0; all the recorded integer results are sorted in order to determine the target decimal data.

[0081] The advantage of this setting is that the operation is repeated until the decimal result is 0 or an obvious loop occurs, then the loop is stopped, all recorded integer results are sorted in order, the target decimal data is determined, and the accuracy of the target decimal data is improved.

[0082] In a specific implementation, when the product is rounded according to the decimal result, the target decimal base and the product rounding method, the repeated cycle of product rounding can be stopped when the decimal result is an infinitely repeating decimal, thereby determining the target decimal data.

[0083] The advantage of this setting is that it reduces the complexity of calculations in the process of determining the target decimal data.

[0084] There is no order of execution for the above steps 204-206 and steps 207-209. Steps 204-206 may be executed first and then steps 207-209, or steps 207-209 may be executed first and then steps 204-206. Steps 204-206 and steps 207-209 may also be executed simultaneously, which is not limited in this embodiment.

[0085] Step 210: merge the target integer data and the target decimal data to obtain a data base conversion result corresponding to the original data to be converted.

[0086] Specifically, after determining the target integer data and the target decimal data, the target integer data and the target decimal data are merged to obtain a data base conversion result corresponding to the original data to be converted.

[0087] The present invention provides a data system conversion method, which comprises the following steps: obtaining original data to be converted; performing data segmentation on the original data to be converted to determine integer data to be converted and decimal data to be converted; converting the character type of the integer data to be converted to determine the integer data to be converted; and converting the character type of the decimal data to be converted to determine the decimal data to be converted; performing power calculation based on the integer data to be converted and simulated vertical multiplication to determine the decimal integer; performing power calculation based on the integer data to be converted and simulated vertical multiplication of the original data to be converted to determine the target integer system Cardinality; determine the target integer data by dividing the radix and taking the remainder according to the decimal integer, the target integer radix and the simulated vertical division; determine the decimal by performing power calculation according to the decimal data to be converted and the simulated vertical multiplication; determine the target decimal radix by performing power calculation according to the decimal data to be converted of the original data to be converted and the simulated vertical multiplication; determine the target decimal data by rounding the product according to the decimal, the target decimal radix and the product rounding method; merge the target integer data and the target decimal data to obtain the data base conversion result corresponding to the original data to be converted. On the basis of the above embodiments, the technical solution of the present invention is used to solve the problem that there is a lack of base conversion method for data with decimal type in the prior art, which results in impaired accuracy of data base conversion and reduced user experience. For the original data to be converted that contains integer data and decimal data, the data to be converted of integer data and decimal data are converted by simulated vertical division and simulated vertical multiplication respectively. Finally, the converted results of integer data and decimal data are merged to determine the data base conversion result corresponding to the original data to be converted, thereby improving the base conversion accuracy and enhancing the user experience.

[0088] The data system conversion device provided by the present invention is described below. The data system conversion device described below and the data system conversion method described above can be referenced to each other.

[0089] Figure 3 is a schematic diagram of the structure of the data conversion device provided by the present invention, referring to Figure 3 As shown, the data system conversion device 300 includes: a data acquisition module 301, a data determination module 302, a system conversion module 303 and a data merging module 304.

[0090] The data acquisition module 301 is used to acquire original data to be converted.

[0091] The data determination module 302 is used to determine integer data to be converted and decimal data to be converted according to the original data to be converted.

[0092] The base conversion module 303 is used to convert the data base according to the original data to be converted, the integer data to be converted, the simulated vertical division and the simulated vertical multiplication to determine the target integer data; and to convert the data base according to the original data to be converted, the decimal data to be converted and the simulated vertical multiplication to determine the target decimal data.

[0093] The data merging module 304 is used to merge the target integer data and the target decimal data to obtain the data base conversion result corresponding to the original data to be converted.

[0094] In an exemplary embodiment, the data determination module 302 is specifically used to: perform data segmentation on the original data to be converted to determine integer data to be converted and decimal data to be converted; convert the character type of the integer data to be converted to determine the integer data to be converted; and convert the character type of the decimal data to be converted to determine the decimal data to be converted.

[0095] In an exemplary embodiment, the base conversion module 303 performs data base conversion based on the original data to be converted, the integer data to be converted, the simulated vertical division and the simulated vertical multiplication to determine the target integer data, and is specifically used for: performing power calculation based on the integer data to be converted and the simulated vertical multiplication to determine the decimal integer; performing power calculation based on the integer data to be converted of the original data to be converted and the simulated vertical multiplication to determine the target integer base; performing division and remainder calculation based on the decimal integer, the target integer base and the simulated vertical division to determine the target integer data.

[0096] In an exemplary embodiment, the base conversion module 303 performs base division and modulo calculation according to a decimal integer, a target integer base and simulated vertical division to determine target integer data, and is specifically used to: perform base division and modulo calculation according to a decimal integer, a target integer base and simulated vertical division to determine a remainder result and a quotient result; record the remainder result, and perform base division and modulo calculation according to the quotient result, the target integer base and simulated vertical division until the quotient result is 0; sort all recorded remainder results in reverse order to determine the target integer data.

[0097] In an exemplary embodiment, the base conversion module 303 performs data base conversion based on the original data to be converted, the decimal data to be converted and the simulated vertical multiplication to determine the target decimal data, and is specifically used for: performing power calculation based on the decimal data to be converted and the simulated vertical multiplication to determine the decimal; performing power calculation based on the decimal data to be converted of the original data to be converted and the simulated vertical multiplication to determine the target decimal base; performing product rounding based on the decimal, the target decimal base and the product rounding method to determine the target decimal data.

[0098] In an exemplary embodiment, the base conversion module 303 performs product rounding according to the decimal number, the target decimal base and the product rounding method to determine the target decimal data, and is specifically used to: perform product rounding according to the decimal number, the target decimal base and the product rounding method to determine the integer result and the decimal result; record the integer result, and perform product rounding according to the decimal result, the target decimal base and the product rounding method until the decimal result is 0; sort all the recorded integer results in order to determine the target decimal data.

[0099] In an exemplary embodiment, the device further includes: a result judgment module. The result judgment module is used to: after obtaining the data base conversion result corresponding to the original data to be converted, determine whether the data base conversion result meets the preset result; if the data base conversion result meets the preset result, save the data base conversion result; if the data base conversion result does not meet the preset result, output error information; wherein the error information is used to prompt that the data base conversion result has an error.

[0100] The device of this embodiment can be used to execute the method of any embodiment in the data system conversion method embodiment. Its specific implementation process and technical effects are similar to those in the data system conversion method embodiment. For details, please refer to the detailed introduction in the data system conversion method embodiment, which will not be repeated here.

[0101] Figure 4 is a schematic diagram of the structure of the electronic device provided by the present invention, such as Figure 4As shown, the electronic device may include: a processor 410, a communication interface 420, a memory 430 and a communication bus 440, wherein the processor 410, the communication interface 420 and the memory 430 communicate with each other through the communication bus 440. The processor 410 may call the logic instructions in the memory 430 to execute the data system conversion method, which method includes: obtaining the original data to be converted; determining the integer data to be converted and the decimal data to be converted according to the original data to be converted; performing data system conversion according to the original data to be converted, the integer data to be converted, the simulated vertical division and the simulated vertical multiplication to determine the target integer data; and performing data system conversion according to the original data to be converted, the decimal data to be converted and the simulated vertical multiplication to determine the target decimal data; merging the target integer data and the target decimal data to obtain the data system conversion result corresponding to the original data to be converted.

[0102] In addition, the logic instructions in the above-mentioned memory 430 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods of various embodiments of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.

[0103] On the other hand, the present invention also provides a computer program product, which includes a computer program. The computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the data base conversion method provided by the above methods, which method includes: obtaining original data to be converted; determining integer data to be converted and decimal data to be converted based on the original data to be converted; performing data base conversion based on the original data to be converted, the integer data to be converted, simulated vertical division and simulated vertical multiplication to determine the target integer data; and performing data base conversion based on the original data to be converted, the decimal data to be converted and simulated vertical multiplication to determine the target decimal data; merging the target integer data and the target decimal data to obtain the data base conversion result corresponding to the original data to be converted.

[0104] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the data base conversion method provided by the above-mentioned methods, the method comprising: obtaining original data to be converted; determining integer data to be converted and decimal data to be converted based on the original data to be converted; performing data base conversion based on the original data to be converted, the integer data to be converted, simulated vertical division and simulated vertical multiplication to determine the target integer data; and performing data base conversion based on the original data to be converted, the decimal data to be converted and simulated vertical multiplication to determine the target decimal data; merging the target integer data and the target decimal data to obtain the data base conversion result corresponding to the original data to be converted.

[0105] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0106] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0107] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for converting data system, characterized in that: include: Get the original data to be converted; Determine integer data to be converted and decimal data to be converted according to the original data to be converted; Performing data base conversion according to the original data to be converted, the integer data to be converted, simulated vertical division and simulated vertical multiplication to determine target integer data; and performing data base conversion according to the original data to be converted, the decimal data to be converted and the simulated vertical multiplication to determine target decimal data; The target integer data and the target decimal data are combined to obtain a data base conversion result corresponding to the original data to be converted.

2. The data conversion method according to claim 1, characterized in that: The step of determining the integer data to be converted and the decimal data to be converted according to the original data to be converted comprises: Performing data segmentation on the original data to be converted to determine integer data to be converted and decimal data to be converted; The character type of the integer data to be converted is converted to determine the integer data to be converted; and the character type of the decimal data to be converted is converted to determine the decimal data to be converted.

3. The data conversion method according to claim 2, characterized in that: The step of converting the data base according to the original data to be converted, the integer data to be converted, the simulated vertical division and the simulated vertical multiplication to determine the target integer data includes: Performing power calculation according to the integer data to be converted and the simulated vertical multiplication to determine a decimal integer; Performing power calculation based on the integer data to be converted of the original data to be converted and the simulated vertical multiplication to determine a target integer base; The target integer data is determined by performing division and remainder calculation based on the decimal integer, the target integer base and the simulated vertical division.

4. The data conversion method according to claim 3, characterized in that: The step of performing division and remaindering according to the decimal integer, the target integer base and the simulated vertical division to determine the target integer data includes: Performing division of the base and obtaining the remainder according to the decimal integer, the target integer base and the simulated vertical division to determine a remainder result and a quotient result; Record the remainder result, and perform base division and remainder calculation according to the quotient result, the target integer base, and the simulated vertical division until the quotient result is 0; Sort all the recorded remainder results in reverse order to determine the target integer data.

5. The data conversion method according to claim 2, characterized in that: The converting of the data base according to the original data to be converted, the decimal data to be converted and the simulated vertical multiplication to determine the target decimal data includes: Performing power calculation based on the decimal data to be converted and the simulated vertical multiplication to determine a decimal; Performing power calculation based on the decimal data to be converted of the original data to be converted and the simulated vertical multiplication to determine a target decimal base; The target decimal data is determined by performing product rounding according to the decimal, the target decimal base and the product rounding method.

6. The data conversion method according to claim 5, characterized in that: The step of performing product rounding according to the decimal number, the target decimal base and the product rounding method to determine the target decimal data includes: Perform product rounding according to the decimal number, the target decimal base and the product rounding method to determine an integer result and a decimal result; Record the integer result, and perform product rounding according to the decimal result, the target decimal base, and the product rounding method until the decimal result is 0; All the recorded integer results are sorted in order to determine the target decimal data.

7. The data conversion method according to claim 1, characterized in that: After obtaining the data system conversion result corresponding to the original data to be converted, the method further includes: Determine whether the data conversion result meets the preset result; When the data base conversion result meets the preset result, saving the data base conversion result; When the data base conversion result does not conform to the preset result, an error message is output; wherein the error message is used to prompt that an error occurs in the data base conversion result.

8. A data system conversion device, characterized in that: include: A data acquisition module, used to acquire original data to be converted; A data determination module, used for determining integer data to be converted and decimal data to be converted according to the original data to be converted; A base conversion module, configured to perform data base conversion according to the original data to be converted, the integer data to be converted, the simulated vertical division and the simulated vertical multiplication to determine target integer data; and perform data base conversion according to the original data to be converted, the decimal data to be converted and the simulated vertical multiplication to determine target decimal data; The data merging module is used to merge the target integer data and the target decimal data to obtain a data base conversion result corresponding to the original data to be converted.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the data system conversion method as described in any one of claims 1 to 7 is implemented.

10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the data system conversion method as claimed in any one of claims 1 to 7 is implemented.