Trusted timestamp generation methods, apparatus, devices, storage media, and products

By identifying the target core and associated nodes in the timestamp generation system, and using node response time and fit degree to generate reliable timestamps, the problems of low efficiency, low accuracy and low reliability in the existing technology are solved, and efficient and reliable timestamp generation is achieved.

CN119449323BActive Publication Date: 2025-10-31中移信息技术有限公司 +1
View PDF 2 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

Existing technologies for generating timestamps are inefficient, inaccurate, and unreliable. Centralized generation relies on the credibility of authorized institutions and is easily tampered with, while blockchain consensus is inefficient.

Method used

By obtaining the response time of each core node in the generation system through timestamps, the target core node and related nodes are determined. Trusted timestamps are generated using the fit between nodes and consensus results. A decentralized consensus method is adopted, with only the target related nodes participating in the consensus.

Benefits of technology

Without sacrificing accuracy, improve the efficiency of timestamp consensus, prevent timestamps from being tampered with, and enhance the efficiency, accuracy, and reliability of timestamp generation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119449323B_ABST
    Figure CN119449323B_ABST
Patent Text Reader

Abstract

This application discloses a trusted timestamp generation method, apparatus, device, storage medium, and product, relating to the field of data processing technology. The method includes: obtaining the response times of each core node in the timestamp generation system to timestamp requests; determining target core nodes based on the response times of each core node; determining target associated nodes based on the fitting degree between nodes; and generating a trusted timestamp based on the consensus results of the target associated nodes when a timestamp verification consensus request is detected from a target core node. Through this method, after determining each core node in the timestamp generation system, a target core node is further determined. When the target core node initiates a timestamp verification consensus request, only the target associated nodes participate in the consensus. This improves timestamp consensus efficiency without sacrificing accuracy, and the decentralized consensus method prevents timestamp tampering, thereby effectively improving the efficiency, accuracy, and trustworthiness of timestamp generation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data processing technology, and in particular to methods, apparatus, devices, storage media and products for generating trusted timestamps. Background Technology

[0002] In the context of global informatization, the demand for digital authentication is increasing daily, placing higher demands on the authenticity, reliability, and integrity of electronic evidence. Timestamps perfectly meet these requirements and have become an important legal tool and technical safeguard, effectively protecting the legitimate rights and interests of all parties. Currently, there are two common methods for generating timestamps. The first is issuance by a third-party credible institution, where timestamps are generated centrally. The reliability of the timestamp depends entirely on the credibility of the credible institution; if the institution is attacked, the timestamp can easily be tampered with, resulting in low reliability. The second method is based on blockchain to generate reliable timestamps. This method cannot guarantee the accuracy of generated timestamps, and the low consensus efficiency of blockchain leads to low efficiency and accuracy in timestamp generation. Therefore, both methods result in low efficiency, low accuracy, and low reliability in timestamp generation.

[0003] The above content is only used to help understand the technical solution of this application and does not represent an admission that the above content is prior art. Summary of the Invention

[0004] The main objective of this application is to provide a reliable timestamp generation method, apparatus, device, storage medium, and product, aiming to solve the technical problems of low efficiency, low accuracy, and low reliability in the generation of timestamps in the prior art.

[0005] To achieve the above objectives, this application proposes a reliable timestamp generation method, the method comprising:

[0006] Upon receiving a timestamp request initiated by a client, the system obtains the times when each core node in the timestamp generation system responds to the timestamp request.

[0007] The target core node is determined based on the time when each core node responds to the timestamp request.

[0008] Determine the target associated nodes based on the fit between nodes;

[0009] When the target core node initiates a timestamp verification consensus request, a trusted timestamp is generated based on the consensus result of the target associated node.

[0010] In one embodiment, before the step of obtaining the response times of each core node in the timestamp generation system to the timestamp request when a timestamp request is received from a client, the method 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 participated in consensus and the number of times consensus was successful in the timestamp generation system;

[0014] The consensus accuracy of each node is calculated based on the number of times it participates in consensus and the number of times the consensus is correct.

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

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

[0017] The average response time from each node to other nodes is calculated to obtain the normalized value of the average response time of each node;

[0018] The consensus accuracy of each node is calculated separately to obtain the normalized value of the consensus accuracy of each node.

[0019] The node evaluation index scoring algorithm calculates the index score of each node based on the normalized value of the average response time and the normalized value of the consensus accuracy of each node.

[0020] The core nodes in the timestamp generation system are determined based on the index scores.

[0021] In one embodiment, the step of determining the target associated node based on the fit between nodes includes:

[0022] Obtain consensus data and response data between nodes;

[0023] A fitted abstract matrix is ​​generated based on the consensus data and response data between nodes;

[0024] The fitting degree between nodes is calculated based on the preset fitting degree algorithm according to the fitting abstract matrix;

[0025] The target associated node is determined by polling the nodes based on the fit between them.

[0026] In one embodiment, the step of generating a trusted timestamp based on the consensus result of the associated node when the target core node initiates a timestamp verification consensus request includes:

[0027] When the target core node initiates a timestamp verification consensus request, the network bandwidth data and CPU core count of the target core node are obtained.

[0028] Obtain network bandwidth data, CPU core count, and network hop count of the target associated node;

[0029] The target heartbeat time prediction model predicts the current heartbeat response time based on the network bandwidth data and CPU core count of the target core node, the network bandwidth data and CPU core count of the key node, and the number of network hops.

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

[0031] The consensus pass rate of the target associated node is determined based on the comparison result between 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 using the target heartbeat time prediction model based on the network bandwidth data and CPU core count of the target core node, the network bandwidth data, CPU core count of the key node, and the number of network hops, the method further includes:

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

[0035] The initial heart rate prediction model is trained based on the historical sample training data.

[0036] Based on the initial heartbeat time prediction model, the predicted heartbeat response time is obtained according to the historical sample test data;

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

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

[0039] Furthermore, to achieve the above objectives, this application also proposes a trusted timestamp generation apparatus, which includes:

[0040] The acquisition module is used to acquire the time when each core node in the timestamp generation system responds to the timestamp request when it receives a timestamp request initiated by the client.

[0041] The core node determination module is used to determine the target core node based on the time when each core node responds to the timestamp request.

[0042] The associated node determination module is used to determine the target associated nodes based on the fit between nodes.

[0043] The generation module is used to generate a trusted timestamp based on the consensus result of the target associated node when the target core node initiates a timestamp verification consensus request.

[0044] In addition, to achieve the above objectives, this application also proposes a trusted timestamp generation device, the device comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the trusted timestamp generation method as described above.

[0045] In addition, to achieve the above objectives, this application also proposes a storage medium, which is a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, it implements the steps of the trusted timestamp generation method described above.

[0046] In addition, to achieve the above objectives, this application also provides a computer program product, which includes a computer program that, when executed by a processor, implements the steps of the trusted timestamp generation method described above.

[0047] One or more technical solutions proposed in this application have at least the following technical effects: Upon receiving a timestamp request initiated by a client, the response time of each core node in the timestamp generation system to the timestamp request is obtained; a target core node is determined based on the response time of each core node to the timestamp request; a target associated node is determined based on the fitting degree between nodes; and a trusted timestamp is generated based on the consensus result of the target associated node when the target core node initiates a timestamp verification consensus request. Through the above method, after determining each core node in the timestamp generation system, the target core node is determined based on the response time of each core node to the timestamp request. Furthermore, when the target core node initiates a timestamp verification consensus request, only the target associated node participates in the consensus. This improves the efficiency of timestamp consensus without sacrificing accuracy, and the decentralized consensus method prevents timestamp tampering, thereby effectively improving the efficiency, accuracy, and trustworthiness of timestamp generation. Attached Figure Description

[0048] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0049] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0050] Figure 1 This is a flowchart illustrating an embodiment of the trusted timestamp generation method of this application.

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

[0052] Figure 3 This is a flowchart illustrating Embodiment 2 of the trusted timestamp generation method of this application.

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

[0054] Figure 5 This is a schematic diagram of the device structure of the hardware operating environment involved in the trusted timestamp generation method in the embodiments of this application.

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

[0056] It should be noted that the executing entity in this embodiment can be a computing service device with data processing, network communication, and program execution functions, such as a tablet computer, personal computer, or mobile phone, or an electronic device or trusted timestamp generation device capable of performing the above functions. The following description uses a trusted timestamp generation device as an example to illustrate this embodiment and the subsequent embodiments.

[0057] Based on this, embodiments of this application provide a method for generating a trusted timestamp, referring to... Figure 1 , Figure 1 This is a flowchart illustrating the first embodiment of the trusted timestamp generation method of this application.

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

[0059] Step S10: Upon receiving a timestamp request initiated by the client, obtain 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 by the client when there is a need to generate a trusted timestamp. For the core node selector, upon receiving a timestamp request from the client, it verifies the validity of the request. If the verification passes, the timestamp request is forwarded to each core node in the timestamp generation system; if the verification fails, the timestamp request is rejected. Furthermore, before generating a trusted timestamp, the time of all nodes in the timestamp generation system is synchronized to ensure the consistency of time across all nodes.

[0061] It should be noted that the reference Figure 2 , Figure 2 The diagram illustrates the overall architecture, which includes a client and a trusted timestamp generation device. 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 the validity of the timestamp request, it forwards the timestamp request to each core node in the timestamp generation system.

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

[0063] It should be understood that the core node in this implementation evaluation has two dimensions. The first dimension is that the core node should have high consensus accuracy in order to initiate a high consensus success rate. The second dimension is that when the core node initiates timestamp consensus, the consensus request should have the lowest response time to each node in order to achieve fast consensus efficiency. Therefore, it is necessary to calculate the average response time from each node to other nodes and the consensus accuracy of each node.

[0064] Specifically, the number of nodes in the 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, using the above formula, the average response time from each node to other nodes can be calculated. Specifically, this can be represented by a set of average response times, for example, t = {t1, t2, t3, ..., t}. n}

[0067] It should be understood that consensus accuracy represents the ratio of the number of correct consensus results to the number of times consensus was achieved. Consensus typically employs a majority-rule strategy. Taking node i as an example, the specific steps are as follows:

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

[0069] Among them, acc i The connum represents the accuracy of consensus. i sucnum represents the number of times a participant joins the consensus mechanism. i This indicates the number of correct consensus statements.

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

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

[0072] Understandably, after calculating the average response time from 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 has better attributes. Normalization is used to control the value range between (0-1) through transformation, preventing the element values ​​in the average response time set from being too large or too small, which would affect the calculation results and make the data more comparable. The specific formula for calculating the normalized value of the average response time of each node is as follows:

[0073]

[0074] Among them, nt iThe normalized value of the average response time of a node is represented by t, where max(t) represents the maximum average response time in the set of average response times, and min(t) represents the minimum average response time in the set of average response times.

[0075] It should be understood that after calculating the consensus accuracy of each node, it is also 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 considered a core node. Normalization makes it easier to compare consensus accuracy. The specific formula for calculating the normalized value of the consensus accuracy of each node is as follows:

[0076]

[0077] Among them, nacc i The normalized value of the consensus accuracy of a node is represented by max(t), which 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 is understandable that the node evaluation index score algorithm refers to the algorithm used to calculate the index score of each node. This node evaluation index score algorithm also assigns corresponding weights to each data point. For example, the weight assigned to the normalized value of the average response time of each node is α, and the weight assigned to 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. Taking node i as an example, the specific steps are as follows:

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

[0080] Among them, score i The index score represents the node's score, α represents the weight of the normalized value of the node's average response time, and nt represents the index score. i β represents the normalized value of the node's average response time, β represents the weight of the normalized value of the node's consensus accuracy, and nacc represents the average response time of the node. i The 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 descending or ascending order, and the top N nodes are selected as core nodes. The value of N can be flexibly set according to actual needs. For example, N=5. The core nodes initiate timestamp verification consensus requests, which can improve consensus accuracy and consensus efficiency.

[0082] Step S20: Determine the target core node based on the time when each core node responds to the timestamp request.

[0083] It should be understood that the target core node refers to the core node that responds to the core node selector first among the core nodes, 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 responds to the core node selector first is selected as the target core node.

[0084] Step S30: Determine the target associated node based on the fit between nodes.

[0085] Understandably, the target associated node refers to a node with a high degree of fit among the remaining nodes outside the core node. There can be multiple target associated nodes. Consensus is only participated in by the target associated nodes, which can effectively improve the efficiency of timestamp consensus without sacrificing accuracy.

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

[0087] It should be understood that the relationships between inter-node consensus data, inter-node response data, and the relationships between inter-node consensus data and inter-node response data are shown in Table 1, specifically as follows:

[0088] Table 1:

[0089]

[0090] It should be noted that after obtaining the consensus data and response data between nodes, the above abstraction can be used to generate an n*2n fitting abstraction matrix, where h = 2n. This fitting abstraction matrix can be specifically represented as:

[0091]

[0092] It should be understood that the preset fit algorithm refers to the algorithm used to calculate the fit between nodes. After generating the fitting abstract matrix, the preset fit algorithm is used to calculate the fit between nodes. Taking node i and node j as an example, the specific steps are as follows:

[0093]

[0094] Among them, fitrate ijThis represents the goodness of fit between nodes, where j and k are variables. For example, if j = 1 and k = 1, then it represents a. 11 .

[0095] It should be noted that after calculating the fit between nodes, each core node is polled in turn, and the node with the highest fit among the remaining nodes is selected as the associated node. A fit closer to 1 indicates a higher fit, and this process continues until all nodes have been selected. When a core node initiates a timestamp verification consensus request, the associated node replaces all other nodes, and only the associated node participates in the consensus. This improves consensus efficiency without sacrificing accuracy, solving the problems of high latency and low efficiency in traditional decentralized timestamp services, thereby enhancing the availability of the timestamp service.

[0096] Step S40: When the target core node initiates a timestamp verification consensus request, a trusted timestamp is generated based on the consensus result of the target associated node.

[0097] It is understandable that the consensus result refers to whether the consensus among multiple target-related nodes has been reached. When a target core node initiates a timestamp verification consensus request, it is determined whether the consensus has been reached. If so, a timestamp is generated and recognized as trustworthy.

[0098] This embodiment obtains the response times of each core node in the timestamp generation system to the timestamp request when a client initiates a timestamp request; determines the target core node based on the response times of each core node; determines the target associated node based on the fit between nodes; and generates a trusted timestamp based on the consensus result of the target associated node when the target core node initiates a timestamp verification consensus request. Through this method, after determining the core nodes in the timestamp generation system, the target core node is determined based on the response times of each core node to the timestamp request. When the target core node initiates a timestamp verification consensus request, only the target associated node participates in the consensus. This improves the efficiency of timestamp consensus without sacrificing accuracy, and the decentralized consensus method prevents timestamp tampering, thereby effectively improving the efficiency, accuracy, and trustworthiness of timestamp generation.

[0099] Based on the first embodiment of this application, in the second embodiment of this application, the content that is the same as or similar to that in the first embodiment described above can be referred to the above description, and will not be repeated hereafter. Based on this, please refer to... Figure 3 Step S40 includes steps S401 to S406:

[0100] Step S401: When the target core node initiates a timestamp verification consensus request, obtain the network bandwidth data and CPU core count of the target core node.

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

[0102] Step S402: Obtain the network bandwidth data, CPU core count, and network hop count of the target associated node.

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

[0104] Step S403: The target heartbeat time prediction model is used to predict the current heartbeat response time based on the network bandwidth data and CPU core count of the target core node, the network bandwidth data and CPU core count of the key node, and the number of network hops.

[0105] It should be understood that the target heartbeat time prediction model refers to a model that predicts 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 reliability of the timestamp. After obtaining the network bandwidth data and CPU core count of the target core node, the network bandwidth data, CPU core count of the key node, and the number of network hops, the model predicts and outputs the current heartbeat response time.

[0106] Furthermore, to effectively improve the accuracy of predicting heartbeat response time, before step S403, the method further includes: acquiring historical sample training data and historical sample test data; training an initial heartbeat time prediction model based on the historical sample training data; obtaining a predicted heartbeat response time based on the initial heartbeat time prediction model and 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 based on the time difference to obtain a target heartbeat time prediction model.

[0107] It is understood that historical sample training data refers to the data used to train the initial heartbeat time prediction model, while historical sample test data refers to the data used to test the initial heartbeat time prediction model. This historical sample training data and historical sample test data include source node network bandwidth, source node CPU cores, destination node network bandwidth, destination node CPU cores, network hop count, etc. See Table 2 for details.

[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, source node CPU cores, destination node network bandwidth, destination node CPU cores, and network hop count can be defined as independent variables, as shown in Table 3:

[0111] Table 3:

[0112] Serial Number Variable type Variable name definition 1 Independent variable Source node network bandwidth <![CDATA[snet l ]]> 2 Independent variable Source node CPU core count <![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 Predicted heartbeat response time <![CDATA[vrestime l ]]>

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

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

[0115] Understandably, after determining the time difference between the predicted heartbeat response time and the actual heartbeat response time, in order to achieve the optimal fitting result, this time difference needs to be minimized. The specific formula can be expressed as:

[0116]

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

[0118] It should be noted that, as shown in the above formula, only α, β, θ, μ, and η are unknowns, representing the weights of the independent variables in the set of independent variables. In this case, the gradient descent method is used to calculate the partial derivatives of α, β, θ, μ, and η respectively. First, an initial value T0 = (α0, β0, θ0, μ0, η0) is randomly set, where λ is the step size, which can be set to 0.001. Then:

[0119]

[0120] After a sufficient number of iterations, T is satisfied. k -T k-1 When σ < σ, stop the iteration and calculate T at this time. kOnce the final value is obtained, the initial heartbeat time prediction model can be iteratively optimized to obtain the target heartbeat time prediction model. Furthermore, the aforementioned σ can be adjusted according to actual needs. The initial value of σ can be set to 0.001. The smaller the σ value, the more accurate the prediction, but the more iterations are required. Conversely, the larger the σ value, the lower the accuracy, but the lower the computational power requirement.

[0121] Step S404: Calculate the time difference based on 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 predicting the current heartbeat response time using the target heartbeat time prediction model, the system time of the target core node is obtained, and this system time is used as a timestamp. The time difference is calculated by comparing this system time with the current heartbeat response time and the system time of the target associated nodes. Taking target associated node i as an example, the specific steps are as follows:

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

[0124] Where x represents the time difference, relatetime i The system time of the target associated node i is represented by `timestamp`, and `vrestime` represents the timestamp of the target core node. i This indicates the current heartbeat response time.

[0125] Step S405: Determine the consensus pass rate of the target associated node based on the comparison result between the time difference and the preset threshold.

[0126] Understandably, after obtaining the time difference, it is necessary to determine whether the time difference is less than a preset threshold. If not, it indicates that consensus has not been reached, indicating that the timestamp data is at risk of being tampered with. If yes, it indicates that consensus has been reached, and at this time, the consensus pass rate of the target associated nodes is calculated.

[0127] Step S406: Generate a trusted timestamp based on the consensus rate.

[0128] It should be understood that after determining the consensus pass rate of the target associated nodes, it is necessary to determine whether the consensus pass rate exceeds half (50%). If so, the timestamp is considered trustworthy, i.e., a trustworthy 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 accuracy of the timestamps of the target core nodes, thereby improving the trustworthiness of the timestamps.

[0129] This embodiment obtains the network bandwidth and CPU core count of the target core node when it detects that the target core node has initiated a timestamp verification consensus request; it also obtains the network bandwidth, CPU core count, and network hop count of the target associated node; it predicts the current heartbeat response time using a target heartbeat time prediction model based on the network bandwidth and CPU core count of the target core node, the network bandwidth and CPU core count of the key node, and the network hop count; it calculates the time difference based on the current heartbeat response time, the system time of the target core node, and the system time of the target associated node; it determines the consensus pass rate of the target associated node based on the comparison result of the time difference with a preset threshold; and it generates a reliable timestamp based on the consensus rate. By substituting the network bandwidth and CPU core count of the target core node, the network bandwidth and CPU core count of the target associated node, and the network hop count into the target heartbeat time prediction model, the current heartbeat response time is obtained. Then, it is determined whether the time difference is less than a preset threshold. If so, when the consensus pass rate of the target associated node exceeds half, the generated timestamp is considered reliable, thereby effectively improving the accuracy and reliability of generating reliable timestamps.

[0130] This application also provides a trusted timestamp generation device; please refer to [reference needed]. Figure 4 The trusted timestamp generation device includes:

[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 it receives a timestamp request initiated by the client.

[0132] The core node determination module 20 is used to determine the target core node based on the time when each core node responds to the timestamp request.

[0133] The associated node determination module 30 is used to determine the target associated node based on the fit between nodes.

[0134] The generation module 40 is used to generate a trusted timestamp based on the consensus result of the target associated node when the target core node initiates a timestamp verification consensus request.

[0135] This embodiment obtains the response times of each core node in the timestamp generation system to the timestamp request when a client initiates a timestamp request; determines the target core node based on the response times of each core node; determines the target associated node based on the fit between nodes; and generates a trusted timestamp based on the consensus result of the target associated node when the target core node initiates a timestamp verification consensus request. Through this method, after determining the core nodes in the timestamp generation system, the target core node is determined based on the response times of each core node to the timestamp request. When the target core node initiates a timestamp verification consensus request, only the target associated node participates in the consensus. This improves the efficiency of timestamp consensus without sacrificing accuracy, and the decentralized consensus method prevents timestamp tampering, thereby effectively improving the efficiency, accuracy, and trustworthiness of timestamp generation.

[0136] The trusted timestamp generation apparatus provided in this application, employing the trusted timestamp generation method in the above embodiments, can solve the technical problems of low efficiency, low accuracy, and low reliability in the prior art of generating trusted timestamps. Compared with the prior art, the beneficial effects of the trusted timestamp generation apparatus provided in this application are the same as those of the trusted timestamp generation method provided in the above embodiments, and other technical features in the trusted timestamp generation apparatus are the same as those disclosed in the methods of the above embodiments, and will not be repeated here.

[0137] In one embodiment, the acquisition module 10 is further configured to: 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; acquire the number of times each node participates in consensus and the number of times consensus is correct in the timestamp generation system; calculate the consensus accuracy of each node based on the number of times it participates in consensus and the number of times consensus is correct; and determine each core node in the timestamp generation system based on the average response time from each node to other nodes and the consensus accuracy of each node.

[0138] In one embodiment, the acquisition module 10 is further configured to calculate the average response time from each node to other nodes to obtain a normalized value of the average response time of each node; calculate the consensus accuracy of each node to obtain a 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 and the normalized value of the consensus accuracy of each node using a node evaluation index score algorithm; and determine each core node in the timestamp generation system based on the index score.

[0139] In one embodiment, the associated node determination module 30 is further configured to acquire consensus data and response data between nodes; generate a fitting abstract matrix based on the consensus data and response data between nodes; calculate the fitting degree between nodes based on the fitting abstract matrix using a preset fitting degree algorithm; and determine the target associated node by polling nodes based on the fitting degree between nodes.

[0140] In one embodiment, the generation module 40 is further configured to, upon detecting that the target core node initiates a timestamp verification consensus request, acquire the network bandwidth data and CPU core count of the target core node; acquire the network bandwidth data, CPU core count, and network hop count of the target associated node; predict the current heartbeat response time using a target heartbeat time prediction model based on the network bandwidth data and CPU core count of the target core node, the network bandwidth data, CPU core count, and network hop count of the key node; calculate the time difference based on 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 based on the comparison result of the time difference with a preset threshold; and generate a trusted timestamp based on the consensus rate.

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

[0142] This application provides a trusted timestamp generation device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the trusted timestamp generation method in the first embodiment described above.

[0143] The following is for reference. Figure 5The diagram illustrates a structural schematic of a trusted timestamp generation device suitable for implementing embodiments of this application. The trusted timestamp generation device in the embodiments of this application may include, but is not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Description), PMPs (Portable Media Players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 5 The trusted timestamp generation device shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of this application.

[0144] like Figure 5 As shown, the trusted timestamp generation device may include a processing unit 1001 (e.g., a central processing unit, a graphics processing unit, etc.) that can perform various appropriate actions and processes according to a program stored in read-only memory (ROM) 1002 or a program loaded from storage device 1003 into random access memory (RAM) 1004. The RAM 1004 also stores various programs and data required for the operation of the trusted timestamp generation device. The processing unit 1001, ROM 1002, and RAM 1004 are interconnected via a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Typically, the following systems can be connected to the I / O interface 1006: input devices 1007 including, for example, touchscreens, touchpads, keyboards, mice, image sensors, microphones, accelerometers, gyroscopes, etc.; output devices 1008 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 1003 including, for example, magnetic tapes, hard disks, etc.; and communication devices 1009. Communication device 1009 allows the trusted timestamp generation device to communicate wirelessly or wiredly with other devices to exchange data. While the figure shows trusted timestamp generation devices with various systems, it should be understood that implementation or possession of all the systems shown is not required. More or fewer systems may be implemented alternatively.

[0145] Specifically, according to the embodiments disclosed in this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments disclosed in this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device, or installed from storage device 1003, or installed from ROM 1002. When the computer program is executed by processing device 1001, it performs the functions defined in the methods of the embodiments disclosed in this application.

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

[0147] It should be understood that the various parts disclosed in this application can be implemented using 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 suitable manner in one or more embodiments or examples.

[0148] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

[0149] This application provides a computer-readable storage medium having computer-readable program instructions (i.e., a computer program) stored thereon, the computer-readable program instructions being used to execute the trusted timestamp generation method in the above embodiments.

[0150] The computer-readable storage medium provided in this application may be, for example, a USB flash drive, but is not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections having one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. 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 conjunction with an instruction execution system, system, or device. The program code contained on the computer-readable storage medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination thereof.

[0151] The aforementioned computer-readable storage medium may be included in a trusted timestamp generation device; or it may exist independently and not be assembled into a trusted timestamp generation device.

[0152] Computer program code for performing the operations of this application can be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, and C++, and conventional procedural programming languages ​​such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a Local Area Network (LAN) or a Wide Area Network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0153] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0154] The modules described in the embodiments of this application can be implemented in software or hardware. The names of the modules do not necessarily limit the functionality of the unit itself.

[0155] The readable storage medium provided in this application is a computer-readable storage medium that stores computer-readable program instructions (i.e., a computer program) for executing the above-described trusted timestamp generation method. This solves the technical problems of low efficiency, low accuracy, and low reliability in generating trusted timestamps in the prior art. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in this application are the same as those of the trusted timestamp generation method provided in the above embodiments, and will not be repeated here.

[0156] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the trusted timestamp generation method described above.

[0157] The computer program product provided in this application can solve the technical problems of low efficiency, low accuracy, and low reliability in generating reliable timestamps in the prior art. Compared with the prior art, the beneficial effects of the computer program product provided in this application are the same as those of the reliable timestamp generation method provided in the above embodiments, and will not be repeated here.

[0158] The above description is only a part of the embodiments of this application and does not limit the patent scope of this application. All equivalent structural transformations made under the technical concept of this application and using the contents of the specification and drawings of this application, or direct / indirect applications in other related technical fields, are included in the patent protection scope of this application.

Claims

1. A method for generating a reliable timestamp, characterized in that, The method includes: When a timestamp request is received from a client, the response time of each core node in the timestamp generation system to the timestamp request is obtained. Each core node in the timestamp generation system is determined based on the average response time from each node to other nodes and the consensus accuracy of each node. The target core node is determined based on the time when each core node responds to the timestamp request. The target associated node is determined based on the fit between nodes. The target associated node is determined based on the fit of the remaining nodes outside the core node. When the target core node initiates a timestamp verification consensus request, a trusted timestamp is generated based on the consensus result of the target associated node.

2. The method as described in claim 1, characterized in that, Before the step of obtaining the response times of each core node in the timestamp generation system to the timestamp request when receiving a 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 participated in consensus and the number of times consensus was successful in the timestamp generation system; The consensus accuracy of each node is calculated based on the number of times it participates in consensus and the number of times the consensus is correct.

3. The method as described in claim 2, characterized in that, The step of determining the timestamp generation system for each core node based on the average response time from each node to other nodes and the consensus accuracy of each node includes: The average response time from each node to other nodes is calculated to obtain the normalized value of the average response time of each node; The consensus accuracy of each node is calculated separately to obtain the normalized value of the consensus accuracy of each node. The node evaluation index scoring algorithm calculates the index score of each node based on the normalized value of the average response time and the normalized value of the consensus accuracy of each node. The core nodes in the timestamp generation system are determined based on the index scores.

4. The method as described in claim 1, characterized in that, The step of determining the target associated node based on the fit between nodes includes: Obtain consensus data and response data between nodes; A fitted abstract matrix is ​​generated based on the consensus data and response data between nodes; The fitting degree between nodes is calculated based on the preset fitting degree algorithm according to the fitting abstract matrix; The target associated node is determined by polling the nodes based on the fit between them.

5. The method according to any one of claims 1 to 4, characterized in that, The step of generating a trusted timestamp based on the consensus result of the associated node when the target core node initiates a timestamp verification consensus request includes: When the target core node initiates a timestamp verification consensus request, the network bandwidth data and CPU core count of the target core node are obtained. Obtain network bandwidth data, CPU core count, and network hop count of the target associated node; The target heartbeat time prediction model predicts the current heartbeat response time based on the network bandwidth data and CPU core count of the target core node, the network bandwidth data, CPU core count, and network hop count of the target associated node. Calculate the time difference based on 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 based on the comparison result between the time difference and the preset threshold. A trusted timestamp is generated based on the consensus pass rate.

6. The method as described in claim 5, characterized in that, Before the step of predicting the current heartbeat response time using the target heartbeat time prediction model based on the network bandwidth data and CPU core count of the target core node, the network bandwidth data and CPU core count of the target associated node, and the network hop count, the method further includes: Obtain historical sample training data and historical sample test data; The initial heart rate prediction model is trained based on the historical sample training data. Based on the initial heartbeat time prediction model, the predicted heartbeat response time is obtained according to the historical sample test data; Determine the time difference between the predicted heartbeat response time and the actual heartbeat response time; The initial heartbeat time prediction model is iteratively optimized based on the time difference to obtain the target heartbeat time prediction model.

7. A trusted timestamp generation device, characterized in that, The device includes: The acquisition module is used to acquire the response time of each core node in the timestamp generation system to the timestamp request when a timestamp request is received from the client. Each core node in the timestamp generation system is determined based on the average response time from each node to other nodes and the consensus accuracy of each node. The core node determination module is used to determine the target core node based on the time when each core node responds to the timestamp request. The associated node determination module is used to determine the target associated node based on the fit between nodes. The target associated node is determined based on the fit of the remaining nodes other than the core node. The generation module is used to generate a trusted timestamp based on the consensus result of the target associated node when the target core node initiates a timestamp verification consensus request.

8. A trusted timestamp generation device, characterized in that, The device includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the trusted timestamp generation method as described in 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, it implements the steps of the trusted timestamp generation method as described in any one of claims 1 to 6.

10. A computer program product, characterized in that, The computer program product includes a computer program that, when executed by a processor, implements the steps of the trusted timestamp generation method as described in any one of claims 1 to 6.

Citation Information

Patent Citations

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

    CN109508984A

  • Blockchain timestamp agreement

    CN111008402A