Data logic calculation method, device, electronic device and storage medium

By running and adjusting compiled programs in distributed storage computing nodes to process data logic scripts, the problem of high transmission consumption of data logic computing network in distributed systems is solved, and efficiency and success rate are improved.

CN111651121BActive Publication Date: 2025-01-07CHINA PING AN PROPERTY INSURANCE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202010361453.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-04-29
Publication Date
2025-01-07
Estimated Expiration
2040-04-29

AI Technical Summary

Technical Problem

In distributed systems, when a general database or search engine calculates the logical calculation of non-relational data, the data needs to be transferred to the client for calculation, resulting in a large number of network transmissions, which reduces speed and performance.

Method used

By obtaining the data set and calculation logic scripts, loading them into the distributed storage computing node to run, adjusting the compiler parameters until they are successful, and using the target compiler for logical calculations to reduce network transmission.

Benefits of technology

It improves the efficiency of data logic computing, reduces network transmission consumption, and ensures successful computing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111651121B_ABST
    Figure CN111651121B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of data processing technology, and discloses a data logic calculation method, including: obtaining a data set and a calculation logic script of the data set; loading the calculation logic script into a preset distributed storage computing node, and running the calculation logic script through a compiler in the distributed storage computing node; judging whether the calculation logic script runs successfully; if the run is successful, using the compiler as a target compiler; if the run fails, adjusting the parameters of the compiler according to the run result, re-running the calculation logic script until the calculation logic script runs successfully and obtains the target compiler; using the target compiler to perform logic calculation on the data set to obtain the logic calculation result of the data set. The present invention also proposes a data logic calculation device, an electronic device, and a computer-readable storage medium. The present invention can achieve high efficiency of data logic calculation. In addition, the present invention also relates to blockchain technology and artificial intelligence technology.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing technology, and in particular to a method, device, electronic device and computer-readable storage medium for data logic calculation. Background Art

[0002] In a distributed system, when general databases, search engines and other software perform logical calculations on general scenarios or personalized non-relational data or non-document data, they all transmit data to the client computing node through the network for logical calculations. The disadvantage of this is that a large amount of network transmission reduces speed and performance. Summary of the invention

[0003] The present invention provides a method, device, electronic device and computer-readable storage medium for data logic calculation, the main purpose of which is to reduce network transmission consumption during data logic calculation and improve the efficiency of data logic calculation.

[0004] To achieve the above object, the present invention provides a data logic calculation method, comprising:

[0005] Acquire a data set and a calculation logic script of the data set, wherein the calculation logic script is used to describe a logical calculation method of the data set;

[0006] Loading the computing logic script into a preset distributed storage computing node, and running the computing logic script through a compiler in the distributed storage computing node;

[0007] Determine whether the calculation logic script runs successfully;

[0008] If the operation is successful, the compiler is used as the target compiler;

[0009] If the operation fails, the parameters of the compiler are adjusted according to the operation result, and the calculation logic script is re-run until the calculation logic script is successfully run to obtain the target compiler;

[0010] The target compiler is used to perform logic calculation on the data set to obtain a logic calculation result of the data set.

[0011] Optionally, the calculation logic script for obtaining the data set includes:

[0012] Compiling a data calculation logic program in a client storing the data set by using a preset scripting language, wherein the data calculation logic program includes a request parameter object and a return parameter object;

[0013] Obtain the data set according to the request parameter object, and determine whether the input data set calculation logic is legal;

[0014] If the calculation logic of the data set is illegal, re-obtain the calculation logic of the data set;

[0015] If the calculation logic of the data set is legal, the calculation logic of the data set is converted into a request message, and the request message is parsed to generate a corresponding logic object, and the generated logic object is returned to the client through the return parameter object.

[0016] Optionally, the step of loading the computing logic script into a preset distributed storage computing node includes:

[0017] Obtaining script parameters when the calculation logic script is running;

[0018] Calling the script storage interface deployed in the distributed storage computing node to obtain the script transmission path;

[0019] According to the script transmission path, the script parameters and the computing logic script are transmitted to the distributed storage computing node.

[0020] Optionally, the using the target compiler to perform logic calculation on the data set to obtain a logic calculation result of the data set includes:

[0021] The data set is allocated to the corresponding target compiler node using a hash function, and the allocated data set is parsed in reverse JSON format to obtain a logical calculation result of the data set.

[0022] Optionally, the hash function includes:

[0023] slice_id=(w1×(hash_str(point_name) / b1)+w2×(day_time(time) / b2))%Hash_Bucket

[0024] Among them, slice_id represents the target compiler node, hash_str(point_name) represents the computing logic script name corresponding to the data set, day_time(time) represents the time function of the time period during which the logic script name corresponding to the data set is transmitted to the distributed storage computing node, b1 and b2 represent the degree of dispersion of the computing logic script corresponding to the data set, and w1 and w2 represent the weights of the computing logic script corresponding to the data set.

[0025] Optionally, the distributed storage computing node is a distributed ledger node based on blockchain technology.

[0026] In order to solve the above problem, the present invention further provides a data logic computing device, the device comprising:

[0027] An acquisition module, used to acquire a data set and a calculation logic script of the data set, wherein the calculation logic script describes a logical calculation method of the data set;

[0028] A loading and running module, used to load the computing logic script into a preset distributed storage computing node, run the computing logic script through a compiler in the distributed storage computing node, obtain a running result, and adjust the parameters of the compiler according to the running result until the computing logic script runs successfully to obtain a target compiler;

[0029] The calculation module is used to perform logic calculation on the data set using the target compiler to obtain the logic calculation result of the data set.

[0030] Optionally, the calculation logic script for obtaining the data set includes:

[0031] Compiling a data calculation logic program in a client storing the data set by using a preset scripting language, wherein the data calculation logic program includes a request parameter object and a return parameter object;

[0032] Obtain the data set according to the request parameter object, and determine whether the input data set calculation logic is legal;

[0033] If the calculation logic of the data set is illegal, re-obtain the calculation logic of the data set;

[0034] If the calculation logic of the data set is legal, the calculation logic of the data set is converted into a request message, and the request message is parsed to generate a corresponding logic object, and the generated logic object is returned to the client through the return parameter object.

[0035] Optionally, the calculation module is specifically used for:

[0036] The data set is allocated to the corresponding target compiler node using a hash function, and the allocated data set is parsed in reverse JSON format to obtain a logical calculation result of the data set.

[0037] In order to solve the above problem, the present invention further provides an electronic device, the electronic device comprising:

[0038] a memory storing at least one instruction; and

[0039] A processor executes instructions stored in the memory to implement any one of the data logic calculation methods described above.

[0040] In order to solve the above problems, the present invention also provides a computer-readable storage medium, in which at least one instruction is stored. The at least one instruction is executed by a processor in an electronic device to implement any one of the data logic calculation methods described above.

[0041] The embodiment of the present invention obtains a data set and a computing logic script of the data set, wherein the computing logic script describes the logical computing method of the data set, thereby saving the preparation time before the data logic computing; the computing logic script is loaded into a preset distributed storage computing node, and the computing logic script is run by a compiler in the distributed storage computing node to obtain the running result, and the parameters of the compiler are adjusted according to the running result until the computing logic script runs successfully to obtain a target compiler, thereby improving the efficiency of computing logic script storage and ensuring the premise of successful data logic computing; the target compiler is used to perform logical computing on the data set to obtain the logical computing result of the data set, thereby reducing a large amount of network transmission consumption through the distributed storage computing node and improving the efficiency of data logic computing. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] Figure 1 A schematic diagram of a flow chart of a data logic calculation method provided by an embodiment of the present invention;

[0043] Figure 2 A schematic diagram of a module of a data logic computing device provided by an embodiment of the present invention;

[0044] Figure 3 A schematic diagram of the internal structure of an electronic device for implementing a data logic calculation method provided by an embodiment of the present invention;

[0045] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0046] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.

[0047] The execution subject of a data logic calculation method provided in an embodiment of the present application includes but is not limited to at least one of the electronic devices such as a server and a terminal that can be configured to execute the method provided in an embodiment of the present application. In other words, the instance dynamic adjustment method can be executed by software or hardware installed in a terminal device or a server device, and the software can be a blockchain platform. The server includes but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, etc.

[0048] Blockchain is a new application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, etc. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods. Each data block contains a batch of network transaction information, which is used to verify the validity of its information (anti-counterfeiting) and generate the next block. Blockchain can include the underlying blockchain platform, platform product service layer, and application service layer.

[0049] The underlying blockchain platform can include processing modules such as user management, basic services, smart contracts, and operation monitoring. Among them, the user management module is responsible for the identity information management of all blockchain participants, including maintaining public and private key generation (account management), key management, and the maintenance of the correspondence between the user's real identity and the blockchain address (authority management), etc., and, under authorization, supervises and audits the transactions of certain real identities and provides risk control rule configuration (risk control audit); the basic service module is deployed on all blockchain node devices to verify the validity of business requests, and records valid requests to storage after consensus is reached. For a new business request, the basic service first adapts the interface for parsing and authentication (interface adaptation), and then encrypts the business information through the consensus algorithm (consensus management). The smart contract module is responsible for the registration and issuance of contracts, as well as contract triggering and contract execution. Developers can define the contract logic in a programming language and publish it to the blockchain (contract registration). According to the logic of the contract terms, the key or other events are called to trigger the execution and complete the contract logic. It also provides the function of contract upgrade and cancellation. The operation monitoring module is mainly responsible for the deployment, configuration modification, contract setting, cloud adaptation and real-time status visualization output of the product during the product release process, such as alarm, network monitoring, node equipment health monitoring, etc.

[0050] The present application can be understood as a distributed artificial intelligence system, and the present application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronic devices, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc. The present application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application can also be practiced in distributed computing environments, in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.

[0051] The present invention provides a method for data logic calculation. Figure 1 FIG. 1 is a flow chart of a data logic calculation method provided by an embodiment of the present invention. The method can be executed by a device, and the device can be implemented by software and / or hardware.

[0052] In this embodiment, the method of data logic calculation includes:

[0053] S1. Obtain a data set and a calculation logic script of the data set, wherein the calculation logic script describes a logical calculation method of the data set.

[0054] In at least one embodiment of the present invention, the data set includes non-relational data and non-document data. For example, the data set includes document data stored in a JSON format.

[0055] In at least one embodiment of the present invention, the data set is stored in the client.

[0056] Furthermore, since there are different logical calculation relationships between the data in the acquired data set, preferably, the implementation example of the present invention compiles the calculation logic script of the corresponding data set in the client where the data set is stored according to user needs, thereby saving the time of data logic calculation. The client refers to a local service program corresponding to the server and providing users with services.

[0057] For example, in a kv document data system, the calculation logic relationship of its data can be addition, subtraction, addition and negation, etc., wherein the document content in the kv document data system is a json string.

[0058] In detail, the calculation logic script for obtaining the data set includes:

[0059] A data calculation logic program is compiled in the client where the data set is stored using a preset scripting language. The data calculation logic program includes a request parameter object (request) and a return parameter object (response). The data set is obtained according to the request parameter object, and it is determined whether the input data set calculation logic is legal; if the data set calculation logic is illegal, the data set calculation logic is re-acquired; if the data set calculation logic is legal, the data set calculation logic is converted into a request message, and the request message is parsed to generate a corresponding logic object, and the generated logic object is returned to the client through the return parameter object, thereby obtaining the calculation logic script of the data set.

[0060] Preferably, the preset scripting language includes: Groovy language, and the determination of whether the data set calculation logic of the data set is legal is performed through a session method.

[0061] The request object is the only legal way for the script program to obtain request data from the outside world. After parsing, a request message will be converted into a logical object request of the Service Request type. The request object may include user_id, req_seq, state, message, time_stamp, datas and other fields. Except for the user_id field, other fields are copied from the request message as is, except for the user_id field in the request message, whose user information type is User, and its content is the entity object of the user corresponding to the user_id.

[0062] The response object is the only legal way for the script program to return information to the outside world. The response object also includes fields such as user_id, req_seq, state, message, time_stamp, datas, etc. Among them, req_seq is a read-only field written by the calculation logic script engine before entering the calculation logic script, time_stamp is automatically filled by the system according to the current time after exiting the calculation logic script, and the remaining values ​​need to be controlled by the writer during the calculation logic script.

[0063] Based on the above implementation, the preparation time before data logic calculation is saved according to the calculation logic script.

[0064] S2. Load the computing logic script into a preset distributed storage computing node, and run the computing logic script through a compiler in the distributed storage computing node.

[0065] In at least one embodiment of the present invention, since the above-mentioned data set is stored in the client, the client does not have the ability to perform data logic calculations. Therefore, the embodiment of the present invention stores the calculation logic scripts of different data through distributed storage and computing nodes and calculates the data to realize data logic calculations and improve the speed of data logic calculations.

[0066] Preferably, the preset distributed storage computing node is a distributed storage computing node created based on Network Attached Storage (NAS). The NAS refers to a device connected to the network and has a data storage function, so it is also called "network storage", which is used to completely separate storage devices from servers and centrally manage data, thereby releasing bandwidth, improving performance, reducing costs, and protecting investments.

[0067] In the embodiment of the present invention, the transmitted computing logic script is stored using a NAS-based distributed storage computing node, which can effectively improve the storage efficiency.

[0068] In detail, the step of loading the computing logic script into a preset distributed storage computing node includes:

[0069] Obtain the script parameters when the computing logic script is running, deploy a script storage interface in the distributed storage computing node, call the script storage interface through the client stored in the data set, obtain the script transmission path, and transmit the script parameters and the computing logic script to the distributed storage computing node according to the script transmission path.

[0070] Furthermore, since the computing logic script stored in the distributed storage computing node cannot directly perform logical calculations on the data, the embodiment of the present invention compiles the computing logic script through a compiler of the distributed storage computing node.

[0071] In at least one embodiment of the present invention, the compiler is compiled using the Java programming language and script parameters when the computing logic script is running, and the computing logic script is run using a script compilation executor of the distributed storage computing node.

[0072] Based on the above implementation, the computing logic script is stored and compiled through distributed storage computing nodes, thereby improving the efficiency of computing logic script storage and the success rate of data logic calculation.

[0073] S3: Determine whether the calculation logic script runs successfully.

[0074] If the operation is successful, execute S4 to use the compiler as the target compiler.

[0075] If the operation fails, execute S5, adjust the parameters of the compiler according to the operation result, and re-run the calculation logic script until the calculation logic script runs successfully to obtain the target compiler.

[0076] S6. Performing logic calculation on the data set using the target compiler to obtain a logic calculation result of the data set.

[0077] In an embodiment of the present invention, performing logical calculation on the data set by using the target compiler includes:

[0078] Receive a user request, use a hash function to allocate the data set to a corresponding target compiler node, perform a reverse JSON format analysis on the allocated data set, complete a logical calculation of the data set, and obtain a logical calculation result of the data set.

[0079] Wherein, the hash function includes:

[0080] slice_id=(w1×(hash_str(point_name) / b1)+w2×(day_time(time) / b2))%Hash_Bucket.

[0081] Among them, slice_id represents the target compiler node, hash_str(point_name) represents the computing logic script name corresponding to the data set, day_time(time) represents the time function of the time period during which the logic script name corresponding to the data set is transmitted to the distributed storage computing node, b1 and b2 represent the degree of dispersion of the computing logic script corresponding to the data set, and w1 and w2 represent the weights of the computing logic script corresponding to the data set.

[0082] Preferably, the embodiment of the present invention implements the reverse JSON format parsing of the data set through a construction method, and the construction method includes:

[0083] JSONObject(String json)->JSONObjectrootObject=new JSONObject(json);

[0084] JSONObjectgetJSONObject(String name){}->JSONObjectparamzObject=rootObject.getJSONObject("paramz");

[0085] JSONArray(Stringjson)->JSONArray=jsonArray=newJSONArray(paramzObject.getString("feeds"));

[0086] JSONObjectgetJSONObject(String name){}->JSONArray feeds=paramzObject.getJSONArray("feeds").

[0087] Preferably, in an embodiment of the present invention, the construction method creates a JSONObject class and utilizes the JSONObject class to implement the de-JSON format parsing of the data set.

[0088] Based on the above implementation, logical calculation is performed on the data set through the compiled calculation logic script.

[0089] The embodiment of the present invention obtains a data set and a calculation logic script of the data set, wherein the calculation logic script describes the logic calculation method of the data set, thereby saving the preparation time before the data logic calculation; the calculation logic script is loaded into a preset distributed storage computing node, and the calculation logic script is run by a compiler in the distributed storage computing node to obtain the running result, and the parameters of the compiler are adjusted according to the running result until the calculation logic script runs successfully to obtain a target compiler, thereby improving the efficiency of the storage of the calculation logic script and ensuring the premise of successful data logic calculation; the target compiler is used to perform logic calculation on the data set to obtain the logic calculation result of the data set. The distributed storage computing node reduces a large amount of network transmission consumption and improves the efficiency of data logic calculation.

[0090] like Figure 2 The figure shows a functional module diagram of the data logic computing device of the present invention.

[0091] The data logic computing device 100 of the present invention can be installed in an electronic device. According to the functions to be implemented, the data logic computing device may include an acquisition module 101, a loading and running module 102, a judgment module 103, and a calculation module 104. The module described in the present invention may also be referred to as a unit, which refers to a series of computer program segments that can be executed by an electronic device processor and can complete fixed functions, and is stored in the memory of the electronic device.

[0092] In this embodiment, the functions of each module / unit are as follows:

[0093] The acquisition module 101 is used to acquire a data set and a calculation logic script of the data set, wherein the calculation logic script describes a logical calculation method of the data set.

[0094] The loading and running module 102 is used to load the computing logic script into a preset distributed storage computing node, and run the computing logic script through a compiler in the distributed storage computing node.

[0095] The judgment module 103 is used to judge whether the calculation logic script runs successfully. If it runs successfully, the compiler is used as the target compiler. If it fails, the parameters of the compiler are adjusted according to the running results, and the calculation logic script is re-run until the calculation logic script runs successfully to obtain the target compiler.

[0096] The calculation module 104 is used to perform logic calculation on the data set using the target compiler to obtain a logic calculation result of the data set.

[0097] In detail, the specific implementation steps of each module of the data logic computing device are as follows:

[0098] The acquisition module 101 acquires a data set and a calculation logic script of the data set, wherein the calculation logic script describes a logical calculation method of the data set.

[0099] In at least one embodiment of the present invention, the data set includes non-relational data and non-document data. For example, the data set includes document data stored in a JSON format.

[0100] In at least one embodiment of the present invention, the data set is stored in the client.

[0101] Furthermore, since there are different logical calculation relationships between the data in the acquired data set, preferably, the implementation example of the present invention compiles the calculation logic script of the corresponding data set in the client where the data set is stored according to user needs, thereby saving the time of data logic calculation. The client refers to a local service program corresponding to the server and providing users with services.

[0102] For example, in a kv document data system, the calculation logic relationship of its data can be addition, subtraction, addition and negation, etc., wherein the document content in the kv document data system is a json string.

[0103] In detail, the calculation logic script for obtaining the data set includes:

[0104] A data calculation logic program is compiled in the client where the data set is stored using a preset scripting language. The data calculation logic program includes a request parameter object (request) and a return parameter object (response). The data set is obtained according to the request parameter object, and it is determined whether the input data set calculation logic is legal; if the data set calculation logic is illegal, the data set calculation logic is re-acquired; if the data set calculation logic is legal, the data set calculation logic is converted into a corresponding request message, and the request message is parsed to generate a corresponding logic object, and the generated logic object is returned to the client through the return parameter object, thereby obtaining the calculation logic script of the data set.

[0105] Preferably, the preset scripting language includes: Groovy language, and the determination of whether the data set calculation logic of the data set is legal is performed through a session method.

[0106] The request object is the only legal way for the script program to obtain request data from the outside world. After parsing, a request message will be converted into a logical object request of the Service Request type. The request object may include user_id, req_seq, state, message, time_stamp, datas and other fields. Except for the user_id field, other fields are copied from the request message as is, except for the user_id field in the request message, whose user information type is User, and its content is the entity object of the user corresponding to the user_id.

[0107] The response object is the only legal way for the script program to return information to the outside world. The response object also includes fields such as user_id, req_seq, state, message, time_stamp, datas, etc. Among them, req_seq is a read-only field written by the calculation logic script engine before entering the calculation logic script, time_stamp is automatically filled by the system according to the current time after exiting the calculation logic script, and the remaining values ​​need to be controlled by the writer during the calculation logic script.

[0108] Based on the above implementation, the preparation time before data logic calculation is saved according to the calculation logic script.

[0109] The loading and running module 102 loads the computing logic script into a preset distributed storage computing node, and runs the computing logic script through a compiler in the distributed storage computing node.

[0110] In at least one embodiment of the present invention, since the above-mentioned data set is stored in the client, the client does not have the ability to perform data logic calculations. Therefore, the embodiment of the present invention stores the calculation logic scripts of different data through distributed storage computing nodes and calculates the data to realize data logic calculations and improve the speed of data logic calculations.

[0111] Preferably, the preset distributed storage computing node is a distributed storage computing node created based on Network Attached Storage (NAS). The NAS refers to a device connected to the network and has a data storage function, so it is also called "network storage", which is used to completely separate storage devices from servers and centrally manage data, thereby releasing bandwidth, improving performance, reducing costs, and protecting investments.

[0112] In the embodiment of the present invention, the transmitted computing logic script is stored using a NAS-based distributed storage computing node, which can effectively improve the storage efficiency.

[0113] In detail, the step of loading the computing logic script into a preset distributed storage computing node includes:

[0114] Obtain the script parameters when the computing logic script is running, deploy a script storage interface in the distributed storage computing node, call the script storage interface through the client stored in the data set, obtain the script transmission path, and transmit the script parameters and the computing logic script to the distributed storage computing node according to the script transmission path.

[0115] Furthermore, since the computing logic script stored in the distributed storage computing node cannot directly perform logical calculations on the data, the embodiment of the present invention compiles the computing logic script through a compiler of the distributed storage computing node.

[0116] In at least one embodiment of the present invention, the compiler is compiled using the Java programming language and script parameters when the computing logic script is running, and the computing logic script is run using a script compilation executor of the distributed storage computing node.

[0117] Based on the above implementation, the computing logic script is stored and compiled through distributed storage computing nodes, thereby improving the efficiency of computing logic script storage and the success rate of data logic calculation.

[0118] The judgment module 103 judges whether the calculation logic script runs successfully. If it runs successfully, the compiler is used as the target compiler. If it fails, the parameters of the compiler are adjusted according to the running results, and the calculation logic script is re-run until the calculation logic script runs successfully to obtain the target compiler.

[0119] The calculation module 104 uses the target compiler to perform logic calculation on the data set to obtain a logic calculation result of the data set.

[0120] In an embodiment of the present invention, performing logical calculation on the data set by using the target compiler includes:

[0121] Receive a user request, use a hash function to allocate the data set to a corresponding target compiler node, perform a reverse JSON format analysis on the allocated data set, complete a logical calculation of the data set, and obtain a logical calculation result of the data set.

[0122] Wherein, the hash function includes:

[0123] slice_id=(w1×(hash_str(point_name) / b1)+w2×(day_time(time) / b2))%Hash_Bucket.

[0124] Among them, slice_id represents the target compiler node, hash_str(point_name) represents the computing logic script name corresponding to the data set, day_time(time) represents the time function of the time period during which the logic script name corresponding to the data set is transmitted to the distributed storage computing node, b1 and b2 represent the degree of dispersion of the computing logic script corresponding to the data set, and w1 and w2 represent the weights of the computing logic script corresponding to the data set.

[0125] Preferably, the embodiment of the present invention implements the reverse JSON format parsing of the data set through a construction method, and the construction method includes:

[0126] JSONObject(String json)->JSONObjectrootObject=new JSONObject(json);

[0127] JSONObjectgetJSONObject(String name){}->JSONObjectparamzObject=rootObject.getJSONObject(“paramz”);

[0128] JSONArray(Stringjson)->JSONArray=jsonArray=new JSONArray(paramzObject.getString("feeds"));

[0129] JSONObjectgetJSONObject(String name){}->JSONArray feeds=paramzObject.getJSONArray("feeds").

[0130] Preferably, in an embodiment of the present invention, the construction method creates a JSONObject class and utilizes the JSONObject class to implement the de-JSON format parsing of the data set.

[0131] Based on the above implementation, logical calculation is performed on the data set through the compiled calculation logic script.

[0132] Preferably, the distributed storage computing nodes in the embodiment of the present invention adopt the distributed ledger nodes in the blockchain technology, so that a jointly governed and shared asset database can be realized in a network composed of multiple sites, different geographical locations or multiple institutions.

[0133] The embodiment of the present invention obtains a data set and a calculation logic script of the data set, wherein the calculation logic script describes the logic calculation method of the data set, thereby saving the preparation time before the data logic calculation; the calculation logic script is loaded into a preset distributed storage computing node, and the calculation logic script is run by a compiler in the distributed storage computing node to obtain the running result, and the parameters of the compiler are adjusted according to the running result until the calculation logic script runs successfully to obtain a target compiler, thereby improving the efficiency of the storage of the calculation logic script and ensuring the premise of successful data logic calculation; the target compiler is used to perform logic calculation on the data set to obtain the logic calculation result of the data set. The distributed storage computing node reduces a large amount of network transmission consumption and improves the efficiency of data logic calculation.

[0134] like Figure 3 FIG. 1 is a schematic diagram of the structure of an electronic device for implementing the method for data logic calculation of the present invention.

[0135] The electronic device 1 may include a processor 10 , a memory 11 , and a bus, and may also include a computer program stored in the memory 11 and executable on the processor 10 , such as a data logic calculation program 12 .

[0136] The memory 11 includes at least one type of readable storage medium, and the readable storage medium includes a flash memory, a mobile hard disk, a multimedia card, a card-type memory (e.g., SD or DX memory, etc.), a magnetic memory, a disk, an optical disk, etc. The memory 11 may be an internal storage unit of the electronic device 1 in some embodiments, such as a mobile hard disk of the electronic device 1. The memory 11 may also be an external storage device of the electronic device 1 in other embodiments, such as a plug-in mobile hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the electronic device 1. Further, the memory 11 may also include both an internal storage unit of the electronic device 1 and an external storage device. The memory 11 may not only be used to store application software and various types of data installed in the electronic device 1, such as the code of a data logic calculation program, etc., but may also be used to temporarily store data that has been output or is to be output.

[0137] The processor 10 may be composed of an integrated circuit in some embodiments, for example, a single packaged integrated circuit, or a plurality of packaged integrated circuits with the same or different functions, including one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and combinations of various control chips, etc. The processor 10 is the control core (Control Unit) of the electronic device, and uses various interfaces and lines to connect various components of the entire electronic device, and executes or executes programs or modules (such as data logic calculation programs, etc.) stored in the memory 11, and calls data stored in the memory 11, so as to execute various functions of the electronic device 1 and process data.

[0138] The bus may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. The bus is configured to realize connection and communication between the memory 11 and at least one processor 10, etc.

[0139] Figure 3 Only an electronic device with components is shown, and those skilled in the art will understand that Figure 3The structure shown does not constitute a limitation on the electronic device 1, and may include fewer or more components than shown in the figure, or combine certain components, or arrange the components differently.

[0140] For example, although not shown, the electronic device 1 may also include a power source (such as a battery) for supplying power to each component. Preferably, the power source may be logically connected to the at least one processor 10 through a power management device, so that the power management device can realize functions such as charging management, discharging management, and power consumption management. The power source may also include any components such as one or more DC or AC power sources, recharging devices, power failure detection circuits, power converters or inverters, power status indicators, etc. The electronic device 1 may also include a variety of sensors, Bluetooth modules, Wi-Fi modules, etc., which will not be repeated here.

[0141] Furthermore, the electronic device 1 may also include a network interface. Optionally, the network interface may include a wired interface and / or a wireless interface (such as a WI-FI interface, a Bluetooth interface, etc.), which is generally used to establish a communication connection between the electronic device 1 and other electronic devices.

[0142] Optionally, the electronic device 1 may further include a user interface, which may be a display, an input unit (such as a keyboard), or a standard wired interface or a wireless interface. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, and an OLED (Organic Light-Emitting Diode) touch device. The display may also be appropriately referred to as a display screen or a display unit, which is used to display information processed in the electronic device 1 and to display a visual user interface.

[0143] It should be understood that the embodiment is for illustration only and the scope of the patent application is not limited to this structure.

[0144] The data logic calculation program 12 stored in the memory 11 in the electronic device 1 is a combination of multiple instructions. When running in the processor 10, it can achieve:

[0145] Acquire a data set and a calculation logic script of the data set, wherein the calculation logic script is used to describe a logical calculation method of the data set;

[0146] Loading the computing logic script into a preset distributed storage computing node, and running the computing logic script through a compiler in the distributed storage computing node;

[0147] Determine whether the calculation logic script runs successfully;

[0148] If the operation is successful, the compiler is used as the target compiler;

[0149] If the operation fails, the parameters of the compiler are adjusted according to the operation result, and the calculation logic script is re-run until the calculation logic script is successfully run to obtain the target compiler;

[0150] The target compiler is used to perform logic calculation on the data set to obtain a logic calculation result of the data set.

[0151] Specifically, the specific implementation method of the processor 10 for the above instructions can refer to Figure 1 The description of the relevant steps in the corresponding embodiments will not be repeated here.

[0152] Furthermore, if the module / unit integrated in the electronic device 1 is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. The computer-readable medium may include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a mobile hard disk, a magnetic disk, an optical disk, a computer memory, and a read-only memory (ROM).

[0153] In the several embodiments provided by the present invention, it should be understood that the disclosed devices, apparatuses and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of the modules is only a logical function division, and there may be other division methods in actual implementation.

[0154] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, that is, they may be located in one place or distributed on 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.

[0155] In addition, each functional module in each embodiment of the present invention may be integrated into one processing unit, each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional modules.

[0156] It is obvious to those skilled in the art that the present invention is not limited to the details of the above exemplary embodiments, and that the present invention can be implemented in other specific forms without departing from the spirit or essential characteristics of the present invention.

[0157] Therefore, no matter from which point of view, the embodiments should be regarded as illustrative and non-restrictive, and the scope of the present invention is limited by the appended claims rather than the above description, so it is intended that all changes falling within the meaning and scope of the equivalent elements of the claims are included in the present invention. Any attached figure mark in the claims should not be regarded as limiting the claims involved.

[0158] In addition, it is clear that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices stated in the system claim can also be implemented by one unit or device through software or hardware. The second and other words are used to indicate names, but not to indicate any particular order.

[0159] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solution of the present invention can be modified or replaced by equivalents without departing from the spirit and scope of the technical solution of the present invention.

Claims

1. A data logic calculation method, characterized in that: The method comprises: Acquire a data set and a calculation logic script of the data set, wherein the calculation logic script is used to describe a logical calculation method of the data set; Loading the computing logic script into a preset distributed storage computing node, and running the computing logic script through a compiler in the distributed storage computing node; Determine whether the calculation logic script runs successfully; If the operation is successful, the compiler is used as the target compiler; If the operation fails, the parameters of the compiler are adjusted according to the operation result, and the calculation logic script is re-run until the calculation logic script is successfully run to obtain the target compiler; Using the target compiler to perform logic calculation on the data set to obtain a logic calculation result of the data set; Wherein, obtaining the calculation logic script of the data set includes: compiling a data calculation logic program in the client where the data set is stored by using a preset scripting language, wherein the data calculation logic program includes a request parameter object and a return parameter object; obtaining the data set according to the request parameter object, and judging whether the input data set calculation logic is legal; if the data set calculation logic is illegal, re-obtaining the calculation logic of the data set; if the data set calculation logic is legal, converting the calculation logic of the data set into a request message, parsing the request message to generate a corresponding logic object, and returning the generated logic object to the client through the return parameter object; The using the target compiler to perform logic calculation on the data set to obtain the logic calculation result of the data set includes: using a hash function to allocate the data set to a corresponding target compiler node, and performing a reverse JSON format analysis on the allocated data set to obtain the logic calculation result of the data set; The hash function includes: slice_id = (w1×(hash_str(point_name) / b1)+w2× (day_time(time) / b2))%Hash_Bucket Among them, slice_id represents the target compiler node, hash_str(point_name) represents the computing logic script name corresponding to the data set, day_time(time) represents the time function of the time period during which the logic script name corresponding to the data set is transmitted to the distributed storage computing node, b1 and b2 represent the degree of dispersion of the computing logic script corresponding to the data set, and w1 and w2 represent the weights of the computing logic script corresponding to the data set.

2. The data logic calculation method according to claim 1, characterized in that: The step of loading the computing logic script into a preset distributed storage computing node includes: Obtaining script parameters when the calculation logic script is running; Calling the script storage interface deployed in the distributed storage computing node to obtain a script transmission path; According to the script transmission path, the script parameters and the computing logic script are transmitted to the distributed storage computing node.

3. The data logic calculation method according to claim 1, characterized in that: The distributed storage computing node is a distributed ledger node based on blockchain technology.

4. A data logic calculation device, used to implement the data logic calculation method as claimed in any one of claims 1 to 3, characterized in that: The device comprises: An acquisition module, used to acquire a data set and a calculation logic script of the data set, wherein the calculation logic script describes a logical calculation method of the data set; A loading and running module, used to load the computing logic script into a preset distributed storage computing node, and run the computing logic script through a compiler in the distributed storage computing node; A judgment module, used to judge whether the computational logic script runs successfully. If the running is successful, the compiler is used as the target compiler. If the running fails, the parameters of the compiler are adjusted according to the running result, and the computational logic script is re-run until the computational logic script runs successfully to obtain the target compiler; The calculation module is used to perform logic calculation on the data set using the target compiler to obtain the logic calculation result of the data set.

5. An electronic device, characterized in that: The electronic device comprises: at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the data logic calculation method according to any one of claims 1 to 3.

6. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the data logic calculation method according to any one of claims 1 to 3 is implemented.

Citation Information

Patent Citations

  • Transaction data storage method and device, block chain system, medium and electronic equipment

    CN110727391A

  • Block chain call link anomaly detection method and device and computer device

    CN110865927A