CN112052034A - Computing interface construction method and device, computer equipment and readable storage medium - Google Patents

Computing interface construction method and device, computer equipment and readable storage medium Download PDF

Info

Publication number
CN112052034A
CN112052034A CN202010909638.2A CN202010909638A CN112052034A CN 112052034 A CN112052034 A CN 112052034A CN 202010909638 A CN202010909638 A CN 202010909638A CN 112052034 A CN112052034 A CN 112052034A
Authority
CN
China
Prior art keywords
calculation
data
computation
cache module
subclass
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.)
Pending
Application number
CN202010909638.2A
Other languages
Chinese (zh)
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 Asset Management Co Ltd
Original Assignee
Ping An Asset Management Co 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 Asset Management Co Ltd filed Critical Ping An Asset Management Co Ltd
Priority to CN202010909638.2A priority Critical patent/CN112052034A/en
Publication of CN112052034A publication Critical patent/CN112052034A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2228Indexing structures
    • G06F16/2255Hash tables
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution
    • G06F16/24552Database cache management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Computer Security & Cryptography (AREA)
  • Computational Linguistics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention relates to the technical field of computers, and discloses a method and a device for constructing a computing interface, computer equipment and a readable storage medium, wherein the method comprises the following steps: acquiring a function set, disassembling the function set to obtain at least one calculation function, and constructing a virtual class of the calculation function to obtain a calculation parent class; inheriting at least one computation parent class to obtain a computation subclass and storing the computation subclass in a preset cache module; recording the basic data into a preset table in a cache module to obtain a matrix table; and setting a trigger thread in the cache module, encapsulating the cache module to obtain a calculation interface, and setting the names of the calculation subclasses and the character table as the labels of the calculation interface. The invention also relates to a blockchain technique, where information can be stored in blockchain nodes. The invention realizes the high decoupling of the function set, improves the construction efficiency of the interface, reduces the redundancy of the code, realizes the technical effect of quickly calling the automatic calculation, and improves the convenience of the user and the acquisition speed of the calculation result.

Description

Computing interface construction method and device, computer equipment and readable storage medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method and an apparatus for constructing a computing interface, a computer device, and a readable storage medium.
Background
The multidimensional rating statistical table is widely applied to various scenes with data reports, such as bond statistics, subject rating, quantitative rating and the like. When a user wants to know the result of all the bond rated multidimensional data, calculation needs to be carried out on the data with different dimensions. The main aspects of the function are as follows: and screening the basic data into an RAM and calculating and packaging a data structure of the multidimensional data. These points all require the use of reasonable data structure, spatial, temporal complexity.
In a conventional method for constructing a matrix table computation interface, a function set is usually preset in the matrix table computation interface, so that the constructed computation interface needs to obtain a corresponding matrix table according to a data request sent by a user side, and then complex and lengthy computation is performed on the matrix table through the function set, and finally a result set consisting of at least one computation result is obtained.
However, the inventor has realized that a user generally only needs to obtain one or a few limited calculation results, and if the calculation results are constructed according to the current construction method, the calculation process of the obtained calculation interface is often complicated, the acquisition speed of the calculation results is slow, and the like, and finally, the use efficiency of the calculation interface is low.
Disclosure of Invention
The invention aims to provide a computing interface construction method, a computing interface construction device, computer equipment and a readable storage medium, which are used for solving the problems that the computing process of an obtained computing interface is complex, the obtaining speed of a computing result is low and the like in the prior art, and finally the use efficiency of the computing interface is low.
In order to achieve the above object, the present invention provides a computing interface construction method, including:
acquiring a function set, disassembling the function set to obtain at least one calculation function, and constructing a virtual class of the calculation function to obtain a calculation parent class;
inheriting at least one computation parent class to obtain a computation subclass and storing the computation subclass in a preset cache module;
inputting the obtained basic data into a preset table in the cache module to obtain a matrix table for storing each character string in the basic data in a table form;
setting a trigger thread in the cache module, wherein the trigger thread is used for calling the computation subclass and the matrix table according to a call request sent by a user side to obtain a computation result; and encapsulating the cache module to obtain a calculation interface, and setting the names of the calculation subclasses and the character table as the labels of the calculation interface.
In the scheme, a data structure is constructed into a calculation parent class in a map form, wherein the name of the calculation function is used as a main key, and the calculation function is used as a key value; and adopting cache or redis as the cache module.
In the above scheme, after inheriting at least one of the computation parent classes to obtain a computation child class and storing the computation child class in a preset cache module, the method further includes:
defining the computation subclass as a member variable in the class of the cache module, so that all classes in the cache module can call the computation subclass;
the method comprises the steps of obtaining user data of at least one preset data carrier, splitting the user data by adopting a segmented locking Hash rule to obtain a parallel data stream, and recording the parallel data stream serving as basic data into at least one register carrier pre-bound with the data carrier.
In the above scheme, a current hash map is used as a segment-lock hash rule, the data carrier is a database or a server for storing user data, the parallel data stream is a plurality of data blocks formed by dividing the user data in the data carrier, and the register carrier is bound with at least one data carrier.
In the above scheme, entering the obtained basic data into a preset table in the cache module includes:
and acquiring basic data from a register carrier by a get data method, and inputting the basic data into a preset table of a cache module by a load data infill statement.
In the above scheme, after obtaining the matrix table for storing each character string in the basic data in a table form, the method includes:
identifying row titles and column titles of character strings in the matrix table, using the row titles and the column titles as coordinate information and storing the coordinate information in the cache module;
after obtaining the matrix table for storing each character string in the basic data in a table form, the method further comprises the following steps:
and uploading the matrix table to a block chain.
In the foregoing solution, the triggering thread includes:
the first trigger thread is used for identifying the calculation factors of the calculation subclasses according to a calling request sent by a user side and setting the calculation factors as calling parameters;
the second trigger thread is used for acquiring a character string corresponding to the coordinate information consistent with the calling parameter from the matrix table;
and the third trigger thread is used for calling the computation subclass to compute the character string and obtain a return result.
In order to achieve the above object, the present invention further provides a computing interface constructing apparatus, including:
the parent construction module is used for acquiring a function set, disassembling the function set to obtain at least one calculation function, and constructing a virtual class of the calculation function to obtain a calculation parent class;
the subclass building module is used for inheriting at least one computation parent class to obtain a computation subclass and storing the computation subclass in a preset cache module;
the data entry module is used for entering the obtained basic data into a preset table in the cache module to obtain a matrix table for storing each character string in the basic data in a table form;
the interface creating module is used for setting a triggering thread in the cache module, and the triggering thread is used for calling the calculation subclass and the matrix table according to a calling request sent by a user side to obtain a calculation result; and encapsulating the cache module to obtain a calculation interface, and setting the names of the calculation subclasses and the character table as the labels of the calculation interface.
To achieve the above object, the present invention further provides a computer device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor of the computer device implements the steps of the above computing interface construction method when executing the computer program.
In order to achieve the above object, the present invention further provides a computer-readable storage medium, which stores a computer program, wherein the computer program realizes the steps of the above computing interface construction method when executed by a processor.
According to the method and the device for constructing the computing interface, the computing function is obtained by disassembling the function set, the virtual class of the computing function is constructed to obtain the computing parent class at least comprising one computing function, so that the high decoupling of the function set is realized, and the realization of a lightweight computing interface is facilitated; by setting the computation parent class which can be repeatedly called, the computation subclass stored in the cache module can inherit the statement block of the computation parent class according to the requirement, so that the repeated calling of a commonly used computation function by a plurality of interfaces is realized, the construction efficiency of the interfaces is improved, and the redundancy of codes is reduced; the basic data are input into a preset table of a cache module, and a matrix table is finally obtained, so that the basic data are structurally processed, and the calling efficiency of character strings in the basic data is further ensured; the cache module is packaged to obtain a lightweight computing interface, and the user side can directly send a calling request by triggering a thread, so that the technical effect of quickly calling automatic computation is realized, and the convenience of a user and the acquisition speed of a computation result are improved.
Drawings
FIG. 1 is a flowchart of a first embodiment of a method for building a computing interface according to the present invention;
FIG. 2 is a schematic diagram of an environment application of a computing interface construction method according to a second embodiment of the computing interface construction method of the present invention;
FIG. 3 is a flowchart of a specific method of a computing interface construction method according to a second embodiment of the computing interface construction method of the present invention;
FIG. 4 is a schematic diagram of program modules of a third embodiment of a computing interface constructing apparatus according to the present invention;
fig. 5 is a schematic diagram of a hardware structure of a computer device according to a fourth embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The invention provides a computing interface construction method, a computing interface construction device, computer equipment and a readable storage medium, which are suitable for the technical field of computers and provide the computing interface construction method based on a parent class construction module, a child class construction module, a data entry module and an interface creation module. The method comprises the steps of obtaining a function set, disassembling the function set to obtain at least one calculation function, and constructing a virtual class of the calculation function to obtain a calculation parent class; inheriting at least one computation parent class to obtain a computation subclass and storing the computation subclass in a preset cache module; inputting the obtained basic data into a preset table in a cache module, and obtaining a matrix table for storing each character string in the basic data in a table form; and setting a trigger thread in the cache module, encapsulating the cache module to obtain a calculation interface, and setting the names of the calculation subclasses and the character table as the labels of the calculation interface.
The first embodiment is as follows:
referring to fig. 1, a method for constructing a computing interface according to the embodiment includes:
s101: acquiring a function set, disassembling the function set to obtain at least one calculation function, and constructing a virtual class of the calculation function to obtain a calculation parent class;
s102: inheriting at least one computation parent class to obtain a computation subclass and storing the computation subclass in a preset cache module;
s105: inputting the obtained basic data into a preset table in the cache module to obtain a matrix table for storing each character string in the basic data in a table form;
s107: setting a trigger thread in the cache module, wherein the trigger thread is used for calling the computation subclass and the matrix table according to a call request sent by a user side to obtain a computation result; and encapsulating the cache module to obtain a calculation interface, and setting the names of the calculation subclasses and the character table as the labels of the calculation interface.
In an exemplary embodiment, the function set for calculating the basic data and composed of at least one calculation function may be obtained from an existing data model, or the function set for operating on the data and composed of at least one calculation function may be obtained from a preset calculation database; and disassembling the function set to obtain a calculation function, and constructing a virtual class of the calculation function to obtain a calculation parent class at least comprising one calculation function. Therefore, the function set is highly decoupled, and the realization of a lightweight computing interface is facilitated.
By setting the computation parent class which can be repeatedly called, the computation subclass stored in the cache module can inherit the statement block of the computation parent class according to the requirement, so that the repeated calling of a commonly used computation function by a plurality of interfaces is realized, the construction efficiency of the interfaces is improved, and the redundancy of codes is reduced.
The method comprises the steps of obtaining basic data from a register carrier through a get data method, inputting the basic data into a preset table of a cache module through a load data infile statement, and finally obtaining a matrix table, so that the basic data are structurally processed, and the calling efficiency of character strings in the basic data is further ensured.
The cache module is packaged to obtain a lightweight computing interface, a user side can directly send a calling request through a triggering thread, and then a corresponding computing result can be obtained from the computing interface without selecting data to be computed and formulas to be used one by one, so that the technical effect of quick calling of automatic computation is realized, and the convenience of a user and the obtaining speed of the computing result are improved.
Example two:
the embodiment is a specific application scenario of the first embodiment, and the method provided by the present invention can be more clearly and specifically explained through the embodiment.
The method provided in this embodiment is specifically described below by taking as an example that in a server running a computing interface construction method, a virtual class of a computing function is constructed to obtain a computing parent class and inherit the computing parent class to obtain a computing child class and load the computing child class into a cache module, basic data is entered into a table preset in the cache module to obtain a matrix table and load the matrix table into the cache module, and a trigger thread is set in the cache module and encapsulated to obtain a computing interface. It should be noted that the present embodiment is only exemplary, and does not limit the protection scope of the embodiments of the present invention.
Fig. 2 schematically shows an environment application diagram of the computing interface construction method according to the second embodiment of the present application.
In an exemplary embodiment, the server 2 on which the computing interface construction method is located is connected to the caching module 3, the data carrier 4 and the registration carrier 5, respectively, via a network, and the server 2 may provide services via one or more networks, which may include various network devices, such as routers, switches, multiplexers, hubs, modems, bridges, repeaters, firewalls, proxy devices and/or the like. The network may include physical links, such as coaxial cable links, twisted pair cable links, fiber optic links, combinations thereof, and/or the like. The network may include wireless links, such as cellular links, satellite links, Wi-Fi links, and/or the like; the cache module 3, the data carrier 4 and the register carrier 5 are databases or servers with data storage function.
Fig. 3 is a flowchart of a specific method of a computing interface constructing method according to an embodiment of the present invention, where the method specifically includes steps S201 to S207.
S201: and acquiring a function set, disassembling the function set to obtain at least one calculation function, and constructing a virtual class of the calculation function to obtain a calculation parent class.
In the step, a function set which is used for calculating basic data and is formed by at least one calculation function can be obtained from an existing data model, or a function set which is used for calculating data and is formed by at least one calculation function can be obtained from a preset calculation database; disassembling the function set to obtain a calculation function, and constructing a virtual class of the calculation function to obtain a calculation parent class at least comprising one calculation function;
in this embodiment, the data structure is constructed as a computation parent class in the form of map, that is: and taking the name of the calculation function as a main key and the calculation function as a key value.
It should be noted that the virtual class refers to a member function declared as virtual in a base class and redefined in one or more derivative classes, and the usage format is that the virtual function returns a type function name (parameter table) { function body }; polymorphism is achieved, and homonym overlay member functions in the derived classes are accessed through base class pointers or references pointing to the derived classes.
S202: inheriting at least one computation parent class to obtain a computation subclass, and storing the computation subclass in a preset cache module.
In the step, the computation parent class capable of being repeatedly called is set, so that the computation subclass stored in the cache module can inherit the statement block of the computation parent class as required, repeated calling of commonly used computation functions by a plurality of interfaces is realized, the construction efficiency of the interfaces is improved, and the redundancy of codes is reduced.
Illustratively, the following code is now provided, in which, in order to reduce duplicated code, the definition contents of the attribute part are omitted in each class, and only the contents of the Print method part are retained:
Figure BDA0002662771950000071
Figure BDA0002662771950000081
person, the statement block of the computation parent class only needs to be inherited by a base.print () statement, as follows:
Figure BDA0002662771950000082
Figure BDA0002662771950000091
in this embodiment, a cache may be used as the cache module, and a redis may also be used as the cache module.
S203: defining the computation subclass as a member variable in the class of the cache module, so that all classes in the cache module can call the computation subclass.
In this step, the member variable refers to a variable defined in the class body, and the scope of action is the whole class, as long as statements in this class can access it, so that by defining the computation subclass as the member variable in the class body of the class of the cache module, all statements in the whole class can access the computation subclass, thereby ensuring the reliability of the cache module in invoking the computation subclass.
It should be noted that values can be used internally by Analysis Services to identify a dimension member. The MemberKeyColumn attribute specifies the member variables for a dimension. For example, a number between 1 and 12 may be a member variable corresponding to a month of the year.
S204: the method comprises the steps of obtaining user data of at least one preset data carrier, splitting the user data by adopting a segmented locking Hash rule to obtain a parallel data stream, and recording the parallel data stream serving as basic data into at least one register carrier pre-bound with the data carrier.
In this step, the data carrier is a database or a server storing user data, the parallel data stream is a plurality of data blocks formed by dividing the user data in the data carrier, and the register carrier is bound with at least one data carrier, thereby realizing the classified management of the data carrier.
In this embodiment, a current Hash Map is used as a segment lock Hash rule, it should be noted that the current Hash Map uses a segment lock technology to divide data into segments for storage, and then a lock is allocated to each segment of data, when one thread occupies the lock to access one segment of data, the data of other segments can be accessed by other threads, so as to implement real Concurrent access, thereby improving the efficiency of obtaining user data from a data carrier, and avoiding the occurrence of data obtaining confusion caused by processing parallel data streams after the user data is divided into the parallel data streams. The Hash map is a Hash association container for associating the value data of the object with the key, so that the user data obtained from the data carrier is stored in the register carrier in the form of key value pairs and as basic data through the segment-lock Hash rule, so as to call the basic data.
The process of segmenting data by using the current hash map, performing access processing on the data by using a preset thread, and performing hash on user data to obtain basic data of a hash map data structure (such as a key value pair form) belongs to the prior art, so that a person skilled in the art can easily obtain the basic data of the hash map data structure by using the prior art, and the technical problems solved in the step are how to improve the efficiency of obtaining the data from the data carrier and inputting the data into the register carrier, how to manage the change of the binding relationship between the data carrier and the register carrier, and avoiding the occurrence of data obtaining and inputting disorder caused by the change, so the technical principles of the current hash map and the hash on the user data are not repeated here.
S205: and inputting the obtained basic data into a preset table in the cache module to obtain a matrix table for storing each character string in the basic data in a table form.
In the step, basic data are obtained from a register carrier through a get data method, the basic data are input into a preset table of a cache module through a load data infill statement, and finally a matrix table is obtained, so that the basic data are structurally processed, and the calling efficiency of character strings in the basic data is further ensured.
S206: and identifying the row header and the column header of the character string in the matrix table, and taking the row header and the column header as coordinate information and storing the coordinate information in the cache module.
By identifying the row titles and the column titles of the character strings in the matrix table, the character strings are called according to the row titles and the column titles through a calling function, and the data calling efficiency is improved.
In this embodiment, the call function is application.
In an exemplary embodiment, assume that the matrix table expresses repayment amounts for the user over months of the year, where the row is titled year, such as: 2017, 2018, 2019, etc., with the column heading month, such as: from 1 month to 12 months; then, receiving a call request sent by a user side, identifying the calculation factors of the calculation subclasses according to the call request and setting the calculation factors as call parameters, wherein the call parameters comprise first dimension data belonging to row headers in the matrix table and second dimension data belonging to column headers in the matrix table; for example: the first dimension data was 2018 and the second dimension data was 4 months.
Extracting a row title consistent with the first dimension data in the matrix table and a character string corresponding to a column title consistent with the second dimension data according to the first dimension data and the second dimension data through the calling function; for example: and obtaining the repayment amount of the 4 months in 2018 in the matrix table to be 200 ten-thousand yuan.
Illustratively, the following code is provided:
if(i==2018,j==4)
{
application, loadlevel ("2018, month 4");
}
after obtaining the matrix table for storing each character string in the basic data in a table form, the method further comprises the following steps:
and uploading the matrix table to a block chain.
It should be noted that the corresponding digest information is obtained based on the matrix table, and specifically, the digest information is obtained by performing hash processing on the matrix table, for example, by using the sha256s algorithm. Uploading summary information to the blockchain can ensure the safety and the fair transparency of the user. The user equipment can download the summary information from the blockchain so as to verify whether the matrix table is tampered. The blockchain referred to in this example is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, consensus mechanism, encryption algorithm, and the like. A block chain (Blockchain), which is essentially a decentralized database, is a series of data blocks associated by using a cryptographic method, and each data block contains information of a batch of network transactions, so as to verify the validity (anti-counterfeiting) of the information and generate a next block. The blockchain may include a blockchain underlying platform, a platform product service layer, an application service layer, and the like.
S207: setting a trigger thread in the cache module, wherein the trigger thread is used for calling the computation subclass and the matrix table according to a call request sent by a user side to obtain a computation result; and encapsulating the cache module to obtain a calculation interface, and setting the names of the calculation subclasses and the character table as the labels of the calculation interface.
In the step, the user side can directly send the calling request by setting the triggering thread to obtain the corresponding calculation result without selecting the data to be calculated and the formula to be used one by one, so that the technical effect of quickly calling the automatic calculation is realized, and the convenience of the user and the calculation result obtaining speed are improved.
The method comprises the following steps that the encapsulation is to hide the attribute and implementation details of an object, only an interface is externally disclosed, and the access level of reading and modifying the attribute in a program is controlled; the abstracted data and behaviors (or functions) are combined to form an organic whole, namely, the data and source codes of operation data are combined organically to form a class, wherein the data and the functions are members of the class.
Therefore, the calculation interface is obtained by packaging the cache module, so that the user terminal can call the calculation subclass and the matrix table conveniently, and the use convenience of the calculation subclass and the matrix table is improved.
In this embodiment, the computation subclasses, the matrix table, and the coordinate information in the cache module may be packaged into an executable file similar to the exe executable file or jar executable file, and when the client sends a call request, the executable file may be directly run and a required return result may be obtained.
The name of the subclass of calculation (such as summation) and the name of the character table (such as the repayment amount table of company A); set to the label of the computing interface, namely: and the company A repayment summing interface is used for facilitating the user side to obtain the required computing interface according to the label.
In a preferred embodiment, the trigger thread includes:
the first trigger thread is used for identifying the calculation factors of the calculation subclasses according to a calling request sent by a user side and setting the calculation factors as calling parameters;
the second trigger thread is used for acquiring a character string corresponding to the coordinate information consistent with the calling parameter from the matrix table;
and the third trigger thread is used for calling the computation subclass to compute the character string and obtain a return result.
In an exemplary embodiment, a call request sent by a user side is received, for example: company A, total amount of 2018 annual repayment; invoking the first trigger thread, and identifying a computing interface corresponding to the invocation request, for example: company a repayment sum interface. Identifying a calculation factor of a calculation subclass in the calculation interface according to the call request, and setting the calculation factor as a call parameter, for example: the calculation factors identified according to the call request include: the payment amount of the year 1 and the month 1 of 2018-the payment amount of the year 12 of 2018 are set as calling parameters, wherein the first dimension data of the calling parameters are years, such as the year 2018, and the second dimension data are months, such as the month 1; from this, 12 call parameters will be obtained.
Calling a second trigger thread, and sequentially extracting character strings corresponding to the coordinate information consistent with each calling parameter through the calling function, namely: extracting a row title which is consistent with the first dimension data in the matrix table, and extracting a character string which is corresponding to a column title which is consistent with the second dimension data; for example: in the obtained matrix table, the repayment amount in 1 month in 2018 is 100 ten-thousand yuan, the repayment amount in 2 month in 2018 is 200 ten-thousand yuan, the repayment amount in 3 month in 2018 is 300 ten-thousand yuan, the repayment amount in 4 month in 2018 is 200 ten-thousand yuan, the repayment amount in 5 month in 2018 is 300 ten-thousand yuan, the repayment amount in 6 month in 2018 is 100 ten-thousand yuan, the repayment amount in 7 month in 2018 is 300 ten-thousand yuan, the repayment amount in 8 month in 2018 is 200 ten-thousand yuan, the repayment amount in 9 month in 2018 is 100 ten-thousand yuan, the repayment amount in 10 month in 2018 is 200 ten-thousand yuan, the repayment amount in 11 month in 2018 is 300 ten-thousand yuan, and the repayment amount in 12 month in 2018 is 100 ten-thousand yuan.
Calling a third triggering thread, and using a summation formula in the calculation operator class to perform summation calculation on the character strings to obtain a calculation result, namely: the total repayment amount from 1 month to 12 months in 2018 is 2400 ten thousand yuan.
Example three:
referring to fig. 4, a computing interface constructing apparatus 1 of the present embodiment includes:
the parent construction module 11 is configured to obtain a function set, disassemble the function set to obtain at least one calculation function, and construct a virtual class of the calculation function to obtain a calculation parent class;
the subclass building module 12 is configured to inherit at least one computation parent class to obtain a computation subclass, and store the computation subclass in a preset cache module;
the data entry module 15 is configured to enter the obtained basic data into a preset table in the cache module, and obtain a matrix table that stores each character string in the basic data in a table form;
the interface creating module 17 is configured to set a trigger thread in the cache module, where the trigger thread is configured to call the computation subclass and the matrix table according to a call request sent by a user end to obtain a computation result; and encapsulating the cache module to obtain a calculation interface, and setting the names of the calculation subclasses and the character table as the labels of the calculation interface.
Optionally, the computing interface constructing apparatus 1 further includes:
a subclass defining module 13, configured to define the computation subclass as a member variable in the class of the cache module, so that all classes in the cache module can call the computation subclass.
Optionally, the computing interface constructing apparatus 1 further includes:
the data obtaining module 14 is configured to obtain user data of at least one preset data carrier, split the user data by using a segment-locked hash rule to obtain a parallel data stream, and record the parallel data stream as basic data into at least one register carrier pre-bound to the data carrier.
Optionally, the computing interface constructing apparatus 1 further includes:
and the title identification module 16 is used for identifying the row titles and the column titles of the character strings in the matrix table, taking the row titles and the column titles as coordinate information and storing the coordinate information in the cache module.
The technical scheme is applied to the technical field of development of computer research and development management, the computing parent class is obtained by providing the virtual class for constructing the computing function and inherits the virtual class, so that the computing child class is obtained and loaded into the cache module, the basic data is recorded into a preset table in the cache module to obtain a matrix table and loaded into the cache module, a triggering thread is arranged in the cache module and a module management tool for obtaining a computing interface is obtained through encapsulation, and the technical effect of providing a development auxiliary function is achieved.
Example four:
in order to achieve the above object, the present invention further provides a computer device 6, components of the computing interface constructing apparatus 1 according to the third embodiment may be distributed in different computer devices, and the computer device 6 may be a smart phone, a tablet computer, a notebook computer, a desktop computer, a rack server, a blade server, a tower server, or a rack server (including an independent server or a server cluster composed of a plurality of application servers) for executing programs. The computer device of the embodiment at least includes but is not limited to: a memory 61, a processor 62, which may be communicatively coupled to each other via a system bus, as shown in FIG. 5. It should be noted that fig. 5 only shows a computer device with components, but it should be understood that not all of the shown components are required to be implemented, and more or fewer components may be implemented instead.
In the present embodiment, the memory 61 (i.e., a readable storage medium) includes a flash memory, a hard disk, a multimedia card, a card-type memory (e.g., SD or DX memory, etc.), a Random Access Memory (RAM), a Static Random Access Memory (SRAM), a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), a programmable read-only memory (PROM), a magnetic memory, a magnetic disk, an optical disk, and the like. In some embodiments, the memory 61 may be an internal storage unit of the computer device, such as a hard disk or a memory of the computer device. In other embodiments, the memory 61 may also be an external storage device of the computer device, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), or the like, provided on the computer device. Of course, the memory 61 may also include both internal and external storage devices of the computer device. In this embodiment, the memory 61 is generally used for storing an operating system and various types of application software installed in the computer device, for example, the program codes of the computing interface constructing apparatus in the third embodiment. Further, the memory 61 may also be used to temporarily store various types of data that have been output or are to be output.
Processor 62 may be a Central Processing Unit (CPU), controller, microcontroller, microprocessor, or other data Processing chip in some embodiments. The processor 62 is typically used to control the overall operation of the computer device. In this embodiment, the processor 62 is configured to execute the program codes stored in the memory 61 or process data, for example, execute the computing interface constructing apparatus, so as to implement the computing interface constructing method of the first embodiment and the second embodiment.
Example five:
to achieve the above objects, the present invention also provides a computer-readable storage medium, such as a flash memory, a hard disk, a multimedia card, a card-type memory (e.g., SD or DX memory, etc.), a Random Access Memory (RAM), a Static Random Access Memory (SRAM), a Read Only Memory (ROM), an Electrically Erasable Programmable Read Only Memory (EEPROM), a Programmable Read Only Memory (PROM), a magnetic memory, a magnetic disk, an optical disk, a server, an App application store, etc., on which a computer program is stored, which when executed by a processor 62, implements corresponding functions. The computer-readable storage medium of the present embodiment is used for storing a computing interface construction apparatus, and when executed by the processor 62, implements the computing interface construction method of the first embodiment and the second embodiment.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (10)

1. A computing interface construction method, comprising:
acquiring a function set, disassembling the function set to obtain at least one calculation function, and constructing a virtual class of the calculation function to obtain a calculation parent class;
inheriting at least one computation parent class to obtain a computation subclass and storing the computation subclass in a preset cache module;
inputting the obtained basic data into a preset table in the cache module to obtain a matrix table for storing each character string in the basic data in a table form;
setting a trigger thread in the cache module, wherein the trigger thread is used for calling the computation subclass and the matrix table according to a call request sent by a user side to obtain a computation result; and encapsulating the cache module to obtain a calculation interface, and setting the names of the calculation subclasses and the character table as the labels of the calculation interface.
2. The method for building the computing interface according to claim 1, wherein the building data structure is a computing parent class in a map form, wherein the name of the computing function is used as a primary key, and the computing function is used as a key value; and adopting cache or redis as the cache module.
3. The method according to claim 1, wherein after inheriting at least one of the computation parent classes to obtain a computation child class and storing the computation child class in a preset cache module, the method further comprises:
defining the computation subclass as a member variable in the class of the cache module, so that all classes in the cache module can call the computation subclass;
the method comprises the steps of obtaining user data of at least one preset data carrier, splitting the user data by adopting a segmented locking Hash rule to obtain a parallel data stream, and recording the parallel data stream serving as basic data into at least one register carrier pre-bound with the data carrier.
4. The computing interface construction method according to claim 3, wherein a current hash map is used as a segment-lock hash rule, the data carrier is a database or a server that stores user data, the parallel data stream is a plurality of data blocks formed by dividing the user data in the data carrier, and the register carrier is bound to at least one data carrier.
5. The computing interface construction method according to claim 3, wherein entering the obtained basic data into a preset table in the cache module comprises:
and acquiring basic data from a register carrier by a get data method, and inputting the basic data into a preset table of a cache module by a load data infill statement.
6. The method for building the computing interface according to claim 1, wherein after obtaining the matrix table for storing each character string in the basic data in a table form, the method comprises:
identifying row titles and column titles of character strings in the matrix table, using the row titles and the column titles as coordinate information and storing the coordinate information in the cache module;
after obtaining the matrix table for storing each character string in the basic data in a table form, the method further comprises the following steps:
and uploading the matrix table to a block chain.
7. The computing interface construction method according to claim 6, wherein the triggering thread comprises:
the first trigger thread is used for identifying the calculation factors of the calculation subclasses according to a calling request sent by a user side and setting the calculation factors as calling parameters;
the second trigger thread is used for acquiring a character string corresponding to the coordinate information consistent with the calling parameter from the matrix table;
and the third trigger thread is used for calling the computation subclass to compute the character string and obtain a return result.
8. A computing interface construction apparatus, comprising:
the parent construction module is used for acquiring a function set, disassembling the function set to obtain at least one calculation function, and constructing a virtual class of the calculation function to obtain a calculation parent class;
the subclass building module is used for inheriting at least one computation parent class to obtain a computation subclass and storing the computation subclass in a preset cache module;
the data entry module is used for entering the obtained basic data into a preset table in the cache module to obtain a matrix table for storing each character string in the basic data in a table form;
the interface creating module is used for setting a triggering thread in the cache module, and the triggering thread is used for calling the calculation subclass and the matrix table according to a calling request sent by a user side to obtain a calculation result; and encapsulating the cache module to obtain a calculation interface, and setting the names of the calculation subclasses and the character table as the labels of the calculation interface.
9. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the steps of the computing interface construction method according to any one of claims 1 to 7 are implemented when the processor of the computer device executes the computer program.
10. A computer-readable storage medium, on which a computer program is stored, the computer program stored in the computer-readable storage medium, when being executed by a processor, implementing the steps of the computing interface construction method according to any one of claims 1 to 7.
CN202010909638.2A 2020-09-02 2020-09-02 Computing interface construction method and device, computer equipment and readable storage medium Pending CN112052034A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010909638.2A CN112052034A (en) 2020-09-02 2020-09-02 Computing interface construction method and device, computer equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010909638.2A CN112052034A (en) 2020-09-02 2020-09-02 Computing interface construction method and device, computer equipment and readable storage medium

Publications (1)

Publication Number Publication Date
CN112052034A true CN112052034A (en) 2020-12-08

Family

ID=73607696

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010909638.2A Pending CN112052034A (en) 2020-09-02 2020-09-02 Computing interface construction method and device, computer equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN112052034A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050091672A1 (en) * 2003-10-24 2005-04-28 Microsoft Corporation Facilitating presentation functionality through a programming interface media namespace
CN105404611A (en) * 2015-11-09 2016-03-16 南京大学 Matrix model based multi-calculation-engine automatic selection method
US9959098B1 (en) * 2015-03-15 2018-05-01 Sigma Sciences Limited Data processing systems and methods
CN109684324A (en) * 2017-10-18 2019-04-26 阿里巴巴集团控股有限公司 A kind of data processing method and its Related product

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050091672A1 (en) * 2003-10-24 2005-04-28 Microsoft Corporation Facilitating presentation functionality through a programming interface media namespace
US9959098B1 (en) * 2015-03-15 2018-05-01 Sigma Sciences Limited Data processing systems and methods
CN105404611A (en) * 2015-11-09 2016-03-16 南京大学 Matrix model based multi-calculation-engine automatic selection method
CN109684324A (en) * 2017-10-18 2019-04-26 阿里巴巴集团控股有限公司 A kind of data processing method and its Related product

Similar Documents

Publication Publication Date Title
CN108958714B (en) Business component type development method and device, computer equipment and storage medium
CN110764942A (en) Multi-type data checking method, device, computer system and readable storage medium
CN112052138A (en) Service data quality detection method and device, computer equipment and storage medium
CN110990403A (en) Business data storage method, system, computer equipment and storage medium
CN112559635B (en) Service processing method, device, equipment and medium for Ethernet alliance chain node
CN111563016A (en) Log collection and analysis method and device, computer system and readable storage medium
CN112231416A (en) Knowledge graph ontology updating method and device, computer equipment and storage medium
CN112181430A (en) Code change statistical method and device, electronic equipment and storage medium
CN110309496B (en) Data summarizing method, electronic device and computer readable storage medium
CN112052141B (en) Data fragment verification method and device, computer equipment and readable storage medium
CN111984674A (en) Method and system for generating structured query language
CN113535677A (en) Data analysis query management method and device, computer equipment and storage medium
CN112364022A (en) Information derivation management method and device, computer equipment and readable storage medium
CN112580079A (en) Authority configuration method and device, electronic equipment and readable storage medium
CN112631719B (en) Data prediction model calling method, device, equipment and storage medium
CN112052034A (en) Computing interface construction method and device, computer equipment and readable storage medium
CN112528189B (en) Data-based component packaging method and device, computer equipment and storage medium
CN111857662B (en) Programming method for describing specific constitution of object based on MAP and interface
CN111580799A (en) Domain specific language script assembling method and system
CN112818199A (en) Webpage access method and device, computer equipment and storage medium
CN113342647A (en) Test data generation method and device
CN112416488A (en) User portrait implementation method and device, computer equipment and computer readable storage medium
CN113806372B (en) New data information construction method, device, computer equipment and storage medium
CN113434505B (en) Transaction information attribute retrieval method, device, computer equipment and storage medium
CN113434359B (en) Data traceability system construction method and device, electronic device and readable storage medium

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