A blockchain-based medical waste traceability and safety management method
By using a blockchain-based approach to trace and securely manage medical waste, the problems of information silos and data tampering have been solved, achieving automation and security in medical waste management and improving management transparency and efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- GUIZHOU XINGQIAN INFORMATION TECH CO LTD
- Filing Date
- 2026-02-26
- Publication Date
- 2026-06-02
AI Technical Summary
Existing methods for tracing and safely managing medical waste suffer from problems such as information silos, data tampering, data entry errors, inconsistent information, and low management efficiency, making it difficult to achieve information security and effective supervision throughout the entire process.
A blockchain-based approach to medical waste traceability and safety management is adopted. Through label numbering and a chain structure, data is automatically transmitted, and information such as temperature, air pressure, and residence time is collected in real time. The data is then encrypted and stored using blockchain technology to ensure that the data is tamper-proof.
It enables automatic data transmission during the medical waste management process, avoids manual entry errors, ensures real-time data updates and management security, and improves management transparency and efficiency.
Smart Images

Figure CN122135904A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of medical information management technology, and in particular to a blockchain-based method for the traceability and safe management of medical waste. Background Technology
[0002] The field of medical information management technology involves the collection, processing, storage, and management of information generated during medical activities. Its core aspects include electronic medical record management, clinical data collection, diagnosis and treatment information recording, data sharing, privacy protection, and medical quality supervision. Improving the efficiency and safety of medical services through information technology, especially in medical waste management, places higher demands on the authenticity and traceability of data and the secure supervision of processes.
[0003] Traditional methods of medical waste traceability and safety management involve collecting and transmitting information through manual records, barcodes, and paper certificates during the generation, classification, temporary storage, transfer, and disposal of waste. This includes registering data such as source, type, weight, handover time, and personnel. Data at each stage is typically entered or transmitted manually by operators; the transfer process relies on on-site signatures or simple electronic tags; and the disposal stage is archived in a separate system. This approach suffers from problems such as information silos, inconsistent traceability paths, and susceptibility to data tampering, making it difficult to achieve comprehensive information security and effective supervision.
[0004] Current technologies rely on manual recording and barcode labeling, which carries risks of data entry errors and inconsistencies. Manually entered information is susceptible to operational oversights and cannot provide real-time updates or status tracking, leading to management delays. Information transmission depends on signature confirmation and paper vouchers, failing to ensure timely and accurate monitoring of waste status. Once data is entered, it is difficult to modify, and changes in the status of key stages such as transportation and disposal cannot be reported in real time, affecting the transparency and security of waste management. Due to severe information silos, data sharing and cross-stage flow are hindered, resulting in low management efficiency and potential regulatory loopholes and implementation deviations. Summary of the Invention
[0005] To address the technical problems existing in the prior art, this invention provides a blockchain-based method for the traceability and secure management of medical waste. The technical solution is as follows: A blockchain-based method for the traceability and secure management of medical waste includes the following steps: S1: Obtain the fields of source department, generation time, waste type, initial state and node number from the medical waste generation node, and pass them into the main structure area of the tag according to the field order. Process the displacement information in the reserved area at the end of the field, and set the field offset and tag number as the chain path input to obtain the tag structure positioning information set. S2: Based on the tag number in the tag structure location information set, extract the temperature reading items, dwell time, air pressure change and node number of the transportation and temporary storage nodes, pair the fields with the numbers, add the sensing fields as label inputs in the upload link, and obtain the tag sensing record association list. S3: Read the temperature field, dwell time and location number from the tag perception record association list, write the time change content into the tag extension area, process the temperature and dwell time fields as text, and write them into the fields according to the time label order to obtain the tag structure field extension fragment group; S4: Extract the continuously changing text from the extended fragment group of the tag structure field, replace the original status field with the monitoring status, add a text field to describe the source content, and insert the status text in the structure segment with the tag number to obtain the tag status jump tracking chain. S5: Using the tag status jump tracking chain, the status text, field description and time content are used as input items. The tag number is used as input items. The status and field description are written into the blockchain structure segment. The time text is processed into the chain. The tag chain segment is processed with the status field as the identifier value to obtain the medical waste status management method structure.
[0006] As a further embodiment of the present invention, the tag structure positioning information set specifically includes tag number, transmission source department, generation time, waste category, initial state, node number, field offset, and tag path; the tag sensing record association list specifically includes tag number, temperature reading item, dwell time period, air pressure change description, node number, and additional sensing fields; the tag structure field extension fragment group specifically includes temperature change description, dwell time description, time annotation order, adjacent time data, and data within the tag extension area; the tag status jump tracking chain specifically includes monitoring status, status text, field description, status change time, tag number, and status update content; and the medical waste status management method structure specifically includes status text, field description, time record, tag number, and blockchain structure segment content.
[0007] As a further aspect of the present invention, the step of obtaining the tag structure positioning information set is as follows: S101: Obtain the field information used to transmit the source department, generation time, waste category, initial status and node number in the medical waste generation node. According to the order of the fields in the original structure, the fields are sequentially transmitted to the tag main structure area. The corresponding content of the field order is obtained by comparing the corresponding position of the field order with the field index number. S102: Based on the corresponding content of the fields, locate the reserved area at the end of the fields in the main structure area of the label, extract the displacement content of each field in this area, and concatenate the field number and displacement content in sequence to form a chain path content to obtain the node chain path information; S103: Based on the node chain path information, call the corresponding tag number in the path and associate it with the node item of the tag structure area, sequentially search the path position within the structure, extract the structure area number and position content corresponding to the field, and obtain the tag structure positioning content.
[0008] As a further aspect of the present invention, the step of obtaining the tag-aware record association list is as follows: S201: Based on the tag number contained in the tag structure location content, extract the corresponding temperature reading item, dwell time content, air pressure change description and node number in the transportation and temporary storage nodes, match the tag number with the above content one by one, and complete the number embedding in the corresponding position to obtain the node tag corresponding list. S202: Based on the list of node labels, extract the pairing of label number with temperature reading item, dwell time content, and air pressure change description in each item, arrange the sensing content under the same number in the reading order, and add field identifier number before each item to obtain the label sensing field arrangement sequence; S203: Arrange the sequence using the label perception fields, mark the positions of the perception fields in the upload link content in order, and complete the synchronous comparison process between the identifier number added before each field and the label number to obtain the label perception record association list.
[0009] As a further aspect of the present invention, the step of obtaining the extended fragment group of the tag structure field is as follows: S301: Read the sensing data in the tag sensing record association list, extract the temperature change field, dwell time segment and its location number, compare the time segments corresponding to consecutive numbers in pairs, filter out the temperature difference content corresponding to consecutive time, and obtain the continuous change field sequence. S302: Based on the continuous change field sequence, the temperature change content and dwell time segment in each field are processed into text, and the temperature descriptive words and time period descriptions that appear more frequently in each group of changes are extracted and concatenated into the tag expansion area in the original order of the fields to obtain the field description embedded fragment. S303: Call the field description embedded fragment, and based on the position number corresponding to the time mark in each item, find the corresponding sequential position in the tag extension area, write the processed text description content into the corresponding paragraph in order, and obtain the tag structure field extension fragment group.
[0010] As a further aspect of the present invention, the step of obtaining the tag state transition tracking chain is as follows: S401: Extract the set of fields transmitted from the extended fragment group of the tag structure field, filter out the field fragments in which the text content in adjacent positions changes continuously, sort them according to the position number order, and include the filtered fragments into the replacement preparation sequence to obtain the continuous fragment sorting result; S402: Based on the continuous segment sorting result, replace the original status field with the monitoring status text content, extract the label number information at the original position of the changed field, compare it with the replacement content synchronously to complete the replacement action, and mark the original field position to obtain the status field replacement path; S403: Call the status field to replace the path, add a text item to each replaced content to describe the source of the change, write the description and the tag number together into the corresponding position of the structure segment, and obtain the tag status jump tracking chain.
[0011] As a further aspect of the present invention, the steps for obtaining the structure of the medical waste status management method are as follows: S501: Use the tag state jump to track the changed state text, field description and time content in the chain, extract the tag number as the index item, write the state text to the corresponding position in the blockchain structure segment in the order of the number, and record the order information of the state content writing to obtain the state content writing sequence. S502: Write the sequence according to the state content, extract the corresponding field description content in each record, bind the field description content with the tag number and write it into the specified position in the same structural segment, and adjust the position alignment order uniformly according to the record order to obtain the field description input sequence. S503: Call the field description input sequence, extract the time text field in segments, insert each segment of time content into the structure segment at the position aligned with the label number, and synchronously adjust the order structure in the chain segment based on the identifier field in the status text to obtain the structure of the medical waste status management method.
[0012] The beneficial effects of the technical solutions provided in the embodiments of the present invention include at least the following: In this invention, the introduction of tag numbering and a chain structure enables automatic data transfer between various stages of waste management, avoiding errors from manual data entry. Data labeling and sensing technologies collect information such as temperature, air pressure, and dwell time in real time during transportation and temporary storage, ensuring dynamic updates to the waste status. Data updates in the tag extension area provide greater flexibility in monitoring, preventing information delays or loss. Combining blockchain technology with encrypted data storage ensures the immutability of data during waste management, enhancing management security. The overall solution reduces human intervention, minimizes information miscommunication and omissions, and enhances regulatory transparency and information flow efficiency. Attached Figure Description
[0013] Figure 1 This is a flowchart of the method of the present invention; Figure 2 This is a flowchart illustrating the process of obtaining the tag structure positioning information set according to the present invention. Figure 3 This is a flowchart illustrating the process of obtaining the tag-sensing record association list in this invention. Figure 4 This is a flowchart illustrating the process of obtaining extended fragment groups of the tag structure field in this invention. Figure 5 This is a flowchart illustrating the process of obtaining the tag status transition tracking chain in this invention. Figure 6 This is a flowchart illustrating the process of obtaining the structure of the medical waste status management method of the present invention. Detailed Implementation
[0014] The present invention will now be described in further detail with reference to the accompanying drawings. These drawings are simplified schematic diagrams, illustrating only the basic structure of the invention, and therefore only show the components relevant to the invention.
[0015] refer to Figures 1 to 6 A blockchain-based method for tracing and safely managing medical waste includes the following steps: S1: Obtain the field information used to transmit the source department, generation time, waste type, initial state and node number in the medical waste generation node, and pass it into the tag main structure area in order of field order. Process the displacement information in the reserved area at the end of the field, and set the field offset and tag number together as the chain path input content to obtain the tag structure positioning information set. S2: Based on the tag number contained in the tag structure location information set, extract the temperature reading items, dwell time content, air pressure change description and node number associated in the transportation and temporary storage nodes, associate each data item with the tag number, and add the perception field as the input content of the annotation field in the upload link to obtain the tag perception record association list. S3: Read the temperature change field, dwell time segment and its location number involved in the sensing data in the tag sensing record association list, write the continuously changing information in adjacent time data to the tag extension area, process the temperature field and dwell time field as text description content, and write them into the segment based on the time mark positioning order to obtain the tag structure field extension segment group. S4: Extract continuously changing text content from the field set of the extended fragment group of the tag structure field, replace the original status field with the monitoring status, and add a text field to describe the source of the corresponding content. Simultaneously, add status text to the structure segment with the tag number to replace the content, and obtain the tag status jump tracking chain. S5: Use tag status jumps to track the changed status text, field descriptions, and time content in the chain. Take the tag number as input, write the status content and field description content into the blockchain structure segment, and process the time text field into the chain. Process the tag chain segment with the status field as the identifier value to obtain the structure of the medical waste status management method.
[0016] The tag structure location information set specifically includes tag number, transmission source department, generation time, waste category, initial state, node number, field offset, and tag path. The tag sensing record association list specifically includes tag number, temperature reading item, dwell time period, air pressure change description, node number, and additional sensing fields. The tag structure field extension fragment group specifically includes temperature change description, dwell time description, time annotation order, adjacent time data, and data within the tag extension area. The tag status jump tracking chain specifically includes monitoring status, status text, field description, status change time, tag number, and status update content. The medical waste status management method structure specifically includes status text, field description, time record, tag number, and blockchain structure segment content.
[0017] Please see Figure 2 The steps for obtaining the tag structure location information set are as follows: S101: Obtain the field information used to transmit the source department, generation time, waste category, initial status and node number in the medical waste generation node. According to the order of the fields in the original structure, the fields are sequentially transmitted to the tag main structure area. The corresponding content of the field order is obtained by comparing the corresponding position of the field order with the field index number. The system initiates the initialization program for the underlying hardware's data acquisition interface. A stable serial communication connection is established with the medical waste generation terminal configured on-site in the hospital department. This terminal uses an ultra-high frequency RFID handheld input device with a working frequency of 920MHz to 925MHz. The system uses this device to accurately locate the physical object of the medical waste to be processed, such as identifying an infectious waste packaging bag with the unique code "MED-WASTE-2026-001". A standardized read command is then sent to the terminal to retrieve the preset key business data stream from memory. This data stream contains five core fields: the source department is set to "General Surgery Inpatient Department", the generation time is set to "January 28, 2026, 14:30:00", the waste category is set to "Infectious Waste", the initial status is set to "Sealed and Awaiting Transport", and the node number is set to the generation location node ID "NODE-GEN-0". After acquiring the above information, the system immediately allocates and establishes a tag main structure area with a total capacity of 128 bytes in memory. This area is logically mapped to a contiguous storage page structure. The system strictly follows the order of each field as defined in the original protocol structure, converts the above text and time information into hexadecimal ASCII byte streams, and starts the writing program to write these byte streams sequentially into the data storage segment of the tag main structure area. During this writing process, the system monitors and records the start and end physical address pointers of the field currently being written in real time, and logically binds these two pointer values with the index number of the current field to generate tuple data containing the index and address range. After all fields are written, the system immediately starts the cyclic redundancy check program to fully read the data in the tag main structure area and compare it with the original acquired content. After confirming that the checksum is consistent and the data is correct, the corresponding content of the field order is obtained.
[0018] S102: Based on the corresponding content of the fields, locate the reserved area at the end of the fields in the main structure area of the label, extract the displacement content of each field in this area, and concatenate the field number and displacement content in order to form a chain path content to obtain the node chain path information; The system reads the corresponding content of the fields in sequence, starts the memory address parsing program, and accurately locates the predefined reserved area at the end of the fields in the main structure area of the tag. This area is designed as a fixed byte space immediately after the physical storage end address of each data field, specifically used to build a logical linked list structure in a non-contiguous storage environment. For each written field, the system extracts its actual physical end address in the main structure area of the tag and simultaneously reads the starting physical address of the next field. The system performs offset calculation logic based on these two address values to determine the memory address step value required to jump from the current field to the next field. For example, when processing the source department field and the generation time field... When connecting segments, the system calculates the hexadecimal value 0x05 as the displacement content. This value represents the byte offset that the read / write head needs to skip at the hardware level. The extracted field number information and the calculated displacement content are concatenated at the binary level to generate a directional path segment. The system sequentially traverses all five fields according to their original arrangement order and serializes the five generated path segments by connecting them end to end, thus forming a chain path that can completely describe the topology of the data distribution inside the tag. This path ensures that even if the data is not physically stored contiguously, it can be accessed logically continuously to obtain the node chain path information.
[0019] S103: Based on the node chain path information, call the corresponding tag number in the path and associate it with the node item of the tag structure area. Sequentially search and process the path position within the structure, extract the structure area number and position content corresponding to the field, and obtain the tag structure positioning content.
[0020] The system receives node chain path information and activates the tag index parsing engine. Utilizing a binary tree-based anti-collision algorithm, it accurately locates a specific physical tag in a complex multi-tag environment filled with signal interference. The tag's electronic product code is "TAG-EPC-998877". Upon successful locking, the system immediately activates the node item mapping table within the tag's structure area and controls the read / write probe to perform non-contiguous address lookup operations in the tag's memory according to the displacement instructions contained in the path information. For example, the system reads data from the starting address and automatically jumps to the next logical address based on the read displacement value 0x05, thereby accurately pinpointing the generation time. In the storage block of the field, at each location point, the system not only reads business data, but also synchronously extracts the metadata of that location, including the structure area number and the specific physical page address information. Assuming that the system finds the structure area number and physical location parameters corresponding to the waste category field, the system will extract these scattered physical location parameters and combine them into a set of structured mapping relationship tables. This table records in detail the correspondence between the tag number and the physical address of each structure area, ensuring that the system can accurately trace back to the specific storage unit of any field at the hardware level through this location content in subsequent processes, thereby obtaining the tag structure location content.
[0021] Please refer to Figure 3 , the steps for obtaining the label-aware record association list are as follows: S201: Locate the label numbers contained in the content based on the label structure, extract the corresponding temperature reading items, residence period content, air pressure change description, and node numbers in the transportation and temporary storage nodes, correspond the label numbers with the above content one by one, and complete the number embedding at the corresponding positions to obtain the node label corresponding list; Locate the label number information contained in the content based on the label structure, remotely activate the environmental perception modules located in the transportation vehicle (license plate number: Beijing A-WT567) and the temporary storage warehouse (number: WH-2026-N) through the wireless network, and within the time window from 15:00 to 16:00 on January 28, 2026, perform high-frequency continuous monitoring on the physical environment where the label is located. The system collects multi-dimensional environmental data in real time from the on-vehicle sensor array and the warehouse monitoring terminal. Specifically, it includes the 24.5-degree Celsius temperature value, 45-minute residence period data, and 101.2 kPa air pressure change description extracted at the transportation vehicle node, and the 18.2-degree Celsius temperature value, 120-minute residence period data, and 100.8 kPa air pressure change description extracted at the temporary storage warehouse node. After the system obtains these original perception data, it performs a strict number embedding operation, uses the label number "TAG-EPC-998877" as the main index key, and embeds it into each corresponding environmental data packet one by one. Then, it encapsulates the temperature, residence time, air pressure, and node number into a JSON format data object with a unique identifier. After ensuring that there are no missing values in the data packet through integrity verification, the system integrates the data associated with specific physical nodes and label identities to obtain the node label corresponding list.
[0022] S202: According to the node label corresponding list, extract the pairing situation of the label number, temperature reading item, residence period content, and air pressure change description in each item, arrange the perception content under the same number in the reading order, and add a field identification number before each content item to obtain the label-aware field arrangement sequence; The system retrieves the list of node labels and extracts all historical environmental sensing records associated with the specific label number "TAG-EPC-998877". All records are then strictly sorted in ascending order based on the UNIX timestamp recorded during each read operation to ensure the data stream conforms to the physical time sequence. Specifically, records from the transport vehicle generated at 15:00 are sorted first, followed by records from the temporary storage warehouse generated at 16:00. After sorting, the system activates the field identifier generator to assign a globally unique field identifier number to each specific sensing content. For example, temperature data items during the transportation phase are marked with a specific temperature identifier code, and dwell time items are marked with a specific time identifier code. Similarly, each data item during the temporary storage phase is also independently identified. These generated identifier numbers are added before the corresponding data content, constructing a linear data stream with strict temporal logic and an index header. This sequence clearly shows the complete trajectory of environmental data changes over time, thus obtaining the label sensing field arrangement sequence.
[0023] S203: Arrange the sequence using the tag-aware fields, mark the positions of the awareness fields in the upload link content in order, and complete the synchronous comparison between the identifier number added before each field and the tag number to obtain the tag-aware record association list.
[0024] The system loads the tag sensing field sequence and establishes a high-speed upload link with the medical waste management cloud platform. This link is built based on the MQTT transmission protocol. The system scans the data buffer status of the upload link, pre-allocates corresponding storage space in the buffer according to the data volume defined in the sequence, executes synchronous writing and comparison procedures, and writes the sensing content with the identification number byte by byte into the designated position of the link according to the sequence order. While writing each field, the system immediately calls the hash algorithm module to concatenate the identification number added before each field with the tag number string and calculate its hash fingerprint. The system verifies the consistency of the data in the transmission preparation process by comparing the generated fingerprint with the preset check value to ensure that the sensing data is not misplaced or confused when it enters the transmission queue. After completing the labeling, writing and fingerprint verification of all fields, the system generates a detailed list containing the original data and its physical mapping address in the transmission link, thereby obtaining the tag sensing record association list.
[0025] Please see Figure 4 The steps to obtain the extended fragment group of the tag structure field are as follows: S301: Read the sensing data in the tag sensing record association list, extract the temperature change field, dwell time segment and its location number, compare the time segments corresponding to consecutive numbers in pairs, filter out the temperature difference content corresponding to consecutive time, and obtain the continuous change field sequence. The system reads detailed sensing data from the tag-based sensing record association list, focusing on extracting temperature change fields and dwell time segment information. It then activates a difference analysis engine to perform pairwise comparisons of consecutively numbered time segments. Specifically, the system calculates the difference between 24.5 degrees Celsius during the transportation phase and 18.2 degrees Celsius during the temporary storage phase, finding an absolute temperature difference of 6.3 degrees Celsius. This result is compared to a preset temperature change significance threshold, set at 1.5 degrees Celsius based on the standard deviation statistical analysis of 30 days of historical transportation data and according to the 3-Sigma principle. Since 6.3 degrees Celsius is significantly greater than the 1.5-degree Celsius threshold, the system determines that a significant environmental temperature change occurred during this period. It immediately marks and filters the consecutively numbered time segments from transportation to temporary storage, along with the calculated temperature difference, filtering out stable data without significant fluctuations to obtain a sequence of continuously changing fields.
[0026] S302: Based on the continuous change field sequence, the temperature change content and dwell time segment in each field are processed into text, and the temperature descriptive words and time period descriptions that appear frequently in each group of changes are extracted and concatenated into the tag expansion area in the original order of the fields to obtain the field description embedded fragment. Based on the continuously changing field sequence, the semantic transformation processing program is initiated to textualize the numerical temperature changes and dwell time segments in each field. The system calls the pre-set environmental description mapping table database. For the calculated 6.3-degree Celsius temperature drop data, it is found to fall within the description range of "sudden environmental cooling". For the 120-minute dwell time data, it is found to meet the definition range of "long-term storage". The system extracts these frequently occurring and accurately matched temperature descriptors and time period descriptions. According to the chronological order of the original events, the texts such as "sudden environmental cooling" and "long-term storage" are concatenated together to form a text stream with complete semantics, such as "the environment in the transportation section warms up and then the environment in the temporary storage section suddenly cools down and is stored for a long time". The system locates the extended area inside the tag that is specifically used to store unstructured notes and prepares to write this generated semantic text, thus obtaining the field description embedded fragment.
[0027] S303: Call the field description embedded fragment, based on the position number corresponding to the time mark in each item, find the corresponding sequential position in the tag extension area, write the processed text description content into the corresponding paragraph in order, and obtain the tag structure field extension fragment group.
[0028] The system calls the field description embedded fragment and starts the timeline parsing program to parse the time stamp information contained in the fragment, namely the two key time nodes of 15:00 and 16:00. Based on these two time stamps, the system looks up the corresponding sequential position number in the storage mapping table of the tag extension area. For example, the data of 15:00 is mapped to the 3rd address of the user storage area, and the data of 16:00 is mapped to the 4th address. The system controls the RFID reader to execute the write command, converts the processed text description content such as "sudden environmental cooling" and "long-term storage" into standard ASCII encoding, and writes it sequentially into the corresponding physical segment of the tag extension area. After the writing is completed, the system immediately performs a readback verification operation to confirm that the written data is completely consistent with the source data in memory, ensuring that the information is not lost during the writing process, thereby obtaining the tag structure field extension fragment group.
[0029] Please see Figure 5 The steps for obtaining the tag status jump tracking chain are as follows: S401: Extract the set of fields from the extended fragment group of the tag structure field, filter out the field fragments in which the text content in adjacent positions changes continuously, sort them according to the position number, and include the filtered fragments into the replacement preparation sequence to obtain the continuous fragment sorting result. The system extracts the field set from the extended fragment group of the tag structure field, initiates a state semantic analysis algorithm, and filters out field fragments where the text content in adjacent positions changes continuously. The system compares the "Transporting" status text of the previous time window with the "Temporarily Stored in Warehouse" status text of the current time window. Through semantic distance calculation, it identifies that the two belong to different business status categories, thus determining that a state mutation has occurred. The system then sorts these changed fragments according to their position numbers and includes the filtered mutated fragments in the replacement preparation sequence. This sequence clearly records the specific time point of the status change, the original status content, and the new status content, providing a precise execution basis for subsequent status update operations, thereby obtaining the continuous fragment sorting result.
[0030] S402: Based on the continuous segment sorting results, replace the original status field with the monitoring status text content, extract the label number information at the original position of the changed field, compare it with the replacement content synchronously to complete the replacement action, and mark the original field position to obtain the status field replacement path; Based on the continuous segment sorting results, a standardized monitoring status code library is loaded. The original natural language status fields such as "temporarily stored in the database" are replaced with system-specific monitoring status text content, such as "STATUS_STORAGE_MONITORED". The system extracts the label number information of the original position of the changed field and compares it with the replacement content to be written. After confirming that the operation permissions and target address are correct, the system performs an overwrite operation in memory, updating the original status field with the new monitoring status text. At the same time, the system writes a revision mark to the status flag in the metadata area, marking the original field position as "revised" and retaining a logical pointer to the historical status for traceability, thereby obtaining the status field replacement path.
[0031] S403: Call the status field to replace the path, add a text item to each replaced content to describe the source of the change, write the description and the tag number together into the corresponding position in the structure segment, and obtain the tag status jump tracking chain.
[0032] The system calls the status field replacement path, starts the source description generation program, analyzes the triggering source that caused the status change, reads the device ID information that triggered this "transport" to "temporary storage" status change, that is, the scanning device number at the warehouse entrance, and generates a text item such as "Source: WH-Scan" to describe the source of the change. The system packages this description content with the tag number and writes it together into the corresponding position of the structure segment according to the path indication, usually located in the remarks storage area adjacent to the status field. This step ensures that each status change not only has a result record, but also a clear triggering reason record, forming a complete evidence chain with causal logic, thereby obtaining the tag status jump tracking chain.
[0033] Please see Figure 6 The steps for obtaining the structure of the medical waste status management method are as follows: S501: Use tag state jump to track the changed state text, field description and time content in the chain, extract the tag number as index item, write the state text to the corresponding position in the blockchain structure segment in the order of the number, and record the order information of the state content writing to obtain the state content writing sequence. The system extracts the core elements from the tag state transition tracking chain, including the changed state text, field descriptions, and time content. Using the tag number as a unique index, the system initiates a state update transaction in the blockchain's smart contract. The system writes the state text into the corresponding position in the block body according to the number order, and generates a new sequence number based on a hash algorithm, combining the previous state's sequence number, tag number, and current timestamp. This sequence number records the strict order information of the state content writing. As a tamper-proof logical credential, it ensures the temporal uniqueness of all state records on the distributed ledger. After the transaction is verified through consensus, it is solidified on the chain, thus obtaining the state content writing sequence.
[0034] S502: Write the sequence according to the status content, extract the corresponding field description content in each record, bind the field description content with the tag number and write it to the specified position in the same structure segment, and adjust the position alignment order according to the record order to obtain the field description input sequence. Based on the state content written sequence, the corresponding field description content in each record is extracted again, such as the semantic text "environmental sudden cooling - long-term storage". The system uses the AES-256 encryption algorithm to bind the field description content with the tag number to generate ciphertext data. The encrypted description content is then located at the specified payload position within the same structural segment and written. The storage layout of the on-chain data is adjusted uniformly according to the time order of record generation to ensure that the physical storage order is strictly aligned with the logical order of occurrence. This step ensures that even in the distributed storage structure of the blockchain, the environmental description of the medical waste package is coherent, orderly and encrypted, thus obtaining the field description input sequence.
[0035] S503: Call the field description input sequence, extract the time text field in segments, insert each segment of time content into the structure segment aligned with the label number, and synchronously adjust the order structure in the chain segment based on the identifier field in the status text to obtain the structure of the medical waste status management method.
[0036] The call field describes the sequence of entries into the blockchain. The time text field contained therein is segmented and extracted. Each segment of time content is inserted into the structural segment at a position precisely aligned with the tag number, constructing a complete time index axis. Based on the identifier field in the status text, the Merkle root hash calculation program is started. By calculating the comprehensive hash value including status, description, and time information, the sequential structure in the chain segment is synchronously adjusted and verified. If the calculated root hash value is consistent with the block header record, it indicates that all status changes, environmental perception data, and time nodes related to the medical waste have been successfully and completely integrated into the blockchain structure, achieving data immutability and logical self-consistency, thereby obtaining the structure of the medical waste status management method.
[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 blockchain-based method for the traceability and safe management of medical waste, characterized in that, Includes the following steps: S1: Obtain the fields of source department, generation time, waste type, initial status and node number from the medical waste generation node, and pass them into the main structure area of the tag according to the field order. Process the displacement information of the reserved area at the end of the field, and set the field offset and the tag number as the chain path input to obtain the tag structure positioning information set. S2: Based on the tag number in the tag structure location information set, extract the temperature reading items, dwell time, air pressure change and node number of the transportation and temporary storage nodes, pair the fields with the numbers, add the sensing fields as label inputs in the upload link, and obtain the tag sensing record association list. S3: Read the temperature field, dwell time and location number from the tag perception record association list, write the time change content into the tag extension area, process the temperature and dwell time fields as text, and write them into the fields according to the time label order to obtain the tag structure field extension fragment group; S4: Extract the continuously changing text from the extended fragment group of the tag structure field, replace the original status field with the monitoring status, add a text field to describe the source content, and insert the status text in the structure segment with the tag number to obtain the tag status jump tracking chain.
2. The blockchain-based medical waste traceability and safety management method according to claim 1, characterized in that: The tag structure positioning information set specifically includes tag number, transmission source department, generation time, waste category, initial state, node number, field offset, and tag path. The tag sensing record association list specifically includes tag number, temperature reading item, dwell time period, air pressure change description, node number, and additional sensing fields. The tag structure field extension fragment group specifically includes temperature change description, dwell time description, time labeling order, adjacent time data, and data within the tag extension area. The tag status jump tracking chain specifically includes monitoring status, status text, field description, status change time, tag number, and status update content.
3. The blockchain-based medical waste traceability and safety management method according to claim 1, characterized in that: The steps for obtaining the tag structure positioning information set are as follows: S101: Obtain the field information used to transmit the source department, generation time, waste category, initial status and node number in the medical waste generation node. According to the order of the fields in the original structure, the fields are sequentially transmitted to the tag main structure area. The corresponding content of the field order is obtained by comparing the corresponding position of the field order with the field index number. S102: Based on the corresponding content of the fields, locate the reserved area at the end of the fields in the main structure area of the label, extract the displacement content of each field in this area, and concatenate the field number and displacement content in sequence to form a chain path content to obtain the node chain path information; S103: Based on the node chain path information, call the corresponding tag number in the path and associate it with the node item of the tag structure area, sequentially search the path position within the structure, extract the structure area number and position content corresponding to the field, and obtain the tag structure positioning content.
4. The blockchain-based medical waste traceability and safety management method according to claim 1, characterized in that: The steps for obtaining the tag-aware record association list are as follows: S201: Based on the tag number contained in the tag structure location content, extract the corresponding temperature reading item, dwell time content, air pressure change description and node number in the transportation and temporary storage nodes, match the tag number with the above content one by one, and complete the number embedding in the corresponding position to obtain the node tag corresponding list. S202: Based on the list of node labels, extract the pairing of label number with temperature reading item, dwell time content, and air pressure change description in each item, arrange the sensing content under the same number in the reading order, and add field identifier number before each item to obtain the label sensing field arrangement sequence; S203: Arrange the sequence using the label perception fields, mark the positions of the perception fields in the upload link content in order, and complete the synchronous comparison process between the identifier number added before each field and the label number to obtain the label perception record association list.
5. The blockchain-based medical waste traceability and safety management method according to claim 1, characterized in that: The steps for obtaining the extended fragment group of the tag structure field are as follows: S301: Read the sensing data in the tag sensing record association list, extract the temperature change field, dwell time segment and its location number, compare the time segments corresponding to consecutive numbers in pairs, filter out the temperature difference content corresponding to consecutive time, and obtain the continuous change field sequence. S302: Based on the continuous change field sequence, the temperature change content and dwell time segment in each field are processed into text, and the temperature descriptive words and time period descriptions that appear more frequently in each group of changes are extracted and concatenated into the tag expansion area in the original order of the fields to obtain the field description embedded fragment. S303: Call the field description embedded fragment, and based on the position number corresponding to the time mark in each item, find the corresponding sequential position in the tag extension area, write the processed text description content into the corresponding paragraph in order, and obtain the tag structure field extension fragment group.
6. The blockchain-based medical waste traceability and safety management method according to claim 1, characterized in that: The steps for obtaining the tag status jump tracking chain are as follows: S401: Extract the set of fields transmitted from the extended fragment group of the tag structure field, filter out the field fragments in which the text content in adjacent positions changes continuously, sort them according to the position number order, and include the filtered fragments into the replacement preparation sequence to obtain the continuous fragment sorting result; S402: Based on the continuous segment sorting result, replace the original status field with the monitoring status text content, extract the label number information at the original position of the changed field, compare it with the replacement content synchronously to complete the replacement action, and mark the original field position to obtain the status field replacement path; S403: Call the status field to replace the path, add a text item to each replaced content to describe the source of the change, write the description and the tag number together into the corresponding position of the structure segment, and obtain the tag status jump tracking chain.
7. The blockchain-based medical waste traceability and safety management method according to claim 1, characterized in that, The method further includes step S5: S5: Use the status text, field description and time content in the tag status jump tracking chain, take the tag number as input, write the status and field description into the blockchain structure segment, process the time text into the chain, process the tag chain segment with the status field as the identifier value, and obtain the medical waste status management method structure. The structure of the medical waste status management method specifically includes status text, field description, time record, tag number, and blockchain structure segment content.
8. The blockchain-based medical waste traceability and safety management method according to claim 7, characterized in that: The steps for obtaining the structure of the medical waste status management method are as follows: S501: Use the tag state jump to track the changed state text, field description and time content in the chain, extract the tag number as the index item, write the state text to the corresponding position in the blockchain structure segment in the order of the number, and record the order information of the state content writing to obtain the state content writing sequence. S502: Write the sequence according to the state content, extract the corresponding field description content in each record, bind the field description content with the tag number and write it into the specified position in the same structural segment, and adjust the position alignment order uniformly according to the record order to obtain the field description input sequence. S503: Call the field description input sequence, extract the time text field in segments, insert each segment of time content into the structure segment at the position aligned with the label number, and synchronously adjust the order structure in the chain segment based on the identifier field in the status text to obtain the structure of the medical waste status management method.