A method for secure traceability of oral medical data integrating photoelectric acquisition and blockchain technology
By using unified timestamp sorting and blockchain technology, the problem of linking imaging data and equipment parameters in oral medical data has been solved, enabling efficient data verification and abnormal behavior identification, and improving the credibility and accuracy of the data.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- TINJIN GUANGDIAN HUADIAN TECH CO LTD
- Filing Date
- 2026-04-15
- Publication Date
- 2026-06-02
AI Technical Summary
In existing technologies, the imaging data, equipment operating parameters, and disinfection records of oral medical data lack a unified time benchmark, making it difficult to establish accurate correlations between data, affecting the accuracy and reliability of the diagnosis and treatment process. Furthermore, cross-system verification is costly, there is a lack of independent consistency verification mechanisms between nodes, and the data record granularity is coarse and difficult to finely divide, which limits the ability to identify abnormal behavior.
By acquiring grayscale data of image frames output by the photoelectric sensor of the oral endoscope, current and rotation speed values of dental treatment equipment, and disinfection timestamps, the timestamps are uniformly sorted and time intervals are divided to generate a photoelectric time series for diagnosis and treatment. Binary encoding and bit operations are performed, and signature generation and comparison are combined with blockchain technology to achieve independent verification by multiple nodes.
It achieves accurate alignment and unified representation of multi-source data, enhances the correlation between diagnostic and treatment behaviors and equipment status and environmental processes, improves data credibility and reduces invalid storage, and improves the ability to identify abnormal behaviors and data credibility.
Smart Images

Figure CN122135871A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of distributed storage technology, and in particular to a method for secure traceability of oral medical data that integrates photoelectric acquisition and blockchain technology. Background Technology
[0002] Distributed storage technology involves a technical system for decentralized recording and consistency maintenance of data based on multi-node networks. Its core aspects include data acquisition, data encryption, inter-node data synchronization, distributed ledger recording, and data traceability management. It involves collecting structured and unstructured data through terminal devices, encoding the data using encryption algorithms, and broadcasting the data to multiple storage nodes via a peer-to-peer network. Each node verifies and records the data according to consensus rules, thus forming a data storage structure that cannot be centrally tampered with. This is used in methodological applications such as medical data management, electronic medical records, and medical process traceability. Traditional methods... The oral medical data security traceability method refers to the management of data such as imaging data, treatment records, and consumable information generated during oral diagnosis and treatment. This is achieved through local server storage, relational database recording, and timestamp-based log files. Data storage and traceability are completed by manually entering treatment information, marking electronic medical records with digital signatures, and backing up and controlling access through a central server. At the same time, in the oral disinfection process, the disinfection time parameters are recorded by manually operating ultraviolet lamp irradiation, chemical disinfectant spraying, and simple electronic control devices based on timers. This allows for the recording and management of oral diagnosis and treatment data and the disinfection process.
[0003] Existing technologies rely on manual input of medical information and data recorded by independent equipment. The lack of a unified time reference among image data, equipment operating parameters, and disinfection records makes it difficult to establish precise correlations between data. In actual treatment, fluctuations in equipment rotation speed and changes in images within the same time period cannot be analyzed in a corresponding manner, affecting the accuracy of process reconstruction. The use of a central server and log file management method results in coarse-grained data recording and a lack of segmented structure, making it difficult to perform fine-grained segmentation and statistics on continuous treatment behaviors, thus limiting the ability to identify abnormal behaviors. For example, short-term abnormal equipment fluctuations may be masked by the overall record. Data is mostly stored in its raw form and lacks a unified encoding, making efficient comparison between different nodes difficult and resulting in high cross-system verification costs. Furthermore, reliance on central control for backup and access control lacks an independent consistency verification mechanism between nodes. Once the central data deviates or is tampered with, other nodes cannot detect the differences in a timely manner. Disinfection process records are mostly based on simple timing devices and are not integrated with medical data, causing a disconnect between environmental safety information and operational behavior, affecting the integrity and credibility of medical process traceability. Summary of the Invention
[0004] To achieve the above objectives, the present invention adopts the following technical solution: a method for secure traceability of oral medical data that integrates photoelectric acquisition and blockchain technology, comprising the following steps. S1: Acquire grayscale data of image frames output by photoelectric sensor of oral endoscope, current value and rotation speed value recorded by control unit of dental treatment equipment, and disinfection timestamp recorded by disinfection monitoring terminal of treatment room. Extract UNIX timestamp and sort it. Match image frame grayscale data, current value and rotation speed value according to timestamp. Calculate the duration of disinfection time and write it to the corresponding time position to generate photoelectric time series of treatment. S2: Set time intervals and divide timestamp intervals according to the photoelectric time series of diagnosis and treatment, classify the records corresponding to the timestamps into the timestamp intervals, sort the grayscale data of image frames in the timestamp intervals, rearrange the current values and rotation speed values, aggregate the duration of disinfection, and generate a set of time windows for diagnosis and treatment data. S3: Traverse the set of time windows of the diagnosis and treatment data, calculate the average gray value of the image frame, calculate the average current and average rotation speed, summarize the duration of disinfection, splice the average gray value, average current, average rotation speed and duration to form a data sequence, perform binary encoding and bit operation and convert to hexadecimal string, and generate diagnosis and treatment segment signature sequence. S4: Send the diagnosis and treatment segment signature sequence to the blockchain distributed storage node, perform signature generation processing based on local oral endoscope photoelectric sensor data and timestamp to form a local signature sequence, compare the received sequence with the local sequence according to the segment index, mark the inconsistent positions and count the number of consistent and inconsistent results, and generate node signature consistency comparison results. S5: Based on the node signature consistency comparison results, count the number of consistent segments and calculate the consistency ratio. Compare the consistency ratio with the consistency threshold. If the condition is met, write the diagnosis and treatment segment signature sequence to the blockchain medical data storage ledger and record the segment index. If the condition is not met, extract the inconsistent segment index and stop writing, and generate a diagnosis and treatment data on-chain storage status identifier.
[0005] As a further aspect of the present invention, the diagnostic photoelectric time series includes a grayscale time axis, a current time trajectory, a rotation speed time trajectory, and a disinfection persistence marker; the diagnostic data time window set includes a time interval label, a window segment index, a window grayscale sequence, a window device parameter group, and a window disinfection aggregation value; the diagnostic segment signature sequence includes a grayscale feature code, a current feature code, a rotation speed feature code, a duration feature code, and a hexadecimal signature unit; the node signature consistency comparison result includes a consistent segment count, an inconsistent segment count, a difference position marker set, and a node comparison identifier; the on-chain evidence storage status identifier includes a consistency ratio value, a threshold judgment flag, a write status code, an inconsistent index set, and a ledger record identifier.
[0006] As a further aspect of the present invention, the image frame grayscale data within the sorting interval includes a stable sorting according to the UNIX timestamp from smallest to largest, and the rearranged current value and rotation speed value are adjusted synchronously based on the order of the UNIX timestamps corresponding to the image frame grayscale data.
[0007] As a further aspect of the present invention, the execution of binary encoding and bit operations includes performing fixed-length binary quantization encoding on the average grayscale value, average current value, average rotation speed value and duration, concatenating them according to a preset bit width, and performing bitwise XOR and cyclic left shift operations in a fixed order.
[0008] As a further aspect of the present invention, the specific steps of S1 are as follows: S101: Acquire grayscale data of image frames output by the photoelectric sensor of the oral endoscope, current and rotation speed values recorded by the control unit of the dental treatment equipment, and disinfection timestamps recorded by the disinfection monitoring terminal of the treatment room. Extract second-level UNIX timestamps from the image frame sequence number, current record item, rotation speed record item, and disinfection record item respectively, and rearrange the record positions in ascending order of timestamps to obtain a multi-source time index sequence. S102: Based on the multi-source time index sequence, the grayscale data of the image frame is used as the reference sequence to retrieve the current value and rotation speed value at the same second position. If there is a time gap between adjacent records, the insertion position is located according to the time difference before and after and the sequence alignment is completed to generate the corresponding grayscale machine control sequence. S103: Based on the grayscale machine control corresponding sequence, extract the start and end positions of the cancellation timestamp and calculate the duration. Write the duration into the corresponding time position and arrange it in the same time axis order as the image frame grayscale data, current value, and rotation speed value to obtain the diagnostic photoelectric time series.
[0009] As a further aspect of the present invention, the specific steps of S2 are as follows: S201: Based on the diagnostic photoelectric time series, set equal interval time division parameters and perform interval mapping processing on the UNIX timestamp sequence. Compare the values of adjacent timestamps with the time division parameters, mark records that meet the same interval range conditions as the same index number, and perform index classification and reorganization on all records to obtain the data distribution structure corresponding to the interval and generate a time interval index sequence. S202: Based on the time interval index sequence, perform image frame image frame grayscale data extraction and sequential rearrangement operations on the record set corresponding to the index, perform serialization arrangement of grayscale data according to the timestamp increment rule, and simultaneously call the current value and rotation speed value data in the same index, perform synchronous sorting processing on the time tag, construct a multi-parameter unified sequence structure, and obtain a multi-parameter time-series rearrangement matrix. S203: Based on the multi-parameter time-series rearrangement matrix, extract the time tag corresponding to the cancellation process and perform interval accumulation operation on the duration. Aggregate and sum the duration values within the same index, and combine them with the corresponding grayscale sequence and parameter sequence for unified encapsulation to obtain a set of diagnosis and treatment data time windows.
[0010] As a further aspect of the present invention, the specific steps of S3 are as follows: S301: Based on the set of time windows for diagnosis and treatment data, extract grayscale data of image frames in segments and calculate the grayscale mean. At the same time, perform mean calculation on the current value sequence and rotation speed value sequence within the same segment to form multi-parameter values corresponding to the segment. Integrate the mean values according to a unified structure to generate a segmented multi-parameter mean vector. S302: Based on the segmented multi-parameter mean vector, extract the cancellation duration data and perform interval summary processing according to the segmented index. Then, concatenate the duration result with the grayscale mean, current mean, and rotation speed mean in a predetermined order to obtain a multi-field concatenation sequence. S303: Based on the multi-field concatenation sequence, perform binary encoding processing on the fields in the sequence, and rearrange and convert the encoding result according to the bit operation rules. Map the processed encoding sequence into a hexadecimal string form to form a unified identifier structure and obtain the diagnosis and treatment segment signature sequence.
[0011] As a further aspect of the present invention, the specific steps of S4 are as follows: S401: Based on the diagnosis and treatment segmented signature sequence, send it to the blockchain distributed storage node and perform segmented index identification parsing on the sequence received by the node. Combine the data of the intraoral endoscope photoelectric sensor and the timestamp record stored locally on the node to perform the same signature generation process, map the original data to the corresponding segmented signature structure, and establish the corresponding relationship according to the index to obtain the node local signature sequence. S402: Based on the node's local signature sequence, call the corresponding segment signature data in the received sequence, compare the position character content in the two sequences item by item according to the segment index, mark and record the consistent positions, perform difference identification classification on the inconsistent positions, and perform sequential integration processing on all marking results to obtain the segment difference mark set; S403: Based on the segmented difference marker set, count the number of consistent and inconsistent markers within the segment, and perform summary processing according to the segment index. Combine the segmented statistical results into comparison data with a unified structure to form a node-level signature consistency description structure, and obtain the node signature consistency comparison result.
[0012] As a further aspect of the present invention, the specific steps of S5 are as follows: S501: Based on the node signature consistency comparison result, perform quantity statistics on segment consistency marks and calculate the consistency ratio, perform proportional conversion processing on the number of consistency marks and the total number of segments to form the corresponding segment consistency value, and uniformly organize all segment consistency ratios to generate a segment consistency ratio sequence. S502: Based on the segmented consistency ratio sequence, call the preset consistency threshold and perform item-by-item comparison operation, determine the size of the segmented consistency ratio and the consistency threshold, mark the segments that meet the conditions, extract the index positions of the segments that do not meet the conditions and classify and aggregate them to form a write judgment structure, and obtain the segmented write judgment set. S503: Based on the segmented write judgment set, call the diagnosis and treatment segment signature sequence and perform on-chain write operation for segments that meet the conditions, and record the corresponding segment index at the same time. For segments that do not meet the conditions, perform index extraction and terminate the write process. Integrate the status identifiers of all segmented processing results to obtain the on-chain evidence storage status identifier of the diagnosis and treatment data.
[0013] As a further aspect of the present invention, the set time interval includes a fixed-length time interval based on the UNIX timestamp, the fixed-length time interval being between 1 second and 5 seconds, and the timestamp interval being divided in a continuous and non-overlapping manner.
[0014] Compared with the prior art, the advantages and positive effects of the present invention are as follows: In this invention, by synchronously acquiring image grayscale, current rotation speed, and disinfection time and sorting them with unified timestamps, multi-source data are precisely aligned, establishing a correlation between diagnostic and treatment behaviors and equipment status and environmental processes. By combining interval division and window reorganization, the continuity and stability of time are enhanced. Through mean fusion and encoding, redundancy is compressed and unified expression is achieved. By using multiple nodes to independently generate signatures and comparing the consistency ratio segment by segment, combined with threshold control of writing behavior, the credibility of data is improved and invalid storage is reduced. Attached Figure Description
[0015] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0016] Figure 1 This is a schematic diagram of the steps of the present invention; Figure 2 This is a detailed schematic diagram of S1 of the present invention; Figure 3 This is a detailed schematic diagram of S2 of the present invention; Figure 4This is a detailed schematic diagram of S3 of the present invention; Figure 5 This is a detailed schematic diagram of S4 of the present invention; Figure 6 This is a detailed schematic diagram of S5 of the present invention. Detailed Implementation
[0017] The technical solution of the present invention will now be described with reference to the accompanying drawings.
[0018] The data processing procedure of this invention can be deployed on a general-purpose processor or AI chip platform to improve processing efficiency and real-time performance, but does not affect the technical process and data consistency verification mechanism of this invention.
[0019] To make the technical problems, technical solutions and advantages of the present invention clearer, a detailed description will be given below in conjunction with the accompanying drawings and specific embodiments.
[0020] Please see Figure 1 This invention provides a method for secure traceability of oral medical data that integrates photoelectric acquisition and blockchain technology, comprising the following steps: S1: Acquire grayscale data of image frames output by the photoelectric sensor of the oral endoscope, current and rotation values recorded by the control unit of the dental treatment equipment, and disinfection timestamps recorded by the disinfection monitoring terminal of the treatment room. Extract UNIX timestamps from the data and sort them. Match the grayscale data of the image frames with the current and rotation values according to the timestamps. Convert the disinfection time into a duration and write it to the corresponding time position to obtain the photoelectric time series of the treatment. S2: Set time intervals according to the photoelectric time series of diagnosis and treatment and divide the timestamps into intervals. Group the records in the same interval into the same segment, sort the grayscale data of the image frames in the segment in order, rearrange the current value and rotation speed value in time order, and perform interval aggregation on the disinfection duration to obtain the set of time windows for diagnosis and treatment data. S3: Based on the time window set of diagnosis and treatment data, extract grayscale data of image frames segment by segment and calculate the grayscale mean. Calculate the mean values of current and rotation speed within the same segment. Perform interval summarization on the disinfection duration. Concatenate the grayscale mean, current mean, rotation speed mean, and duration in sequence to form a data sequence. Perform binary encoding and bitwise operations on the data sequence and convert it into a hexadecimal string to obtain the diagnosis and treatment segment signature sequence. S4: Based on the diagnosis and treatment segment signature sequence, it is sent to the blockchain distributed storage node. The node performs the same signature generation process based on the locally synchronized oral endoscope photoelectric sensor data and timestamp record to obtain the local signature sequence. The received sequence and the local sequence are compared item by item according to the segment index. Inconsistent positions are marked and the consistent and inconsistent quantities are summarized to obtain the node signature consistency comparison result. S5: Based on the node signature consistency comparison results, count the number of consistent segments and calculate the consistency ratio. Compare the consistency ratio with the consistency threshold. When the consistency ratio meets the writing conditions, write the diagnosis and treatment segment signature sequence to the blockchain medical data storage ledger node and record the segment index. When the consistency ratio does not meet the writing conditions, extract the inconsistent segment index and stop the writing operation to obtain the on-chain storage status identifier of the diagnosis and treatment data.
[0021] The diagnostic and treatment photoelectric time series includes a grayscale time axis, current time trajectory, rotation speed time trajectory, and disinfection persistence markers; the diagnostic and treatment data time window set includes time interval labels, window segment indexes, window grayscale sequences, window device parameter groups, and window disinfection aggregate values; the diagnostic and treatment segment signature sequence includes grayscale feature codes, current feature codes, rotation speed feature codes, duration feature codes, and hexadecimal signature units; the node signature consistency comparison results include consistent segment counts, inconsistent segment counts, difference location marker sets, and node comparison identifiers; the on-chain evidence storage status identifiers for the diagnostic and treatment data include consistency ratio values, threshold judgment flags, write status codes, inconsistent index sets, and ledger record identifiers.
[0022] Please see Figure 2 The specific steps of S1 are as follows: S101: Acquire grayscale data of image frames output by the photoelectric sensor of the oral endoscope, current and rotation speed values recorded by the control unit of the dental treatment equipment, and disinfection timestamps recorded by the disinfection monitoring terminal of the treatment room. Extract second-level UNIX timestamps from the image frame sequence number, current record item, rotation speed record item, and disinfection record item respectively, and rearrange the record positions in ascending order of timestamps to obtain a multi-source time index sequence. During the diagnosis and treatment process, the photoelectric sensor of the oral endoscope outputs grayscale data of image frames at a frequency of 25 frames per second. The raw data is stored in the form of an array, and the grayscale data range of each image frame is 0 to 255. In the example, the average grayscale values collected from the 100th to the 102nd second are 132, 128, and 135, respectively. The dental treatment equipment control unit records the current value at 0.5-second intervals through the built-in current acquisition chip. In the example, the current values for the corresponding time periods are 1.2 amps, 1.4 amps, and 1.3 amps, respectively. The rotation speed value is acquired by the encoder and recorded once per second. In the example, it is 30,000 rpm, 30,500 rpm, and 30,200 rpm. The disinfection monitoring terminal records the disinfection timestamp, with the start time at the 100th second and the end time at the 110th second. Timestamp extraction is performed on each of the above data types. The image frame sequence number is converted into the corresponding acquisition time. For example, frame 2500 corresponds to second 100. The acquisition time is multiplied by 1000 to convert it into a millisecond-level timestamp, and then uniformly converted into a second-level UNIX timestamp. Current and speed records are directly read from the device's internal time register and converted into UNIX timestamps. The disinfection record is read from the log file's time field and formatted uniformly. The extracted timestamps are sorted in ascending order. Data that is out of order in the original sequence is reordered according to its time value. For example, if the original current record times are 102 seconds, 100 seconds, and 101 seconds, they are reordered to 100 seconds, 101 seconds, and 102 seconds, and the corresponding data positions are adjusted synchronously. This forms a multi-source time index sequence containing grayscale time series, current time series, speed time series, and disinfection time series, providing a unified time reference for subsequent alignment.
[0023] S102: Based on the multi-source time index sequence, the grayscale data of the image frame is used as the reference sequence to retrieve the current value and rotation speed value at the same second position. If there is a time gap between adjacent records, the insertion position is located according to the time difference before and after and the sequence is aligned to generate the corresponding grayscale machine control sequence. Using the grayscale data of the image frames as a baseline sequence, a timeline is established in seconds, for example, 100 seconds, 101 seconds, and 102 seconds. For each time point, the current value at the same time position is retrieved in the current recording sequence. If a perfect match exists, it is read directly; for example, the current value at 101 seconds is 1.4 amps. When a time gap is detected, for example, if the grayscale sequence has 103 seconds but the current recording only has 102 seconds and 104 seconds, the time difference between the two is calculated to be 1 second and 1 second respectively. The current value at that time point is determined by linear interpolation to be the average of the two values, i.e., 1.3 amps and 1.5 amps are averaged to get 1.4 amps. The same processing procedure is performed on the rotation speed value. If it is missing, it is inserted according to the ratio of the difference between the two values. In the example, 102 seconds is 30200 revolutions per minute, 104 seconds is 30600 revolutions per minute, so 103 seconds is interpolated to 30400 revolutions per minute. After completing the imputation of all missing time points, the grayscale data, current values, and rotation speed values of the image frames are paired item by item according to the same time index. For example, time 100 seconds corresponds to grayscale 132, current 1.2, and rotation speed 30000, while time 101 seconds corresponds to grayscale 128, current 1.4, and rotation speed 30500. This yields a grayscale machine-controlled corresponding sequence, in which each time point has three types of synchronized data.
[0024] S103: Based on the corresponding sequence of grayscale machine control, extract the start and end positions of the cancellation timestamp and convert the duration. Write the duration into the corresponding time position and arrange it in the same time axis order as the grayscale data of the image frame, current value and rotation speed value to obtain the photoelectric time series of diagnosis and treatment. The system reads the start and end timestamps of the erasure process, for example, starting at 100 seconds and ending at 110 seconds. The duration is calculated by subtracting the start time from the end time, resulting in a duration of 10 seconds. This duration is then allocated to each second within the corresponding time interval. For instance, each time point between 100 and 110 seconds is marked with a duration of 10 seconds, while non-erasure intervals are marked as 0 seconds. The duration is then written to the corresponding time position, forming a four-dimensional data structure together with the image frame grayscale data, current value, and rotation speed value. For example, at the 100-second position, a combination of 132, 1.2, 30000, and 10 is formed; at the 111-second position, a combination of 130, 1.1, 29800, and 0 is formed. All time points are sorted using a uniform timeline to ensure continuous and complete time sequence. This creates a diagnostic phototherapy time series, indexed primarily by time, with each time point containing four data items: grayscale, current, rotation speed, and erasure duration.
[0025] Please see Figure 3 The specific steps of S2 are as follows: S201: Based on the photoelectric time series of diagnosis and treatment, set equal interval time division parameters and perform interval mapping processing on the UNIX timestamp sequence. Compare the values of adjacent timestamps with the time division parameters, mark the records that meet the same interval range conditions as the same index number, and perform index classification and reorganization on all records to obtain the data distribution structure corresponding to the interval and generate the time interval index sequence. In this example, the time division parameter is set to 5 seconds. The time axis is divided into intervals, such as 100 to 104 seconds (interval 1), 105 to 109 seconds (interval 2), and so on. Interval mapping is performed on the UNIX timestamp sequence, assigning each time point to its corresponding interval based on its time value. By comparing the difference between adjacent timestamps with the time division parameter, for example, if the difference between 101 seconds and 102 seconds is 1 second (less than 5 seconds), they are assigned to the same interval (interval 1). If the difference between 104 seconds and 105 seconds is 1 second but they cross the interval boundary, then 105 seconds is assigned to interval 2. After numbering all records, they are categorized and reorganized, aggregating data with the same number. For example, interval 1 contains all records from 100 to 104 seconds. This results in the data distribution structure corresponding to the intervals, forming a time interval index sequence.
[0026] S202: Based on the time interval index sequence, perform image frame grayscale data extraction and sequential rearrangement operations on the record set corresponding to the index, perform serialization and arrangement of grayscale data according to the timestamp increment rule, and simultaneously call the current value and speed value data in the same index, perform synchronous sorting processing on the time tag, construct a multi-parameter unified sequence structure, and obtain a multi-parameter time-series rearrangement matrix. For each interval, extract the grayscale data of the image frames. For example, in interval 1, the grayscale data of the image frames are 132, 128, 135, 130, and 129. Arrange them in ascending order of timestamps to form an ordered sequence. Simultaneously, extract the corresponding current value sequence 1.2, 1.4, 1.3, 1.2, and 1.1, and the rotational speed value sequence 30000, 30500, 30200, 30100, and 29900. Perform synchronous sorting on the timestamps to ensure a one-to-one correspondence between the three types of parameters and the grayscale data of the image frames. Combine the grayscale sequence, current sequence, and rotational speed sequence into a unified multi-parameter sequence structure. For example, interval 1 forms a multi-parameter sequence matrix of length 5. Perform the same operation on all intervals to obtain a multi-parameter time-series rearrangement matrix, which uses intervals as row indices and time series as column structures.
[0027] S203: Based on the multi-parameter time series rearrangement matrix, extract the time label corresponding to the cancellation process and perform interval accumulation operation on the duration. Aggregate and sum the duration values within the same index, and combine them with the corresponding grayscale sequence and parameter sequence for unified encapsulation to obtain the set of diagnosis and treatment data time windows. For example, if the entire period from 100 to 104 seconds in interval 1 falls within the disinfection time, then the duration of each time point is 10 seconds. The durations within this interval are summed to obtain a total duration of 50 seconds. If interval 2 only contains the period from 105 to 109 seconds, with 105 to 110 seconds being the disinfection interval, then the duration within interval 2 is 5 time points, each lasting 10 seconds, for a total of 50 seconds. After aggregating and summing the durations within the same index, they are encapsulated with the corresponding grayscale sequence and parameter sequence. For example, interval 1 is encapsulated as a grayscale sequence 132 to 129, a current sequence 1.2 to 1.1, a rotational speed sequence 30000 to 29900, and a duration of 50 seconds. This forms a set of diagnostic and treatment data time windows. In this step, the time interval division, index mapping, and multi-parameter sequence rearrangement processes can be accelerated by AI chips to achieve efficient data window construction, but the interval division rules and data classification methods remain unchanged.
[0028] Please see Figure 4 The specific steps of S3 are as follows: S301: Based on the time window set of diagnosis and treatment data, extract grayscale data of image frames in segments and calculate the grayscale mean. At the same time, perform mean calculation on the current value sequence and speed value sequence within the same segment to form multi-parameter values corresponding to the segment. Integrate the mean values according to a unified structure to generate segmented multi-parameter mean vector. The diagnostic data time window set is read segment by segment according to the interval index. For example, interval 1 corresponds to a time range of 100 seconds to 104 seconds. From this interval, the image frame grayscale data sequence 132, 128, 135, 130, and 129 are extracted. The sequence is accumulated item by item to obtain a total of 654. Then, based on the number of data points in the interval (5), the average grayscale value is calculated to obtain an average grayscale value of 130.8. Within the same segment, the current value sequence 1.2 amperes and 1.4 amperes are read. The current values are 1.3 amperes, 1.2 amperes, and 1.1 amperes. By summing these values, the total current value is 6.2 amperes. Dividing this by the number of data points (5) gives the average current value of 1.24 amperes. The same process is performed on the speed values of 30,000 rpm, 30,500 rpm, 30,200 rpm, 30,100 rpm, and 29,900 rpm. The sum of these values is 150,700 rpm. Dividing this by 5 gives the average speed value of 30,140 rpm. The average grayscale value, average current value, and average rotational speed value are integrated in a preset order to form a multi-parameter numerical vector. For example, the vector corresponding to interval 1 is 130.8, 1.24, and 30140. In interval 2, if the grayscale sequence is 131, 129, 134, 132, and 130, then the average value is 131.2, the average current value is 1.26 amperes, and the average rotational speed value is 30220 revolutions per minute, forming the corresponding vectors 131.2, 1.26, and 30220. The above process is repeated for all intervals to obtain a set of segmented multi-parameter mean vectors.
[0029] S302: Based on the segmented multi-parameter mean vector, extract the cancellation duration data and perform interval summary processing according to the segmented index. Then, concatenate the duration result with the grayscale mean, current mean, and speed mean in a predetermined order to obtain a multi-field concatenation sequence. Based on the segmented multi-parameter mean vector, the disinfection duration data for the corresponding intervals is read. For example, the cumulative duration of interval 1 is 50 seconds, and the cumulative duration of interval 2 is 50 seconds. The duration is concatenated with the grayscale mean, current mean, and rotation speed mean of the corresponding interval in a fixed field order. The concatenation result for interval 1 is 130.8, 1.24, 30140, 50, and the concatenation result for interval 2 is 131.2, 1.26, 30220, 45. To ensure data structure consistency, interval validation is performed on the duration data. When the duration is less than 30 seconds, it is marked as a short period; when the duration is more than 60 seconds, it is marked as a long period. In the example, intervals 1 and 2 are both within the range of 30 to 60 seconds, and are marked as intermediate intervals. The concatenated data is arranged in interval index order to form a multi-field concatenation sequence. For example, the sequence is the concatenation result of interval 1 to interval n, and the field order is kept consistent. If there are missing intervals, the missing values are filled by the mean of the preceding and following intervals. For example, when interval 3 is missing, the mean of grayscale values of intervals 2 and 4 is used to obtain the supplementary value. The complete multi-field concatenated sequence is obtained.
[0030] S303: Based on the multi-field concatenation sequence, perform binary encoding processing on the fields in the sequence, and rearrange and convert the encoding result according to the bit operation rules. Map the processed encoding sequence into a hexadecimal string form to form a unified identifier structure and obtain the diagnosis and treatment segment signature sequence. First, the average grayscale value is multiplied by 10 to convert it to an integer, for example, 130.8 becomes 1308. The average current value is multiplied by 100 to convert it to an integer, for example, 1.24 becomes 124. The rotation speed value is kept in integer form, and the duration is directly represented as an integer in seconds. Then, each integer is converted into a fixed-length binary sequence. The grayscale data of the image frame is represented by 12 bits, the current value by 8 bits, the rotation speed value by 16 bits, and the duration by 7 bits. The corresponding binary data of each field are concatenated in order to form a complete encoding sequence. The concatenated binary sequence is then rearranged according to the field interleaving method. For example, the first bit of grayscale, the first bit of current, the first bit of rotation speed, and the first bit of duration are arranged in sequence, then the second bit is arranged, and so on until all bits are rearranged. The rearranged binary sequence is divided into groups of 4 bits each, and each group is converted into a corresponding hexadecimal character. For example, the encoding result of interval 1 is A3F4C2. The same encoding process is performed on all intervals to obtain the diagnosis and treatment segment signature sequence.
[0031] Please see Figure 5 The specific steps of S4 are as follows: S401: Based on the diagnosis and treatment segmented signature sequence, send it to the blockchain distributed storage node and perform segmented index identification parsing on the sequence received by the node. Combine the data of the intraoral endoscope photoelectric sensor and the timestamp record stored locally on the node to perform the same signature generation process, map the original data to the corresponding segmented signature structure, and establish the corresponding relationship according to the index to obtain the node local signature sequence. The segmented signature sequence of the diagnosis and treatment is sent to the blockchain distributed storage node via an encrypted communication interface. During the transmission process, a corresponding segment index number and time identifier are appended to each segment signature. For example, interval 1 corresponds to index 1, and the time identifier is from 100 seconds to 104 seconds, forming a complete transmission data packet. After receiving the data packet, the node parses the index number and signature string, temporarily stores the signature in index order in the cache, and reads the original grayscale data, current data, rotation speed data, and disinfection time record for the corresponding time period from local storage. Perform the same interval division operation as the previous steps on the local raw data. For example, divide the period from 100 seconds to 104 seconds into interval 1. Extract the image frame grayscale data set 131, 129, 134, 130, and 128 from this interval, sum them to obtain 652, and divide by the number of data points (5) to obtain the grayscale mean of 130.4. Perform the same processing on the current value set 1.21 amps, 1.25 amps, 1.28 amps, 1.22 amps, and 1.20 amps to obtain the mean of 1.23 amps. Calculate the average of the rotation speed value set 30050 rpm, 30300 rpm, 30200 rpm, 30150 rpm, and 30000 rpm to obtain 30140 rpm. The disinfection duration is read as 50 seconds. After performing quantization processing on the above data, perform binary encoding and bit rearrangement operations to generate a local signature string, for example, A3F4D2 for interval 1. Perform the same processing on all intervals and establish a one-to-one correspondence with the index to form a node local signature sequence.
[0032] S402: Based on the node's local signature sequence, call the corresponding segment signature data in the received sequence, compare the position character content in the two sequences item by item according to the segment index, mark and record the consistent positions, perform difference identification classification on the inconsistent positions, and perform sequential integration processing on all marking results to obtain the segment difference mark set; The signature data in the received sequence is compared item by item according to the segment index. For example, if the received signature for interval 1 is A3F4C2 and the local signature is A3F4D2, the two signature strings are read character by character. The first character A is compared with A and recorded as a match; the second character 3 is compared with 3 and recorded as a match; the third character F is compared with F and recorded as a match; the fourth character 4 is compared with 4 and recorded as a match; the fifth character C is compared with D and recorded as a mismatch; and the sixth character 2 is compared with 2 and recorded as a match. The comparison result of each character is converted into a tag value, for example, a match is marked as 1 and a mismatch as 0. Therefore, the tag sequence for interval 1 is 1, 1, 1, 1, 0, 1. If the signatures for interval 2 are completely identical, the tag sequence 1, 1, 1, 1, 1, 1 is generated. The character-by-character comparison operation is performed on all intervals, and the tag sequences of each interval are integrated according to the index order to form a segmented difference tag set. Each interval in this set corresponds to a set of binary tag data.
[0033] S403: Based on the segment difference tag set, count the number of consistent and inconsistent tags within the segment, and perform summary processing according to the segment index. Combine the segment statistical results into comparison data with a unified structure to form a node-level signature consistency description structure, and obtain the node signature consistency comparison result. For each interval, perform a count operation on the number of consistent and inconsistent flags. For example, if the flag sequence for interval 1 is 1, 1, 1, 1, 0, 1, then the number of flags with a value of 1 is 5, and the number of flags with a value of 0 is 1. Record the count as 5 consistent flags and 1 inconsistent flag. For interval 2, the flag sequence is 1, 1, 1, 1, 1, then the count is 6 consistent flags and 0 inconsistent flags. After performing the same statistical processing on all intervals, summarize the statistical results of each interval in index order to form a data set with a unified structure. For example, interval 1 is 5 and 1, interval 2 is 6 and 0, and interval 3 is 5 and 1. Further organize the statistical results into a node-level signature consistency description structure, where each interval contains the number of consistent flags, the number of inconsistent flags, and the total number of characters, to obtain the node signature consistency comparison result.
[0034] Please see Figure 6 The specific steps of S5 are as follows: S501: Based on the node signature consistency comparison results, perform quantity statistics on segment consistency marks and calculate the consistency ratio. Perform proportional conversion between the number of consistency marks and the total number of segments to form the corresponding segment consistency value. Then, uniformly organize all segment consistency ratios to generate a segment consistency ratio sequence. Based on the node signature consistency comparison results, a consistency ratio calculation is performed for each interval. For example, interval 1 has a consistency count of 5 and a total character count of 6, resulting in a consistency ratio of 0.83. Interval 2 has a consistency count of 6 and a total character count of 6, with a consistency ratio of 1.00. Interval 3 also has a consistency count of 5 and a total character count of 6, with a consistency ratio of 0.83. The consistency ratios of all intervals are then organized into a segmented consistency ratio sequence in index order, for example, 0.83, 1.00, 0.83. The consistency ratio results are then used to determine intervals: intervals with a consistency ratio below 0.80 are marked as low consistency intervals, intervals between 0.80 and 0.95 are marked as medium consistency intervals, and intervals above 0.95 are marked as high consistency intervals. In this example, intervals 1 and 3 are medium consistency intervals, and interval 2 is a high consistency interval. Finally, the consistency ratios and corresponding labels of all intervals are organized into a unified sequence structure.
[0035] S502: Based on the segmented consistency ratio sequence, call the preset consistency threshold and perform item-by-item comparison operation, determine the size of the segmented consistency ratio and the consistency threshold, mark the segments that meet the conditions, extract the index positions of the segments that do not meet the conditions and classify and aggregate them to form a write judgment structure, and obtain the segmented write judgment set. The threshold was set to 0.90, a value obtained through statistical analysis of 15 sets of historical data. The average false positive rate was 12% when the threshold was 0.85, 6% when it was 0.90, and 9% when it was 0.95. Therefore, 0.90 was selected as the optimal threshold. The consistency ratio of interval 1 (0.83) was compared with the threshold of 0.90 and determined to be unsatisfactory. The consistency ratio of interval 2 (1.00) was compared with the threshold and determined to be satisfactory. The consistency ratio of interval 3 (0.83) was determined to be unsatisfactory. Interval indices that met the conditions were recorded as candidate indices (e.g., index 2), and interval indices that did not meet the conditions were recorded as blocking indices (e.g., indices 1 and 3). These two types of indices were then categorized and aggregated to form a segmented decision set.
[0036] S503: Based on the segmented write judgment set, call the diagnosis and treatment segment signature sequence and perform on-chain write operation for segments that meet the conditions, and record the corresponding segment index at the same time. For segments that do not meet the conditions, perform index extraction and terminate the write process. Integrate the status identifiers of all segmented processing results to obtain the on-chain evidence storage status identifier of diagnosis and treatment data. Based on the segmented write judgment set, on-chain write control operations are executed. For intervals that meet the conditions, the corresponding diagnosis and treatment segment signature sequence is invoked to perform blockchain writing. For example, the signature of interval 2, B1D3E5, is submitted to the distributed ledger through the blockchain interface and a transaction record is generated. At the same time, the interval index 2 is associated with the transaction number. For intervals that do not meet the conditions, such as intervals 1 and 3, only the index is extracted and marked as not written, and no on-chain storage operation is performed. The processing status of all intervals is uniformly integrated to generate a data structure containing interval index, write status, and corresponding signature information. For example, interval 1 is not written, interval 2 is written, and interval 3 is not written, forming an on-chain evidence storage status identifier for diagnosis and treatment data. The consistency ratio calculation and threshold determination process can be accelerated by AI chip to perform calculations and batch processing, thereby improving the efficiency of on-chain write decisions, without changing the consistency determination criteria and write rules.
[0037] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A method for secure traceability of oral medical data integrating photoelectric acquisition and blockchain technology, characterized in that: Includes the following steps: S1: Acquire grayscale data of image frames output by photoelectric sensor of oral endoscope, current value and rotation speed value recorded by control unit of dental treatment equipment, and disinfection timestamp recorded by disinfection monitoring terminal of treatment room. Extract UNIX timestamp and sort it. Match image frame grayscale data, current value and rotation speed value according to timestamp. Calculate the duration of disinfection time and write it to the corresponding time position to generate photoelectric time series of treatment. S2: Set time intervals and divide timestamp intervals according to the photoelectric time series of diagnosis and treatment, classify the records corresponding to the timestamps into the timestamp intervals, sort the grayscale data of image frames in the timestamp intervals, rearrange the current values and rotation speed values, aggregate the duration of disinfection, and generate a set of time windows for diagnosis and treatment data. S3: Traverse the set of time windows of the diagnosis and treatment data, calculate the average gray value of the image frame, calculate the average current and average rotation speed, summarize the duration of disinfection, splice the average gray value, average current, average rotation speed and duration to form a data sequence, perform binary encoding and bit operation and convert to hexadecimal string, and generate diagnosis and treatment segment signature sequence. S4: Send the diagnosis and treatment segment signature sequence to the blockchain distributed storage node, perform signature generation processing based on local oral endoscope photoelectric sensor data and timestamp to form a local signature sequence, compare the received sequence with the local sequence according to the segment index, mark the inconsistent positions and count the number of consistent and inconsistent results, and generate node signature consistency comparison results. S5: Based on the node signature consistency comparison results, count the number of consistent segments and calculate the consistency ratio. Compare the consistency ratio with the consistency threshold. If the condition is met, write the diagnosis and treatment segment signature sequence to the blockchain medical data storage ledger and record the segment index. If the condition is not met, extract the inconsistent segment index and stop writing, and generate a diagnosis and treatment data on-chain storage status identifier.
2. The method for secure traceability of oral medical data integrating photoelectric acquisition and blockchain technology according to claim 1, characterized in that: The diagnostic photoelectric time series includes a grayscale time axis, current time trajectory, rotation speed time trajectory, and disinfection persistence marker; the diagnostic data time window set includes time interval labels, window segment index, window grayscale sequence, window device parameter group, and window disinfection aggregate value; the diagnostic segment signature sequence includes grayscale feature code, current feature code, rotation speed feature code, duration feature code, and hexadecimal signature unit; the node signature consistency comparison result includes consistent segment count, inconsistent segment count, difference position marker set, and node comparison identifier; the on-chain evidence storage status identifier includes consistency ratio value, threshold judgment flag, write status code, inconsistent index set, and ledger record identifier.
3. The method for secure traceability of oral medical data integrating photoelectric acquisition and blockchain technology according to claim 1, characterized in that: The image frame grayscale data within the sorting interval includes a stable sorting according to the UNIX timestamp from smallest to largest, and the rearranged current value and rotation speed value are adjusted synchronously based on the order of the UNIX timestamps corresponding to the image frame grayscale data.
4. The method for secure traceability of oral medical data integrating photoelectric acquisition and blockchain technology according to claim 1, characterized in that: The execution of binary encoding and bit operations includes performing fixed-length binary quantization encoding on the average grayscale value, average current value, average rotation speed value and duration, concatenating them according to a preset bit width, and performing bitwise XOR and cyclic left shift operations in a fixed order.
5. The method for secure traceability of oral medical data integrating photoelectric acquisition and blockchain technology according to claim 1, characterized in that, The specific steps of S1 are as follows: S101: Acquire grayscale data of image frames output by the photoelectric sensor of the oral endoscope, current and rotation speed values recorded by the control unit of the dental treatment equipment, and disinfection timestamps recorded by the disinfection monitoring terminal of the treatment room. Extract second-level UNIX timestamps from the image frame sequence number, current record item, rotation speed record item, and disinfection record item respectively, and rearrange the record positions in ascending order of timestamps to obtain a multi-source time index sequence. S102: Based on the multi-source time index sequence, the grayscale data of the image frame is used as the reference sequence to retrieve the current value and rotation speed value at the same second position. If there is a time gap between adjacent records, the insertion position is located according to the time difference before and after and the sequence alignment is completed to generate the corresponding grayscale machine control sequence. S103: Based on the grayscale machine control corresponding sequence, extract the start and end positions of the cancellation timestamp and calculate the duration. Write the duration into the corresponding time position and arrange it in the same time axis order as the image frame grayscale data, current value, and rotation speed value to obtain the diagnostic photoelectric time series.
6. The method for secure traceability of oral medical data integrating photoelectric acquisition and blockchain technology according to claim 1, characterized in that, The specific steps of S2 are as follows: S201: Based on the diagnostic photoelectric time series, set equal interval time division parameters and perform interval mapping processing on the UNIX timestamp sequence. Compare the values of adjacent timestamps with the time division parameters, mark records that meet the same interval range conditions as the same index number, and perform index classification and reorganization on all records to obtain the data distribution structure corresponding to the interval and generate a time interval index sequence. S202: Based on the time interval index sequence, perform image frame grayscale data extraction and sequential rearrangement operations on the record set corresponding to the index, perform serialization and arrangement of image frame grayscale data according to the timestamp increment rule, and simultaneously call the current value and rotation speed value data in the same index, perform synchronous sorting processing on the time tag, construct a multi-parameter unified sequence structure, and obtain a multi-parameter time-series rearrangement matrix. S203: Based on the multi-parameter time-series rearrangement matrix, extract the time tag corresponding to the cancellation process and perform interval accumulation operation on the duration. Aggregate and sum the duration values within the same index, and combine them with the corresponding grayscale sequence and parameter sequence for unified encapsulation to obtain a set of diagnosis and treatment data time windows.
7. The method for secure traceability of oral medical data integrating photoelectric acquisition and blockchain technology according to claim 1, characterized in that, The specific steps for S3 are as follows: S301: Based on the set of time windows for diagnosis and treatment data, extract grayscale data of image frames in segments and calculate the grayscale mean. At the same time, perform mean calculation on the current value sequence and rotation speed value sequence within the same segment to form multi-parameter values corresponding to the segment. Integrate the mean values according to a unified structure to generate a segmented multi-parameter mean vector. S302: Based on the segmented multi-parameter mean vector, extract the cancellation duration data and perform interval summary processing according to the segmented index. Then, concatenate the duration result with the grayscale mean, current mean, and rotation speed mean in a predetermined order to obtain a multi-field concatenation sequence. S303: Based on the multi-field concatenation sequence, perform binary encoding processing on the fields in the sequence, and rearrange and convert the encoding result according to the bit operation rules. Map the processed encoding sequence into a hexadecimal string form to form a unified identifier structure and obtain the diagnosis and treatment segment signature sequence.
8. The method for secure traceability of oral medical data integrating photoelectric acquisition and blockchain technology according to claim 1, characterized in that, The specific steps of S4 are as follows: S401: Based on the diagnosis and treatment segmented signature sequence, send it to the blockchain distributed storage node and perform segmented index identification parsing on the sequence received by the node. Combine the data of the intraoral endoscope photoelectric sensor and the timestamp record stored locally on the node to perform the same signature generation process, map the original data to the corresponding segmented signature structure, and establish the corresponding relationship according to the index to obtain the node local signature sequence. S402: Based on the node's local signature sequence, call the corresponding segment signature data in the received sequence, compare the position character content in the two sequences item by item according to the segment index, mark and record the consistent positions, perform difference identification classification on the inconsistent positions, and perform sequential integration processing on all marking results to obtain the segment difference mark set; S403: Based on the segmented difference marker set, count the number of consistent and inconsistent markers within the segment, and perform summary processing according to the segment index. Combine the segmented statistical results into comparison data with a unified structure to form a node-level signature consistency description structure, and obtain the node signature consistency comparison result.
9. The method for secure traceability of oral medical data integrating photoelectric acquisition and blockchain technology according to claim 1, characterized in that, The specific steps of S5 are as follows: S501: Based on the node signature consistency comparison result, perform quantity statistics on segment consistency marks and calculate the consistency ratio, perform proportional conversion processing on the number of consistency marks and the total number of segments to form the corresponding segment consistency value, and uniformly organize all segment consistency ratios to generate a segment consistency ratio sequence. S502: Based on the segmented consistency ratio sequence, call the preset consistency threshold and perform item-by-item comparison operation, determine the size of the segmented consistency ratio and the consistency threshold, mark the segments that meet the conditions, extract the index positions of the segments that do not meet the conditions and classify and aggregate them to form a write judgment structure, and obtain the segmented write judgment set. S503: Based on the segmented write judgment set, call the diagnosis and treatment segment signature sequence and perform on-chain write operation for segments that meet the conditions, and record the corresponding segment index at the same time. For segments that do not meet the conditions, perform index extraction and terminate the write process. Integrate the status identifiers of all segmented processing results to obtain the on-chain evidence storage status identifier of the diagnosis and treatment data.
10. The method for secure traceability of oral medical data integrating photoelectric acquisition and blockchain technology according to claim 1, characterized in that: The set time interval includes a fixed-length time interval based on the UNIX timestamp, the fixed-length time interval ranging from 1 second to 5 seconds, and the timestamp interval is divided in a continuous and non-overlapping manner.