A rehabilitation evaluation report generation method and device, an electronic device, and a storage medium

By using a front-end privacy protection preprocessing module on the browser side to identify and process sensitive areas of rehabilitation assessment reports, the problem of privacy leakage and traceability when rehabilitation assessment reports are converted into images is solved. This achieves efficient and accurate privacy protection and traceability, improving user experience and system performance.

CN122156381APending Publication Date: 2026-06-05HANGZHOU JIECHUANGRUI MEDICAL TECHNOLOGY CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
HANGZHOU JIECHUANGRUI MEDICAL TECHNOLOGY CO LTD
Filing Date
2026-03-06
Publication Date
2026-06-05

AI Technical Summary

Technical Problem

When existing rehabilitation assessment reports are converted into image format, there is a risk of privacy data leakage, it is difficult to achieve accurate protection and traceability of sensitive areas, and the server processing burden is heavy, resulting in a poor user experience.

Method used

A front-end privacy protection preprocessing module is introduced on the browser side. By identifying sensitive areas and applying visual desensitization and dynamic watermarking in real time, an irreversible image is generated, preventing sensitive data from being clearly displayed in the image and embedding irrefutable traceability information.

Benefits of technology

It achieves pixel-level privacy protection and traceability of rehabilitation assessment reports on the front end, reduces the risk of privacy leakage, improves user experience and reduces server load, and meets the flexible configuration needs of different sensitivity levels.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122156381A_ABST
    Figure CN122156381A_ABST
Patent Text Reader

Abstract

The application discloses a rehabilitation evaluation report generation method and device, electronic equipment and a storage medium, and belongs to the cross field of medical information technology and data security. The method is implemented on the browser side: first, the HTML page of the rehabilitation evaluation report is rendered; then, the DOM tree is scanned, and target elements containing sensitive information are identified according to a preset rule; next, privacy intervention processing is performed according to the protection strategy of each target element - an overlay layer is created for the elements that need to be desensitized and visual desensitization effects (such as blurring and mosaic) are applied, and a dynamic watermark layer containing the operation user identifier and the millisecond timestamp is superimposed on the elements that need to be watermarked; finally, an image conversion library is called to convert the processed DOM tree into an image and output. The application performs pixel-level accurate intervention on the sensitive area at the image generation source, can effectively protect the privacy of patients and embed traceable information, and the whole process is completed on the front end without the participation of a server, thereby significantly improving the security and processing efficiency of medical data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of medical informatics and web front-end technology, and particularly to a method, apparatus, electronic device, and storage medium for generating rehabilitation assessment reports. Background Technology In the informatization process of rehabilitation medicine, generating assessment reports containing highly sensitive data such as patient personal information (e.g., name, ID number), detailed diagnostic results, and functional assessment scores is a core requirement. Currently, the mainstream approaches are: 1. Using Web technologies (HTML / CSS) to render the reports in a browser. 2. Using front-end libraries (such as html-to-image, html2canvas, dom-to-image, etc.) to convert the rendered HTML into image format for easy archiving, printing, and sharing.

[0002] The existing problems and risks are as follows: 1. High Risk of Privacy Leakage: The directly converted images completely contain the original sensitive data. Once the images are illegally screenshotted, downloaded, or forwarded, patient privacy faces serious risks of leakage (such as identity theft, discrimination, etc.), violating regulations such as the Personal Information Protection Law and the Guidelines for the Security Management of Health and Medical Big Data.

[0003] 2. Difficulty in tracing the source of leakage: Traditional image reports lack effective identification, making it impossible to trace the source of responsibility (specific operator, operation time) after leakage.

[0004] 3. Heavy backend processing burden: If desensitization or watermarking is performed on the server side, the complete sensitive data needs to be transmitted to the server, and the image is returned after processing, resulting in high latency, high server pressure, and poor user experience.

[0005] 4. Existing protection is insufficient: simple global watermarks are easily cropped; static watermarks (such as fixed logos) lack traceability information; backend watermarks cannot solve the problem of frontend screenshot leakage.

[0006] 5. Lack of specificity in the solution: General screenshot protection technology is difficult to meet the characteristics of large differences in field-level sensitivity and geographical dispersion in medical rehabilitation assessment reports.

[0007] Therefore, there is an urgent need for a method and system that can implement privacy protection and source watermark embedding for sensitive areas scattered in rehabilitation assessment reports in real time and accurately at the front end, so as to prevent privacy leakage from the source and realize the accountability after leakage. Summary of the Invention

[0008] The purpose of this invention is to provide a method, apparatus, electronic device, and storage medium for generating rehabilitation assessment reports, which can at least solve one of the following technical problems: 1. How to efficiently and accurately identify different types of sensitive data areas (such as name boxes, diagnosis conclusion paragraphs, and scoring table cells) scattered in HTML rehabilitation assessment reports on the front end.

[0009] 2. How to perform effective privacy protection operations on specific sensitive areas identified in real time on the browser side before calling libraries such as html-to-image to convert HTML to images, so as to avoid leakage of sensitive data.

[0010] 3. How to design a mechanism that can both protect privacy information (making it unidentifiable in the image) and embed non-repudiable traceability information (operator identity, precise time), and this mechanism must be difficult to completely remove or circumvent.

[0011] 4. How to achieve the above protection process without relying on server-side processing, thereby significantly reducing network latency and server load, and improving user experience.

[0012] 5. How to ensure that the protection mechanism is flexible and configurable to meet the needs of different sensitivity levels of fields in rehabilitation assessment reports (e.g., ID numbers need to be strongly desensitized, and diagnostic conclusions can be watermarked).

[0013] To achieve the above objectives, the present invention provides a method, apparatus, electronic device and storage medium for generating rehabilitation assessment reports. Its core lies in introducing a front-end privacy protection preprocessing module located after the HTML report is rendered and before the html-to-image library is called.

[0014] According to a first aspect of the present invention, a method for generating a rehabilitation assessment report is provided, which is applied to a browser. The method includes the following steps: The HTML page that renders the rehabilitation assessment report; Scan the DOM tree of the HTML page and identify at least one target element containing sensitive information according to the preset sensitive area identification rules; Based on the protection policy corresponding to each target element, privacy intervention processing is performed on the target element; wherein, the privacy intervention processing includes: for target elements configured with a desensitization policy, creating an overlay layer that matches the position and size of the target element, and applying a visual desensitization effect to the overlay layer; for target elements configured with a watermark policy, overlaying a dynamically generated watermark layer on the target element, the watermark layer containing the unique identifier of the current operating user and the generation timestamp; The image conversion library is called to convert the privacy-modified DOM tree into an image and output the image.

[0015] In some implementations, the sensitive area identification rules include at least one of the following: CSS class name or ID matching rules, regular expression data format matching rules, and DOM structure positioning rules.

[0016] In some implementations, visual desensitization effects include at least one of the following: Gaussian blur, mosaic, solid color block masking, and text replacement.

[0017] In some implementations, the watermark layer is a semi-transparent text layer that is rotated at a certain angle and tiled within the target element area, and its generated timestamp is accurate to the millisecond level.

[0018] In some implementations, privacy intervention involves modifying the original DOM elements in real time before calling the image conversion library, so that subsequent image conversion captures the intervened visual effect.

[0019] In some implementations, the method for generating rehabilitation assessment reports further includes providing a configuration interface for presetting sensitive area identification rules and assigning desensitization or watermark protection strategies to different sensitive areas.

[0020] In some implementations, the overlay or watermark layer is set to not respond to mouse events via CSS properties, so that mouse operations can penetrate to the underlying original element.

[0021] In some implementations, when multiple target elements require privacy intervention, asynchronous batch processing or frame-by-frame rendering based on animation frames is used for performance optimization.

[0022] In some implementations, the generation timestamp in the watermark layer is obtained in real time based on the browser's system time, and combined with the unique identifier of the current user, and then embedded into the target element area through an irreversible visual overlay method.

[0023] According to a second aspect of the present invention, an apparatus for generating a rehabilitation assessment report is also provided, comprising: The rendering module is used to render the HTML pages of the rehabilitation assessment reports; The recognition module is used to scan the DOM tree of an HTML page and identify at least one target element containing sensitive information according to preset sensitive area recognition rules. The intervention module is used to perform privacy intervention processing on target elements according to the protection policy corresponding to each target element. The privacy intervention processing includes: for target elements configured with a desensitization policy, creating an overlay layer that matches the position and size of the target element and applying a visual desensitization effect to the overlay layer; for target elements configured with a watermark policy, overlaying a dynamically generated watermark layer on the target element, the watermark layer containing the unique identifier of the current operating user and the generation timestamp. The conversion module is used to call an image conversion library to convert the privacy-modified DOM tree into an image and output the image.

[0024] According to a third aspect of the present invention, an electronic device is also provided, including one or more processors and a memory, the memory storing one or more programs that, when executed by the processor, implement the method described above.

[0025] According to a fourth aspect of the present invention, a computer-readable storage medium is also provided, on which a computer program is stored, which, when executed by a processor, implements the above-described method.

[0026] The beneficial effects of this invention are: 1. Source privacy protection: The generated images do not contain or cannot be clearly read the original sensitive information (through de-identification) or clearly indicate the source (through watermarking), fundamentally reducing the risk of privacy leakage caused by image dissemination and meeting strict data compliance requirements.

[0027] 2. Precise Leakage Tracing: Dynamically embedded operator identification (user ID / employee number) and millisecond-level timestamp watermarks provide direct and conclusive evidence for determining responsibility for any leaked images.

[0028] 3. Improved processing efficiency: Privacy protection and source tracing information embedding are completed in real time in the user's browser front end, without the need to interact with the server for sensitive data. The image generation speed is significantly improved and the server load is greatly reduced (compared to server-side processing solutions).

[0029] 4. Precise and flexible protection: It achieves pixel-level selective protection of regions (non-global processing) without affecting non-sensitive areas; it supports flexible configuration of "de-sensitization" or "watermarking" strategies by field to meet the needs of different business scenarios and sensitivity levels.

[0030] 5. Enhanced resistance to circumvention: Pixel-level desensitization (such as Gaussian blur, mosaic) permanently destroys information visually; dynamic watermarks are strongly bound to the user / time and cover key areas, making it difficult to completely eliminate all traceability traces using conventional methods such as cropping and smearing; the overlay or watermark layer does not respond to mouse events to avoid interfering with the user's normal operation.

[0031] 6. Performance optimization: By using asynchronous batch processing or frame-by-frame rendering, a large number of DOM operations are avoided from blocking the UI main thread, ensuring a smooth user experience.

[0032] 7. Compatibility and easy integration: Based on standard Web technologies (HTML / CSS / JavaScript), it integrates seamlessly with mainstream html-to-image libraries and can be quickly embedded into existing rehabilitation information systems.

[0033] In summary, this invention discloses a method, apparatus, electronic device, and storage medium for generating rehabilitation assessment reports, belonging to the interdisciplinary field of medical information technology and data security. The method is implemented on the browser side: first, the HTML page of the rehabilitation assessment report is rendered; then, the DOM tree is scanned, and target elements containing sensitive information are identified according to preset rules; next, privacy intervention processing is performed according to the protection strategy of each target element—an overlay layer is created for elements requiring desensitization and visual desensitization effects (such as blurring or mosaic) are applied; for elements requiring watermarking, a dynamic watermark layer containing the user's identifier and a millisecond-level timestamp is overlaid; finally, an image conversion library is called to convert the processed DOM tree into an image and output it. This invention performs pixel-level precise intervention on sensitive areas at the image generation source, effectively protecting patient privacy while embedding traceable information. Furthermore, the entire process is completed on the front end without server involvement, significantly improving the security and processing efficiency of medical data. Attached Figure Description

[0034] Figure 1 This is a flowchart illustrating a method for generating rehabilitation assessment reports according to one embodiment of the present invention.

[0035] Figure 2 This is a system framework diagram of a rehabilitation assessment report generation device according to one embodiment of the present invention.

[0036] Figure 3 This is a schematic diagram of an electronic device according to one embodiment of the present invention. Detailed Implementation

[0037] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without inventive effort are within the scope of protection of this invention.

[0038] This invention belongs to the interdisciplinary field of medical information technology and data security, specifically relating to a method, apparatus, electronic device, and storage medium for generating rehabilitation assessment reports containing sensitive patient health information in a web environment. In particular, this invention focuses on the front-end processing stage of converting HTML-formatted rehabilitation assessment reports into image formats (such as PNG and JPEG). Through innovative real-time intervention technology, it achieves pixel-level privacy protection for specific sensitive areas and embeds dynamic watermarks with traceable information, ensuring that the generated images possess strong privacy protection and leakage tracking capabilities during distribution and storage.

[0039] This invention provides a method for generating rehabilitation assessment reports. (Refer to...) Figure 1The diagram shown is a flowchart illustrating an embodiment of the method for generating rehabilitation assessment reports according to the present invention.

[0040] This method can be executed by an electronic device, which can be implemented by software and / or hardware. The method is applied to a browser and includes the following steps: The HTML page that renders the rehabilitation assessment report; Scan the DOM tree of the HTML page and identify at least one target element containing sensitive information according to the preset sensitive area identification rules; Based on the protection policy corresponding to each target element, privacy intervention processing is performed on the target element; wherein, the privacy intervention processing includes: for target elements configured with a desensitization policy, creating an overlay layer that matches the position and size of the target element, and applying a visual desensitization effect to the overlay layer; for target elements configured with a watermark policy, overlaying a dynamically generated watermark layer on the target element, the watermark layer containing the unique identifier of the current operating user and the generation timestamp; The image conversion library is called to convert the privacy-modified DOM tree into an image and output the image.

[0041] Preferred rules for identifying sensitive areas include at least one of the following: CSS class name or ID matching rules, regular expression data format matching rules, and DOM structure location rules.

[0042] Preferred visual desensitization effects include at least one of the following: Gaussian blur, mosaic, solid color block masking, and text replacement.

[0043] Preferably, the watermark layer is a semi-transparent text layer that is rotated at a certain angle and tiled within the target element area, and its generated timestamp is accurate to the millisecond level.

[0044] As a preferred approach, privacy intervention involves modifying the original DOM elements in real time before calling the image conversion library, so that subsequent image conversion captures the visual effect after intervention.

[0045] As a preferred method, the method for generating rehabilitation assessment reports also includes: providing a configuration interface for presetting sensitive area identification rules and assigning desensitization or watermark protection strategies to different sensitive areas.

[0046] As a preferred option, the overlay or watermark layer is set to not respond to mouse events via CSS properties, so that mouse operations can penetrate to the underlying original element.

[0047] As a preferred approach, when multiple target elements require privacy intervention, asynchronous batch processing or frame-by-frame rendering based on animation frames can be used for performance optimization.

[0048] Preferably, the generation timestamp in the watermark layer is obtained in real time based on the browser's system time, and combined with the unique identifier of the current user, and then embedded into the target element area through an irreversible visual overlay method.

[0049] Reference Figure 2 The diagram shown is a functional module schematic of the rehabilitation assessment report generation device of the present invention.

[0050] The rehabilitation assessment report generation device of the present invention can be installed in an electronic device. Depending on the functions implemented, the rehabilitation assessment report generation device may include a rendering module, a recognition module, an intervention module, a conversion module, an output module, and a configuration management module. These modules can also be referred to as units, which are a series of computer program segments that can be executed by the processor of an electronic device and perform a fixed function, and are stored in the memory of the electronic device.

[0051] In this embodiment, the functions of each module / unit are as follows: The rendering module is responsible for rendering the HTML page of the rehabilitation assessment report and generating the HTML rehabilitation report; The identification module is used to scan the DOM tree of the HTML rehabilitation report. Based on the sensitive area identification rules preset by the configuration management module, it identifies at least one target element containing sensitive information and forms a set of sensitive area elements.

[0052] The configuration management module provides a configuration interface for presetting sensitive area identification rules and assigning desensitization or watermark protection strategies to different sensitive areas. The configuration information is passed to the identification module and the intervention module respectively.

[0053] The intervention module is used to perform privacy intervention processing on target elements according to the protection policy corresponding to each target element; wherein, the privacy intervention processing includes: for target elements configured with a desensitization policy, creating an overlay layer that matches the position and size of the target element, and applying a visual desensitization effect to the overlay layer; for target elements configured with a watermark policy, overlaying a dynamically generated watermark layer on the target element, the watermark layer containing the unique identifier of the current operating user and the generation timestamp; The conversion module is used to call an image conversion library to convert the privacy-modified DOM tree into an image; The output module is used to output secure images with privacy protection and watermarks (the functions of the output module can also be integrated into the conversion module).

[0054] Preferably, the intervention module includes a strategy parsing unit, a desensitization processing unit, a watermarking processing unit, and a performance optimization unit. The strategy parsing unit directs each target element in the sensitive area element set to the desensitization processing unit or the watermarking processing unit, respectively, based on the protection strategy corresponding to each target element. The desensitization processing unit creates an overlay layer for the target elements configured with the desensitization strategy and applies a visual desensitization effect. The watermarking processing unit overlays a dynamically generated watermark layer on the target elements configured with the watermarking strategy. The performance optimization unit performs asynchronous batch processing or frame-by-frame rendering optimization for the processing of multiple target elements.

[0055] Reference Figure 3 The diagram shown is a schematic representation of a preferred embodiment of the electronic device 1 of the present invention.

[0056] The electronic device 1 includes, but is not limited to, a memory 11, a processor 12, a display 13, and a network interface 14. The electronic device 1 connects to a network via the network interface 14 to acquire raw data. The network can be an intranet, the Internet, Global System for Mobile Communications (GSM), Wideband Code Division Multiple Access (WCDMA), 4G, 5G, Bluetooth, or Wi-Fi. Wireless or wired networks such as Fi and voice communication networks.

[0057] The memory 11 includes at least one type of readable storage medium, including flash memory, hard disk, multimedia card, card-type memory (e.g., SD or DX memory), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, disk, optical disk, etc.

[0058] Preferably, the memory 11 can be an internal storage unit of the electronic device 1, such as a hard disk or RAM of the electronic device 1. In other embodiments, the memory 11 can also be an external storage device of the electronic device 1, such as a plug-in hard disk, smart media card (SMC), secure digital card (SD) card, flash card, etc., equipped with the electronic device 1. Of course, the memory 11 can also include both internal storage units and external storage devices of the electronic device 1.

[0059] In this embodiment, the memory 11 is typically used to store the operating system and various application software installed on the electronic device 1, such as the program code of the rehabilitation assessment report generation program 10. In addition, the memory 11 can also be used to temporarily store various types of data that have been output or will be output.

[0060] The processor 12 can preferably be a central processing unit (CPU), controller, microcontroller, microprocessor, or other data processing chip. The processor 12 is typically used to control the overall operation of the electronic device 1, such as performing data interaction or communication-related control and processing. In this embodiment, the processor 12 is used to run program code stored in the memory 11 or process data, such as running the program code for the rehabilitation assessment report generation program 10.

[0061] The display 13 can be referred to as a display screen or display unit. Preferably, the display 13 can be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, or an organic light-emitting diode (OLED) touchscreen, etc. The display 13 is used to display information processed in the electronic device 1 and to display a visual working interface, such as displaying the results of data statistics.

[0062] Network interface 14 may optionally include a standard wired interface, a wireless interface (such as Wi-Fi), etc. The network interface 14 (FI interface) is typically used to establish communication connections between electronic device 1 and other electronic devices.

[0063] Figure 3 Only an electronic device 1 with components 11-14 and a rehabilitation assessment report generation program 10 is shown. However, it should be understood that implementation of all the components shown is not required, and more or fewer components may be implemented instead.

[0064] Optionally, the electronic device 1 may further include a user interface, which may include a display, an input unit such as a keyboard, and optionally, a standard wired interface or a wireless interface. Preferably, the display may be an LED display, a liquid crystal display, a touch-screen liquid crystal display, or an organic light-emitting diode (OLED) display. Emitting Diode (OLED) touch devices, etc. The display, which can also be appropriately referred to as a screen or display unit, is used to display information processed in the electronic device 1 and to display a visual user interface.

[0065] The electronic device 1 may also include radio frequency (RF) circuits, sensors, and audio circuits, etc., which will not be described in detail here.

[0066] In the above embodiments, when the processor 12 executes the rehabilitation assessment report generation program 10 stored in the memory 11, it can perform the following steps: The HTML page that renders the rehabilitation assessment report; Scan the DOM tree of the HTML page and identify at least one target element containing sensitive information according to the preset sensitive area identification rules; Based on the protection policy corresponding to each target element, privacy intervention processing is performed on the target element; wherein, the privacy intervention processing includes: for target elements configured with a desensitization policy, creating an overlay layer that matches the position and size of the target element, and applying a visual desensitization effect to the overlay layer; for target elements configured with a watermark policy, overlaying a dynamically generated watermark layer on the target element, the watermark layer containing the unique identifier of the current operating user and the generation timestamp; The image conversion library is called to convert the privacy-modified DOM tree into an image and output the image.

[0067] The storage device can be the memory 11 of the electronic device 1, or it can be other storage devices that are communicatively connected to the electronic device 1.

[0068] For a detailed explanation of the above steps, please refer to the above. Figure 2 Functional block diagram of the embodiment of the rehabilitation assessment report generation device and Figure 1 A flowchart illustrating an embodiment of the method for generating rehabilitation assessment reports.

[0069] Furthermore, embodiments of the present invention also propose a computer-readable storage medium, which can be non-volatile or volatile. This computer-readable storage medium can be a hard disk, multimedia card, SD card, flash memory card, SMC, read-only memory (ROM), erasable programmable read-only memory (EPROM), or portable compact disc read-only memory (CD). The computer-readable storage medium includes any one or more of the following: ROM, USB memory, etc. The computer-readable storage medium includes a data storage area and a program storage area. The data storage area stores data created based on the use of blockchain nodes, and the program storage area stores a rehabilitation assessment report generation program 10. When executed by the processor, the rehabilitation assessment report generation program 10 performs the following operations: The HTML page that renders the rehabilitation assessment report; Scan the DOM tree of the HTML page and identify at least one target element containing sensitive information according to the preset sensitive area identification rules; Based on the protection policy corresponding to each target element, privacy intervention processing is performed on the target element; wherein, the privacy intervention processing includes: for target elements configured with a desensitization policy, creating an overlay layer that matches the position and size of the target element, and applying a visual desensitization effect to the overlay layer; for target elements configured with a watermark policy, overlaying a dynamically generated watermark layer on the target element, the watermark layer containing the unique identifier of the current operating user and the generation timestamp; The image conversion library is called to convert the privacy-modified DOM tree into an image and output the image.

[0070] The specific implementation of the computer-readable storage medium of the present invention is largely the same as the specific implementation of the above-described method for generating rehabilitation assessment reports, and will not be repeated here.

[0071] To better explain the technical solution of the present invention, the present invention also provides the following specific embodiments: Example 1: Protection of Patient Motor Function Assessment Reports This embodiment uses the generation of a rehabilitation assessment report image containing patient ID, balance ability score, and doctor's diagnosis as an example to illustrate the invention in detail.

[0072] 1. System Configuration: First, configure the protection policy through the provided configuration interface: For elements displaying patient IDs (extremely sensitive), configure them to be "de-sensitized"; Elements related to balance ability scores and doctor's diagnoses are configured to be watermarked. Rule definitions can be based on CSS class names. For example, the HTML element containing the patient ID can be assigned the class name "patient-id", the scoring element can be assigned the class name "score", and the diagnosis element can be assigned the class name "diagnosis". The recognition module will then perform matching based on these class names.

[0073] 2. Execution process: Reference Figure 1 The specific steps in this embodiment are as follows: Step 101: Doctor Zhang Ming views a patient's motor function assessment report in the rehabilitation information system and clicks the "Generate Safe Image" button; Step 102: The rendering module dynamically renders the complete report HTML page in the browser, which includes the patient ID (e.g., "P123456"), balance ability score (e.g., "85 points") and diagnosis (e.g., "weakness of muscle strength in the left lower limb"). Step 103: The recognition module automatically scans the DOM tree of the current report and accurately locates the three target elements with class names "patient-id", "score", and "diagnosis" according to the preset CSS class name rules. Step 104: The intervention module processes the data according to the strategy configuration: For an element with the class name "patient-id" (desensitization strategy): create an element whose size exactly matches its location. Create an overlay and set its background to pure black (background-color: #000000). Also, add the CSS property `pointer-events: none` to the overlay, allowing mouse events to penetrate to the underlying element. Then, append this overlay to the inside or top of the original element, completely obscuring the original text "P123456". For elements with class names "score" and "diagnosis" (watermarking strategy): A semi-transparent watermark layer is dynamically generated. The content of the watermark layer is "Operating Doctor: Zhang Ming | Generation Time: 2024-04-25 14:30:25.120". This timestamp is obtained in real time based on the browser system time, accurate to milliseconds. It is implemented by drawing with Canvas or repeating and tiling with CSS background. The watermark text color is light gray (rgba(150,150,150,0.4)), the font size is 14px, the rotation angle is -20°, and it is tiled to cover the entire scoring and diagnosis area. This watermark layer also sets pointer-events: none to avoid interference. Finally, the watermark becomes part of the element background in an irreversible visual overlay.

[0074] Step 105: The conversion module calls the html-to-imag library (e.g., html2canvas(document.getElementById('report-container')))) to convert the entire report container, which has been modified by the DOM, into a Canvas object. Because asynchronous batch processing is used, the processing of multiple target elements does not block the main UI thread, and the page remains smooth.

[0075] Step 106: The output module converts the Canvas object into a PNG image and provides options for download or automatic upload to secure storage. In the final generated image, the patient ID area is a black square, and no information can be read; the scoring and diagnosis information areas clearly show the original data, but the data is covered with a semi-transparent watermark containing the operator's identity and precise time.

[0076] Example 2: Protection of ID Numbers and Telephone Numbers This embodiment protects the ID card number and phone number appearing in the report, demonstrating the application of data pattern recognition.

[0077] 1. Rule configuration: In the configuration interface, add the following regular expression rules: ID card number matching rule \d{17}[\dXx]|\d{15}, and phone number matching rule 1[3-9]\d{9}. Configure the protection policy as "de-sensitization-mosaic".

[0078] 2. Execution process: After the report is rendered, the recognition module scans all text nodes, uses regular expressions to match text fragments that conform to the format of ID card number and phone number, and locates the parent element where they are located. The intervention module creates a Canvas overlay for each matched element, draws the original area content onto the Canvas, then performs pixelation (mosaic) on the Canvas image data, and then displays the processed Canvas as an overlay, setting pointer-events: none; Subsequent image conversion captures the visual content after mosaic processing, making the original ID number and phone number unrecognizable.

[0079] Example 3: Protection of Sensitive Data in Multiple Cells in a Table Rehabilitation assessment reports often contain detailed scoring items in tabular form, which may require watermarking certain columns (such as "scoring items") and desensitizing other columns (such as "patient name").

[0080] 1. Rule configuration: Utilize DOM structure positioning rules, such as "select all cells in the second column of the table" or "select subsequent cells in the row containing the text 'patient name'".

[0081] 2. Execution process: The recognition module locates all target cells that need to be protected based on XPath or CSS selectors (such as table tr td:nth-child(2)); The intervention module applies watermarks to the first type of cells and desensitizes and masks the second type of cells according to the configuration. Since there are a large number of target elements, a frame-by-frame rendering method based on requestAnimationFrame is used to process them in batches to avoid page lag caused by a large number of DOM operations at once.

[0082] In the final generated image, different columns of the table exhibit different protection effects, satisfying both privacy protection needs and preserving data usability.

[0083] Example 4: Performance Optimization Scenario When dozens of sensitive areas in the same report need to be processed simultaneously, the intervention module starts an asynchronous batch processing mechanism, putting DOM modification operations into a micro-task queue in batches or using setTimeout to split them, ensuring that the workload of each frame is controlled within a reasonable range; at the same time, requestAnimationFrame is used to perform batch modifications before the start of each frame to ensure smooth animation and no delay in user interaction.

[0084] Example 5: Details of Dynamic Watermark Generation Each time the timestamp in the watermark layer is generated, `new Date().toISOString()` is called to obtain the current UTC time, accurate to milliseconds (e.g., 2024-04-25T08:30:15.456Z). The user identifier is obtained from the current login session (e.g., UserID: 12345). The two are combined, drawn as a texture using a Canvas, and then tiled onto the target element as the background image. This process is entirely completed on the front end, without server intervention, and each generation is different, ensuring that each image has a unique fingerprint.

[0085] Other implementation variations: Overlay optimization: In addition to solid color block masking, Gaussian blur desensitization can also be achieved using backdrop-filter: blur(10px), which does not require Canvas and has better performance.

[0086] Watermark style: The watermark density, color, and angle can be adjusted as needed, or more complex patterns (such as QR codes) can be used to enhance traceability.

[0087] Interaction Penetration: All overlay and watermark layers are set to pointer-events: none to ensure that users can still interact with the original form elements (such as clicking on the input box) without affecting normal business operations.

[0088] In summary, this invention achieves pixel-level precise intervention in sensitive areas of rehabilitation assessment reports through a real-time preprocessing step before front-end image conversion. It can both strongly desensitize and protect core privacy, and embed dynamic traceability watermarks. Moreover, the entire process is completed on the browser side without relying on a server, which significantly improves the security and processing efficiency of medical data.

[0089] It should be noted that the sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, apparatus, article, or method that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, apparatus, article, or method. Without further limitations, an element defined by the phrase "comprising one…" does not exclude the presence of other identical elements in the process, apparatus, article, or method that includes that element.

[0090] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes several instructions to cause a terminal device (which may be a mobile phone, computer, electronic device, or network device, etc.) to execute the methods described in the various embodiments of the present invention.

[0091] The above are merely preferred embodiments of the present invention and do not limit the scope of the patent. Any equivalent structural or procedural transformations made based on the description and drawings of the present invention, or direct or indirect applications in other related technical fields, are similarly included within the scope of patent protection of the present invention.

Claims

1. A method for generating a rehabilitation assessment report, characterized in that, Applied to the browser, including: The HTML page that renders the rehabilitation assessment report; Scan the DOM tree of the HTML page and identify at least one target element containing sensitive information according to the preset sensitive area identification rules; Based on the protection strategy corresponding to each target element, privacy intervention processing is performed on the target element; The image conversion library is called to convert the privacy-modified DOM tree into an image, and the image is output. The privacy intervention process includes: For a target element configured with a desensitization strategy, create an overlay layer on the target element that matches its position and size, and apply a visual desensitization effect to the overlay layer; For a target element configured with a watermarking policy, a dynamically generated watermark layer is overlaid on the target element. The watermark layer contains the unique identifier of the current operating user and the generation timestamp.

2. The method for generating a rehabilitation assessment report according to claim 1, characterized in that, The sensitive area identification rules include at least one of the following: CSS class name or ID matching rules, regular expression data format matching rules, and DOM structure positioning rules.

3. The method for generating a rehabilitation assessment report according to claim 1, characterized in that, The visual desensitization effects include at least one of the following: Gaussian blur, mosaic, solid color block masking, and text replacement.

4. The method for generating a rehabilitation assessment report according to claim 1, characterized in that, The watermark layer is a semi-transparent text layer that is rotated at a certain angle and tiled within the target element area, and its generated timestamp is accurate to the millisecond level.

5. The method for generating a rehabilitation assessment report according to claim 1, characterized in that, The privacy intervention process modifies the original DOM elements in real time before calling the image conversion library, so that the subsequent image conversion captures the visual effect after intervention.

6. The method for generating a rehabilitation assessment report according to any one of claims 1-5, characterized in that, Also includes: A configuration interface is provided for presetting the sensitive area identification rules and assigning desensitization or watermark protection strategies to different sensitive areas.

7. The method for generating a rehabilitation assessment report according to any one of claims 1-5, characterized in that, The overlay or watermark layer is set to not respond to mouse events via CSS properties, so that mouse operations can penetrate to the underlying original element.

8. The method for generating a rehabilitation assessment report according to any one of claims 1-5, characterized in that, When multiple target elements require privacy intervention, performance optimization is achieved by using asynchronous batch processing or frame-by-frame rendering based on animation frames.

9. The method for generating a rehabilitation assessment report according to any one of claims 1-5, characterized in that, The generation timestamp in the watermark layer is obtained in real time based on the browser's system time, and combined with the unique identifier of the current user, and then embedded into the target element area through an irreversible visual overlay method.

10. A device for generating rehabilitation assessment reports, characterized in that, include: The rendering module is used to render the HTML pages of the rehabilitation assessment reports; The identification module is used to scan the DOM tree of the HTML page and identify at least one target element containing sensitive information according to the preset sensitive area identification rules. An intervention module is used to perform privacy intervention processing on the target elements according to the protection strategy corresponding to each target element; wherein, the privacy intervention processing includes: for target elements configured with a desensitization strategy, creating an overlay layer on the target element that matches its position and size, and applying a visual desensitization effect on the overlay layer; for target elements configured with a watermark strategy, overlaying a dynamically generated watermark layer on the target element, the watermark layer containing the unique identifier of the current operating user and the generation timestamp; The conversion module is used to call an image conversion library to convert the privacy-intervention-processed DOM tree into an image and output the image.