Trusted timestamp generation method and device, equipment, storage medium and product

By obtaining the time when each core node in the timestamp generation system responds to the timestamp request, the target core node and associated node are determined, and a trusted timestamp is generated based on the consensus results, the low efficiency and accuracy of timestamp generation in the prior art are solved. The problem of low and low credibility achieves efficient, accurate and trustworthy timestamp generation.

CN119449323AActive Publication Date: 2025-02-14中移信息技术有限公司 +1
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202411597126.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-08
Publication Date
2025-02-14
Estimated Expiration
2044-11-08

AI Technical Summary

Technical Problem

The prior art generates time stamps inefficient, low accuracy and low credibility.

Method used

When receiving the timestamp request initiated by the client, obtain the time when each core node in the timestamp generation system responds to the timestamp request, determine the target core node and the target associated node, and initiate the timestamp verification consensus request at the target core node. When , a trusted timestamp is generated based on the consensus result of the target associated node.

Benefits of technology

Without losing accuracy, improve the time stamp consensus efficiency, prevent the timestamps from being tampered, and effectively improve the efficiency, accuracy and credibility of generating timestamps.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119449323A_ABST
    Figure CN119449323A_ABST
Patent Text Reader

Abstract

The invention discloses a trusted timestamp generation method and device, equipment, a storage medium and a product, and relates to the technical field of data processing, and the method comprises the steps: obtaining the time of each core node in a timestamp generation system for responding to a timestamp request; determining a target core node according to the time when each core node responds to the timestamp request; determining a target association node according to the fitting degree between the nodes; when it is detected that the target core node initiates a timestamp verification consensus request, generating a trusted timestamp according to a consensus result of the target associated node; through the mode, after each core node in the time generation system is determined, the target core node is further determined, and when the target core node initiates the timestamp verification consensus request, only the target associated node participates in consensus, so that the timestamp consensus efficiency is improved on the premise of not losing the accuracy, and the time generation efficiency is improved. And the timestamp can be prevented from being tampered through a decentralized consensus mode, so that the efficiency, the accuracy and the credibility of generating the timestamp can be effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and in particular to a trusted timestamp generation method, apparatus, device, storage medium and product. Background Art

[0002] Under the general trend of global informatization, the demand for digital authentication is increasing day by day, and there are higher requirements for the authenticity, reliability and integrity of electronic evidence. Timestamps can just meet the above requirements and have become an important legal means and technical guarantee, which can effectively protect the legitimate rights and interests of all parties. At present, the common methods of generating timestamps are divided into two categories. The first category is issued by a third-party credit institution, that is, a third-party credit institution is used to centrally generate timestamps. The credibility of timestamps depends entirely on the credibility of the credit institution. Once the credit institution is attacked, the timestamp can be easily tampered with, resulting in low credibility of the generated trusted timestamps; the second category is to generate trusted timestamps based on blockchain. This method cannot guarantee the accuracy of generating trusted timestamps, and the blockchain consensus efficiency is low, resulting in low efficiency and low accuracy of generating timestamps. Based on this, the above method generates timestamps with low efficiency, low accuracy and low credibility.

[0003] The above contents are only used to assist in understanding the technical solution of the present application and do not constitute an admission that the above contents are prior art. Summary of the invention

[0004] The main purpose of this application is to provide a trusted timestamp generation method, device, equipment, storage medium and product, aiming to solve the technical problems of low efficiency, low accuracy and low credibility in the prior art of generating timestamps.

[0005] To achieve the above purpose, the present application proposes a method for generating a trusted timestamp, the method comprising:

[0006] Upon receiving a timestamp request initiated by a client, obtaining the time at which each core node in the timestamp generation system responds to the timestamp request;

[0007] Determine the target core node according to the time at which each core node responds to the timestamp request;

[0008] Determine the target associated node according to the degree of fit between the nodes;

[0009] When it is detected that the target core node initiates a timestamp verification consensus request, a trusted timestamp is generated according to the consensus result of the target associated node.

[0010] In one embodiment, before the step of obtaining the time when each core node in the timestamp generation system responds to the timestamp request when receiving the timestamp request initiated by the client, the step further includes:

[0011] Count the number of nodes in the timestamp generation system;

[0012] Calculate the average response time from each node to other nodes based on the number of nodes;

[0013] Obtain the number of times each node in the timestamp generation system participated in the consensus and the number of times the consensus was correct;

[0014] Calculate the consensus accuracy of each node based on the number of times the consensus was participated in and the number of times the consensus was correct;

[0015] The core nodes in the timestamp generation system are determined according to the average response time of each node to other nodes and the consensus accuracy of each node.

[0016] In one embodiment, the step of determining each core node in the timestamp generation system according to the average response time of each node to other nodes and the consensus accuracy of each node includes:

[0017] Calculate the average response time from each node to other nodes respectively to obtain a normalized value of the average response time of each node;

[0018] Calculating the consensus accuracy of each node respectively to obtain a normalized value of the consensus accuracy of each node;

[0019] Calculating the index score of each node based on the node evaluation index scoring algorithm according to the normalized value of the average response time of each node and the normalized value of the consensus accuracy of each node;

[0020] Each core node in the timestamp generation system is determined according to the index score.

[0021] In one embodiment, the step of determining the target associated node according to the degree of fit between the nodes includes:

[0022] Obtain inter-node consensus data and inter-node response data;

[0023] generating a fitting abstract matrix according to the inter-node consensus data and the inter-node response data;

[0024] Calculating the degree of fit between nodes according to the fitting abstract matrix based on a preset degree of fit algorithm;

[0025] The target associated node is determined by polling nodes according to the degree of fit between the nodes.

[0026] In one embodiment, when the target core node is detected to initiate a timestamp verification consensus request, the step of generating a trusted timestamp according to the consensus result of the associated node includes:

[0027] When detecting that the target core node initiates a timestamp verification consensus request, obtaining network bandwidth data and CPU core number of the target core node;

[0028] Obtain network bandwidth data, number of CPU cores, and number of network hops of the target associated node;

[0029] Predict the current heartbeat response time based on the network bandwidth data and CPU core number of the target core node, the network bandwidth data, CPU core number and network hop number of the key node through the target heartbeat time prediction model;

[0030] Calculate the time difference according to the current heartbeat response time, the system time of the target core node and the system time of the target associated node;

[0031] Determine the consensus passing rate of the target associated node according to the comparison result of the time difference and the preset threshold;

[0032] A trusted timestamp is generated based on the consensus rate.

[0033] In one embodiment, before the step of predicting the current heartbeat time according to the network bandwidth data and the number of CPU cores of the target core node, the network bandwidth data, the number of CPU cores and the number of network hops of the key nodes by the target heartbeat time prediction model, the step further includes:

[0034] Obtain historical sample training data and historical sample test data;

[0035] Training an initial heartbeat time prediction model according to the historical sample training data;

[0036] Obtaining a predicted heartbeat response time based on the initial heartbeat time prediction model according to the historical sample test data;

[0037] Determining a time difference between the predicted heartbeat response time and the actual heartbeat response time;

[0038] The initial heartbeat time prediction model is iteratively optimized according to the time difference to obtain a target heartbeat time prediction model.

[0039] In addition, to achieve the above purpose, the present application also proposes a trusted timestamp generation device, the trusted timestamp generation device comprising:

[0040] An acquisition module, configured to, upon receiving a timestamp request initiated by a client, acquire the time at which each core node in the timestamp generation system responds to the timestamp request;

[0041] A core node determination module, configured to determine a target core node according to the time at which each core node responds to the timestamp request;

[0042] An associated node determination module is used to determine a target associated node according to the degree of fit between nodes;

[0043] A generation module is used to generate a trusted timestamp according to the consensus result of the target associated node when detecting that the target core node initiates a timestamp verification consensus request.

[0044] In addition, to achieve the above-mentioned purpose, the present application also proposes a trusted timestamp generation device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the trusted timestamp generation method described above.

[0045] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the trusted timestamp generation method described above are implemented.

[0046] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the steps of the trusted timestamp generation method described above are implemented.

[0047] One or more technical solutions proposed in the present application have at least the following technical effects: when receiving a timestamp request initiated by a client, obtaining the time when each core node in the timestamp generation system responds to the timestamp request; determining the target core node according to the time when each core node responds to the timestamp request; determining the target associated node according to the degree of fit between the nodes; when detecting that the target core node initiates a timestamp verification consensus request, generating a trusted timestamp according to the consensus result of the target associated node; through the above method, after determining each core node in the time generation system, the target core node is determined according to the time when each core node responds to the timestamp request, and when the timestamp verification consensus request is initiated by the target core node, only the target associated node participates in the consensus, thereby improving the timestamp consensus efficiency without losing accuracy, and preventing the timestamp from being tampered with through a decentralized consensus method, thereby effectively improving the efficiency, accuracy and credibility of generating timestamps. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] The accompanying drawings herein are incorporated in and constitute a part of the specification, illustrate embodiments consistent with the present application, and together with the description, are used to explain the principles of the present application.

[0049] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0050] Figure 1 A flowchart of the first embodiment of the method for generating a trusted timestamp in this application is provided;

[0051] Figure 2 A schematic diagram of the overall architecture of the trusted timestamp generation method provided in Example 1 of the present application;

[0052] Figure 3 A flowchart of the second embodiment of the method for generating a trusted timestamp in this application is provided;

[0053] Figure 4 This is a schematic diagram of the module structure of a trusted timestamp generation device according to an embodiment of the present application;

[0054] Figure 5 A schematic diagram of the device structure of the hardware operating environment involved in the trusted timestamp generation method in the embodiment of the present application.

[0055] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0056] It should be noted that the execution subject of this embodiment can be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or an electronic device capable of realizing the above functions, a trusted timestamp generating device, etc. The following takes a trusted timestamp generating device as an example to illustrate this embodiment and the following embodiments.

[0057] Based on this, the present application embodiment provides a method for generating a trusted timestamp. Figure 1 , Figure 1 This is a flow chart of the first embodiment of the trusted timestamp generation method of the present application.

[0058] In this embodiment, the method for generating a trusted timestamp includes steps S10 to S40:

[0059] Step S10, when receiving a timestamp request initiated by the client, obtaining the time when each core node in the timestamp generation system responds to the timestamp request.

[0060] It should be understood that a timestamp request refers to an application request initiated from the client when there is a need to generate a trusted timestamp. For the core node selector, after receiving the timestamp request initiated by the client, it will verify the legitimacy of the timestamp request. If the verification is successful, the timestamp request will be forwarded to each core node in the timestamp generation system. If the verification fails, the timestamp application will be rejected. In addition, before generating a trusted timestamp, the time of all nodes in the timestamp generation system will be synchronized to ensure the consistency of the time of each node.

[0061] It should be noted that the reference Figure 2 , Figure 2 It is a schematic diagram of the overall architecture, which specifically includes: a client and a trusted timestamp generation device, wherein the trusted timestamp generation device includes a core node selector, core nodes, and associated nodes. The specific process is that the client sends a timestamp request to the core node selector, and when the core node selector verifies that the timestamp request is legal, it forwards the timestamp request to each core node in the timestamp generation system.

[0062] Furthermore, in order to effectively improve the accuracy of determining the core nodes, before step S10, it also includes: counting the number of nodes in the timestamp generation system; calculating the average response time of each node to other nodes based on the number of nodes; obtaining the number of times each node in the timestamp generation system participates in the consensus and the number of correct consensuses; calculating the consensus accuracy of each node based on the number of times the consensus is participated in and the number of correct consensuses; and determining each core node in the timestamp generation system based on the average response time of each node to other nodes and the consensus accuracy of each node.

[0063] It should be understood that there are two dimensions for evaluating core nodes in this implementation. The first dimension is that as a core node, the consensus accuracy should be high so that the success rate of initiating consensus will be high. The second dimension is that when a core node initiates timestamp consensus, the response time for the consensus request to reach each node should be the lowest so that the consensus efficiency will be fast. Therefore, it is necessary to calculate the average response time of each node to other nodes and the consensus accuracy of each node.

[0064] Specifically, the number of nodes in the statistical timestamp generation system is n, and the average response time from node i to node j is t ij , then the average response time from node i to other nodes is:

[0065]

[0066] It should be noted that the above formula is used to calculate the average response time from each node to other nodes. Specifically, it can be represented by an average response time set, for example, t = {t1, t2, t3...t n}.

[0067] It should be understood that the consensus accuracy represents the ratio of the number of correct consensuses to the number of times consensus is participated in. The strategy of minority obeys majority is usually adopted in consensus. Taking node i as an example, it is specifically:

[0068] acc i =sucnum i / connum i .

[0069] Among them, acc i Indicates the consensus accuracy, connum i Indicates the number of times participating in consensus, sucnum i Represents the correct number of consensus.

[0070] It should be noted that the above formula is used to calculate the consensus accuracy of each node respectively, which can be specifically represented by a consensus accuracy set, for example, acc = {acc1, acc2, acc3...acc n}.

[0071] Furthermore, in order to effectively improve the accuracy of determining core nodes, the step of determining each core node in the timestamp generation system based on the average response time of each node to other nodes and the consensus accuracy of each node includes: calculating the average response time of each node to other nodes respectively to obtain a normalized value of the average response time of each node; calculating the consensus accuracy of each node respectively to obtain a normalized value of the consensus accuracy of each node; calculating the index score of each node based on the normalized value of the average response time of each node and the normalized value of the consensus accuracy of each node based on the node evaluation index scoring algorithm; and determining each core node in the timestamp generation system according to the index score.

[0072] It can be understood that after calculating the average response time of each node to other nodes, it is necessary to further calculate the normalized value of the average response time of each node. The larger the normalized value, the faster the average response time, indicating that the node attribute is better. Normalization is used to control the value range between (0-1) through transformation to prevent the element values ​​in the average response time set from being too large or too small, affecting the calculation results, and making the data more comparable. The specific formula for calculating the normalized value of the average response time of each node is:

[0073]

[0074] Among them, nt iRepresents the normalized value of the average response time of the node, max(t) represents the maximum average response time in the average response time set, and min(t) represents the minimum average response time in the average response time set.

[0075] It should be understood that after calculating the consensus accuracy of each node, it is necessary to further calculate the normalized value of the consensus accuracy of each node. The larger the normalized value, the higher the consensus accuracy, indicating that the node is more authoritative and should be used as a core node. The normalized calculation makes it easier to compare the consensus accuracy. The specific formula for calculating the normalized value of the consensus accuracy of each node is:

[0076]

[0077] Among them, NACC i Represents the normalized value of the consensus accuracy of the node, max(t) represents the maximum consensus accuracy in the consensus accuracy set, and min(t) represents the minimum consensus accuracy in the consensus accuracy set.

[0078] It can be understood that the node evaluation index scoring algorithm refers to an algorithm for calculating the index score of each node. The node evaluation index scoring algorithm also sets corresponding weights for each data. For example, the weight set for the normalized value of the average response time of each node is α, and the weight set for the normalized value of the consensus accuracy of each node is β, and α+β=1. Then, the index score of each node is calculated by combining the normalized value of the average response time of each node and the normalized value of the consensus accuracy of each node. Node i is used as an example for explanation, specifically:

[0079] score i =α*nt i +β*nacc i .

[0080] Among them, score i represents the index score of the node, α represents the weight of the normalized value of the average response time of the node, nt i represents the normalized value of the average response time of the node, β represents the weight of the normalized value of the consensus accuracy of the node, nacc i A normalized value representing the consensus accuracy of a node.

[0081] It should be noted that after calculating the index score of each node, they are sorted in order from large to small or from small to large, and then the top N nodes are used as core nodes. N can be flexibly set according to actual needs. For example, N=5, the core node initiates a timestamp verification consensus request, which can improve the consensus accuracy on the one hand, and the consensus efficiency on the other hand.

[0082] Step S20: determining a target core node according to the time at which each core node responds to the timestamp request.

[0083] It should be understood that the target core point refers to the core node that first responds to the core node selector among the core points, that is, the core node that takes the shortest time to respond to the timestamp request. Specifically, a competition mechanism is adopted among the core nodes, and the core node that first responds to the core node selector is taken as the target core node.

[0084] Step S30, determining the target associated node according to the degree of fit between the nodes.

[0085] It can be understood that the target associated node refers to the node with high fitting degree among the remaining nodes outside the core node. The number of the target associated nodes can be multiple. Only the target associated nodes participate in the consensus, which can effectively improve the timestamp consensus efficiency without losing accuracy.

[0086] Furthermore, in order to effectively improve the accuracy of determining the target associated nodes, step S30 includes: obtaining inter-node consensus data and inter-node response data; generating a fitting abstract matrix based on the inter-node consensus data and the inter-node response data; calculating the degree of fit between nodes according to the fitting abstract matrix based on a preset fitting algorithm; and determining the target associated nodes by polling nodes according to the degree of fit between the nodes.

[0087] It should be understood that the inter-node consensus data, the inter-node response data, and the relationship between the inter-node consensus data and the inter-node response data refer to Table 1, specifically:

[0088] Table 1:

[0089]

[0090] It should be noted that after obtaining the inter-node consensus data and inter-node response data, the above abstraction can be generated into an n*2n fitting abstract matrix, where h=2n. The fitting abstract matrix can be specifically expressed as:

[0091]

[0092] It should be understood that the preset fitting algorithm refers to an algorithm for calculating the fitting between nodes. After generating the fitting abstract matrix, the fitting between nodes is calculated using the preset fitting algorithm. The example of node i and node j is used for explanation. Specifically,

[0093]

[0094] Among them, fitrate ijIndicates the degree of fit between nodes, j and k both represent variables. For example, j = 1, k = 1, which means a 11 .

[0095] It should be noted that after calculating the degree of fit between nodes, each core node is polled, and nodes with high degree of fit are selected from the remaining nodes outside the core node as associated nodes. The closer the degree of fit between nodes is to 1, the higher the degree of fit is, until all nodes are selected. When the core node initiates a timestamp verification consensus request, all nodes are replaced by associated nodes, and only associated nodes participate in the consensus, which can improve the efficiency of consensus without losing accuracy, solve the problems of high latency and low efficiency of traditional decentralized timestamp services, and thus improve the availability of timestamp services.

[0096] Step S40, when it is detected that the target core node initiates a timestamp verification consensus request, a trusted timestamp is generated according to the consensus result of the target associated node.

[0097] It can be understood that the consensus result refers to the result of whether the consensus of multiple target-related nodes is passed. When it is detected that the target core node initiates a timestamp verification consensus request, it is determined whether the consensus is passed. If so, the timestamp is recognized as credible, that is, a credible timestamp is generated.

[0098] This embodiment obtains the time when each core node in the timestamp generation system responds to the timestamp request initiated by the client when receiving the timestamp request; determines the target core node according to the time when each core node responds to the timestamp request; determines the target associated node according to the fit between the nodes; and generates a trusted timestamp according to the consensus result of the target associated node when detecting that the target core node initiates a timestamp verification consensus request; through the above method, after determining each core node in the time generation system, the target core node is determined according to the time when each core node responds to the timestamp request, and when the timestamp verification consensus request is initiated by the target core node, only the target associated node participates in the consensus, which improves the timestamp consensus efficiency without losing accuracy, and prevents the timestamp from being tampered with through a decentralized consensus method, thereby effectively improving the efficiency, accuracy and credibility of generating timestamps.

[0099] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as those in the above-mentioned embodiment 1 can be referred to the above introduction, and will not be repeated in the following. Figure 3 , step S40 includes steps S401 to S406:

[0100] Step S401, when it is detected that the target core node initiates a timestamp verification consensus request, the network bandwidth data and the number of CPU cores of the target core node are obtained.

[0101] It should be understood that the network bandwidth data includes but is not limited to the upload bandwidth, download bandwidth and total bandwidth of the target core node, and the number of CPU cores refers to the number of physical computing cores contained in the target core node. After obtaining the network bandwidth data and CPU core number of the target core node, the above data will be sent to each target-related node.

[0102] Step S402, obtaining network bandwidth data, number of CPU cores, and number of network hops of the target associated node.

[0103] It is understandable that for the target associated node, when receiving the timestamp verification consensus request, it will also obtain its own network bandwidth data, CPU core number and network hop number.

[0104] Step S403, predicting the current heartbeat response time according to the network bandwidth data and the number of CPU cores of the target core node, the network bandwidth data, the number of CPU cores and the number of network hops of the key nodes through the target heartbeat time prediction model.

[0105] It should be understood that the target heartbeat time prediction model refers to a model for predicting the heartbeat response time. The target heartbeat time prediction model is used to verify the accuracy of the timestamp of the target core node and improve the credibility of the timestamp. After obtaining the input network bandwidth data and number of CPU cores of the target core node, the network bandwidth data, number of CPU cores and number of network hops of the key nodes, the current heartbeat response time is predicted and output.

[0106] Furthermore, in order to effectively improve the accuracy of predicting heartbeat response time, before step S403, it also includes: obtaining historical sample training data and historical sample test data; training an initial heartbeat time prediction model according to the historical sample training data; obtaining a predicted heartbeat response time based on the initial heartbeat time prediction model according to the historical sample test data; determining the time difference between the predicted heartbeat response time and the actual heartbeat response time; and iteratively optimizing the initial heartbeat time prediction model according to the time difference to obtain a target heartbeat time prediction model.

[0107] It can be understood that the historical sample training data refers to the data used to train the initial heartbeat time prediction model, and the historical sample test data refers to the data used to test the initial heartbeat time prediction model. The historical sample training data and the historical sample test data include the source node network bandwidth, the source node CPU core number, the destination node network bandwidth, the destination node CPU core number, the number of network hops, etc. For details, please refer to Table 2:

[0108] Table 2:

[0109]

[0110] It should be noted that in order to better represent the above historical sample training data, the source node network bandwidth, the source node CPU core number, the destination node network bandwidth, the destination node CPU core number, and the network hop number can be defined as independent variables, specifically referring to Table 3:

[0111] Table 3:

[0112] Serial number Variable Types Variable Name definition 1 Independent Variable Source node network bandwidth <![CDATA[snet l ]]> 2 Independent Variable Number of CPU cores of the source node <![CDATA[scpu l <!-- 8 -->]]> 3 Independent Variable Destination node network bandwidth <![CDATA[tnet l ]]> 4 Independent Variable Number of CPU cores in the destination node <![CDATA[tcpu l ]]> 5 Independent Variable Network hop count <![CDATA[nethop l ]]> 6 Dependent Variable Predicting heartbeat response time <![CDATA[vrestime l ]]>

[0113] Specifically, the set of independent variables can be expressed as: T l ={snet l ,scpu l ,tnet l ,tcpu l ,nethop l}. The initial heartbeat time prediction model trained at this time can be expressed as:

[0114] vrestime l =snet l *α+scpu l *β+tnet l *θ+tcpu l *μ+nethop l *η.

[0115] It can be understood that after determining the time difference between the predicted heartbeat response time and the actual heartbeat response time, in order to optimize the fitting result, the time difference needs to be minimized. The specific formula can be expressed as:

[0116]

[0117] Among them, restime represents the actual heartbeat response time, and vrestime represents the predicted heartbeat response time.

[0118] It should be noted that, from the above formula, only α, β, θ, μ, η are unknown quantities, which are the weights of the respective variables in the independent variable set. At this time, the gradient descent method is used to calculate the partial derivatives of α, β, θ, μ, η. First, a random initial value T0 = (α0, β0, θ0, μ0, η0) is set, where λ is the step size, which can be set to 0.001. At this time:

[0119]

[0120] After enough iterations, T k -T k-1 <σ, stop the iteration and calculate T kAs the final value, the iterative optimization of the initial heartbeat time prediction model can be completed to obtain the target heartbeat time prediction model. In addition, the above σ can be adjusted according to actual needs. The initial value of σ can be set to 0.001. The smaller the σ value, the more accurate it is, and the more iterations are required. On the contrary, the larger the σ value, the lower the accuracy, but the computing power requirement is low.

[0121] Step S404, calculating the time difference according to the current heartbeat response time, the system time of the target core node and the system time of the target associated node.

[0122] It should be understood that after the target heartbeat time prediction model is used to predict the current heartbeat response time, the system time of the target core node is obtained, and the system time of the target core node is used as a timestamp to calculate the time difference between the current heartbeat response time and the system time of the target associated node. The target associated node i is used as an example for explanation, specifically:

[0123] x=|relatetime i -timestamp-vrestime i |.

[0124] Among them, x represents the time difference, relatetime i Indicates the system time of the target associated node i, timestamp indicates the timestamp of the target core node, vrestime i Indicates the current heartbeat response time.

[0125] Step S405: determining the consensus passing rate of the target associated node according to the comparison result between the time difference and a preset threshold.

[0126] It is understandable that after obtaining the time difference, it is necessary to determine whether the time difference is less than the preset threshold. If not, it indicates that the consensus has not been passed, indicating that the timestamp data is at risk of being tampered with. If so, it indicates that the consensus has been passed. At this time, the consensus pass rate of the target associated node is calculated.

[0127] Step S406, generating a trusted timestamp according to the consensus rate.

[0128] It should be understood that after determining the consensus pass rate of the target associated node, it is necessary to determine whether the consensus pass rate exceeds half (50%). If so, the timestamp is deemed to be credible, that is, a credible timestamp is generated. On the one hand, decentralized consensus is used to solve the problem that centralized timestamp generation services are easily tampered with. On the other hand, the target heartbeat time prediction model is used to verify the timestamp accuracy of the target core node and improve the credibility of the timestamp.

[0129] In this embodiment, when it is detected that the target core node initiates a timestamp verification consensus request, the network bandwidth data and the number of CPU cores of the target core node are obtained; the network bandwidth data, the number of CPU cores and the number of network hops of the target associated node are obtained; the current heartbeat response time is predicted according to the network bandwidth data and the number of CPU cores of the target core node, the network bandwidth data, the number of CPU cores and the number of network hops of the key node through the target heartbeat time prediction model; the time difference is calculated according to the current heartbeat response time, the system time of the target core node and the system time of the target associated node; the consensus pass rate of the target associated node is determined according to the comparison result of the time difference and the preset threshold; a trusted timestamp is generated according to the consensus rate; in the above manner, the network bandwidth data and the number of CPU cores of the target core node, the network bandwidth data, the number of CPU cores and the number of network hops of the target associated node are substituted into the target heartbeat time prediction model to obtain the current heartbeat response time, and then it is determined whether the time difference is less than the preset threshold. If so, when the consensus pass rate of the target associated node exceeds half, it is proved that the generated timestamp is credible, thereby effectively improving the accuracy and credibility of generating a trusted timestamp.

[0130] This application also provides a trusted timestamp generation device, please refer to Figure 4 , the trusted timestamp generating device comprises:

[0131] The acquisition module 10 is used to acquire the time when each core node in the timestamp generation system responds to the timestamp request when receiving the timestamp request initiated by the client.

[0132] The core node determination module 20 is used to determine the target core node according to the time at which each core node responds to the timestamp request.

[0133] The associated node determination module 30 is used to determine the target associated node according to the degree of fit between nodes.

[0134] The generating module 40 is used to generate a trusted timestamp according to the consensus result of the target associated node when detecting that the target core node initiates a timestamp verification consensus request.

[0135] This embodiment obtains the time when each core node in the timestamp generation system responds to the timestamp request initiated by the client when receiving the timestamp request; determines the target core node according to the time when each core node responds to the timestamp request; determines the target associated node according to the fit between the nodes; and generates a trusted timestamp according to the consensus result of the target associated node when detecting that the target core node initiates a timestamp verification consensus request; through the above method, after determining each core node in the time generation system, the target core node is determined according to the time when each core node responds to the timestamp request, and when the timestamp verification consensus request is initiated by the target core node, only the target associated node participates in the consensus, which improves the timestamp consensus efficiency without losing accuracy, and prevents the timestamp from being tampered with through a decentralized consensus method, thereby effectively improving the efficiency, accuracy and credibility of generating timestamps.

[0136] The trusted timestamp generation device provided by the present application adopts the trusted timestamp generation method in the above embodiment, which can solve the technical problems of low efficiency, low accuracy and low credibility in generating trusted timestamps in the prior art. Compared with the prior art, the beneficial effects of the trusted timestamp generation device provided by the present application are the same as the beneficial effects of the trusted timestamp generation method provided by the above embodiment, and the other technical features in the trusted timestamp generation device are the same as the features disclosed in the above embodiment method, which will not be repeated here.

[0137] In one embodiment, the acquisition module 10 is also used to count the number of nodes in the timestamp generation system; calculate the average response time of each node to other nodes based on the number of nodes; obtain the number of times each node in the timestamp generation system participates in consensus and the number of correct consensuses; calculate the consensus accuracy of each node based on the number of times the consensus is participated in and the number of correct consensuses; determine the core nodes in the timestamp generation system based on the average response time of each node to other nodes and the consensus accuracy of each node.

[0138] In one embodiment, the acquisition module 10 is also used to calculate the average response time of each node to other nodes respectively to obtain the normalized value of the average response time of each node; calculate the consensus accuracy of each node respectively to obtain the normalized value of the consensus accuracy of each node; calculate the index score of each node based on the normalized value of the average response time of each node and the normalized value of the consensus accuracy of each node based on the node evaluation index scoring algorithm; determine each core node in the timestamp generation system according to the index score.

[0139] In one embodiment, the associated node determination module 30 is also used to obtain inter-node consensus data and inter-node response data; generate a fitting abstract matrix based on the inter-node consensus data and the inter-node response data; calculate the degree of fit between nodes based on the fitting abstract matrix based on a preset degree of fit algorithm; and determine the target associated node by polling the node based on the degree of fit between the nodes.

[0140] In one embodiment, the generation module 40 is also used to obtain the network bandwidth data and CPU core number of the target core node when it is detected that the target core node initiates a timestamp verification consensus request; obtain the network bandwidth data, CPU core number and network hop number of the target associated node; predict the current heartbeat response time according to the network bandwidth data and CPU core number of the target core node, the network bandwidth data, CPU core number and network hop number of the key node through the target heartbeat time prediction model; calculate the time difference according to the current heartbeat response time, the system time of the target core node and the system time of the target associated node; determine the consensus pass rate of the target associated node according to the comparison result of the time difference and the preset threshold; and generate a trusted timestamp according to the consensus rate.

[0141] In one embodiment, the generation module 40 is also used to obtain historical sample training data and historical sample test data; train an initial heartbeat time prediction model according to the historical sample training data; obtain a predicted heartbeat response time based on the initial heartbeat time prediction model according to the historical sample test data; determine the time difference between the predicted heartbeat response time and the actual heartbeat response time; iteratively optimize the initial heartbeat time prediction model according to the time difference to obtain a target heartbeat time prediction model.

[0142] The present application provides a trusted timestamp generation device, which includes: at least one processor; and a memory that is 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 so that the at least one processor can execute the trusted timestamp generation method in the above-mentioned embodiment 1.

[0143] Reference below Figure 5, which shows a schematic diagram of the structure of a trusted timestamp generation device suitable for implementing the embodiments of the present application. The trusted timestamp generation device in the embodiments of the present application may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 5 The trusted timestamp generation device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0144] like Figure 5 As shown, the trusted timestamp generation device may include a processing device 1001 (e.g., a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the trusted timestamp generation device are also stored. The processing device 1001, ROM1002, and RAM1004 are connected to each other via a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touchpad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the trusted timestamp generation device to communicate wirelessly or wired with other devices to exchange data. Although the figure shows a trusted timestamp generation device with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or provided instead.

[0145] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.

[0146] The trusted timestamp generation device provided by the present application adopts the trusted timestamp generation method in the above embodiment, which can solve the technical problems of low efficiency, low accuracy and low credibility in generating trusted timestamps in the prior art. Compared with the prior art, the beneficial effects of the trusted timestamp generation device provided by the present application are the same as the beneficial effects of the trusted timestamp generation method provided by the above embodiment, and the other technical features in the trusted timestamp generation device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.

[0147] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.

[0148] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

[0149] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, and the computer-readable program instructions are used to execute the trusted timestamp generation method in the above-mentioned embodiment.

[0150] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the above.

[0151] The computer-readable storage medium may be included in the trusted timestamp generation device; or may exist independently without being assembled into the trusted timestamp generation device.

[0152] Computer program code for performing the operations of the present application may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0153] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0154] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.

[0155] The readable storage medium provided by the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned trusted timestamp generation method, and can solve the technical problems of low efficiency, low accuracy, and low credibility in generating trusted timestamps in the prior art. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided by the present application are the same as the beneficial effects of the trusted timestamp generation method provided by the above-mentioned embodiment, and will not be repeated here.

[0156] The present application also provides a computer program product, including a computer program, which implements the steps of the above-mentioned trusted timestamp generation method when executed by a processor.

[0157] The computer program product provided by the present application can solve the technical problems of low efficiency, low accuracy and low credibility in generating trusted timestamps in the prior art. Compared with the prior art, the beneficial effects of the computer program product provided by the present application are the same as those of the trusted timestamp generation method provided by the above embodiment, which will not be elaborated here.

[0158] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.

Claims

1. A method for generating a trusted timestamp, characterized in that: The method comprises: Upon receiving a timestamp request initiated by a client, obtaining the time at which each core node in the timestamp generation system responds to the timestamp request; Determine the target core node according to the time at which each core node responds to the timestamp request; Determine the target associated node according to the degree of fit between the nodes; When it is detected that the target core node initiates a timestamp verification consensus request, a trusted timestamp is generated according to the consensus result of the target associated node.

2. The method according to claim 1, characterized in that Before the step of obtaining the time when each core node in the timestamp generation system responds to the timestamp request upon receiving the timestamp request initiated by the client, the method further includes: Count the number of nodes in the timestamp generation system; Calculate the average response time from each node to other nodes based on the number of nodes; Obtain the number of times each node in the timestamp generation system participated in the consensus and the number of times the consensus was correct; Calculate the consensus accuracy of each node based on the number of times the consensus was participated in and the number of times the consensus was correct; The core nodes in the timestamp generation system are determined according to the average response time of each node to other nodes and the consensus accuracy of each node.

3. The method according to claim 2, characterized in that The step of determining each core node in the timestamp generation system according to the average response time of each node to other nodes and the consensus accuracy of each node includes: Calculate the average response time from each node to other nodes respectively to obtain a normalized value of the average response time of each node; Calculating the consensus accuracy of each node respectively to obtain a normalized value of the consensus accuracy of each node; Calculating the index score of each node based on the node evaluation index scoring algorithm according to the normalized value of the average response time of each node and the normalized value of the consensus accuracy of each node; Each core node in the timestamp generation system is determined according to the index score.

4. The method according to claim 1, characterized in that The step of determining the target associated node according to the degree of fit between the nodes comprises: Obtain inter-node consensus data and inter-node response data; generating a fitting abstract matrix according to the inter-node consensus data and the inter-node response data; Calculating the degree of fit between nodes according to the fitting abstract matrix based on a preset degree of fit algorithm; The target associated node is determined by polling nodes according to the degree of fit between the nodes.

5. The method according to any one of claims 1 to 4, characterized in that The step of generating a trusted timestamp according to the consensus result of the associated node when detecting that the target core node initiates a timestamp verification consensus request includes: When detecting that the target core node initiates a timestamp verification consensus request, obtaining network bandwidth data and CPU core number of the target core node; Obtain network bandwidth data, number of CPU cores, and number of network hops of the target associated node; Predict the current heartbeat response time based on the network bandwidth data and CPU core number of the target core node, the network bandwidth data, CPU core number and network hop number of the key node through the target heartbeat time prediction model; Calculate the time difference according to the current heartbeat response time, the system time of the target core node and the system time of the target associated node; Determine the consensus passing rate of the target associated node according to the comparison result of the time difference and the preset threshold; A trusted timestamp is generated based on the consensus rate.

6. The method according to claim 5, characterized in that Before the step of predicting the current heartbeat time by the target heartbeat time prediction model according to the network bandwidth data and the number of CPU cores of the target core node, the network bandwidth data, the number of CPU cores and the number of network hops of the key node, the step further includes: Obtain historical sample training data and historical sample test data; Training an initial heartbeat time prediction model according to the historical sample training data; Obtaining a predicted heartbeat response time based on the initial heartbeat time prediction model according to the historical sample test data; Determining a time difference between the predicted heartbeat response time and the actual heartbeat response time; The initial heartbeat time prediction model is iteratively optimized according to the time difference to obtain a target heartbeat time prediction model.

7. A trusted timestamp generation device, characterized in that: The device comprises: An acquisition module, configured to, upon receiving a timestamp request initiated by a client, acquire the time at which each core node in the timestamp generation system responds to the timestamp request; A core node determination module, configured to determine a target core node according to the time at which each core node responds to the timestamp request; An associated node determination module is used to determine a target associated node according to the degree of fit between nodes; A generation module is used to generate a trusted timestamp according to the consensus result of the target associated node when detecting that the target core node initiates a timestamp verification consensus request.

8. A trusted timestamp generation device, characterized in that: The device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the trusted timestamp generation method according to any one of claims 1 to 6.

9. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the trusted timestamp generation method according to any one of claims 1 to 6 are implemented.

10. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the steps of the trusted timestamp generation method according to any one of claims 1 to 6 are implemented.

Citation Information

Patent Citations

  • A block chain electronic storage method based on deterministic consensus and trusted timestamp

    CN109508984A

  • Blockchain timestamp agreement

    CN111008402A

  • System for managing blockchain-based centralized ledger system

    CN111108526A

  • Timestamp marking method and device based on consensus block chain

    CN113810453A

  • Byzantine fault tolerant agreement on current time

    US20240250837A1