A semantic solidification and derivation method based on common predicate logic
By adopting the network public predicate logic method based on public semantics and public state reuse in distributed systems such as blockchain, the problem of reusability and certainty of semantic solidification and derivation in public script development is solved, and a safer and more secure implementation is achieved. Reliable program development.
Patent Information
- Application Number
- CN202011102058.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-10-15
- Publication Date
- 2024-09-17
- Estimated Expiration
- 2040-10-15
AI Technical Summary
In an open Internet environment, in distributed multi-node systems such as blockchain systems, there are risks such as writing errors and difficult security control in the process of semantic solidification and derivation of public scripts, resulting in insufficient reusability and certainty in program development.
Adopt a network public predicate logic method based on public semantics and public state reuse, obtain index values by calculating the digital characteristics of semantic units and data states, and generate semantic roots and state roots for the solidification and derivation of automata to ensure the semantics of the script and the uniqueness and security of data status.
It improves the convenience and unique certainty of computer program development, enhances the security and reliability of the system, and is suitable for the development of public scripts in scenarios such as blockchain, parallel blockchain, and distributed storage.
Smart Images

Figure CN114372471B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of blockchain technology and distributed computing, and in particular to a semantic solidification and derivation method based on public predicate logic in an Internet environment. Background Art
[0002] Systems running in an open Internet environment, such as blockchain systems, have a large number of scenarios where data states in the form of public scripts are combined with predicate logic to drive processing, with contract automata as typical cases. Distributed multi-node features require the unique accuracy of script semantics and the solidification of multi-level granular semantics. In the process of public script development, semantics and data states are solidified and derived and reused at different levels of granularity, thereby improving the convenience and efficiency of script development.
[0003] Since the automatic machine mechanism of the data status of various programs including scripts has the problems of business scenario upgrades, complex structure, and difficult security control, it may cause risks such as program writing errors or overflows.
[0004] Therefore, the present invention proposes a semantic solidification and derivation method of network public predicate logic based on public semantics and public state reuse, thereby improving the convenience and unique certainty of computer program development. Summary of the invention
[0005] In view of the technical problems existing in the prior art, the purpose of the present invention is to provide a computer semantic solidification and derivation method based on public semantics and public state reuse. The present invention solidifies through predicate logic and propositional logic based on common basic states, thereby realizing the encapsulation and solidification of semantics and states at a granularity level suitable for business needs. It is suitable for application scenarios in which computer practitioners develop programs including various public scripts including blockchain, parallel blockchain and distributed storage. It is a more convenient and deterministic method for developing network programs in public occasions.
[0006] The technical solution of the present invention is:
[0007] A semantic solidification and derivation method based on common predicate logic, the steps of which include:
[0008] 1) Select or design multiple semantic units X for program development for automaton A to form a semantic unit set Σ(X); wherein the semantic unit set {X} includes semantic units X(1), X(2), ..., X(N), and X(N) is the Nth semantic unit; different semantic units are designed according to different requirements to realize different logical functions; the data state set {D} corresponding to the semantic unit set {X} includes data states D(1), D(2), ..., D(K); D(K) is the data state corresponding to the Kth data processed by the semantic unit X;
[0009] 2) Obtain digital features for each semantic unit in the semantic unit set {X} and calculate the index value of each semantic unit to obtain a semantic unit index set {H_X} and a digital feature set {Sign_X}; wherein the set {Sign_X} includes Sign_X(1), Sign_X(2), ..., Sign_X(N), the semantic unit index set {H_X} includes H_X(1), H_X(2), ..., H_X(N), the digital feature corresponding to the semantic unit X(N) is Sign_X(N), and the index value corresponding to the semantic unit X(N) is H_X(N); logarithm According to each data state in the state set {D}, digital features are acquired and the index value of each data state is calculated to obtain a data state index set {H_D} and a digital feature set {Sign_D}; wherein the data state index set {H_D} includes data state index values H_D(1), H_D(2), ..., H_D(K), and the digital feature set {Sign_D} includes Sign_D(1), Sign_D(2), ..., Sign_D(K), H_D(K) is the index value of the data state D(K), and Sign_D(K) is the digital feature of the data state D(K);
[0010] 3) Using the semantic unit index set {H_X} as input, obtain the semantic root Root_X through the calculation mode, and using the data state index set {H_D} as input, obtain the state root Root_D through the calculation mode; using the semantic root Root_X and the state root Root_D values as input, obtain the root Root_A of the automaton A through the calculation mode;
[0011] 4) Automaton A' starts automaton A through the automaton root Root_A, uses the semantic root Root_X to obtain all semantic units of automaton A, and uses the state root Root_D to obtain the data state corresponding to the execution semantics of automaton A; then uses the digital features corresponding to the semantic units to drive the corresponding semantic units, uses the digital features corresponding to the data state to drive the corresponding data, and uses the predicate logic in the semantic units to process the corresponding propositional logic, so that automaton A' obtains the requirements for automaton A.
[0012] Furthermore, the digital feature may be a digital signature or other common digital features.
[0013] Furthermore, the input parameter type and category of the semantic unit X are set by the specific business scenario, and the input parameter is a business parameter or other code or constraint condition related to the functional application.
[0014] Furthermore, the semantic unit is a programmable code that has been security audited or long-term verified by a professional organization, or a programmable code that has been long-term verified to have high execution efficiency, or a programmable code that has been long-term verified to have stable execution, or a combination of the above.
[0015] Furthermore, the data state D is set by a specific business scenario, and the data state is a data block or a data set, which is in the form of structured data, unstructured data or semi-structured data.
[0016] Furthermore, the calculation mode may be a Merkle tree, a dictionary tree, or other types of calculation modes, so as to obtain the data root of the input data.
[0017] Furthermore, the automaton A is a program template, a function, a framework or a computer software program.
[0018] Furthermore, the automaton A' and the automaton A are of the same type or different types.
[0019] In a given public network system, various transactions are driven by predicate logic including programs. The semantics of the script construction process (the specific form corresponds to the "X series" in the subsequent description) and the reliability and security of the data state (the specific form corresponds to the "D series" in the subsequent description) are the basis for the unique certainty of system operation. Solidifying and deriving various types of verified or tested public predicate logic is an important means.
[0020] Aiming at the common or basic needs of business applications, a computer automaton A for semantic solidification and derivation is invented, which specifically includes a semantic unit X series and an associated data state D series. The semantic unit series and the data series are digitally signed to form a set of semantic unit sets {X}, semantic unit index sets {H_X} and digital feature sets {Sign_X}, data state sets {D}, data state index sets {H_D} and digital feature sets {Sign_D}, semantic roots Root_X and state roots Root_D, and automaton roots Root_A, such as Figure 1 The specific form of the automaton A can be a program template, a function, a framework, or other computer software forms.
[0021] The automaton root Root_A of the present invention is obtained by taking the semantic root Root_X and the state root Root_D as input through the calculation model, such as Figure 2 As shown. The automaton root Root_A can be used as the semantic unit index of other automata. The calculation mode can be Merkle tree, dictionary tree and other types of calculation modes to obtain the data root of the input data.
[0022] The semantic root Root_X of the present invention is obtained by taking the index values {H_X} of all semantic units X(s) as input through a calculation model, such as Figure 3 All semantic unit index values H_X(s) are obtained by evaluating the digital feature values of semantic units X(s) one by one, where s∈[1,N], such as Figure 5 As shown, N is the total number of semantic units, and the digital feature evaluation can be hash calculation or other custom methods, or can be a digital signature or other common digital features.
[0023] The semantic unit index value set {H_X} of the present invention is specifically composed of semantic units H_X(1), H_X(2), ..., H_X(N), which realizes the identifiability and retrieval of semantic units. H_X(s) is the index value of the sth semantic unit X(s), such as Figure 6 The specific form of the semantic unit can be "program statements and their combinations", and the index value of the semantic unit is obtained by evaluating the digital feature value of the semantic unit.
[0024] The semantic unit set Σ(X) of the present invention is specifically composed of semantic units X(1), X(2), ..., X(N), such as Figure 7 As shown in the figure, different semantic units realize different logical functions according to different designs of specific requirements; each statement corresponds to a digital feature, which is the {Sign_X} identifier, specifically Sign_X(1), Sign_X(2), …, Sign_X(N), such as Figure 8 As shown, semantic units correspond to digital features one by one, such as Fig.13 As shown. The specific semantic unit can be a programmable code that has been audited by a professional organization for security or verified for long-term execution, or a programmable code that has been verified for long-term high execution efficiency, or a programmable code that has been verified for long-term stable execution, or a combination of these. The input parameter types and categories of the semantic units X(1), X(2), ..., X(N) are set by specific business scenarios. Different parameters can be specific business parameters or other codes, or constraints related to functional applications, such as version number, year, billing and its business constraints. The constraints can be for the entire semantic complex, or for specific individuals or parameter combinations.
[0025] The state root Root_D of the present invention is obtained by taking the index values of all data states D(t) as input through a calculation model, such as Figure 4 All data state index values H_D(t) are obtained by evaluating the digital eigenvalues of the data state D(t) one by one, where t∈[1,K], such as Fig. 9As shown in the figure, K is the total number of data states, and feature evaluation can be hash calculation or other custom methods.
[0026] The data state index value set {H_D} of the present invention is specifically composed of data state index values H_D(1), H_D(2), ..., H_D(K), which realizes the identifiability and retrieval of the data state. Fig.10 The present invention obtains searchability by performing digital features on semantic units and data state units, and obtains identifiability by performing digital features.
[0027] The data state set {D} of the present invention is specifically composed of different data states D(1), D(2), ..., D(K), such as Fig.11 As shown, different data are stored in different data structures according to the requirements, and each data forms a state; each data state corresponds to a digital feature, which is the {Sign_D} identifier, specifically Sign_D(1), Sign_D(2), …, Sign_D(K), as shown in Fig.12 As shown, the digital features of the data state correspond to the data state one by one, such as Fig.14 As shown, data states D(1), D(2), ..., D(K) are set by specific business scenarios. Data states are the existence forms of data blocks or data sets, which can be structured data forms, unstructured data forms, or semi-structured data forms.
[0028] On the basis of the above, as shown in Figure 15, automaton A' derives automaton A and calls A during operation, which is a schematic framework diagram, wherein automata A and A' can be of the same type or different types, and automaton A' is derived from automaton A. Automaton A' starts automaton A through the automaton root Root_A, uses the semantic root Root_X to obtain all semantic units of automaton A, and uses the state root Root_D to obtain the data state corresponding to the execution semantics of automaton A. Then, the authorized digital features are used to drive the semantic units and data states, and the predicate logic is used to process the corresponding propositional logic, that is, the authorized semantic units operate on the corresponding data, so as to obtain the requirements of automaton A' for automaton A. Among them, the driving specifically refers to the user comparing the authorized semantic unit digital features {Sign_X_} and data status {Sign_D_} obtained in combination with the computer logical state with the semantic unit digital features {Sign_X} and data status {Sign_D} of the automaton A respectively, so as to obtain the semantic unit and data status corresponding to the authorized digital features, wherein the digital feature set {Sign_X_} is not greater than the set {Sign_X}, and the digital feature set {Sign_D_} is not greater than the set {Sign_D}.
[0029] Compared with the prior art, the present invention has the following beneficial effects:
[0030] It does not rely on specific business scenarios and operating environments, and has safe operation and better diffusibility of reuse sets. A method for solidifying and building contract automata is proposed, which is suitable for public computing environments, including calling and deriving methods in blockchain, parallel blockchain, distributed computing, distributed storage, etc., and is applied in the fields of public automata, private automata, and polymorphic automata.
[0031] The parts not involved in the device are the same as those in the prior art or can be implemented by using the prior art. The present invention has a simple structure and is easy to operate. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] Figure 1 The data structure diagram of the automaton proposed by the present invention;
[0033] Figure 2 This is a schematic diagram of the automatic root generation proposed by the present invention;
[0034] Figure 3 A schematic diagram for generating the semantic root proposed by the present invention;
[0035] Figure 4 A schematic diagram of the state root generation proposed by the present invention;
[0036] Figure 5 A schematic diagram for generating indexes of different semantic units proposed in the present invention;
[0037] Figure 6 Different semantic unit index sets proposed by the present invention;
[0038] Figure 7 Different sets of semantic units proposed for the present invention;
[0039] Figure 8 The digital feature sets corresponding to the different semantic units proposed in the present invention;
[0040] Fig. 9 A schematic diagram for generating different data indexes proposed by the present invention;
[0041] Fig.10 Different data index sets proposed for the present invention;
[0042] Fig.11 Different datasets proposed for this invention;
[0043] Fig.12 A digital feature set corresponding to different data proposed in the present invention;
[0044] Fig.13 Different semantic units and corresponding digital features proposed by the present invention;
[0045] Fig.14 Different data and corresponding digital features proposed for the present invention;
[0046] Fig.15 A schematic diagram derived from the automaton proposed by the present invention;
[0047] Fig.16 The data structure diagram of the case script proposed by the present invention;
[0048] Fig.17 A schematic diagram of the root generation of the case script function proposed by the present invention;
[0049] Fig.18 Schematic diagram of the derivation of the case script function proposed in the present invention. DETAILED DESCRIPTION
[0050] The technical solutions in the embodiments of the present invention will be described clearly and completely below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments.
[0051] In a given network system, various transactions are driven by predicate logic including scripts. The reliability and security of the program construction process are the basic conditions for the stable operation of the system.
[0052] Aiming at the common or basic needs of the business, the function f of the computer program is designed to include: instruction unit X series and associated data D series, all instruction series and data series are digitally signed, all instruction sets {X} and signature sets {Sign_X}, all data sets {D} and signature sets {Sign_D}, the semantic root Root_X generated by the Merkle tree of all instruction hash value sets {H_X}, the state root Root_D generated by the Merkle tree of the data data hash value set {H_D}, and the automaton root Root_f generated again by Root_X and Root_D using the Merkle tree algorithm, such as Fig.16 .
[0053] All instruction sets {X} are specifically composed of semantic units X(1), X(2), ..., X(N), such as Figure 7 As shown, different instructions are designed according to the requirements to achieve different executions; each instruction corresponds to a digital signature, which is the {Sign_X} identifier, specifically Sign_X(1), Sign_X(2), …, Sign_X(N), as shown in Figure 8 As shown, the instructions correspond to the digital signatures one by one, such as Fig.13The specific instructions can be programmable codes that have been audited by professional organizations for safety or verified for long-term execution, programmable codes that have been verified for long-term execution with high efficiency, programmable codes that have been verified for long-term execution with stable execution, or a combination of the above.
[0054] All data state sets {D} are specifically composed of different data blocks D(1), D(2), ..., D(K), such as Fig.11 As shown in the figure, different data are stored in different data structures according to the requirements, and each data forms a state; each data block corresponds to a digital signature, which is the {Sign_D} identifier, specifically Sign_D(1), Sign_D(2), …, Sign_D(K), as shown in Fig.12 As shown, the digital signature corresponds to the data state one by one, such as Fig.14 As shown, the data blocks D(1), D(2), ..., D(K) are set according to specific business scenarios, and each can be in the form of structured data, unstructured data, or semi-structured data.
[0055] All instruction sets {X} are hashed one by one to obtain the corresponding hash value set {H_X}, such as Figure 5 and Figure 6 On this basis, the semantic root Root_X of the Merkle tree of the instruction set is obtained with all hash values as leaves, as shown in Figure 3 shown.
[0056] All data state sets {D} are hashed one by one to obtain the corresponding hash value set {H_D}, such as Fig. 9 and Fig.10 On this basis, the state root Root_D of the Merkle tree of the data state is obtained with all hash values as leaves, as shown in Figure 4 shown.
[0057] Take Root_X and Root_D as the leaves of the Merkle tree and find the root automaton root Root_f, such as Fig.17 As shown. On this basis, the automaton root Root_f of the function can exist as the instruction index of other functions.
[0058] On the basis of the above, as shown in 18, it is a schematic framework diagram of the script function f' derived from the script function f, wherein functions f and f' can be of the same type or different types, and function f' is derived from function f. All instructions of function f are obtained through Root_X, and all data states corresponding to the execution semantics of function f are obtained through Root_D. After using the authorized statement digital signature {Sign_X_} and data digital signature {Sign_D_}, they are compared with the unit data signature {Sign_X} and data digital signature {Sign_D_} corresponding to the statement to obtain the right to use the corresponding statements and data that have passed the comparison, and the statements are used to perform the logical required operations on the corresponding data. Thus, the requirements of function f' for function f are obtained.
[0059] The above is only an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.
Claims
1. A semantic solidification and derivation method based on common predicate logic, the steps of which include: 1) Select or design multiple semantic units X for program development for automaton A to form a semantic unit set {X}; wherein the semantic unit set {X} includes semantic units X(1), X(2), ..., X(N), where X(N) is the Nth semantic unit; different semantic units implement different logical functions according to different design requirements; the data state set {D} corresponding to the semantic unit set {X} includes data states D(1), D(2), ..., D(K); D(K) is the data state corresponding to the Kth data processed by the semantic unit X; 2) Obtain digital features of each semantic unit in the semantic unit set {X} and calculate the index value of each semantic unit to obtain a semantic unit index set {H_X} and a digital feature value set {Sign_X}; wherein the digital feature set {Sign_X} includes Sign_X(1), Sign_X(2), ..., Sign_X(N), the semantic unit index set {H_X} includes H_X(1), H_X(2), ..., H_X(N), the digital feature corresponding to the semantic unit X(N) is Sign_X(N), and the index value corresponding to the semantic unit X(N) is H_X(N) ; Obtain digital features for each data state in the data state set {D} and calculate the index value of each data state to obtain a data state index set {H_D} and a digital feature set {Sign_D}; wherein the data state index set {H_D} includes data state index values H_D(1), H_D(2), ..., H_D(K), and the signature set {Sign_D} includes Sign_D(1), Sign_D(2), ..., Sign_D(K), H_D(K) is the index value of the data state D(K), and Sign_D(K) is the digital feature of the data state D(K); 3) Using the semantic unit index set {H_X} as input, the semantic root Root_X is obtained through the calculation mode, and using the data state index set {H_D} as input, the state root Root_D is obtained through the calculation mode; using the semantic root Root_X and the state root Root_D values as input, the root Root_A of the automaton A is obtained through the calculation mode; 4) Automaton A' starts automaton A through its root Root_A, uses semantic root Root_X to obtain all semantic units of automaton A, and uses state root Root_D to obtain data state corresponding to the execution semantics of automaton A; then uses digital features corresponding to semantic units to drive corresponding semantic units, uses digital features corresponding to data state to drive corresponding data, and uses predicate logic in semantic units to process corresponding propositional logic, so that automaton A' obtains the demand for automaton A.
2. The method according to claim 1, characterized in that The digital feature is a digital signature.
3. The method according to claim 1, characterized in that The input parameter type and category of the semantic unit X are set by the specific business scenario, and the input parameter is a business parameter or a constraint condition related to the functional application.
4. The method according to claim 1, characterized in that The semantic unit is a programmable code that has passed a security audit or long-term execution verification by a designated professional organization, or a programmable code that has been verified for long-term high execution efficiency, or a programmable code that has been verified for long-term stable execution, or a combination of the above.
5. The method according to claim 1, characterized in that The data state D is set by a specific business scenario. The data state is a data block or a data set. The data structure of the data state is a structured data form, an unstructured data form, or a semi-structured data form.
6. The method according to claim 1, characterized in that The calculation mode is a Merkle tree or a dictionary tree, which is used to obtain the data root of the input data.
7. The method according to claim 1, characterized in that Automaton A is a program template, function, framework or computer software program.
8. The method according to claim 1, characterized in that Automaton A' may be of the same type as automaton A or of a different type.
