Middleware improvement system and method supporting operation of Java Applet in modern Linux system
Through the design of dynamic frame communication, encoding conversion and compatibility interface layer, the compatibility problem of Java Applet in modern Linux systems is solved, the stability and compatibility of data transmission is achieved, and the normal operation of Java Applet in modern Linux systems and the reliability of data transmission is ensured.
Patent Information
- Application Number
- CN202510328584.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-19
- Publication Date
- 2025-07-04
AI Technical Summary
Java Applet has compatibility problems in modern Linux systems, especially in the new version of the operating system, which affects the performance and reliability of the application. The old version of the IcedTea project is no longer maintained, making it difficult to adapt to the new features of the modern operating system.
The dynamic frame communication module is used to encapsulate and parse data packets. The encoding and conversion module converts non-UTF-8 encodings into UTF-8 format. The compatibility interface layer simulates the traditional Java plug-in API interface, and detects communication timeout or verification failure through the exception handling module to trigger the packet retransmission mechanism to ensure the stability and compatibility of data transmission.
It realizes the stable operation of Java Applet in modern Linux systems, reduces system upgrade costs and risks, improves application availability and maintainability, ensures the reliability and integrity of data transmission, and solves the compatibility problem of Java Applet in modern Linux systems.
Smart Images

Figure CN120263840A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer software technology, and particularly to an improved middleware system and method for supporting the operation of Java Applets in modern Linux systems. Background Art
[0002] Since the advent of Java Applet technology in 1995, as an important tool for embedding Java applications into web pages, it has occupied a prominent position in the field of enterprise application development. An Applet is a special Java program that can be embedded in an HTML document. It is loaded by a browser and executed on the client side, with characteristics such as cross-platform, high security, and powerful interaction capabilities. Especially in fields such as finance and government affairs, Applet technology has been widely used due to its ability to access local resources, such as print support, data encryption services, and hardware device control.
[0003] The operating mechanism of Java Applet depends on the Java plugin installed in the web browser, such as Oracle JavaPlugin or IcedTea. When a user browses a web page containing an Applet tag, the browser will detect the tag and trigger a series of operations: loading the Java plugin, downloading and verifying the Applet class file, and starting the local Java Virtual Machine (JVM) to execute the Applet code. This mechanism allows web applications to break through the security restrictions of the browser sandbox and directly interact with the user's local system.
[0004] However, with the development of web technology and security standards, the limitations of Java Applet technology have gradually emerged. First, the version compatibility issue has become a major challenge. Especially in the Linux environment, the IcedTea project stopped supporting web Applets after version 1.8, which makes applications relying on old Applets unable to operate properly in the updated environment. Second, legacy versions of IcedTea (such as version 1.6) can still provide a certain degree of support, but these versions are no longer maintained and are difficult to adapt to the new features of modern operating systems, resulting in problems such as blocking in new distributions such as Ubuntu 20.04, seriously affecting the performance and reliability of applications.
[0005] In view of the above problems, for systems that still rely on Java Applet technology, there is an urgent need for a solution to ensure their stable operation on modern operating systems while meeting the requirements of security and maintainability. Especially in traditional industries, the migration of core business systems often requires a long time cycle, so the improvement of existing technologies is particularly important. This not only helps to ensure the continuous and reliable operation of these systems, but also provides a transition space for future comprehensive technology upgrades, ensuring business continuity while reducing migration costs. In addition, improving existing technologies is also an important measure to enhance the system's security protection level, thereby protecting users from increasingly complex network threats. Summary of the Invention
[0006] The technical problem to be solved by the present invention: In view of the above problems of the existing technology, a middleware improvement system and method for supporting Java Applet to run on modern Linux systems with high data transmission reliability and good compatibility are provided.
[0007] To solve the above technical problems, the technical solutions adopted by the present invention are as follows:
[0008] A middleware improvement system for supporting Java Applet to run on modern Linux systems, including:
[0009] A dynamic frame communication module for encapsulating and parsing data packets; the dynamic frame communication module includes a dynamic frame structure, and the dynamic frame structure sequentially includes a frame header, a length field, a data payload, a checksum, and an end identifier;
[0010] An encoding conversion module for detecting the character encoding format of the input data and converting non-UTF-8 encoded data into UTF-8 format for transmission;
[0011] A compatibility interface layer for simulating traditional Java plug-in API interfaces to receive unmodified Applet code call instructions.
[0012] As a further improvement of the method of the present invention: The frame header structure in the dynamic frame communication module includes a magic number, a version number, a flag bit, and a length field. The magic number is a 4-byte fixed value used to identify the frame type. The version number includes a major version number and a minor version number. The flag bit is used to identify the compression, encryption, and fragmentation attributes of the data frame. The length field represents the length of the data payload in network byte order.
[0013] As a further improvement of the method of the present invention: The checksum in the dynamic frame structure is located after the data payload and before the end identifier, and is implemented using a specified data verification algorithm.
[0014] As a further improvement of the method of the present invention: The encoding conversion module includes:
[0015] An encoding detection unit for detecting the encoding type of input data;
[0016] An encoding conversion unit for converting non-UTF-8 encoded data into UTF-8 format;
[0017] An output unit for returning the converted UTF-8 string;
[0018] A special character processing unit for detecting and processing invalid or unmappable characters that occur during the encoding conversion process, and maintaining data integrity through a replacement strategy; the replacement strategy includes using Unicode replacement characters to replace invalid byte sequences, and normalizing escape characters to ensure cross-platform compatibility.
[0019] As a further improvement of the method of the present invention: the encoding detection unit checks the first few bytes of the input data to determine whether there is a BOM marker. If a BOM marker is detected, the corresponding encoding type is returned. Otherwise, the encoding type is inferred by a heuristic method.
[0020] As a further improvement of the method of the present invention: after receiving the encoding type returned by the encoding detection unit, the encoding conversion unit converts the original byte array into a string according to the encoding type, and re-encodes the string into UTF-8 format.
[0021] As a further improvement of the method of the present invention: the system further includes an exception handling module, which is used to trigger a packet retransmission mechanism when a communication timeout or a checksum failure is detected to achieve the stability of data transmission; the communication timeout means that the packet fails to complete transmission within the specified time, and the checksum failure means that the checksum of the packet is inconsistent with the received checksum.
[0022] As a further improvement of the method of the present invention: the exception handling module includes:
[0023] A retry unit for automatically triggering a retry request when a communication timeout or failure occurs to achieve the stability of data transmission; the retry unit attempts to re-send the packet multiple times at a determined interval according to a preset retry strategy until the packet is successfully transmitted or the maximum number of retries is reached;
[0024] A timeout control unit for setting the timeout for each request to avoid long-term blocking of network communication or data transmission;
[0025] A data integrity verification unit for detecting the integrity of the packet by calculating and comparing the checksum when the data sending request is made and the checksum after the receiving end receives the data. If the checksum does not match, the packet exception handling process is triggered.
[0026] The present invention also provides an improved method for middleware to support the operation of Java Applets in modern Linux systems, including:
[0027] Using a dynamic frame communication module to encapsulate and parse data packets. The dynamic frame communication module includes a dynamic frame structure, and the dynamic frame structure includes a frame header, a length field, a data payload, a checksum, and an end identifier;
[0028] During the process of encapsulating and parsing data packets, using an encoding conversion module to detect the character encoding format of the input data, and converting non-UTF-8 encoded data into UTF-8 format for transmission;
[0029] Using a compatibility interface layer to simulate the traditional Java plug-in API interface to receive unmodified Applet code call instructions and achieve compatibility with existing Applet application code.
[0030] As a further improvement of the method of the present invention: during the data transmission process, it also includes using an exception handling module to detect whether there is a communication timeout or whether the check fails. If a communication timeout or a check failure is detected, a data packet retransmission mechanism is triggered to achieve the stability of data transmission; the communication timeout refers to that the data packet fails to complete transmission within the specified time, and the check failure refers to that the checksum of the data packet is inconsistent with the received checksum.
[0031] Compared with the prior art, the beneficial effects of the present invention are as follows:
[0032] 1. By setting up a dynamic frame communication module, an encoding conversion module, and a compatibility interface layer, the present invention effectively solves the compatibility problem of Java Applets running in modern Linux systems. The dynamic frame communication module encapsulates and parses data packets using a specific dynamic frame structure, ensuring the integrity and reliability of data transmission and improving the stability of communication; the encoding conversion module can automatically detect the character encoding format of the input data and convert non-UTF-8 encoded data into UTF-8 format for transmission, solving the character encoding compatibility problem and ensuring the consistency of data in different operating system environments; the compatibility interface layer simulates the traditional Java plug-in API interface, enabling unmodified Applet code to be normally called, achieving compatibility with existing Applet application code, without the need to modify the code of the deployed application system, reducing the cost and risk of system upgrade, and improving the usability and maintainability of the application. In summary, this technical solution provides an effective, stable, and highly compatible middleware improvement system for supporting the operation of Java Applets in modern Linux systems, with high practical value and promotional significance.
[0033] 2. Further, the present invention uses an exception handling module to detect communication timeouts or verification failures during data transmission, and triggers a data packet retransmission mechanism when the above situations are detected, effectively avoiding possible data loss or errors during data transmission, improving the reliability and stability of data transmission, ensuring the integrity and accuracy of data, and reducing the risk of abnormal operation or failure of the application caused by data transmission problems. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] Figure 1 It is a schematic structural diagram of an improved middleware system for supporting Java Applet to run on a modern Linux system in an embodiment of the present invention.
[0035] Figure 2 It is a schematic diagram of the data flow of the Applet in an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0036] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
[0037] As Figure 1 shown, an improved middleware system for supporting Java Applet to run on a modern Linux system in this embodiment includes:
[0038] A dynamic frame communication module for encapsulating and parsing data packets. The dynamic frame communication module includes a dynamic frame structure, and the dynamic frame structure includes a frame header, a length field, a data payload, a checksum, and an end identifier;
[0039] An encoding conversion module for detecting the character encoding format of the input data and converting non-UTF-8 encoded data into UTF-8 format for transmission;
[0040] A compatibility interface layer for simulating a traditional Java plug-in API interface to receive unmodified Applet code call instructions.
[0041] As Figure 2As shown in the figure, in this embodiment, through the design of the compatibility interface layer, the system can seamlessly dock with the traditional Java plug-in API interface, ensuring that the unmodified Applet code can be normally called. Specifically, the Applet in the browser interacts with the local Java environment through the C++ side of IcedTea, while the Java side of IcedTea is responsible for communicating with components (such as CTPDeviceDriver) in the local Java environment. This design enables the Applet to run normally in modern Linux systems without any code modification.
[0042] The following is a specific implementation code example:
[0043]
[0044]
[0045] In the above code, the LegacyAdapter class implements the processing of legacy requests through the handleLegacyRequest method. First, it converts the legacy request format to the new format, then processes the request, and finally converts the response back to the legacy format. This design ensures that the legacy Applet code can run normally in the new system environment without code modification, thus achieving backward compatibility. Through this compatibility design, the system not only reduces the cost and risk of system upgrade, but also improves the usability and maintainability of the application, ensuring stable support for browser Java Applet applications in the modern Linux system environment.
[0046] In this embodiment, by setting the above dynamic frame communication module, encoding conversion module, and compatibility interface layer, the compatibility problem of Java Applet in modern Linux system operation is effectively solved. The dynamic frame communication module encapsulates and parses data packets using a specific dynamic frame structure, ensuring the integrity and reliability of data transmission and improving the stability of communication; the encoding conversion module can automatically detect the character encoding format of the input data and convert non-UTF-8 encoded data to UTF-8 format for transmission, solving the character encoding compatibility problem and ensuring the consistency of data in different operating system environments; the compatibility interface layer simulates the traditional Java plug-in API interface, enabling the unmodified Applet code to be normally called, achieving compatibility with the existing Applet application code, without the need to modify the code of the deployed application system, reducing the cost and risk of system upgrade, and improving the usability and maintainability of the application.
[0047] In this embodiment, the frame header structure in the dynamic frame communication module includes a magic number, a version number, a flag bit, and a length field. The magic number is a 4-byte fixed value used to identify the frame type. The version number includes a major version number and a minor version number. The flag bit is used to identify the compression, encryption, and fragmentation attributes of the data frame. The length field represents the data payload length in network byte order.
[0048] In this embodiment, by setting a magic number, a version number, a flag bit, and a length field in the frame header structure of the dynamic frame communication module, key information such as the type, version information, and data payload length of the data frame can be identified and described more accurately. The setting of the magic number helps to quickly identify the type of the data frame, ensuring that the data frame can be correctly parsed and processed; the setting of the version number enables the system to be compatible with different versions of the data frame format, improving the scalability and adaptability of the system; the setting of the flag bit can flexibly identify the compression, encryption, and fragmentation attributes of the data frame, providing more flexibility and security for data transmission; the length field represents the data payload length in network byte order, ensuring the compatibility and consistency of the data frame in different operating systems and network environments, and further improving the reliability and stability of data transmission.
[0049] In this embodiment, the checksum in the dynamic frame structure is located after the data payload and before the end identifier, and is implemented using a specified data check algorithm.
[0050] In a specific application embodiment, the frame header structure in the dynamic frame communication module contains multiple key fields to ensure the accurate identification and processing of data frames. Specifically, the frame header structure includes a magic number, a version number, a flag bit, and a length field. Among them, the magic number is a 4-byte fixed value used to clearly identify the frame type, ensuring that the receiving end can quickly and accurately identify the type of the data frame, so as to perform correct parsing and processing; the version number consists of a major version number and a minor version number, a total of 2 bytes, used to identify the protocol version followed by the data frame, enabling the system to be compatible with different versions of the data frame format and enhancing the scalability and adaptability of the system; the flag bit is 2 bytes, used to identify multiple attributes of the data frame, including a compression flag, an encryption flag, and a fragmentation flag. Through these flag bits, the sending end and the receiving end can clearly know whether the data frame has been compressed, encrypted, or fragmented, and thus take corresponding processing measures, improving the flexibility and security of data transmission; the length field represents the data payload length in network byte order, which is 4 bytes, used to inform the receiving end of the total length of the data payload part, enabling the receiving end to accurately read and process the data payload, avoiding data parsing errors or data loss caused by unclear data lengths.
[0051] Furthermore, in this embodiment, the checksum in the dynamic frame structure is set after the data payload and before the end identifier, and is calculated and implemented using a specified data verification algorithm. This layout design enables the checksum to cover the entire data payload part, thereby effectively detecting whether errors or tampering occur during data transmission. Specifically, the data frame contains dynamic length information, check codes, and special end identifiers. This structural design not only ensures the integrity and reliability of data transmission but also cleverly avoids conflicts with the operating system security check mechanism, improving the compatibility and stability of the data frame in the modern operating system environment.
[0052] The specific details of the frame format are as follows:
[0053] The frame format is in sequence: [Frame Header (8 bytes)][Length Field (4 bytes)][Data Payload][Checksum (4 bytes)][End Identifier (4 bytes)].
[0054] Detailed description of the frame header structure:
[0055] Magic Number (4 bytes): The fixed value is 0x49544541 ("ITEA"), which is used to identify the frame type.
[0056] Version Number (2 bytes): Includes the major version number and the minor version number, which are used to identify the protocol version.
[0057] Flag Bits (2 bytes):
[0058] Bit 0: Compression Flag, which is used to indicate whether the data frame is compressed.
[0059] Bit 1: Encryption Flag, which is used to indicate whether the data frame is encrypted.
[0060] Bit 2: Fragmentation Flag, which is used to indicate whether the data frame is fragmented data.
[0061] Bits 3 - 15: Reserved Extension Bits, which provide space for future function expansion.
[0062] The length field uses a 32-bit unsigned integer to represent the total length of the data payload part in network byte order (big-endian). The maximum payload capacity can reach 16MB, meeting the requirements for large data volume transmission.
[0063] Regarding the implementation of the checksum, it is calculated and verified through the FrameChecksum class in the following Java code:
[0064]
[0065] In this embodiment, the encoding conversion module includes:
[0066] The encoding detection unit is used to detect the encoding type of the input data;
[0067] The encoding conversion unit is used to convert non-UTF-8 encoded data into UTF-8 format;
[0068] The output unit is used to return the converted UTF-8 string;
[0069] The special character processing unit is used to detect and process invalid or unmappable characters that occur during the encoding conversion process, and maintain data integrity through a replacement strategy; the replacement strategy includes using the Unicode replacement character (U+FFFD) to replace invalid byte sequences, and normalizing escape characters to ensure cross-platform compatibility.
[0070] In this embodiment, the encoding detection unit checks the first few bytes of the input data to determine whether there is a BOM mark. If a BOM mark is detected, the corresponding encoding type is returned. Otherwise, the encoding type is inferred by a heuristic method.
[0071] Specifically, the encoding detection unit checks the input data to determine the encoding type of the input data. This unit determines whether there is a BOM (Byte Order Mark) mark by looking at the first few bytes of the input data. If a BOM mark is detected, the encoding type corresponding to the BOM mark is directly returned, such as UTF-8, UTF-16BE, or UTF-16LE, etc. If no BOM mark is detected, the encoding detection unit uses a heuristic method to infer the encoding type. This method analyzes based on the characteristics and patterns of the input data to determine the encoding type of the input data as accurately as possible.
[0072] In this embodiment, after receiving the encoding type returned by the encoding detection unit, the encoding conversion unit converts the original byte array into a string according to the encoding type, and re-encodes the string into UTF-8 format.
[0073] Specifically, the above encoding detection and conversion functions are implemented through the EncodingHandler class in the following Java code:
[0074]
[0075]
[0076] The system of this embodiment also includes an exception handling module. The exception handling module is used to trigger a packet retransmission mechanism when a communication timeout or a checksum failure is detected to achieve the stability of data transmission; a communication timeout means that a packet fails to complete transmission within the specified time, and a checksum failure means that the checksum of a packet is inconsistent with the received checksum.
[0077] In this embodiment, the exception handling module includes:
[0078] A retry unit, which is used to automatically trigger a retry request when communication times out or fails, so as to achieve the stability of data transmission; the retry unit attempts to resend the data packet multiple times at a determined interval according to a preset retry policy until the data packet is successfully transmitted or the maximum number of retries is reached;
[0079] A timeout control unit, which is used to set the timeout time for each request to avoid long-term blocking of network communication or data transmission;
[0080] A data integrity verification unit, which detects the integrity of the data packet by calculating and comparing the checksum when the data sending request is made and after the receiving end receives the data. If the checksum does not match, it triggers the data packet exception handling process.
[0081] Specifically, as one of the core components of the exception handling module, the main function of the retry unit is to automatically trigger a retry request when communication times out or fails. The retry unit attempts to resend the data packet multiple times at a determined interval according to a preset retry policy until the data packet is successfully transmitted or the maximum number of retries is reached. This mechanism can effectively handle data transmission interruptions caused by network jitter, temporary network failures, etc., and improve the success rate of data transmission. For example, in the following code example, the sendWithRetry method of the RetryHandler class implements the retry mechanism through a loop and an exponential backoff strategy to ensure automatic retries when communication timeouts or failures occur:
[0082]
[0083]
[0084] The timeout control unit is responsible for setting the timeout time for each request to avoid long-term blocking of network communication or data transmission. A reasonable setting of the timeout time is crucial for balancing the real-time performance and reliability of data transmission. If the timeout time is too short, it may lead to frequent retries and increase the network burden; while if the timeout time is too long, it will reduce the system's response speed and affect the user experience. Therefore, the timeout control unit needs to comprehensively consider factors such as network conditions, data packet size, and the application's requirements for real-time performance, and dynamically adjust the timeout time. For example, when the network condition is good, the timeout time can be appropriately shortened to improve the system's fast response ability; while when the network condition is poor, the timeout time can be appropriately extended to increase the possibility of successful data transmission. In addition, the timeout control unit can also optimize and adjust the timeout time according to the system's historical records and statistical data to adapt to different network environments and application requirements.
[0085] The data integrity verification unit detects the integrity of data packets by calculating and comparing the checksums when the data transmission request is sent and after the receiving end receives the data. The checksum is calculated through a specific data verification algorithm, which can effectively detect whether errors occur or the data is tampered with during the transmission process. If the checksums do not match, it indicates that there is a problem with the data packet during transmission. At this time, the data integrity verification unit will trigger the data packet exception handling process, such as requesting the retransmission of the data packet, etc.
[0086] Through this verification mechanism, it can be ensured that the data received by the receiving end is consistent with the data sent by the sending end, thereby improving the reliability and accuracy of data transmission. Common checksum algorithms include CRC check, MD5 check, and SHA check, etc. In practical applications, an appropriate checksum algorithm can be selected according to the security and performance requirements of data transmission.
[0087] In summary, through the collaborative work of the retry unit, timeout control unit, and data integrity verification unit, the exception handling module significantly improves the stability and reliability of the system. These mechanisms can effectively handle various exception situations such as communication timeouts and verification failures, ensuring the stability of data transmission, and providing a solid technical guarantee for supporting the operation of Java Applet on modern Linux systems.
[0088] This embodiment also provides an improved method for middleware to support the operation of Java Applet on modern Linux systems, including:
[0089] Using the dynamic frame communication module to encapsulate and parse data packets. The dynamic frame communication module includes a dynamic frame structure, which sequentially includes a frame header, a length field, a data payload, a checksum, and an end identifier;
[0090] During the process of encapsulating and parsing data packets, use the encoding conversion module to detect the character encoding format of the input data, and convert non-UTF-8 encoded data into UTF-8 format for transmission;
[0091] Use the compatibility interface layer to simulate the traditional Java plug-in API interface to receive unmodified Applet code call instructions and achieve compatibility with existing Applet application code.
[0092] In this embodiment, during the data transmission process, it also includes using the exception handling module to detect whether there is a communication timeout or a verification failure. If a communication timeout or a verification failure is detected, trigger the data packet retransmission mechanism to achieve the stability of data transmission; the communication timeout refers to that the data packet fails to complete transmission within the specified time, and the verification failure refers to that the checksum of the data packet is inconsistent with the received checksum.
[0093] The above are only the preferred embodiments of the present invention, and the protection scope of the present invention is not limited to the above embodiments. All technical solutions falling within the concept of the present invention belong to the protection scope of the present invention. It should be noted that for those of ordinary skill in the art, several improvements and refinements made without departing from the principle of the present invention should also be regarded as within the protection scope of the present invention.
Claims
1. An improved middleware system for supporting the operation of Java Applets on modern Linux systems, characterized in that Comprising: A dynamic frame communication module for encapsulating and parsing data packets. The dynamic frame communication module includes a dynamic frame structure, and the dynamic frame structure includes a frame header, a length field, a data payload, a checksum, and an end identifier; An encoding conversion module for detecting the character encoding format of input data and converting non-UTF-8 encoded data into UTF-8 format for transmission; A compatibility interface layer for simulating a traditional Java plug-in API interface to receive unmodified Applet code call instructions.
2. The middleware improvement system for supporting the operation of Java Applet on modern Linux systems according to claim 1, wherein The frame header structure in the dynamic frame communication module includes a magic number, a version number, a flag bit, and a length field. The magic number is a 4-byte fixed value used to identify the frame type. The version number includes a major version number and a minor version number. The flag bit is used to identify the compression, encryption, and fragmentation attributes of the data frame. The length field represents the length of the data payload in network byte order.
3. The middleware improvement system for supporting the operation of Java Applets on modern Linux systems according to claim 1, characterized in that The checksum in the dynamic frame structure is located after the data payload and before the end identifier, and is implemented using a specified data verification algorithm.
4. The middleware improvement system for supporting the operation of Java Applets on modern Linux systems according to claim 1, characterized in that, The encoding conversion module includes: An encoding detection unit for detecting the encoding type of input data; An encoding conversion unit for converting non-UTF-8 encoded data into UTF-8 format; An output unit for returning the converted UTF-8 string; A special character processing unit for detecting and processing invalid or unmappable characters that occur during the encoding conversion process, and maintaining data integrity through a replacement strategy; the replacement strategy includes using Unicode replacement characters to replace invalid byte sequences and normalizing escape characters to ensure cross-platform compatibility.
5. The middleware improvement system for supporting the operation of Java Applets on modern Linux systems according to claim 4, characterized in that, The encoding detection unit checks the first few bytes of the input data to determine whether there is a BOM marker. If a BOM marker is detected, the corresponding encoding type is returned. Otherwise, the encoding type is inferred by a heuristic method.
6. The middleware improvement system for supporting the operation of Java Applets on modern Linux systems according to claim 4, wherein After receiving the encoding type returned by the encoding detection unit, the encoding conversion unit converts the original byte array into a string according to the encoding type and re-encodes the string into UTF-8 format.
7. The middleware improvement system for supporting the operation of Java Applets on modern Linux systems according to claim 1, wherein The system further includes an exception handling module for triggering a data packet retransmission mechanism when communication timeout or checksum failure is detected to achieve the stability of data transmission; the communication timeout means that the data packet fails to complete transmission within the specified time, and the checksum failure means that the checksum of the data packet is inconsistent with the received checksum.
8. The middleware improvement system for supporting the operation of Java Applets in modern Linux systems according to claim 7, wherein The exception handling module includes: A retry unit for automatically triggering a retry request when communication timeout or failure occurs to achieve the stability of data transmission; the retry unit attempts to re-send the data packet multiple times at determined intervals according to a preset retry strategy until the data packet is successfully transmitted or the maximum number of retries is reached; A timeout control unit for setting the timeout time for each request to avoid long-term blocking of network communication or data transmission; A data integrity verification unit for detecting the integrity of the data packet by calculating and comparing the checksum when the data transmission request is sent and after the receiving end receives the data. If the checksum does not match, the data packet exception handling process is triggered.
9. An improved method for middleware to support the operation of Java Applets on modern Linux systems, characterized in that, Comprising: The dynamic frame communication module is used to encapsulate and parse data packets. The dynamic frame communication module includes a dynamic frame structure, and the dynamic frame structure includes a frame header, a length field, a data payload, a checksum, and an end identifier; During the process of encapsulating and parsing data packets, the encoding conversion module is used to detect the character encoding format of the input data, and convert the non-UTF-8 encoded data into UTF-8 format before transmission; The compatibility interface layer is used to simulate the traditional Java plug-in API interface to receive the unmodified Applet code call instructions and achieve compatibility with the existing Applet application code.
10. The middleware improvement method for supporting the operation of Java Applet in modern Linux systems according to claim 9, characterized in that, During the data transmission process, it also includes using an exception handling module to detect whether there is a communication timeout or whether the verification fails. If a communication timeout or verification failure is detected, a data packet retransmission mechanism is triggered to achieve the stability of data transmission; the communication timeout refers to that the data packet fails to complete transmission within the specified time, and the verification failure refers to that the checksum of the data packet is inconsistent with the received checksum.