CN115421698A - Data processing method and device based on declarative and distributed accounts book and electronic device - Google Patents

Data processing method and device based on declarative and distributed accounts book and electronic device Download PDF

Info

Publication number
CN115421698A
CN115421698A CN202211050203.2A CN202211050203A CN115421698A CN 115421698 A CN115421698 A CN 115421698A CN 202211050203 A CN202211050203 A CN 202211050203A CN 115421698 A CN115421698 A CN 115421698A
Authority
CN
China
Prior art keywords
execution
declarative
analysis
result
preset
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211050203.2A
Other languages
Chinese (zh)
Inventor
张健
宋文鹏
赵阳
吕国新
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Minyuxing Beijing Technology Co ltd
Original Assignee
Minyuxing Beijing Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Minyuxing Beijing Technology Co ltd filed Critical Minyuxing Beijing Technology Co ltd
Priority to CN202211050203.2A priority Critical patent/CN115421698A/en
Publication of CN115421698A publication Critical patent/CN115421698A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/31Programming languages or programming paradigms
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/72Code refactoring

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • Devices For Executing Special Programs (AREA)

Abstract

The application discloses a data processing method and device based on an declarative type and a distributed account book and an electronic device. The method comprises the following steps: the declarative programming model converts the upper-layer business to-be-consensus business logic into a first declarative statement according to a preset specification; the engine service firstly calls an analysis interpreter to analyze the first declarative statement, then calls an execution controller to judge whether the analysis result meets a preset execution condition, and if so, constructs an execution tree to generate an execution plan and executes the execution plan; the transaction executor converts an execution result into transaction data, and writes the transaction data into a distributed consistency network for consensus processing. The method and the device solve the technical problems of low development efficiency, poor readability and difficulty in achieving decoupling at different levels.

Description

Data processing method and device based on declarative and distributed accounts book and electronic device
Technical Field
The application relates to the field of distributed consistency processing, in particular to a data processing method and device based on an declarative type and a distributed account book and an electronic device.
Background
The distributed consistency network is embodied in the consistency of an account book, namely consensus data, and the consensus data solves the data trust problem of decentralization through a consensus algorithm. The premise of the distributed consistency processing is that the upper layer service logic needs to be handed over to the distributed consistency network in a data form for processing in a programming mode. Wherein, the programming adopts an instruction programming (inductive programming): is a programming paradigm that describes the behavior that a computer needs to do. Instruct "machine" how to do things (how), emphasize more the flow and steps, and emphasize the operational details.
But the writing of the instruction type programming is more difficult to accurately execute the instructions in an expected mode, and the capability of any part of the program to change the state makes the execution of the program difficult to infer, so that the development efficiency is low and the readability is poor; due to the data architecture design limited by the consensus processing layer, different levels of decoupling are difficult to achieve.
Aiming at the problems of low development efficiency, poor readability and difficulty in realizing decoupling at different levels in the related technology, an effective solution is not provided at present.
Disclosure of Invention
The application mainly aims to provide a data processing method, a data processing device and an electronic device based on a declarative type and a distributed type account book, so as to solve the problems of low development efficiency, poor readability and difficulty in realizing decoupling at different levels.
In order to achieve the above object, according to an aspect of the present application, there is provided a data processing method based on an declarative and distributed ledger.
The data processing method based on the declarative and distributed accounts book comprises the following steps: the declarative programming model converts the upper-layer business to-be-consensus business logic into a first declarative statement according to a preset specification; the engine service firstly calls an analysis interpreter to analyze the first declarative statement, then calls an execution controller to judge whether an analysis result meets a preset execution condition, and if so, constructs an execution tree to generate an execution plan and executes the execution plan; the transaction executor converts an execution result into transaction data, and writes the transaction data into a distributed consistency network for consensus processing.
Further, the transaction executor converts an execution result into transaction data, and writes the transaction data into the distributed consistency network for consensus processing, and then the method further includes: the declarative programming model converts the business logic to be inquired of the upper layer business into a second declarative statement according to a preset specification; the engine service firstly calls an analysis interpreter to analyze the second declarative statement, then calls a response controller to respond to the analysis result according to a preset response rule, and simultaneously constructs an execution tree according to the response result to generate and execute an execution plan; and the transaction querier determines a result value and a state value in the distributed consistency network according to the execution result and returns the result value and the state value to the upper-layer service.
Further, after the declarative programming model converts the upper-layer business to-be-consensus business logic into a first declarative statement according to a preset specification, the engine service calls the analysis interpreter to analyze the first declarative statement, then calls the execution controller to judge whether an analysis result meets a preset execution condition, and if so, constructs an execution tree to generate an execution plan and further comprises the following steps: a connector passes the first declarative statement into a configured engine service.
Further, after the declarative programming model converts the upper-layer business to-be-queried business logic into a second declarative statement according to the preset specification, the engine service calls the analysis interpreter to analyze the second declarative statement, then calls the response controller to respond to the analysis result according to the preset response rule, and constructs an execution tree according to the response result to generate an execution plan and further includes the following steps before execution: a connector passes the second declarative statement into a configured engine service.
Further, the execution controller generates the execution condition by receiving a first configuration content of the user.
Further, the response controller generates a response rule by receiving a second configuration content of the user.
Further, the transaction processor supports simultaneous configuration of multiple distributed coherence networks.
In order to achieve the above object, according to another aspect of the present application, there is provided a data processing apparatus based on an declarative and distributed ledger.
The data processing device based on the declarative and distributed accounts book comprises the following components: the declarative programming model is used for converting the upper-layer business to-be-consensus business logic into a first declarative statement according to a preset specification; the engine service is used for calling an analysis interpreter to analyze the first declarative statement, then calling an execution controller to judge whether an analysis result meets a preset execution condition, and if so, constructing an execution tree to generate an execution plan and execute the execution plan; and the transaction executor is used for converting the execution result into transaction data and writing the transaction data into the distributed consistency network for consensus processing.
Further, the declarative programming model is also used for converting the upper-layer business to-be-queried business logic into a second declarative statement according to a preset specification; the engine service is also used for calling the analysis interpreter to analyze the second declarative statement, calling the response controller to respond the analysis result according to the preset response rule, and constructing an execution tree according to the response result to generate and execute an execution plan; further comprising: and the transaction querier is used for determining a result value and a state value in the distributed consistency network according to the execution result and returning the result value and the state value to the upper-layer service.
In order to achieve the above object, according to another aspect of the present application, there is provided an electronic device.
An electronic device according to the present application includes: a memory in which a computer program is stored, and a processor, wherein the processor is configured to run the computer program to perform the method for data processing based on declarative and distributed ledgers.
In the embodiment of the application, a data processing mode based on a declarative form and a distributed account book is adopted, and an upper-layer business to-be-consensus business logic is converted into a first declarative form statement according to a preset specification through a declarative programming model; the engine service firstly calls an analysis interpreter to analyze the first declarative statement, then calls an execution controller to judge whether the analysis result meets a preset execution condition, and if so, constructs an execution tree to generate an execution plan and executes the execution plan; the transaction executor converts an execution result into transaction data, and writes the transaction data into a distributed consistency network for consensus processing; the aim of carrying out data consensus by using declarative statements to replace instruction programming and mutually independence modules in the data consensus process is achieved, so that the technical effects of improving development efficiency, enhancing readability and decoupling between engine services and a distributed consistency network are achieved, and the technical problems that development efficiency is low, readability is poor and decoupling at different levels is difficult to achieve are solved.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this application, are included to provide a further understanding of the application and to enable other features, objects, and advantages of the application to be more apparent. The drawings and their description illustrate the embodiments of the invention and do not limit it. In the drawings:
FIG. 1 is a schematic flow chart diagram of a data processing method based on declarative and distributed ledgers in accordance with a preferred embodiment of the present application;
FIG. 2 is a schematic flow chart diagram of a data processing method based on declarative and distributed ledgers in accordance with another preferred embodiment of the present application;
FIG. 3 is a block diagram of a data processing apparatus based on declarative and distributed ledgers in accordance with a preferred embodiment of the present application;
FIG. 4 is a block diagram of a data processing apparatus based on declarative and distributed ledgers in accordance with another preferred embodiment of the present application;
FIG. 5 is a functional block diagram of a data processing method based on declarative and distributed ledgers in accordance with a preferred embodiment of the present application;
fig. 6 is a working block diagram of a data processing method based on declarative and distributed ledgers in accordance with another preferred embodiment of the present application.
Detailed Description
In order to make the technical solutions better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only partial embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
It should be noted that the terms "first," "second," and the like in the description and claims of this application and in the accompanying drawings are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It should be understood that the data so used may be interchanged under appropriate circumstances such that embodiments of the application described herein may be used. Moreover, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
In this application, the terms "upper", "lower", "left", "right", "front", "rear", "top", "bottom", "inner", "outer", "middle", "vertical", "horizontal", "lateral", "longitudinal", and the like indicate orientations or positional relationships based on the orientations or positional relationships shown in the drawings. These terms are used primarily to better describe the invention and its embodiments and are not intended to limit the indicated devices, elements or components to a particular orientation or to be constructed and operated in a particular orientation.
Moreover, some of the above terms may be used to indicate other meanings besides the orientation or positional relationship, for example, the term "on" may also be used to indicate some kind of attachment or connection relationship in some cases. The specific meanings of these terms in the present invention can be understood according to specific situations by those of ordinary skill in the art.
Furthermore, the terms "mounted," "disposed," "provided," "connected," and "sleeved" are to be construed broadly. For example, it may be a fixed connection, a removable connection, or a unitary construction; can be a mechanical connection, or an electrical connection; may be directly connected, or indirectly connected through intervening media, or may be in internal communication between two devices, elements or components. The specific meanings of the above terms in the present invention can be understood by those of ordinary skill in the art according to specific situations.
It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict. The present application will be described in detail below with reference to the accompanying drawings in conjunction with embodiments.
According to an embodiment of the present invention, there is provided a data processing method based on a declarative and distributed ledger, as shown in fig. 1, 5, and 6, the method including steps S101 to S103 as follows:
s101, converting upper-layer service to-be-consensus service logic into a first declarative statement by a declarative programming model according to a preset specification;
and converting the service logic to be identified by the upper layer service into a first declarative statement by referring to the declarative programming model. The converted declarative statements have language which is easy to understand, the development efficiency and the readability can be improved, and flexible switching of a lower-layer platform is supported through a generalized declarative consensus specification.
In this embodiment, the upper-layer service to-be-identified service logic may be docked into the declarative programming model for conversion through interface operation of personnel on the upper-layer service; or an automatic detection program is configured in the upper-layer service, and when the service logic to be identified is detected, the service logic to be identified is automatically docked into the declarative programming model for conversion.
It should be understood that, when there are multiple service logics to be identified in the upper layer service, a random algorithm may be used to place the multiple service logics to be identified in a message queue, and the multiple service logics to be identified may be docked into the declarative programming model one by one for conversion.
According to the embodiment of the present invention, preferably, after the declarative programming model converts the upper-layer business to-be-consensus business logic into the first declarative statement according to the preset specification, the engine service calls the analysis interpreter to analyze the first declarative statement, and then calls the execution controller to determine whether the analysis result meets the preset execution condition, and if so, the method further includes the following steps:
a connector passes the first declarative statement into a configured engine service.
And connecting the declarative programming model and the engine service by adopting a connector to realize the butt joint between the declarative programming model and the engine service, thereby realizing the smooth butt joint of the first declarative statement.
Step S102, the engine service firstly calls an analysis interpreter to analyze the first declarative statement, then calls an execution controller to judge whether the analysis result meets a preset execution condition, and if so, constructs an execution tree to generate an execution plan and executes the execution plan;
the engine service comprises an analysis interpreter, an execution controller and the like; firstly, an engine service calls an analysis interpreter, and the analysis interpreter can analyze a first declarative statement according to a preset analysis rule; specifically, analyzing the first declarative statement according to a preset analysis rule includes: lexical analysis, syntactic analysis and semantic analysis, and completes analysis and preliminary verification of the declarative statements.
After the analysis is completed, the engine service calls the execution controller again, and the execution controller performs execution condition verification processing; specifically, an analysis result can be obtained after the analysis is finished, the execution controller judges whether the analysis result meets a preset execution condition, and if the analysis result meets the preset execution condition, an execution tree is constructed to generate an execution plan and execute the execution plan.
In this embodiment, preferably, the execution controller generates the execution condition by receiving the first configuration content of the user. That is, the personnel can carry out flexible configuration according to the actual situation, such as the configuration of the account model and the related conditions of the data structure. Therefore, the configurable common consensus module can meet the configurable execution conditions of the bottom common consensus module, can be flexibly configured and quickly accessed according to the execution preconditions of the common consensus module (distributed consistency network), supports different common consensus algorithms and data models, and does not limit the design of a lower platform.
Step S103, the transaction executor converts the execution result into transaction data, and writes the transaction data into the distributed consistency network for consensus processing.
And an execution plan is generated through the constructed execution tree and an execution result is obtained after the execution plan is executed, transaction data which can be received by a distributed consistency network is constructed through a transaction executor according to the execution result, the transaction data is written into the distributed consistency network through an rpc interface, consensus processing is carried out through the distributed consistency network, and the problem of data trust of decentralization is solved through a consensus algorithm. Therefore, the distributed consistency network and the engine service are mutually independent, and decoupling between the distributed consistency network and the engine service is realized.
In this embodiment, preferably, the transaction processor supports simultaneous configuration of a plurality of distributed coherent networks. The transaction processor supports simultaneous configuration of a plurality of consensus modules (distributed consensus network), and realizes consensus processing of the same data.
From the above description, it can be seen that the present invention achieves the following technical effects:
in the embodiment of the application, a data processing mode based on a declarative form and a distributed account book is adopted, and the logic of the upper-layer business to-be-consensus business is converted into a first declarative form statement through a declarative programming model according to a preset specification; the engine service firstly calls an analysis interpreter to analyze the first declarative statement, then calls an execution controller to judge whether the analysis result meets a preset execution condition, and if so, constructs an execution tree to generate an execution plan and executes the execution plan; the transaction executor converts an execution result into transaction data, and writes the transaction data into a distributed consistency network for consensus processing; the purpose of using declarative statements to replace instruction type programming to carry out data consensus and mutually independence modules in the data consensus process is achieved, so that the technical effects of improving development efficiency, enhancing readability and achieving decoupling between engine services and a distributed consistency network are achieved, and the technical problems that development efficiency is low, readability is poor and decoupling at different levels is difficult to achieve are solved.
According to the embodiment of the present invention, as shown in fig. 2, 5, and 6, preferably, the transaction executor converts the execution result into transaction data, and then writes the transaction data into the distributed consistency network for consensus processing, and further includes:
step S201, converting upper layer business to-be-inquired business logic into a second declarative statement by a declarative programming model according to a preset specification;
after the above processing, a consensus processing result is obtained, and the result is stored in the distributed consistency network.
And converting the business logic to be queried of the upper layer business into a second declarative statement by referring to the declarative programming model. The converted declarative statements have language which is easy to understand, development efficiency and readability can be improved, and flexible switching of a lower-layer platform is supported through generalized declarative consensus specifications.
In this embodiment, the logic docking of the upper-layer service to-be-identified service may be performed to the declarative programming model for conversion through interface operation of a person on the upper-layer service.
After the declarative programming model converts the business logic to be queried of the upper layer business into a second declarative statement according to a preset specification, the engine service firstly calls an analysis interpreter to analyze the second declarative statement, then calls a response controller to respond to an analysis result according to a preset response rule, and simultaneously constructs an execution tree according to a response result to generate an execution plan and further comprises the following steps before execution:
a connector passes the second declarative statement into a configured engine service.
And the connector is adopted to connect the declarative programming model and the engine service, so that the two are butted, and the second declarative statement is smoothly butted.
Step S202, the engine service firstly calls an analysis interpreter to analyze the second declarative statement, then calls a response controller to respond to the analysis result according to a preset response rule, and constructs an execution tree according to the response result to generate an execution plan and execute the execution plan;
the engine service comprises an analysis interpreter, an execution controller and the like; firstly, the engine service calls an analysis interpreter, and a second declarative statement can be analyzed through the analysis interpreter according to a preset analysis rule; specifically, analyzing the second declarative statement according to the preset analysis rule includes: lexical analysis, syntactic analysis and semantic analysis, and completes analysis and preliminary verification of the declarative statements.
After the analysis is completed, the engine service calls the response controller again, and the response controller processes the response result; specifically, an analysis result can be obtained after the analysis is finished, the response controller responds to the analysis result according to a preset response rule, and meanwhile, an execution tree is constructed according to the response result to generate and execute an execution plan.
In this embodiment, preferably, the response controller generates the response rule by receiving the second configuration content of the user. That is, personnel can flexibly configure according to actual conditions, configure analysis rules according to consensus data recording rules of consensus modules (distributed consensus networks), support different consensus algorithms and data models, and do not limit the design of lower-layer platforms.
And step S203, the transaction querier determines a result value and a state value in the distributed consistency network according to the execution result, and returns the result value and the state value to the upper-layer service.
And generating an execution plan through the constructed execution tree and executing to obtain an execution result, calling a data query interface through the transaction querier, determining a result value and a state value in the distributed consistency network, and then calling the data query interface to return the result value and the state value to the upper-layer service. Therefore, the corresponding consensus result is called from the distributed consistency network according to the service logic to be inquired, and the inquiry is realized. The distributed consistency network and the engine service are mutually independent, and decoupling between the distributed consistency network and the engine service is realized.
It should be noted that the steps illustrated in the flowcharts of the figures may be performed in a computer system such as a set of computer-executable instructions and that, although a logical order is illustrated in the flowcharts, in some cases, the steps illustrated or described may be performed in an order different than presented herein.
According to an embodiment of the present invention, there is also provided an apparatus for implementing the data processing method based on the declarative and distributed ledgers, as shown in fig. 3, 5, and 6, the apparatus including:
the declarative programming model 10 is used for converting the upper-layer business to-be-consensus business logic into a first declarative statement according to a preset specification;
and converting the service logic to be identified by the upper layer service into a first declarative statement by referring to the declarative programming model. The converted declarative statements have language which is easy to understand, development efficiency and readability can be improved, and flexible switching of a lower-layer platform is supported through generalized declarative consensus specifications.
In this embodiment, the upper-layer service to-be-identified service logic may be docked into the declarative programming model for conversion through interface operation of personnel on the upper-layer service; or an automatic detection program is configured in the upper-layer service, and when the service logic to be identified is detected, the service logic to be identified is automatically docked into the declarative programming model for conversion.
It should be understood that, when there are multiple service logics to be identified in the upper layer service, a random algorithm may be used to place the multiple service logics to be identified in a message queue, and the multiple service logics to be identified may be connected to the declarative programming model one by one for conversion.
According to the embodiment of the present invention, preferably, after the declarative programming model converts the upper-level business to-be-consensus business logic into the first declarative statement according to the preset specification, the engine service invokes the analysis interpreter to analyze the first declarative statement, and then invokes the execution controller to determine whether the analysis result meets the preset execution condition, if yes, the method further includes the steps of constructing an execution tree to generate an execution plan and executing:
a connector passes the first declarative statement into a configured engine service.
And connecting the declarative programming model and the engine service by adopting a connector to realize the butt joint between the declarative programming model and the engine service, thereby realizing the smooth butt joint of the first declarative statement.
The engine service 11 is used for calling an analysis interpreter to analyze the first declarative statement, then calling an execution controller to judge whether an analysis result meets a preset execution condition, and if so, constructing an execution tree to generate an execution plan and execute the execution plan;
the engine service comprises an analysis interpreter, an execution controller and the like; firstly, an engine service calls an analysis interpreter, and the analysis interpreter can analyze a first declarative statement according to a preset analysis rule; specifically, analyzing the first declarative statement according to a preset analysis rule includes: lexical analysis, syntactic analysis and semantic analysis, and completes analysis and preliminary verification of the declarative statements.
After the analysis is completed, the engine service calls the execution controller again, and the execution controller carries out execution condition verification processing; specifically, an analysis result can be obtained after the analysis is finished, the execution controller judges whether the analysis result meets a preset execution condition, and if the analysis result meets the preset execution condition, an execution tree is constructed to generate an execution plan and execute the execution plan.
In this embodiment, preferably, the execution controller generates the execution condition by receiving the first configuration content of the user. That is, the personnel can carry out flexible configuration according to the actual situation, such as the configuration of the account model and the relevant conditions of the data structure. Therefore, the configurable execution conditions of the bottom consensus module are met, the flexible configuration and the quick access are realized according to the execution preconditions of the consensus module (distributed consistency network), different consensus algorithms and data models are supported, and the design of a lower platform is not limited.
And the transaction executor 12 is configured to convert an execution result into transaction data, and then write the transaction data into the distributed consistency network for consensus processing.
And an execution plan is generated through the constructed execution tree and an execution result is obtained after the execution plan is executed, transaction data which can be received by a distributed consistency network is constructed through a transaction executor according to the execution result, the transaction data is written into the distributed consistency network through an rpc interface, consensus processing is carried out through the distributed consistency network, and the problem of data trust of decentralization is solved through a consensus algorithm. Therefore, the distributed consistency network and the engine service are mutually independent, and decoupling between the distributed consistency network and the engine service is realized.
In this embodiment, preferably, the transaction processor supports simultaneous configuration of a plurality of distributed coherent networks. The transaction processor supports simultaneous configuration of multiple consensus modules (distributed coherent networks) while achieving consensus processing of the same data.
From the above description, it can be seen that the present invention achieves the following technical effects:
in the embodiment of the application, a data processing mode based on a declarative form and a distributed account book is adopted, and an upper-layer business to-be-consensus business logic is converted into a first declarative form statement according to a preset specification through a declarative programming model; the engine service firstly calls an analysis interpreter to analyze the first declarative statement, then calls an execution controller to judge whether the analysis result meets a preset execution condition, and if so, constructs an execution tree to generate an execution plan and executes the execution plan; the transaction executor converts an execution result into transaction data, and writes the transaction data into a distributed consistency network for consensus processing; the aim of carrying out data consensus by using declarative statements to replace instruction programming and mutually independence modules in the data consensus process is achieved, so that the technical effects of improving development efficiency, enhancing readability and decoupling between engine services and a distributed consistency network are achieved, and the technical problems that development efficiency is low, readability is poor and decoupling at different levels is difficult to achieve are solved.
The declarative programming model 10 is further used for converting the upper-layer business to-be-queried business logic into a second declarative statement according to a preset specification;
after the above processing, a consensus processing result is obtained, and the result is stored in the distributed consistency network.
And converting the business logic to be inquired of the upper layer business into a second declarative statement by referring to the declarative programming model. The converted declarative statements have language which is easy to understand, development efficiency and readability can be improved, and flexible switching of a lower-layer platform is supported through generalized declarative consensus specifications.
In this embodiment, the logic docking of the upper-layer service to-be-identified service may be performed to the declarative programming model for conversion through interface operation of a person on the upper-layer service.
After the declarative programming model converts the business logic to be queried of the upper layer business into a second declarative statement according to a preset specification, the engine service firstly calls an analysis interpreter to analyze the second declarative statement, then calls a response controller to respond to an analysis result according to a preset response rule, and simultaneously constructs an execution tree according to a response result to generate an execution plan and further comprises the following steps before execution:
a connector passes the second declarative statement into a configured engine service.
And the connector is adopted to connect the declarative programming model and the engine service, so that the two are butted, and the second declarative statement is smoothly butted.
The engine service 11 is further configured to invoke the analysis interpreter to analyze the second declarative statement, invoke the response controller to respond to the analysis result according to a preset response rule, and construct an execution tree according to the response result to generate and execute an execution plan;
the engine service comprises an analysis interpreter, an execution controller and the like; firstly, the engine service calls an analysis interpreter, and a second declarative statement can be analyzed through the analysis interpreter according to a preset analysis rule; specifically, analyzing the second declarative statement according to a preset analysis rule includes: lexical analysis, syntactic analysis and semantic analysis, and completes analysis and preliminary verification of the declarative statements.
After the analysis is completed, the engine service calls the response controller again, and the response controller processes the response result; specifically, an analysis result can be obtained after the analysis is finished, the response controller responds to the analysis result according to a preset response rule, and meanwhile, an execution tree is constructed according to the response result to generate and execute an execution plan.
In this embodiment, preferably, the response controller generates the response rule by receiving the second configuration content of the user. That is, personnel can flexibly configure according to actual conditions, configure analysis rules according to consensus data recording rules of consensus modules (distributed consistency networks), support different consensus algorithms and data models, and do not limit the design of lower-layer platforms.
Further comprising: the transaction querier 22 is arranged to,
and the transaction querier 22 is used for determining a result value and a state value in the distributed consistency network according to the execution result and returning the result value and the state value to the upper-layer service.
And generating an execution plan through the constructed execution tree and executing to obtain an execution result, calling a data query interface through the transaction querier, determining a result value and a state value in the distributed consistency network, and then calling the data query interface to return the result value and the state value to the upper-layer service. Therefore, the corresponding consensus result is called from the distributed consistency network according to the service logic to be inquired, and the inquiry is realized. The distributed consistency network and the engine service are mutually independent, and decoupling between the distributed consistency network and the engine service is realized.
It will be apparent to those skilled in the art that the modules or steps of the present invention described above may be implemented by a general purpose computing device, they may be centralized on a single computing device or distributed across a network of multiple computing devices, and they may alternatively be implemented by program code executable by a computing device, such that they may be stored in a storage device and executed by a computing device, or fabricated separately as individual integrated circuit modules, or fabricated as a single integrated circuit module from multiple modules or steps. Thus, the present invention is not limited to any specific combination of hardware and software.
The above description is only a preferred embodiment of the present application and is not intended to limit the present application, and various modifications and changes may be made to the present application by those skilled in the art. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims (10)

1. A data processing method based on a declarative and distributed ledgers is characterized by comprising the following steps:
the declarative programming model converts the upper-layer business to-be-consensus business logic into a first declarative statement according to a preset specification;
the engine service firstly calls an analysis interpreter to analyze the first declarative statement, then calls an execution controller to judge whether the analysis result meets a preset execution condition, and if so, constructs an execution tree to generate an execution plan and executes the execution plan;
the transaction executor converts an execution result into transaction data, and writes the transaction data into a distributed consistency network for consensus processing.
2. The method of claim 1, wherein the transaction executor converts the execution result into transaction data, and writes the transaction data into the distributed coherent network for consensus processing, further comprising:
the declarative programming model converts the upper-layer business to-be-queried business logic into a second declarative statement according to a preset specification;
the engine service firstly calls an analysis interpreter to analyze the second declarative statement, then calls a response controller to respond to the analysis result according to a preset response rule, and simultaneously constructs an execution tree according to the response result to generate and execute an execution plan;
and the transaction querier determines a result value and a state value in the distributed consistency network according to the execution result and returns the result value and the state value to the upper-layer service.
3. The method of claim 1, wherein after the declarative programming model converts the upper-layer business to-be-commonly-recognized business logic into a first declarative statement according to a preset specification, the engine service calls the analysis interpreter to analyze the first declarative statement, then calls the execution controller to determine whether an analysis result meets a preset execution condition, and if so, constructs an execution tree to generate an execution plan and further comprises:
a connector passes the first declarative statement into a configured engine service.
4. The method of claim 2, wherein after the declarative programming model converts the upper-layer business to-be-queried business logic into a second declarative statement according to the preset specification, the engine service invokes the analysis interpreter to analyze the second declarative statement, and invokes the response controller to respond to the analysis result according to the preset response rule, and the constructing the execution tree according to the response result to generate the execution plan further comprises:
a connector passes the second declarative statement into a configured engine service.
5. The method of claim 1, wherein the execution controller generates the execution condition by receiving a first configuration content of a user.
6. The method of claim 2, wherein the response controller generates the response rule by receiving a second configuration content of the user.
7. The method of claim 1, wherein the transaction processor supports simultaneous configuration of multiple distributed coherency networks.
8. A data processing apparatus based on a declarative and distributed ledger, comprising:
the declarative programming model is used for converting the upper-layer business to-be-consensus business logic into a first declarative statement according to a preset specification;
the engine service is used for calling an analysis interpreter to analyze the first declarative statement, then calling an execution controller to judge whether an analysis result meets a preset execution condition, and if so, constructing an execution tree to generate an execution plan and execute the execution plan;
and the transaction executor is used for converting the execution result into transaction data and writing the transaction data into the distributed consistency network for consensus processing.
9. The apparatus of claim 8,
the declarative programming model is also used for converting the business logic to be inquired of the upper layer business into a second declarative statement according to a preset specification;
the engine service is also used for calling the analysis interpreter to analyze the second declarative statement, calling the response controller to respond the analysis result according to the preset response rule, and constructing an execution tree according to the response result to generate and execute an execution plan;
further comprising: the business inquiry device is used for inquiring the business,
and the transaction querier is used for determining a result value and a state value in the distributed consistency network according to the execution result and returning the result value and the state value to the upper-layer service.
10. An electronic device, comprising: memory and a processor, characterized in that the memory has stored therein a computer program, wherein the processor is arranged to run the computer program to execute the method of data processing based on declarative and distributed ledgers of any one of claims 1 to 7.
CN202211050203.2A 2022-08-30 2022-08-30 Data processing method and device based on declarative and distributed accounts book and electronic device Pending CN115421698A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211050203.2A CN115421698A (en) 2022-08-30 2022-08-30 Data processing method and device based on declarative and distributed accounts book and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211050203.2A CN115421698A (en) 2022-08-30 2022-08-30 Data processing method and device based on declarative and distributed accounts book and electronic device

Publications (1)

Publication Number Publication Date
CN115421698A true CN115421698A (en) 2022-12-02

Family

ID=84200412

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211050203.2A Pending CN115421698A (en) 2022-08-30 2022-08-30 Data processing method and device based on declarative and distributed accounts book and electronic device

Country Status (1)

Country Link
CN (1) CN115421698A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117389569A (en) * 2023-10-26 2024-01-12 重庆猪哥亮科技有限责任公司 Program interpretation execution method

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110309196A (en) * 2019-05-22 2019-10-08 深圳壹账通智能科技有限公司 Block chain data storage and query method, apparatus, equipment and storage medium
CN112527504A (en) * 2020-12-17 2021-03-19 金蝶蝶金云计算有限公司 Multi-tenant resource quota management method and device, and computer equipment
CN112905615A (en) * 2021-03-02 2021-06-04 浪潮云信息技术股份公司 Distributed consistency protocol submission method and system based on sequence verification
CN113391885A (en) * 2021-06-18 2021-09-14 电子科技大学 Distributed transaction processing system
WO2022140936A1 (en) * 2020-12-28 2022-07-07 杭州趣链科技有限公司 Metering method and device for data query workload in blockchain, and terminal

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110309196A (en) * 2019-05-22 2019-10-08 深圳壹账通智能科技有限公司 Block chain data storage and query method, apparatus, equipment and storage medium
CN112527504A (en) * 2020-12-17 2021-03-19 金蝶蝶金云计算有限公司 Multi-tenant resource quota management method and device, and computer equipment
WO2022140936A1 (en) * 2020-12-28 2022-07-07 杭州趣链科技有限公司 Metering method and device for data query workload in blockchain, and terminal
CN112905615A (en) * 2021-03-02 2021-06-04 浪潮云信息技术股份公司 Distributed consistency protocol submission method and system based on sequence verification
CN113391885A (en) * 2021-06-18 2021-09-14 电子科技大学 Distributed transaction processing system

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117389569A (en) * 2023-10-26 2024-01-12 重庆猪哥亮科技有限责任公司 Program interpretation execution method

Similar Documents

Publication Publication Date Title
Nanda et al. Decentralizing execution of composite web services
CN110365751B (en) Service processing method, device and equipment of gateway system
CN107402989A (en) The method and distributed NewSQL Database Systems that a kind of full-text search is established
CN110083455B (en) Graph calculation processing method, graph calculation processing device, graph calculation processing medium and electronic equipment
CN112866333A (en) Cloud-native-based micro-service scene optimization method, system, device and medium
US20210240784A1 (en) Method, apparatus and storage medium for searching blockchain data
CN109151030B (en) Internet of things object distributed interaction system and method
JP2020109613A (en) Smart irrigation area e-platform based on four-layered architecture and data processing method
Wachholder et al. Enabling emergent behavior in systems-of-systems through bigraph-based modeling
CN109196476A (en) Seamless high-performance interoperability between the different type figure of shared garbage collector
CN115421698A (en) Data processing method and device based on declarative and distributed accounts book and electronic device
CN109858817A (en) A kind of Workflow Management System and method
CN111190750B (en) Data processing method and system
CN103299277B (en) Gpu system and processing method thereof
CN110737425A (en) billing platform system application program establishing method and device
CN102880669A (en) Business processing method and business processing device based on file
CN105144107A (en) Method, processing modules and system for executing an executable code
CN109739666A (en) Striding course call method, device, equipment and the storage medium of singleton method
CN109814973A (en) A kind of implementation method of desktop cloud platform, system and server
CN109816546A (en) A kind of farm farming management platform and method based on J2EE framework
CN110018831A (en) Program processing method, device and Related product
CN109597611A (en) Front end data flow control Components Development system, method, equipment and storage medium
CN114816357A (en) Service arrangement system for serving process bank
CN108073389A (en) A kind of automotive engine system based on script
CN112559336B (en) Method, device and system for self-adaptively debugging heterogeneous computing chip and main board chip

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20221202

RJ01 Rejection of invention patent application after publication