CN112328960B - Optimization method and device for data operation, electronic equipment and storage medium - Google Patents

Optimization method and device for data operation, electronic equipment and storage medium Download PDF

Info

Publication number
CN112328960B
CN112328960B CN202011205599.4A CN202011205599A CN112328960B CN 112328960 B CN112328960 B CN 112328960B CN 202011205599 A CN202011205599 A CN 202011205599A CN 112328960 B CN112328960 B CN 112328960B
Authority
CN
China
Prior art keywords
data
matrix
cluster
data blocks
list
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.)
Active
Application number
CN202011205599.4A
Other languages
Chinese (zh)
Other versions
CN112328960A (en
Inventor
黄安琪
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Property and Casualty Insurance Company of China Ltd
Original Assignee
Ping An Property and Casualty Insurance Company of China Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Property and Casualty Insurance Company of China Ltd filed Critical Ping An Property and Casualty Insurance Company of China Ltd
Priority to CN202011205599.4A priority Critical patent/CN112328960B/en
Publication of CN112328960A publication Critical patent/CN112328960A/en
Application granted granted Critical
Publication of CN112328960B publication Critical patent/CN112328960B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F17/00Digital computing or data processing equipment or methods, specially adapted for specific functions
    • G06F17/10Complex mathematical operations
    • G06F17/16Matrix or vector computation, e.g. matrix-matrix or matrix-vector multiplication, matrix factorization
    • 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/2453Query optimisation
    • 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/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor

Abstract

The invention relates to the field of data processing, and discloses a data operation optimization method, which comprises the following steps: obtaining a first data block set and a second data block set according to the first query information and the second query information; acquiring a preset number of data blocks from a first data block set and storing the data blocks in a first list, and acquiring a preset number of data blocks from a second data block set and storing the data blocks in a second list; decoding the data blocks in the first list and the second list to obtain a first matrix and a second matrix; and calculating the first matrix and the second matrix by utilizing a pre-constructed matrix operation function to obtain a data analysis value. The present invention also relates to blockchain techniques, the first set of data blocks and the second set of data blocks may be stored in a blockchain node. The invention also provides a data operation optimizing device, equipment and a storage medium. The invention can acquire data according to the query information, does not need to manually define the data, and can analyze the data with different element numbers.

Description

Optimization method and device for data operation, electronic equipment and storage medium
Technical Field
The present invention relates to the field of data processing, and in particular, to a method and apparatus for optimizing data operation, an electronic device, and a computer readable storage medium.
Background
Currently, many data analysis and processing scenarios (e.g., insurance data analysis and processing scenarios) are applied to matrix processing methods, and common matrix processing methods generally use Excel for processing, however, using Excel processing files requires that the file to be analyzed be imported into an Excel table and then processed by a specific processing function (e.g., an MMULT function), and the main disadvantage of this existing matrix processing method is that for an unequal amount of information, the processing cannot be performed once, and multiple functions are required to be called. Therefore, the problems that data are required to be imported into a table first, the data cannot be automatically selected and the analysis cannot be performed on matrixes with different element numbers exist at present when a large amount of data are analyzed.
Disclosure of Invention
The invention provides a data operation optimization method, a data operation optimization device, electronic equipment and a computer readable storage medium, and mainly aims to solve the problems that a traditional processing method cannot automatically select data and cannot analyze matrixes with different element numbers.
In order to achieve the above object, the present invention provides a method for optimizing data operation, including:
acquiring first query information and second query information input by a user, and respectively querying according to the first query information and the second query information to obtain first storage address information and second address storage information;
acquiring a first data block set and a second data block set according to the first storage address information and the second storage address information;
acquiring a first preset number of data blocks from the first data block set and storing the first preset number of data blocks in a first preset list, and acquiring a second preset number of data blocks from the second data block set and storing the second preset number of data blocks in a second preset list;
decoding the data blocks in the first list and the second list to obtain a first matrix and a second matrix respectively;
and calculating the first matrix and the second matrix by utilizing a pre-constructed matrix operation function to obtain a data analysis value.
Optionally, the acquiring a first preset number of data blocks from the first data block set and storing the first preset number of data blocks in a first preset list includes:
calling all data blocks in the first data block set, and storing the data blocks into the first list one by one according to the response speed of a hard disk or a magnetic disk where the data blocks are located;
And stopping the calling operation when the number of the data blocks stored in the first list reaches a first preset number.
Optionally, decoding the data blocks in the first list and the second list to obtain a first matrix and a second matrix respectively, including:
performing erasure code decoding on the data blocks in the first list and the second list respectively to obtain a first data cluster and a second data cluster respectively;
initializing a cluster center of the first data cluster and a cluster center of the second data cluster to respectively obtain a first initial cluster center and a second initial cluster center;
calculating a first loss value of the first data cluster by using the first initial cluster center through variance, calculating a second loss value of the second data cluster by using the second initial cluster center through variance, respectively comparing the first loss value with a preset threshold value, and comparing the second loss value with the preset threshold value, wherein when the first loss value is smaller than the preset threshold value, a first number set is obtained, and when the second loss value is smaller than the preset threshold value, a second number set is obtained;
and respectively constructing the first matrix and the second matrix according to the first number set and the second number set.
Optionally, the calculating, by using the first initial cluster core through variance, a first loss value of the first data cluster, and calculating, by using the second initial cluster core through variance, a second loss value of the second data cluster includes:
mapping the data of the first data cluster and the data of the second data cluster into a two-dimensional coordinate system;
in the two-dimensional coordinate system, performing variance calculation on the data of the first data cluster and the first initial cluster center, and performing variance calculation on the data of the second data cluster and the second initial cluster center to respectively obtain a first loss value and a second loss value;
and when the first loss value is larger than or equal to a preset threshold value, randomly determining cluster centers of the first data cluster again, calculating the first loss value until the first loss value is smaller than the threshold value, and when the second loss value is larger than or equal to the preset threshold value, randomly determining cluster centers of the second data cluster again, and calculating the second loss value until the second loss value is smaller than the threshold value.
Optionally, before the first query information and the second query information input by the user are obtained and the first storage address information and the second storage address information are respectively obtained according to the first query information and the second query information, the method further includes:
Acquiring an interface and a blockchain node of a pre-constructed database management system, and connecting the database management system and the blockchain node according to the interface;
acquiring original data, and differentiating the original data into data blocks with the same number as the block chain link points by utilizing a pre-constructed erasure code;
calculating key word information of the data block; the data blocks are stored to the blockchain nodes in a distributed mode through the database management system;
mapping the key information and address storage information corresponding to the data block, and storing the key information and the address storage information in the database management system.
Optionally, the calculating the first matrix and the second matrix by using a pre-constructed matrix operation function to obtain a data analysis value includes:
when the number of the elements is the same, calculating the first matrix and the second matrix by using a single matrix operation function to obtain a data analysis value;
and when the element numbers are different, calculating the first matrix and the second matrix by using a multiple matrix operation function to obtain a data analysis value.
Optionally, the performing product operation on the first matrix and the second matrix by using a multiple matrix operation function to obtain a data analysis value includes:
Traversing the first matrix, randomly extracting an element from the first matrix, inquiring the element in the database management system to obtain a data cluster related to the element, converting the data cluster into a matrix, and multiplying the matrix by the second matrix to obtain an intermediate operation result set;
and adding and opening the intermediate operation results in the intermediate operation result set to obtain the data analysis value.
In order to solve the above problems, the present invention further provides an optimizing apparatus for data operation, the apparatus comprising:
the query module is used for acquiring first query information and second query information input by a user, respectively querying to obtain first storage address information and second address storage information according to the first query information and the second query information, and acquiring a first data block set and a second data block set according to the first storage address information and the second storage address information;
the calling module is used for acquiring a first preset number of data blocks from the first data block set and storing the first preset number of data blocks in a first preset list, and acquiring a second preset number of data blocks from the second data block set and storing the second preset number of data blocks in a second preset list;
The decoding module is used for decoding the data blocks in the first list and the second list to obtain a first matrix and a second matrix respectively;
and the operation module is used for operating the first matrix and the second matrix by utilizing a pre-constructed matrix operation function to obtain a data analysis value.
In order to solve the above-mentioned problems, the present invention also provides an electronic apparatus including: at least one processor; the method comprises the steps of,
a memory communicatively coupled to the at least one processor; wherein, the liquid crystal display device comprises a liquid crystal display device,
the memory stores computer program instructions executable by the at least one processor to enable the at least one processor to perform the method of optimizing data operations described above.
In order to solve the above-mentioned problems, the present invention also provides a computer-readable storage medium including a storage data area storing created data and a storage program area storing a computer program; wherein the computer program when executed by the processor implements the above-described data operation optimization method.
According to the embodiment of the invention, the first data block set and the second data block set are obtained according to the query information of the user, and the data to be processed is directly obtained through the query information without manually selecting the data. And acquiring a first preset number of data blocks from the first data block set and storing the first preset number of data blocks in a first preset list, acquiring a second preset number of data blocks from the second data block set and storing the second preset number of data blocks in a second preset list, dividing the data into different data blocks, and improving the utilization rate of the data storage space. And calculating the first matrix and the second matrix by using a pre-constructed matrix operation function to obtain a data analysis value, wherein the constructed matrix operation function can realize the operation on the matrixes with different element numbers. Therefore, the embodiment of the invention solves the problems that when matrix data are analyzed, the data are required to be imported into a table, operation data cannot be automatically selected, and the matrix with different element numbers cannot be analyzed.
Drawings
FIG. 1 is a flow chart of a method for optimizing data operations according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating a detailed implementation of one of the steps in the optimization method of the data operation provided in FIG. 1;
FIG. 3 is a schematic block diagram of an optimizing apparatus for data operation according to an embodiment of the present application;
fig. 4 is a schematic diagram of an internal structure of an electronic device for implementing an optimization method for data operation according to an embodiment of the present application;
the achievement of the objects, functional features and advantages of the present application will be further described with reference to the accompanying drawings, in conjunction with the embodiments.
Detailed Description
It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the application.
The application provides a data operation optimization method. The execution subject of the data operation optimization method includes, but is not limited to, at least one of a server, a terminal, and the like, which can be configured to execute the method provided by the embodiment of the application. In other words, the optimization method of the data operation may be performed by software or hardware installed in a terminal device or a server device, and the software may be a blockchain platform. The service end includes but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, and the like.
Referring to a flow chart of an optimization method of data operation shown in fig. 1, an embodiment of the application provides an optimization method of data operation, which includes:
S1, acquiring first query information and second query information input by a user, and respectively querying according to the first query information and the second query information to obtain first storage address information and second address storage information.
The first query information and the second query information are key word information of data which the user wants to analyze, and the embodiment of the invention can be applied to enterprises, banks, insurance and the like which need to analyze the data. Taking the processing of loan information by a bank as an example, the first query includes: the repayment capability factor name (information C), the repayment capability factor type (information D). And obtaining repayment capability factors (named as plan-class-a) through the information C and the information D. The second query information includes: capital monitoring ID (abbreviated as information A), risk ID (abbreviated as information B). And inquiring the specific value of the obtained repayment capability factor through the information A and the information B.
Further, in an embodiment of the present invention, before S1, the method includes:
acquiring an interface and a blockchain node of a pre-constructed database management system, and connecting the database management system and the blockchain node according to the interface;
Acquiring original data, and differentiating the original data into data blocks with the same number as the block chain link points by utilizing a pre-constructed erasure code;
calculating key word information of the data block; the data blocks are stored to the blockchain nodes in a distributed mode through the database management system;
mapping the key information and address storage information corresponding to the data block, and storing the key information and the address storage information in the database management system.
The embodiment of the invention can increase the space utilization rate of data storage by constructing a distributed storage system.
S2, acquiring a first data block set and a second data block set according to the first storage address information and the second storage address information.
In the embodiment of the invention, the first data block set and the second data block set are obtained from the blockchain node by inquiring the blockchain node where the corresponding data block is located through the first storage address information and the second storage address information.
S3, acquiring a first preset number of data blocks from the first data block set, storing the first preset number of data blocks in a preset first list, and acquiring a second preset number of data blocks from the second data block set, and storing the second preset number of data blocks in a preset second list.
In detail, in the embodiment of the present invention, the acquiring a first preset number of data blocks from the first data block set and storing the first preset number of data blocks in a first preset list includes: calling all data blocks in the first data block set, and storing the data blocks into the first list one by one according to the response speed of a hard disk or a magnetic disk where the data blocks are located; and stopping the calling operation when the number of the data blocks stored in the first list reaches a first preset number.
In the embodiment of the invention, the response speed is determined according to the hard disk or the magnetic disk where the data block is located, and the data block is acquired in sequence through the response speed, so that the recovery speed of the original data can be greatly increased, and the data calling efficiency is improved.
In the embodiment of the present invention, the operation process of acquiring the second preset number of data blocks from the second data block set and storing the second preset number of data blocks in the second preset list is similar to the operation process of acquiring the first preset number of data blocks from the first data block set and storing the first preset number of data blocks in the first preset list, which is not repeated herein.
S4, decoding the data blocks in the first list and the second list to obtain a first matrix and a second matrix respectively.
In detail, in the embodiment of the present invention, the S4 includes:
step a, erasure code decoding is carried out on the data blocks in the first list and the second list respectively, and a first data cluster and a second data cluster are obtained respectively;
in the embodiment of the invention, the erasure code decoding is a process of converting compiled data of a data block into original data. And decoding the data block through the erasure code to obtain the first data cluster and the second data cluster.
Initializing a cluster core of the first data cluster and a cluster core of the second data cluster to obtain a first initial cluster core and a second initial cluster core respectively;
c, calculating a first loss value of the first data cluster by using the first initial cluster center through variance, calculating a second loss value of the second data cluster by using the second initial cluster center through variance, respectively comparing the first loss value with a preset threshold value, comparing the second loss value with the preset threshold value, obtaining a first number set when the first loss value is smaller than the preset threshold value, and obtaining a second number set when the second loss value is smaller than the preset threshold value;
and d, respectively constructing the first matrix and the second matrix according to the first number set and the second number set.
In the embodiment of the invention, the loss value calculation method comprises the following steps:
wherein said x t For the data coordinates of the first data cluster core or the second data cluster core, the mu i For said x t The other data coordinates of the data cluster where K represents the number of data clusters, for example, two data clusters in this example, so k=2.
In the embodiment of the present invention, the calculating, by using the first initial cluster center and the variance, the first loss value of the first data cluster, and the calculating, by using the second initial cluster center and the variance, the second loss value of the second data cluster include:
mapping the data of the first data cluster and the data of the second data cluster into a two-dimensional coordinate system;
in the two-dimensional coordinate system, performing variance calculation on the data of the first data cluster and the first initial cluster center, and performing variance calculation on the data of the second data cluster and the second initial cluster center to respectively obtain a first loss value and a second loss value;
and when the first loss value is larger than or equal to a preset threshold value, randomly determining cluster centers of the first data cluster again, calculating the first loss value until the first loss value is smaller than the threshold value, and when the second loss value is larger than or equal to the preset threshold value, randomly determining cluster centers of the second data cluster again, and calculating the second loss value until the second loss value is smaller than the threshold value.
According to the embodiment of the invention, the first data cluster and the second data cluster are further classified through the clustering process of the step a, the step b and the step c, the data in the data clusters are converged, and the data analysis accuracy is improved.
Further, the process of constructing the first matrix and the second matrix from the first set of numbers and the second set of numbers respectively according to the embodiment of the present invention may be accomplished by a conversion package in a computer programming language.
S5, calculating the first matrix and the second matrix by utilizing a pre-constructed matrix operation function to obtain a data analysis value.
In the embodiment of the present invention, before the operation is performed on the first matrix and the second matrix, detecting the number of elements of the first matrix and the second matrix, and selecting a corresponding matrix operation function to perform the operation on the first matrix and the second matrix according to whether the number of elements is the same.
In detail, in the embodiment of the present invention, the calculating the first matrix and the second matrix by using the pre-constructed matrix operation function to obtain a data analysis value includes:
and step A, when the number of the elements is the same, calculating the first matrix and the second matrix by using a single matrix operation function to obtain a data analysis value.
When the number of the elements is the same, the embodiment of the invention multiplies the corresponding positions of the elements in the first matrix and the second matrix, and adds and then opens the result of the multiplication to obtain the data analysis value.
And B, when the element numbers are different, calculating the first matrix and the second matrix by using a multiple matrix operation function to obtain a data analysis value.
Further, in an embodiment of the present invention, the step B includes:
SB1, traversing the first matrix, randomly extracting an element from the first matrix, inquiring the element by using the database management system to obtain a data cluster related to the element, converting the data cluster into a matrix, and multiplying the matrix by the second matrix to obtain an intermediate operation result set;
SB2, adding and opening the intermediate operation result in the intermediate operation result set to obtain the data analysis value.
When the number of the elements is different, the embodiment of the invention traverses the first matrix, extracts an element Zi from the first matrix, queries the element Zi in the database management system to obtain a data cluster related to the element, converts the data cluster into a matrix Ai, and multiplies the matrix Ai by the second matrix to obtain an intermediate operation result set Re, for example: the intermediate operation result Rei =ai is a second matrix, and when the number of elements of the first matrix is 5, i=1, 2 … 5. And traversing the first matrix to obtain intermediate operation results of Z1, Z2, Z3, Z4 and Z5 as Re1, re2, re3, re4 and Re5 respectively.
Further, in the embodiment of the present invention, the intermediate operation result in the intermediate operation result set is subjected to the following operationAnd obtaining the data analysis value.
FIG. 3 is a schematic block diagram of an optimizing apparatus for data operation according to the present invention.
The data operation optimizing apparatus 100 of the present invention may be installed in an electronic device. Depending on the implemented functions, the data operation optimizing device 100 may include a query module 101, a retrieving module 102, a decoding module 103, and an operation module 104. The module of the present invention may also be referred to as a unit, meaning a series of computer program segments capable of being executed by the processor of the electronic device and of performing fixed functions, stored in the memory of the electronic device.
In the present embodiment, the functions concerning the respective modules/units are as follows:
the query module 101 is configured to obtain first query information and second query information input by a user, query to obtain first storage information and second storage information, and obtain a first data block set and a second data block set according to the first storage information and the second storage information.
The first query information and the second query information are key word information of data which the user wants to analyze, and the embodiment of the invention can be applied to enterprises, banks, insurance and the like which need to analyze the data. Taking the processing of loan information by a bank as an example, the first query includes: the repayment capability factor name (information C), the repayment capability factor type (information D). And obtaining repayment capability factors (named as plan-class-a) through the information C and the information D. The second query information includes: capital monitoring ID (abbreviated as information A), risk ID (abbreviated as information B). And inquiring the specific value of the obtained repayment capability factor through the information A and the information B.
Further, in the embodiment of the present invention, the query module 101 is further configured to include:
acquiring an interface and a blockchain node of a pre-constructed database management system, and connecting the database management system and the blockchain node according to the interface;
acquiring original data, and differentiating the original data into data blocks with the same number as the block chain link points by utilizing a pre-constructed erasure code;
calculating key word information of the data block; the data blocks are stored to the blockchain nodes in a distributed mode through the database management system;
mapping the key information and address storage information corresponding to the data block, and storing the key information and the address storage information in the database management system.
The embodiment of the invention can increase the space utilization rate of data storage by constructing a distributed storage system.
In the embodiment of the present invention, the query module 101 queries, through the first storage address information and the second storage address information, a blockchain node where a corresponding data block is located, and obtains the first data block set and the second data block set from the blockchain node.
The retrieving module 102 is configured to obtain a first preset number of data blocks from the first data block set and store the first preset number of data blocks in a first preset list, and obtain a second preset number of data blocks from the second data block set and store the second preset number of data blocks in a second preset list.
In detail, in the embodiment of the present invention, the retrieving module 102 obtains a first preset number of data blocks from the first data block set and stores the first preset number of data blocks in a first pre-constructed list, including: calling all data blocks in the first data block set, and storing the data blocks into the first list one by one according to the response speed of a hard disk or a magnetic disk where the data blocks are located; and stopping the calling process and storing the data blocks in the first list when the number of the data blocks stored in the first list reaches the first preset number.
In the embodiment of the invention, the response speed is determined according to the hard disk or the magnetic disk where the data block is located, and the data block is acquired in sequence through the response speed, so that the recovery speed of the original data can be greatly increased, and the data calling efficiency is improved.
In the embodiment of the present invention, the operation process of the retrieving module 102 for obtaining the second preset number of data blocks from the second data block set and storing the second preset number of data blocks in the second preset list is similar to the above-mentioned operation process of obtaining the first preset number of data blocks from the first data block set and storing the first preset number of data blocks in the first preset list, and will not be repeated here.
The decoding module 103 is configured to decode the data blocks in the first list and the second list to obtain a first matrix and a second matrix respectively.
In detail, in the embodiment of the present invention, the decoding module 103 decodes the data blocks in the first list and the second list to obtain a first matrix and a second matrix, respectively, including:
step a, erasure code decoding is carried out on the data blocks in the first list and the second list respectively, and a first data cluster and a second data cluster are obtained respectively;
in the embodiment of the invention, the erasure code decoding is a process of converting compiled data of a data block into original data. And decoding the data block through the erasure code to obtain the first data cluster and the second data cluster.
Initializing a cluster core of the first data cluster and a cluster core of the second data cluster to obtain a first initial cluster core and a second initial cluster core respectively;
c, calculating a first loss value of the first data cluster by using the first initial cluster center through variance, calculating a second loss value of the second data cluster by using the second initial cluster center through variance, respectively comparing the first loss value with a preset threshold value, comparing the second loss value with the preset threshold value, obtaining a first number set when the first loss value is smaller than the preset threshold value, and obtaining a second number set when the second loss value is smaller than the preset threshold value;
And d, respectively constructing the first matrix and the second matrix according to the first number set and the second number set.
In the embodiment of the invention, the loss value calculation method comprises the following steps:
wherein said x t For the data coordinates of the first data cluster core or the second data cluster core, the mu i For said x t The other data coordinates of the data cluster where K represents the number of data clusters, for example, two data clusters in this example, so k=2.
In the embodiment of the present invention, the calculating, by using the first initial cluster center and the variance, the first loss value of the first data cluster, and the calculating, by using the second initial cluster center and the variance, the second loss value of the second data cluster include:
mapping the data of the first data cluster and the data of the second data cluster into a two-dimensional coordinate system;
in the two-dimensional coordinate system, performing variance calculation on the data of the first data cluster and the first initial cluster center, and performing variance calculation on the data of the second data cluster and the second initial cluster center to respectively obtain a first loss value and a second loss value;
and when the first loss value is larger than or equal to a preset threshold value, randomly determining cluster centers of the first data cluster again, calculating the first loss value until the first loss value is smaller than the threshold value, and when the second loss value is larger than or equal to the preset threshold value, randomly determining cluster centers of the second data cluster again, and calculating the second loss value until the second loss value is smaller than the threshold value. According to the embodiment of the invention, the first data cluster and the second data cluster are further classified through the clustering process of the step a, the step b and the step c, the data in the data clusters are converged, and the data analysis accuracy is improved.
Further, the process of constructing the first matrix and the second matrix from the first set of numbers and the second set of numbers respectively according to the embodiment of the present invention may be accomplished by a conversion package in a computer programming language.
The operation module 104 is configured to operate on the first matrix and the second matrix by using a pre-constructed matrix operation function, so as to obtain a data analysis value.
In the embodiment of the present invention, before the operation is performed on the first matrix and the second matrix, detecting the number of elements of the first matrix and the second matrix, and selecting a corresponding matrix operation function to perform the operation on the first matrix and the second matrix according to whether the number of elements is the same.
In detail, in the embodiment of the present invention, the calculating the first matrix and the second matrix by using the pre-constructed matrix operation function to obtain a data analysis value includes:
and step A, when the number of the elements is the same, calculating the first matrix and the second matrix by using a single matrix operation function to obtain a data analysis value.
When the number of the elements is the same, the embodiment of the invention multiplies the corresponding positions of the elements in the first matrix and the second matrix, and adds and then opens the result of the multiplication to obtain the data analysis value.
And B, when the element numbers are different, calculating the first matrix and the second matrix by using a multiple matrix operation function to obtain a data analysis value.
Further, in an embodiment of the present invention, the step B includes:
SB1, traversing the first matrix, randomly extracting an element from the first matrix, inquiring the element by using the database management system to obtain a data cluster related to the element, converting the data cluster into a matrix, and multiplying the matrix by the second matrix to obtain an intermediate operation result set;
SB2, adding and opening the intermediate operation result in the intermediate operation result set to obtain the data analysis value.
When the number of the elements is different, the embodiment of the invention traverses the first matrix, extracts an element Zi from the first matrix, queries the element Zi in the database management system to obtain a data cluster related to the element, converts the data cluster into a matrix Ai, and multiplies the matrix Ai by the second matrix to obtain an intermediate operation result set Re, for example: the intermediate operation result Rei =ai is a second matrix, and when the number of elements of the first matrix is 5, i=1, 2 … 5. And traversing the first matrix to obtain intermediate operation results of Z1, Z2, Z3, Z4 and Z5 as Re1, re2, re3, re4 and Re5 respectively.
Further, in the embodiment of the present invention, the intermediate operation result in the intermediate operation result set is subjected to the following operationAnd obtaining the data analysis value.
Preferably, to ensure data security, the visualized dataflow monitoring graph may be stored in a blockchain.
Fig. 4 is a schematic structural diagram of an electronic device for implementing the optimization method of data operation according to the present invention.
The electronic device 1 may comprise a processor 10, a memory 11 and a bus, and may further comprise a computer program, such as a data-operated optimizer 12, stored in the memory 11 and executable on the processor 10.
The memory 11 includes at least one type of readable storage medium, including flash memory, a mobile hard disk, a multimedia card, a card memory (e.g., SD or DX memory, etc.), a magnetic memory, a magnetic disk, an optical disk, etc. The memory 11 may in some embodiments be an internal storage unit of the electronic device 1, such as a removable hard disk of the electronic device 1. The memory 11 may in other embodiments also be an external storage device of the electronic device 1, such as a plug-in mobile hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card) or the like, which are provided on the electronic device 1. Further, the memory 11 may also include both an internal storage unit and an external storage device of the electronic device 1. The memory 11 may be used not only for storing application software installed in the electronic device 1 and various types of data, such as codes of the data operation optimizing program 12, but also for temporarily storing data that has been output or is to be output.
The processor 10 may be comprised of integrated circuits in some embodiments, for example, a single packaged integrated circuit, or may be comprised of multiple integrated circuits packaged with the same or different functions, including one or more central processing units (Central Processing unit, CPU), microprocessors, digital processing chips, graphics processors, combinations of various control chips, and the like. The processor 10 is a Control Unit (Control Unit) of the electronic device, connects respective parts of the entire electronic device using various interfaces and lines, executes or executes programs or modules (e.g., an optimization program or the like for performing data operations) stored in the memory 11, and invokes data stored in the memory 11 to perform various functions of the electronic device 1 and process the data.
The bus may be a peripheral component interconnect standard (peripheral component interconnect, PCI) bus or an extended industry standard architecture (extended industry standard architecture, EISA) bus, among others. The bus may be classified as an address bus, a data bus, a control bus, etc. The bus is arranged to enable a connection communication between the memory 11 and at least one processor 10 etc.
Fig. 4 shows only an electronic device with components, it being understood by a person skilled in the art that the structure shown in fig. 4 does not constitute a limitation of the electronic device 1, and may comprise fewer or more components than shown, or may combine certain components, or may be arranged in different components.
For example, although not shown, the electronic device 1 may further include a power source (such as a battery) for supplying power to each component, and preferably, the power source may be logically connected to the at least one processor 10 through a power management device, so that functions of charge management, discharge management, power consumption management, and the like are implemented through the power management device. The power supply may also include one or more of any of a direct current or alternating current power supply, recharging device, power failure detection circuit, power converter or inverter, power status indicator, etc. The electronic device 1 may further include various sensors, bluetooth modules, wi-Fi modules, etc., which will not be described herein.
Further, the electronic device 1 may also comprise a network interface, optionally the network interface may comprise a wired interface and/or a wireless interface (e.g. WI-FI interface, bluetooth interface, etc.), typically used for establishing a communication connection between the electronic device 1 and other electronic devices.
The electronic device 1 may optionally further comprise a user interface, which may be a Display, an input unit, such as a Keyboard (Keyboard), or a standard wired interface, a wireless interface. Alternatively, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch, or the like. The display may also be referred to as a display screen or display unit, as appropriate, for displaying information processed in the electronic device 1 and for displaying a visual user interface.
It should be understood that the embodiments described are for illustrative purposes only and are not limited to this configuration in the scope of the patent application.
The optimization program 12 of data operations stored in the memory 11 of the electronic device 1 is a combination of a plurality of instructions, which, when executed in the processor 10, can implement:
acquiring first query information and second query information input by a user, and respectively querying according to the first query information and the second query information to obtain first storage address information and second address storage information;
acquiring a first data block set and a second data block set according to the first storage address information and the second storage address information;
Acquiring a first preset number of data blocks from the first data block set and storing the first preset number of data blocks in a first preset list, and acquiring a second preset number of data blocks from the second data block set and storing the second preset number of data blocks in a second preset list;
decoding the data blocks in the first list and the second list to obtain a first matrix and a second matrix respectively;
and calculating the first matrix and the second matrix by utilizing a pre-constructed matrix operation function to obtain a data analysis value.
Further, the modules/units integrated in the electronic device 1 may be stored in a computer readable storage medium if implemented in the form of software functional units and sold or used as separate products. The computer readable medium may include: any entity or device capable of carrying the computer program code, a recording medium, a U disk, a removable hard disk, a magnetic disk, an optical disk, a computer Memory, a Read-Only Memory (ROM).
Further, the computer-usable storage medium may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function, and the like; the storage data area may store data created from the use of blockchain nodes, and the like.
In the several embodiments provided in the present invention, it should be understood that the disclosed apparatus, device and method may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is merely a logical function division, and there may be other manners of division when actually implemented.
The modules described as separate components may or may not be physically separate, and components shown as modules may or may not be physical units, may be located in one place, or may be distributed over multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional module in the embodiments of the present invention may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units can be realized in a form of hardware or a form of hardware and a form of software functional modules.
It will be evident to those skilled in the art that the invention is not limited to the details of the foregoing illustrative embodiments, and that the present invention may be embodied in other specific forms without departing from the spirit or essential characteristics thereof.
The present embodiments are, therefore, to be considered in all respects as illustrative and not restrictive, the scope of the invention being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any accompanying diagram representation in the claims should not be considered as limiting the claim concerned.
The blockchain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, consensus mechanism, encryption algorithm and the like. The Blockchain (Blockchain), which is essentially a decentralised database, is a string of data blocks that are generated by cryptographic means in association, each data block containing a batch of information of network transactions for verifying the validity of the information (anti-counterfeiting) and generating the next block. The blockchain may include a blockchain underlying platform, a platform product services layer, an application services layer, and the like.
Furthermore, it is evident that the word "comprising" does not exclude other elements or steps, and that the singular does not exclude a plurality. A plurality of units or means recited in the system claims can also be implemented by means of software or hardware by means of one unit or means. The terms second, etc. are used to denote a name, but not any particular order.
Finally, it should be noted that the above-mentioned embodiments are merely for illustrating the technical solution of the present invention and not for limiting the same, and although the present invention has been described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that modifications and equivalents may be made to the technical solution of the present invention without departing from the spirit and scope of the technical solution of the present invention.

Claims (7)

1. A method of optimizing data operations, the method comprising:
acquiring first query information and second query information input by a user, and respectively querying according to the first query information and the second query information to obtain first storage address information and second storage address information;
acquiring a first data block set and a second data block set according to the first storage address information and the second storage address information;
acquiring a first preset number of data blocks from the first data block set and storing the first preset number of data blocks in a first preset list, and acquiring a second preset number of data blocks from the second data block set and storing the second preset number of data blocks in a second preset list;
decoding the data blocks in the first list and the second list to obtain a first matrix and a second matrix respectively;
Calculating the first matrix and the second matrix by utilizing a pre-constructed matrix operation function to obtain a data analysis value;
the decoding the data blocks in the first list and the second list to obtain a first matrix and a second matrix respectively includes: performing erasure code decoding on the data blocks in the first list and the second list respectively to obtain a first data cluster and a second data cluster respectively; initializing a cluster center of the first data cluster and a cluster center of the second data cluster to respectively obtain a first initial cluster center and a second initial cluster center; comparing the first loss value with a preset threshold value, comparing the second loss value with the preset threshold value respectively, obtaining a first number set when the first loss value is smaller than the preset threshold value, and obtaining a second number set when the second loss value is smaller than the preset threshold value; respectively constructing the first matrix and the second matrix according to the first number set and the second number set;
The calculating by using the first initial cluster core through variance to obtain a first loss value of the first data cluster, and calculating by using the second initial cluster core through variance to obtain a second loss value of the second data cluster includes: mapping the data of the first data cluster and the data of the second data cluster into a two-dimensional coordinate system; in the two-dimensional coordinate system, performing variance calculation on the data of the first data cluster and the first initial cluster center, and performing variance calculation on the data of the second data cluster and the second initial cluster center to respectively obtain a first loss value and a second loss value; when the first loss value is larger than or equal to a preset threshold value, randomly determining cluster centers of a first data cluster again, calculating a first loss value until the first loss value is smaller than the threshold value, and when the second loss value is larger than or equal to the preset threshold value, randomly determining cluster centers of a second data cluster again, and calculating a second loss value until the second loss value is smaller than the threshold value;
the calculating the first matrix and the second matrix by using the pre-constructed matrix operation function to obtain a data analysis value comprises the following steps: when the number of elements of the first matrix is the same as that of the second matrix, calculating the first matrix and the second matrix by using a single matrix operation function to obtain a data analysis value; and when the element numbers of the first matrix and the second matrix are different, calculating the first matrix and the second matrix by using a multiple matrix operation function to obtain a data analysis value.
2. The method for optimizing data operations according to claim 1, wherein said obtaining a first preset number of data blocks from said first set of data blocks and saving the first preset number of data blocks to a first list of pre-built data blocks comprises:
calling all data blocks in the first data block set, and storing the data blocks into the first list one by one according to the response speed of a hard disk or a magnetic disk where the data blocks are located;
and stopping calling all the data blocks in the first data block set when the number of the data blocks stored in the first list reaches a first preset number.
3. The method for optimizing data operation according to claim 1, wherein before the first query information and the second query information input by the user are obtained, and the first storage address information and the second address storage information are respectively obtained according to the first query information and the second query information, the method further comprises:
acquiring an interface and a blockchain node of a pre-constructed database management system, and connecting the database management system and the blockchain node according to the interface;
acquiring original data, and differentiating the original data into data blocks with the same number as the block chain link points by utilizing a pre-constructed erasure code;
Calculating key word information of the data block; the data blocks are stored to the blockchain nodes in a distributed mode through the database management system;
mapping the key information and address storage information corresponding to the data block, and storing the key information and the address storage information in the database management system.
4. The method for optimizing data operation as claimed in claim 3, wherein said multiplying said first matrix by said second matrix by using a multiple matrix operation function to obtain a data analysis value comprises:
traversing the first matrix, randomly extracting an element from the first matrix, inquiring the element in the database management system to obtain a data cluster related to the element, converting the data cluster into a matrix, and multiplying the matrix by the second matrix to obtain an intermediate operation result set;
and adding and opening the intermediate operation results in the intermediate operation result set to obtain the data analysis value.
5. An optimization apparatus for data operations, for implementing the optimization method for data operations according to any one of claims 1 to 4, the apparatus comprising:
The query module is used for acquiring first query information and second query information input by a user, respectively querying to obtain first storage address information and second storage address information according to the first query information and the second query information, and acquiring a first data block set and a second data block set according to the first storage address information and the second storage address information;
the calling module is used for acquiring a first preset number of data blocks from the first data block set and storing the first preset number of data blocks in a first preset list, and acquiring a second preset number of data blocks from the second data block set and storing the second preset number of data blocks in a second preset list;
the decoding module is used for decoding the data blocks in the first list and the second list to obtain a first matrix and a second matrix respectively;
and the operation module is used for operating the first matrix and the second matrix by utilizing a pre-constructed matrix operation function to obtain a data analysis value.
6. An electronic device, the electronic device comprising:
at least one processor; the method comprises the steps of,
a memory communicatively coupled to the at least one processor; wherein, the liquid crystal display device comprises a liquid crystal display device,
the memory stores computer program instructions executable by the at least one processor to enable the at least one processor to perform the method of optimizing data operations according to any one of claims 1 to 4.
7. A computer-readable storage medium comprising a storage data area and a storage program area, characterized in that the storage data area stores created data, the storage program area storing a computer program; wherein the computer program when executed by a processor implements the method of optimizing data operations according to any one of claims 1 to 4.
CN202011205599.4A 2020-11-02 2020-11-02 Optimization method and device for data operation, electronic equipment and storage medium Active CN112328960B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011205599.4A CN112328960B (en) 2020-11-02 2020-11-02 Optimization method and device for data operation, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011205599.4A CN112328960B (en) 2020-11-02 2020-11-02 Optimization method and device for data operation, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN112328960A CN112328960A (en) 2021-02-05
CN112328960B true CN112328960B (en) 2023-09-19

Family

ID=74324481

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011205599.4A Active CN112328960B (en) 2020-11-02 2020-11-02 Optimization method and device for data operation, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112328960B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001184336A (en) * 1999-12-17 2001-07-06 Samsung Electronics Co Ltd Matrix arithmetic unit and digital signal processor having matrix arithmetic function
WO2011156247A2 (en) * 2010-06-11 2011-12-15 Massachusetts Institute Of Technology Processor for large graph algorithm computations and matrix operations
WO2017124647A1 (en) * 2016-01-20 2017-07-27 北京中科寒武纪科技有限公司 Matrix calculation apparatus
KR20190027462A (en) * 2017-09-07 2019-03-15 주식회사 스마트데이터복구에스디알 Method and Apparatus of Data Recovery in Storage System
CN111539211A (en) * 2020-04-17 2020-08-14 中移(杭州)信息技术有限公司 Entity and semantic relation recognition method and device, electronic equipment and storage medium
CN111639153A (en) * 2020-04-24 2020-09-08 平安国际智慧城市科技股份有限公司 Query method and device based on legal knowledge graph, electronic equipment and medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11227030B2 (en) * 2019-04-01 2022-01-18 Wave Computing, Inc. Matrix multiplication engine using pipelining

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001184336A (en) * 1999-12-17 2001-07-06 Samsung Electronics Co Ltd Matrix arithmetic unit and digital signal processor having matrix arithmetic function
WO2011156247A2 (en) * 2010-06-11 2011-12-15 Massachusetts Institute Of Technology Processor for large graph algorithm computations and matrix operations
WO2017124647A1 (en) * 2016-01-20 2017-07-27 北京中科寒武纪科技有限公司 Matrix calculation apparatus
KR20190027462A (en) * 2017-09-07 2019-03-15 주식회사 스마트데이터복구에스디알 Method and Apparatus of Data Recovery in Storage System
CN111539211A (en) * 2020-04-17 2020-08-14 中移(杭州)信息技术有限公司 Entity and semantic relation recognition method and device, electronic equipment and storage medium
CN111639153A (en) * 2020-04-24 2020-09-08 平安国际智慧城市科技股份有限公司 Query method and device based on legal knowledge graph, electronic equipment and medium

Also Published As

Publication number Publication date
CN112328960A (en) 2021-02-05

Similar Documents

Publication Publication Date Title
WO2021238563A1 (en) Enterprise operation data analysis method and apparatus based on configuration algorithm, and electronic device and medium
CN112528616B (en) Service form generation method and device, electronic equipment and computer storage medium
WO2022088632A1 (en) User data monitoring and analysis method, apparatus, device, and medium
WO2022105135A1 (en) Information verification method and apparatus, and electronic device and storage medium
CN112702228B (en) Service flow limit response method, device, electronic equipment and readable storage medium
CN114881616A (en) Business process execution method and device, electronic equipment and storage medium
CN113434542B (en) Data relationship identification method and device, electronic equipment and storage medium
CN113157853B (en) Problem mining method, device, electronic equipment and storage medium
CN114491047A (en) Multi-label text classification method and device, electronic equipment and storage medium
CN113505273B (en) Data sorting method, device, equipment and medium based on repeated data screening
CN113868528A (en) Information recommendation method and device, electronic equipment and readable storage medium
CN111930963B (en) Knowledge graph generation method and device, electronic equipment and storage medium
CN113010542A (en) Service data processing method and device, computer equipment and storage medium
CN111429085A (en) Contract data generation method and device, electronic equipment and storage medium
CN112328960B (en) Optimization method and device for data operation, electronic equipment and storage medium
CN113626605B (en) Information classification method, device, electronic equipment and readable storage medium
CN113656690B (en) Product recommendation method and device, electronic equipment and readable storage medium
CN112597752B (en) Complaint text processing method and device, electronic equipment and storage medium
CN114840388A (en) Data monitoring method and device, electronic equipment and storage medium
CN113590856B (en) Label query method and device, electronic equipment and readable storage medium
CN112214556B (en) Label generation method, label generation device, electronic equipment and computer readable storage medium
CN113434365B (en) Data characteristic monitoring method and device, electronic equipment and storage medium
CN113704616B (en) Information pushing method and device, electronic equipment and readable storage medium
CN112445854B (en) Multi-source service data real-time processing method, device, terminal and storage medium
WO2022134345A1 (en) File access method, apparatus, 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
GR01 Patent grant
GR01 Patent grant