Microsoft and WPS compatible decoding method, device and equipment and storage medium
By building a dynamic adaptation mechanism and a layered pointer system, the compatibility issues between Microsoft and WPS encoding methods were resolved, enabling efficient and accurate data analysis of the attendance machine system and improving system stability and configuration efficiency.
Patent Information
- Application Number
- CN202510976394.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-16
- Publication Date
- 2025-09-09
AI Technical Summary
Existing technologies are unable to effectively support decoding schemes for Microsoft and WPS encoding methods, resulting in errors and data loss when the attendance machine system parses configuration files, increasing operational complexity and reducing configuration efficiency and accuracy.
By building a dynamic adaptation mechanism, using a hierarchical pointer system to identify encoding types, establishing a structured parsing framework, setting paragraph, sentence and data pointers, and accurately extracting valid data units, redundant information interference caused by encoding differences is eliminated.
It realizes automatic recognition and compatible parsing of Microsoft and WPS encoding formats, eliminates parsing errors, improves decoding efficiency and system stability, and avoids waste of hardware resources.
Smart Images

Figure CN120611700A_ABST
Abstract
Claims
1. A decoding method compatible with Microsoft and WPS, characterized in that: The method is used for a clock-in machine chip, and the method includes: Read the imported configuration file, extract the data of the first target number of bytes before the file, and determine the source software and encoding method of the file by searching for the target string; Determine the header file position area in the configuration file according to the determined target software and filter it. Taking the end of the header file as the starting point, set a group of paragraph pointers, a group of sentence pointers, and a group of data pointers respectively, which are used to locate the paragraph position, sentence position, and data position of the file respectively; Read the paragraphs in the configuration file according to the paragraph pointers, read the sentences in the paragraphs based on the sentence pointers, and read the valid unit data in the sentences based on the sentence pointers; Configure the extracted valid unit data into the attendance system.
2. The method according to claim 1, characterized in that When it is determined that the file uses Microsoft encoding, read the first 43,000 characters of the configuration file, determine it as the header file position area and filter it, and set a pointer starting from the end of the header file; When it is determined that the file uses WPS encoding, read the first 39,794 characters of the configuration file, determine it as the header file position area and filter it, and set a pointer starting from the end of the header file.
3. The method according to claim 1, characterized in that The paragraph pointer includes a paragraph start pointer and a paragraph end pointer, which are used to locate the start position and end position of the paragraph respectively; The sentence pointer includes a sentence start pointer and a sentence end pointer, which are used to locate the start position and end position of the sentence respectively; The data pointer includes a data start pointer and a data end pointer, which are used to locate the start position and end position of the unit data respectively.
4. The method according to claim 3, characterized in that The paragraph start pointer scans the string <Row ss: as the starting position of the paragraph, and scans the string as the end position of the paragraph; The data between <Row ss: and is determined as a valid paragraph; In the valid paragraph, the sentence pointer scans the string <Cell ss: as the starting position of the sentence, and scans the string as the end position of the paragraph; The data between <Cell ss: and is determined as a valid sentence; In the valid sentence, the data pointer scans the string <Data ss: as the starting position of the data, and scans the string as the end position of the data; The data between <Data ss: and is determined as valid unit data.
5. The method according to claim 4, characterized in that For Microsoft encoding files, the string / n at the end of the sentence indicates the end flag of the sentence; When the string <Cell ss: is scanned in the valid sentence and the matching string is not scanned, or the string <Cell ss: is scanned and the string <Data ss: is not scanned, or the string <Cell ss: is scanned and the string is not scanned, it indicates that there is no valid data in this sentence, and the end of the sentence is determined based on the string / n.
6. The method according to claim 5, characterized in that For a WPS encoded file, when the string <Cell ss: is scanned in a valid paragraph and no matching string is scanned, the end pointer of the paragraph is scanned 13 characters downward from the position of the start pointer of the paragraph, and other strings are further detected from the next two characters; when the string / > appears, it indicates that there is no valid data in this paragraph, and the string / > is used to represent the end flag of the paragraph.
7. The method according to claim 5 or 6, characterized in that The end pointer of the paragraph is scanned in sequence from the start pointer of the paragraph to the end flag of the paragraph, where when the end pointer of the paragraph moves to a position greater than the end pointer of the segment, it indicates that the statement exceeds the current paragraph, and the start pointer of the segment is directly moved to the position of the next string <Row ss: to enter the decoding configuration of the next paragraph; when the end pointer of the paragraph moves to a position less than the end pointer of the segment, it indicates that the statement does not exceed the current paragraph, and the start pointer of the data is scanned from the position of the start pointer of the paragraph to the position of the target number of characters after the string <Data ss:; when the start pointer of the data moves to a position greater than the end pointer of the paragraph, it indicates that there is no valid data in this paragraph, and blank data is configured into the attendance machine system; when the start pointer of the data moves to a position less than the end pointer of the paragraph, the end pointer of the data is scanned from the position of the start pointer of the paragraph to the string position, and the data between the start pointer of the data and the end pointer of the data is extracted and configured into the attendance machine system.
8. A decoding device compatible with Microsoft and WPS, characterized in that: The device includes: a matching module, configured to read the imported configuration file, extract the data of the target number of bytes at the beginning of the file, and determine the source software and encoding method of the file by searching for the target string; a setting module, configured to determine the position area of the header file in the configuration file according to the determined target software and filter it, and starting from the end of the header file, set a group of paragraph pointers, a group of paragraph pointers, and a group of data pointers respectively for positioning the paragraph position, paragraph position, and data position of the file; an extraction module, configured to read the paragraphs in the configuration file according to the paragraph pointer, read the paragraphs in the paragraph based on the paragraph pointer, and read the valid unit data in the paragraph based on the paragraph pointer; a configuration module, configured to configure the extracted valid unit data into the attendance machine system.
9. A computer device, characterized in that: The computer device includes a processor and a memory, and at least one instruction, at least one program, a code set or an instruction set is stored in the memory, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement the decoding method compatible with Microsoft and WPS according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that At least one instruction, at least one program, a code set or an instruction set is stored in the readable storage medium, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement the decoding method compatible with Microsoft and WPS according to any one of claims 1 to 7.