Excel data display and update monitoring method and related device thereof

By using the XLSX plugin to parse and convert JSON format, it enables automated updates and multi-user collaboration of Excel data, solving the problem of manual handling of data changes in Excel files and reducing the workload of developers.

CN115408994BActive Publication Date: 2026-11-24CHINA PING AN PROPERTY INSURANCE CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202211086177.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-06
Publication Date
2026-11-24
Estimated Expiration
2042-09-06

AI Technical Summary

Technical Problem

In the settlement system, data changes in Excel files require developers to manually replace static files or server data items, which increases workload and operation time costs, and cannot achieve automated data adjustment by authorized personnel or collaborative viewing by multiple people.

Method used

By using the pre-set XLSX plugin to parse data files uploaded by authorized users, convert them into JSON format, map them to Excel files, and perform event monitoring and adaptive adjustments, the system enables automated data updates and multi-user collaboration.

Benefits of technology

It reduced the workload of developers, enabled automated adjustment of Excel data and collaborative viewing by multiple users, and avoided redeployment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115408994B_ABST
    Figure CN115408994B_ABST
Patent Text Reader

Abstract

This application belongs to the field of R&D management and is applied to the field of rapid compilation of Excel files. It relates to an Excel data display and update monitoring method, apparatus, computer equipment, and storage medium, including: acquiring a data file; parsing it into raw data to be filled into an Excel file; performing format conversion and data reorganization on the raw data; acquiring the reorganized data one by one, mapping the data to the corresponding fill cells in the Excel file to complete the initial generation of the Excel file; monitoring events in the initialized Excel file, and determining and updating the data in the Excel file after a corresponding preset event is triggered based on the event monitoring results. This application facilitates automated data adjustment based on changes made to Excel data by authorized personnel, and also facilitates collaborative viewing and modification by multiple people. Furthermore, modifications do not require developers to redeploy the data, reducing the workload of developers.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the fields of R&D management and rapid compilation of Excel files, and in particular to an Excel data display and update monitoring method and related equipment. Background Technology

[0002] In the settlement system, different institutions need to conduct data review and settlement for orders or service items, as well as other business process scenarios. Different business scenarios require different data to be entered into Excel files for institutions to process corresponding business. The contents of the Excel files will also change as business functions change. If it involves administrators or authorized personnel to make changes to the Excel files, it is necessary to contact the developers to replace the static files or directly add, delete, or modify data items on the server. Moreover, the changes need to be deployed to take effect, which increases the workload of developers and the operation time cost of institutional users. Summary of the Invention

[0003] The purpose of this application is to propose an Excel data display and update monitoring method and related equipment, so as to automatically adjust the data according to the changes made to the Excel data by authorized personnel, facilitate multiple people to view and modify it collaboratively, and eliminate the need for developers to redeploy the data after modification, thus reducing the workload of developers.

[0004] To address the aforementioned technical problems, this application provides a method for displaying and monitoring Excel data updates, employing the following technical solution:

[0005] An Excel data display and update monitoring method includes the following steps:

[0006] Retrieve data files uploaded by authorized personnel;

[0007] The file stream corresponding to the data file is read based on the preset XLSX plugin, and the data file is parsed into the original data of the preset Excel file to be filled;

[0008] The original data is converted into JSON format data;

[0009] Using the key value in the JSON format data as the array name, add the value corresponding to the same key value to the array one by one in the order in the JSON format data;

[0010] Based on the custom column names and the array names corresponding to each column name in the Excel file, the target data to be filled into the Excel file is obtained, and the target data is reorganized into JSON format based on each column name;

[0011] The recombined JSON data is obtained one by one, and the key values ​​in the JSON data are mapped to the corresponding column fill cells in the Excel file. The elements in the array corresponding to the key value are inserted one by one into the row fill cells corresponding to the column name according to the array sequence to complete the initial generation of the Excel file.

[0012] Event monitoring is performed on the initial generation of the Excel file. Based on the event monitoring results, the data in the Excel file after the corresponding preset event is triggered is determined and updated.

[0013] Furthermore, the preset XLSX plugin includes an encoding process and a decoding process, and the step of reading the file stream corresponding to the data file based on the preset XLSX plugin includes:

[0014] The encoding process is performed on the file stream corresponding to the data file using a preset encoding function, and the data file is encoded into an ASCII string in Base64 encoding format;

[0015] The ASCII string is decoded using a preset decoding function to obtain the decoded data that will be displayed in the Excel file.

[0016] Furthermore, the preset XLSX plugin also includes a transcoding process. Before the step of using a preset encoding function to perform the encoding process on the file stream corresponding to the data file to encode the data file into a Base64 encoded ASCII string, the method further includes:

[0017] Based on a preset character byte count reference table, determine whether there are characters exceeding one byte in the file stream corresponding to the data file;

[0018] If the file stream corresponding to the data file contains a character that is more than one byte long, the character is converted into a one-byte character using a preset encoding function;

[0019] The transcoded character is then re-inserted into the position of its original counterpart in the file stream, and the file stream is updated to serve as the file stream corresponding to the data file.

[0020] Furthermore, after the steps of obtaining the reconstructed JSON format data one by one, mapping the key values ​​in the JSON format data to the corresponding column fill cells in the Excel file, and inserting the elements in the array corresponding to the key values ​​one by one into the row fill cells corresponding to the column names according to the array sequence, the method further includes:

[0021] Determine whether the distances between the fill data in the column fill cell and the row fill cell and the top and bottom borders and left and right borders of the fill cell all meet the corresponding preset distance thresholds;

[0022] If the distance between at least one of the top and bottom borders and the left and right borders of at least any of the filled cells does not meet the corresponding distance threshold, then the row height and column width of the filled cells in the Excel file are adaptively adjusted based on the preset page adaptive display framework.

[0023] Furthermore, the step of monitoring events during the initialization of the Excel file, and determining and updating the data in the Excel file after the corresponding preset event is triggered based on the event monitoring results, specifically includes:

[0024] Based on a preset event monitor, it identifies whether there are data addition, deletion, or modification events in the Excel file generated during initialization;

[0025] If any of the data addition, deletion, or modification events occur, the corresponding target data in the Excel file will be updated after the event is triggered.

[0026] Furthermore, the step of updating the corresponding target data in the Excel file after the occurrence of any of the data addition, deletion, or modification events specifically includes:

[0027] After the event is triggered, obtain the data in the Excel file, the column names and row numbers corresponding to each data item;

[0028] Based on the data in the Excel file, the column names and row numbers corresponding to each data item, the data is reorganized to generate the latest JSON format data corresponding to the Excel file;

[0029] The latest JSON format data replaces the JSON format data reconstructed from the target data, thus completing the data update.

[0030] Furthermore, the step of reorganizing the data based on the data in the Excel file, the column names and row numbers corresponding to each data item, and generating the latest JSON format data corresponding to the Excel file specifically includes:

[0031] Obtain the distinguishing identifier of the event trigger and use the distinguishing identifier as the outer key value of the latest JSON format data;

[0032] The outer value of the latest JSON format data is constructed by obtaining the data in the Excel file and the column names corresponding to each data, thus completing the construction of the latest JSON format data.

[0033] The step of obtaining the outer value of the latest JSON format data, which consists of the data in the Excel file and the column names corresponding to each data item, includes:

[0034] Obtain the column name and use the column name as the name of each array within the outer value;

[0035] Based on the column names and row numbers, the data in the Excel file are sequentially added to the corresponding arrays according to the row number sequence to complete the construction of the outer value.

[0036] To address the aforementioned technical problems, this application also provides an Excel data display and update monitoring device, which employs the following technical solution:

[0037] An Excel data display and update monitoring device, comprising:

[0038] The data acquisition module is used to acquire data files uploaded by authorized personnel.

[0039] The data parsing module is used to read the file stream corresponding to the data file based on the preset XLSX plugin, and parse the data file into the original data to be filled into the preset Excel file;

[0040] The format conversion module is used to convert the original data into JSON format data;

[0041] An array construction module is used to add the values ​​corresponding to the same key to the array one by one in the order in the JSON data, using the key value in the JSON data as the array name;

[0042] The data recombination module is used to obtain the target data to be filled into the Excel file based on the custom column names and the array names corresponding to each column name in the Excel file, and to reconstruct the target data in JSON format based on each column name;

[0043] The initialization module is used to obtain the reorganized JSON format data one by one, map the key values ​​in the JSON format data to the corresponding column fill cells in the Excel file, and insert the elements in the array corresponding to the key values ​​into the row fill cells corresponding to the column names one by one according to the array sequence, thereby completing the initialization and generation of the Excel file.

[0044] The monitoring and update module is used to monitor events during the initialization and generation of the Excel file, and based on the event monitoring results, determine and update the data in the Excel file after the corresponding preset event is triggered.

[0045] To address the aforementioned technical problems, this application also provides a computer device that employs the following technical solution:

[0046] A computer device includes a memory and a processor, wherein the memory stores computer-readable instructions, and the processor executes the computer-readable instructions to implement the steps of the Excel data display and update monitoring method described above.

[0047] To address the aforementioned technical problems, this application also provides a computer-readable storage medium, employing the technical solution described below:

[0048] A computer-readable storage medium storing computer-readable instructions, which, when executed by a processor, implement the steps of the Excel data display and update monitoring method described above.

[0049] Compared with the prior art, the embodiments of this application have the following main advantages:

[0050] The Excel data display and update monitoring method described in this application involves: acquiring a data file; parsing it into raw data to be filled into an Excel file; performing format conversion and data reorganization on the raw data; acquiring the reorganized data one by one and mapping it to the corresponding fill cells in the Excel file to complete the initial generation of the Excel file; monitoring events in the initialized Excel file; and determining and updating the data in the Excel file after a corresponding preset event is triggered based on the event monitoring results. This application facilitates automated data adjustment based on changes made to Excel data by authorized personnel, and also facilitates collaborative viewing and modification by multiple people. Furthermore, modifications do not require developers to redeploy the data, reducing their workload. Attached Figure Description

[0051] To more clearly illustrate the solutions in this application, the accompanying drawings used in the description of the embodiments of this application will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0052] Figure 1 This is an exemplary system architecture diagram to which this application can be applied;

[0053] Figure 2 A flowchart of an embodiment of the Excel data display and update monitoring method according to this application;

[0054] Figure 3 yes Figure 2 A flowchart of a specific implementation of step 202 shown;

[0055] Figure 4 yes Figure 2 A flowchart of a specific implementation of step 207 shown;

[0056] Figure 5 yes Figure 4 A flowchart of a specific implementation of step 404 shown;

[0057] Figure 6 A schematic diagram of the structure of an embodiment of the Excel data display and update monitoring device according to this application;

[0058] Figure 7 yes Figure 6 A structural diagram of one specific embodiment of 602 is shown;

[0059] Figure 8 A schematic diagram of the structure of an embodiment of the computer device according to this application. Detailed Implementation

[0060] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains; the terminology used herein in the specification of the application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application; the terms "comprising" and "having," and any variations thereof, in the specification, claims, and foregoing drawings of this application, are intended to cover non-exclusive inclusion. The terms "first," "second," etc., in the specification, claims, or foregoing drawings of this application are used to distinguish different objects, not to describe a particular order.

[0061] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.

[0062] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings.

[0063] like Figure 1 As shown, system architecture 100 may include terminal devices 101, 102, and 103, a network 104, and a server 105. Network 104 serves as the medium for providing communication links between terminal devices 101, 102, and 103 and server 105. Network 104 may include various connection types, such as wired or wireless communication links, or fiber optic cables, etc.

[0064] Users can use terminal devices 101, 102, and 103 to interact with server 105 via network 104 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 101, 102, and 103, such as web browser applications, shopping applications, search applications, instant messaging tools, email clients, social media platform software, etc.

[0065] Terminal devices 101, 102, and 103 can be various electronic devices with displays and support web browsing, including but not limited to smartphones, tablets, e-book readers, MP3 players (Moving Picture Experts Group Audio Layer III), MP4 players (Moving Picture Experts Group Audio Layer IV), laptops, and desktop computers, etc.

[0066] Server 105 can be a server that provides various services, such as a backend server that supports the pages displayed on terminal devices 101, 102, and 103.

[0067] It should be noted that the Excel data display and update monitoring method provided in this application embodiment is generally executed by a server / terminal device, and correspondingly, the Excel data display and update monitoring device is generally set in the server / terminal device.

[0068] It should be understood that Figure 1 The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included.

[0069] Continue to refer to Figure 2 The diagram illustrates a flowchart of an embodiment of the Excel data display and update monitoring method according to this application. The Excel data display and update monitoring method includes the following steps:

[0070] Step 201: Obtain the data file uploaded by authorized personnel.

[0071] In this embodiment, the authorized personnel can be an administrator or a programmer with upload permissions, and the data file refers to a Word document format file stored in a local file.

[0072] Step 202: Based on the preset XLSX plugin, read the file stream corresponding to the data file and parse the data file into the original data of the preset Excel file to be filled.

[0073] In this embodiment, the preset XLSX plugin includes an encoding process and a decoding process. The step of reading the file stream corresponding to the data file based on the preset XLSX plugin includes: using a preset encoding function to perform the encoding process on the file stream corresponding to the data file, encoding the data file into an ASCII string in Base64 encoding format; using a preset decoding function to perform the decoding process on the ASCII string, obtaining the decoded data to be displayed in the Excel file.

[0074] By encoding and decoding the file stream corresponding to the data file, the data transmitted by the file stream can be displayed normally on the Excel page.

[0075] In this embodiment, the encoding function can be the btoa function. Directly calling the btoa function can encode the file stream corresponding to the data file into an ASCII string in Base64 encoding format. The decoding function can be the atob function. Directly calling the atob function can decode the encoded Base64 encoded ASCII string into data that can be displayed in an Excel file.

[0076] In this embodiment, the preset XLSX plugin further includes a transcoding process. Before the step of using a preset encoding function to perform the encoding process on the file stream corresponding to the data file to encode the data file into an ASCII string in Base64 encoding format, the method further includes: determining whether there is a character exceeding one byte in the file stream corresponding to the data file based on a preset character byte count reference table; if there is a character exceeding one byte in the file stream corresponding to the data file, transcoding the character into a one-byte character using a preset transcoding function; re-inserting the transcoded character into the position of the character corresponding to the character before transcoding in the file stream, updating the file stream, and using the file stream as the file stream corresponding to the data file.

[0077] By checking the byte size before encoding and correcting it if the byte size is too large, unnecessary bugs are prevented from occurring when encoding the file stream due to excessively large character bytes.

[0078] In this embodiment, the transcoding function can be the toBinatyString function. Directly calling the toBinatyString function can convert characters that are more than one byte, such as characters in Unicode encoding format, into single-byte ASCII characters.

[0079] Continue to refer to Figure 3 , Figure 3 yes Figure 2 A flowchart of a specific implementation of step 202 shown includes the following steps:

[0080] Step 301: Based on the character byte count reference table, determine whether there are characters exceeding one byte in the file stream corresponding to the data file;

[0081] Step 302: If there are characters exceeding one byte in the file stream corresponding to the data file, use a preset transcoding function to transcode the characters into one-byte characters;

[0082] Step 303: Insert the transcoded character back into the position of the character corresponding to the character before transcoding in the file stream, update the file stream, and use the file stream as the file stream corresponding to the data file;

[0083] Step 304: Use a preset encoding function to perform the encoding process on the file stream corresponding to the data file, and encode the data file into an ASCII string in Base64 encoding format;

[0084] Step 305: Use a preset decoding function to perform the decoding process on the ASCII string to obtain the decoded data to be displayed in the Excel file.

[0085] Step 203: Convert the original data into JSON format.

[0086] By converting the raw data to JSON format, it becomes easier to format the data, making it easier to identify and extract.

[0087] Step 204: Using the key value in the JSON format data as the array name, add the value corresponding to the same key value to the array one by one in the order in the JSON format data.

[0088] By iterating through the JSON format data, specifically the data in the format {key1:value1; key2:value2; ...; key(i-1):value(i-1); key(i):value(i)}, key-value pairs with the same key value are identified based on the iteration results. This results in data in the format {key1:[value1,value2,...value(i-1),value(i)]; key2:[value1,value2,...value(i-1),value(i)]; ...}, facilitating integer group mapping in the Excel page. The 'i' mentioned above is merely used to represent different data within the two data formats and does not specifically refer to any numerical value.

[0089] Step 205: Based on the custom column names and the array names corresponding to each column name in the Excel file, obtain the target data to be filled into the Excel file, and reorganize the target data in JSON format based on each column name.

[0090] Using the custom column names and corresponding array names in the Excel file, the corresponding data in the format {key1:[value1,value2,…value(i-1),value(i)];key2:[value1,value2,…value(i-1),value(i)];…} is selected and reorganized into JSON format. This process involves selecting and cleaning the original data to filter out the target data.

[0091] Step 206: Obtain the recombined JSON format data one by one, map the key values ​​in the JSON format data to the corresponding column fill cells in the Excel file, and insert the elements in the array corresponding to the key values ​​into the row fill cells corresponding to the column names one by one according to the array sequence to complete the initial generation of the Excel file.

[0092] In this embodiment, a pre-defined page adaptive display framework is used. After the steps of acquiring the recombined JSON format data one by one, mapping the key values ​​in the JSON format data to the corresponding column fill cells in the Excel file, and inserting the elements in the array corresponding to the key values ​​one by one into the row fill cells corresponding to the column names according to the array sequence, the method further includes: determining whether the distance between the fill data in the column fill cells and the row fill cells and the top and bottom borders and left and right borders of the fill cells all meet the corresponding preset distance thresholds; if the distance corresponding to at least one of the top and bottom borders and left and right borders of at least any fill cell does not meet the corresponding distance threshold, then the row height and column width of the fill cells in the Excel file are adaptively adjusted based on the page adaptive display framework; until the distance corresponding to the top and bottom borders and left and right borders of all fill cells meets the corresponding distance threshold, then the adaptive adjustment of the row height and column width of the fill cells in the Excel file is completed.

[0093] In this embodiment, the step of adaptively adjusting the row height and column width of the fill cells in the Excel file further includes: setting adjustment conditions in advance, namely, fill cells in the same column have the same width and fill cells in the same row have the same height.

[0094] In this embodiment, the adaptive adjustment of the row height and column width of the fill cells in the Excel file is intended to make the fill cells in the Excel file adapt to the length and height of the data in each fill cell, thereby reducing the manual steps of adjusting the row height and column width and reducing the amount of manual operation.

[0095] Step 207: Perform event monitoring on the Excel file generated during initialization, and determine and update the data in the Excel file after the corresponding preset event is triggered based on the event monitoring results.

[0096] In this embodiment, a preset event monitor is used. The step of monitoring the events generated during the initialization of the Excel file and determining and updating the data in the Excel file after the corresponding preset event is triggered based on the event monitoring results specifically includes: based on the event monitor, identifying whether there are data addition, deletion, or modification events in the Excel file generated during the initialization; if any of the data addition, deletion, or modification events exists, then updating the corresponding target data in the Excel file after the event is triggered.

[0097] After data is added, deleted, or modified in the Excel file, the corresponding target data in the Excel file is updated in a timely manner to facilitate Excel file sharing and allow other users with viewing permissions to be informed of the Excel file update status.

[0098] In this embodiment, the step of updating the target data in the Excel file after the occurrence of any of the data addition, deletion, or modification events specifically includes: obtaining the data in the Excel file, the column names and row numbers corresponding to each data item after the event is triggered; reorganizing the data based on the data in the Excel file, the column names and row numbers corresponding to each data item, to generate the latest JSON format data corresponding to the Excel file; and replacing the JSON format data reorganized from the target data with the latest JSON format data to complete the data update.

[0099] Continue referring to the diagram. Figure 4 yes Figure 2 A flowchart of a specific implementation of step 207 shown includes the following steps:

[0100] Step 401: Based on the event monitor, identify whether there are data addition, deletion, or modification events in the Excel file generated during initialization;

[0101] Step 402: If any of the data addition, deletion, or modification events exists;

[0102] Step 403: After the event is triggered, obtain the data in the Excel file, the column name and row number corresponding to each data item;

[0103] Step 404: Based on the data in the Excel file, the column names and row numbers corresponding to each data item, reorganize the data to generate the latest JSON format data corresponding to the Excel file;

[0104] Step 405: Replace the JSON format data reconstructed from the target data with the latest JSON format data to complete the data update.

[0105] In this embodiment, the step of reorganizing the data based on the data in the Excel file, the column names and row numbers corresponding to each data item, and generating the latest JSON format data corresponding to the Excel file specifically includes: obtaining the distinguishing identifier of the event triggerer and using the distinguishing identifier as the outer key value of the latest JSON format data; obtaining the data in the Excel file and the column names corresponding to each data item to form the outer value value of the latest JSON format data, thus completing the construction of the latest JSON format data. The event triggerer can be understood as an authorized user who has triggered an event on the Excel file.

[0106] By using the distinctive identifier of the event trigger as the outer key value of the latest JSON format data, other authorized personnel can promptly identify the personnel who have made changes to the Excel file, facilitating accountability and scheduling management.

[0107] In this embodiment, the step of obtaining the data in the Excel file and the column names corresponding to each data to form the outer value of the latest JSON format data includes: obtaining the column names and using the column names as the names of each array in the outer value; based on the column names and row numbers, adding the data in the Excel file to the arrays corresponding to the data in the order of row numbers to complete the formation of the outer value.

[0108] Continue to refer to Figure 5 , Figure 5 yes Figure 4 A flowchart of a specific embodiment of step 404 shown includes the following steps:

[0109] Step 501: Obtain the distinguishing identifier of the event trigger and use the distinguishing identifier as the outer key value of the latest JSON format data;

[0110] Step 502: Obtain the column name and use the column name as the name of each array within the outer value;

[0111] Step 503: Based on the column name and row number, add the data in the Excel file to the corresponding array according to the row number sequence to complete the construction of the outer value.

[0112] This application obtains a data file; parses it into raw data to be filled into an Excel file; performs format conversion and data reorganization on the raw data; obtains the reorganized data one by one, maps the data to the corresponding fill cells in the Excel file, and completes the initial generation of the Excel file; monitors events in the initialized Excel file, and determines and updates the data in the Excel file after the corresponding preset event is triggered based on the event monitoring results. This application facilitates automated data adjustment based on changes made to Excel data by authorized personnel, and also facilitates collaborative viewing and modification by multiple people. Furthermore, modifications do not require developers to redeploy the data, reducing the workload of developers.

[0113] The embodiments of this application can acquire and process relevant data based on artificial intelligence technology. Artificial intelligence (AI) refers to the theories, methods, technologies, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to obtain optimal results.

[0114] Foundational technologies for artificial intelligence generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing, operating / interactive systems, and mechatronics. AI software technologies mainly encompass computer vision, robotics, biometrics, speech processing, natural language processing, and machine learning / deep learning.

[0115] In this embodiment of the application, when updating the target data corresponding to the Excel file, an artificial intelligence model can be used for automated updating. At the same time, when adaptively adjusting the row height and column width of the fill cells corresponding to the Excel file, an adaptive adjustment model can be used, which can reduce the workload of manual adjustment and make it more automated.

[0116] Further reference Figure 6 As a response to the above Figure 2 The implementation of the method shown in this application provides an embodiment of an Excel data display and update monitoring device, which is similar to... Figure 2 Corresponding to the method embodiments shown, this device can be specifically applied to various electronic devices.

[0117] like Figure 6 As shown, the Excel data display and update monitoring device 600 described in this embodiment includes: a data acquisition module 601, a data parsing module 602, a format conversion module 603, an array construction module 604, a data recombination module 605, an initialization module 606, and a monitoring and update module 607. Wherein:

[0118] Data acquisition module 601 is used to acquire data files uploaded by authorized personnel;

[0119] The data parsing module 602 is used to read the file stream corresponding to the data file based on the preset XLSX plugin, and parse the data file into the original data to be filled into the preset Excel file;

[0120] The format conversion module 603 is used to convert the original data into JSON format data.

[0121] An array construction module 604 is used to add values ​​corresponding to the same key to the array one by one in the order in the JSON data, using the key value in the JSON data as the array name;

[0122] The data recombination module 605 is used to obtain the target data to be filled into the Excel file based on the custom column names and the array names corresponding to each column name in the Excel file, and to reconstruct the target data in JSON format based on each column name;

[0123] Initialization module 606 is used to obtain the recombined JSON format data one by one, map the key values ​​in the JSON format data to the corresponding column fill cells in the Excel file, and insert the elements in the array corresponding to the key values ​​into the row fill cells corresponding to the column names one by one according to the array sequence, thereby completing the initialization and generation of the Excel file.

[0124] The monitoring and update module 607 is used to monitor events during the initialization of the Excel file, and based on the event monitoring results, determine and update the data in the Excel file after the corresponding preset event is triggered.

[0125] This application obtains a data file; parses it into raw data to be filled into an Excel file; performs format conversion and data reorganization on the raw data; obtains the reorganized data one by one, maps the data to the corresponding fill cells in the Excel file, and completes the initial generation of the Excel file; monitors events in the initialized Excel file, and determines and updates the data in the Excel file after the corresponding preset event is triggered based on the event monitoring results. This application facilitates automated data adjustment based on changes made to Excel data by authorized personnel, and also facilitates collaborative viewing and modification by multiple people. Furthermore, modifications do not require developers to redeploy the data, reducing the workload of developers.

[0126] In some specific embodiments of this example, the Excel data display and update monitoring device further includes an adaptive adjustment module. The adaptive adjustment module is used to determine whether the distance between the fill data in the column fill cell and the row fill cell and the top and bottom borders and left and right borders of the fill cell all meet the corresponding preset distance thresholds. If the distance corresponding to at least any one of the top and bottom borders and left and right borders of at least any fill cell does not meet the corresponding distance threshold, the row height and column width of the fill cells in the Excel file are adaptively adjusted based on the preset page adaptive display framework. The adaptive adjustment of the row height and column width of the fill cells in the Excel file is completed until the distances corresponding to the top and bottom borders and left and right borders of all fill cells meet the corresponding distance thresholds.

[0127] In this embodiment, the adaptive adjustment module adaptively adjusts the row height and column width of the fill cells in the Excel file. The purpose is to make the fill cells in the Excel file adapt to the length and height of the data in each fill cell, reducing the manual steps of adjusting the row height and column width and reducing the amount of manual operation.

[0128] Continue to refer to Figure 7 , Figure 7 yes Figure 6 The diagram shows a structural embodiment of the data parsing module 602. The data parsing module 602 includes a character byte judgment submodule 6021, a data transcoding submodule 6022, a file stream update submodule 6023, a data encoding submodule 6024, and a data decoding submodule 6025.

[0129] The character byte determination submodule 6021 is used to determine whether there are characters exceeding one byte in the file stream corresponding to the data file based on the character byte count reference table;

[0130] The data transcoding submodule 6022 is used to transcode the characters into one-byte characters using a preset transcoding function if there are characters exceeding one byte in the file stream corresponding to the data file.

[0131] The file stream update submodule 6023 is used to re-insert the transcoded character into the position of the corresponding character in the file stream before transcoding, update the file stream, and use the file stream as the file stream corresponding to the data file;

[0132] The data encoding submodule 6024 is used to perform the encoding process on the file stream corresponding to the data file using a preset encoding function, and encode the data file into an ASCII string in Base64 encoding format;

[0133] The data decoding submodule 6025 is used to perform the decoding process on the ASCII string using a preset decoding function to obtain the decoded data to be displayed in the Excel file.

[0134] The character byte judgment submodule, data transcoding submodule, file stream update submodule, data encoding submodule, and data decoding submodule further ensure the accuracy of data conversion when displaying data files in Excel, and avoid garbled characters.

[0135] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by instructing related hardware through computer-readable instructions. These computer-readable instructions can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the methods described above. The aforementioned storage medium can be a non-volatile storage medium such as a magnetic disk, optical disk, or read-only memory (ROM), or random access memory (RAM).

[0136] It should be understood that although the steps in the flowcharts of the accompanying figures are shown sequentially as indicated by the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the accompanying figures may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the sub-steps or stages of other steps.

[0137] To address the aforementioned technical problems, embodiments of this application also provide a computer device. Please refer to [link / reference needed]. Figure 8 , Figure 8 This is a basic structural block diagram of the computer device in this embodiment.

[0138] The computer device 8 includes a memory 8a, a processor 8b, and a network interface 8c that are interconnected via a system bus. It should be noted that only the computer device 8 with components 8a-8c is shown in the figure; however, it should be understood that it is not required to implement all the shown components, and more or fewer components can be implemented alternatively. Those skilled in the art will understand that the computer device described here is a device capable of automatically performing numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes, but is not limited to, microprocessors, application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), digital signal processors (DSPs), embedded devices, etc.

[0139] The computer device can be a desktop computer, laptop, handheld computer, or cloud server, etc. The computer device can interact with the user via a keyboard, mouse, remote control, touchpad, or voice control.

[0140] The memory 8a 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, magnetic disk, optical disk, etc. In some embodiments, the memory 8a may be an internal storage unit of the computer device 8, such as the hard disk or memory of the computer device 8. In other embodiments, the memory 8a may also be an external storage device of the computer device 8, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc., equipped on the computer device 8. Of course, the memory 8a may include both the internal storage unit and its external storage device of the computer device 8. In this embodiment, the memory 8a is typically used to store the operating system and various application software installed on the computer device 8, such as computer-readable instructions for Excel data display and update monitoring methods. In addition, the memory 8a can also be used to temporarily store various types of data that have been output or will be output.

[0141] In some embodiments, the processor 8b may be a central processing unit (CPU), controller, microcontroller, microprocessor, or other data processing chip. The processor 8b is typically used to control the overall operation of the computer device 8. In this embodiment, the processor 8b is used to execute computer-readable instructions stored in the memory 8a or to process data, for example, to execute computer-readable instructions for the Excel data display and update monitoring method.

[0142] The network interface 8c may include a wireless network interface or a wired network interface, which is typically used to establish communication connections between the computer device 8 and other electronic devices.

[0143] The computer device proposed in this embodiment belongs to the field of rapid Excel file compilation technology. This application acquires a data file; parses it into raw data to be filled into an Excel file; performs format conversion and data reorganization on the raw data; acquires the reorganized data one by one, maps the data to the corresponding fill cells in the Excel file, and completes the initial generation of the Excel file; monitors events in the initialized Excel file, and determines and updates the data in the Excel file after a corresponding preset event is triggered based on the event monitoring results. This application facilitates automated data adjustment based on changes made to Excel data by authorized personnel, and also facilitates collaborative viewing and modification by multiple people. Furthermore, modifications do not require developers to redeploy the data, reducing the workload of developers.

[0144] This application also provides another embodiment, namely, providing a computer-readable storage medium storing computer-readable instructions that can be executed by a processor to cause the processor to perform the steps of the Excel data display and update monitoring method described above.

[0145] The computer-readable storage medium proposed in this embodiment belongs to the field of rapid Excel file compilation technology. This application acquires a data file; parses it into raw data to be filled into an Excel file; performs format conversion and data reorganization on the raw data; acquires the reorganized data one by one, maps the data to the corresponding fill cells in the Excel file, and completes the initial generation of the Excel file; monitors events in the initialized Excel file, and determines and updates the data in the Excel file after a corresponding preset event is triggered based on the event monitoring results. This application facilitates automated data adjustment based on changes made to Excel data by authorized personnel, and also facilitates collaborative viewing and modification by multiple people. Furthermore, modifications do not require developers to redeploy the data, reducing the workload of developers.

[0146] 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 this application, in essence, 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), and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of this application.

[0147] Obviously, the embodiments described above are only some embodiments of this application, not all embodiments. The accompanying drawings show preferred embodiments of this application, but do not limit the patent scope of this application. This application can be implemented in many different forms; rather, the purpose of providing these embodiments is to provide a more thorough and comprehensive understanding of the disclosure of this application. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing specific embodiments, or make equivalent substitutions for some of the technical features. Any equivalent structures made using the content of this application's specification and drawings, directly or indirectly applied to other related technical fields, are similarly within the scope of patent protection of this application.

Claims

1. A method for displaying and monitoring Excel data updates, characterized in that, Includes the following steps: Obtain data files uploaded by authorized personnel, wherein the data files refer to Word document format files stored in local files; The data file is read based on a preset XLSX plugin, and the data file is parsed into the original data to be filled into a preset Excel file. The preset XLSX plugin includes an encoding process and a decoding process. The step of reading the file stream corresponding to the data file based on the preset XLSX plugin includes: The encoding process is performed on the file stream corresponding to the data file using a preset encoding function, and the data file is encoded into an ASCII string in Base64 encoding format; The ASCII string is decoded using a preset decoding function to obtain the decoded data that will be displayed in the Excel file; The original data is converted into JSON format data; Using the key value in the JSON format data as the array name, add the value corresponding to the same key value to the array one by one in the order in the JSON format data; Based on the custom column names and the array names corresponding to each column name in the Excel file, the target data to be filled into the Excel file is obtained, and the target data is reorganized into JSON format based on each column name; The recombined JSON data is obtained one by one, and the key values ​​in the JSON data are mapped to the corresponding column fill cells in the Excel file. The elements in the array corresponding to the key value are inserted one by one into the row fill cells corresponding to the column name according to the array sequence. It is determined whether the distance between the fill data in the column fill cells and the row fill cells and the top and bottom borders and left and right borders of the fill cells meet the corresponding preset distance thresholds. If the distance corresponding to at least one of the top and bottom borders and left and right borders of at least any fill cell does not meet the corresponding distance threshold, the row height and column width of the fill cells in the Excel file are adaptively adjusted based on the preset page adaptive display framework. The row height and column width adaptive adjustment is based on the preset adjustment conditions, including equal width of fill cells in the same column and equal height of fill cells in the same row. The initial generation of the Excel file is completed, realizing the filling of data from the Word document format file into the Excel file. Event monitoring is performed on the initial generation of the Excel file. Based on the event monitoring results, the data in the Excel file after the corresponding preset event is triggered is determined and updated.

2. The Excel data display and update monitoring method according to claim 1, characterized in that, The preset XLSX plugin also includes a transcoding process. Before the step of using a preset encoding function to perform the encoding process on the file stream corresponding to the data file to encode the data file into a Base64 encoded ASCII string, the method further includes: Based on a preset character byte count reference table, determine whether there are characters exceeding one byte in the file stream corresponding to the data file; If the file stream corresponding to the data file contains a character that is more than one byte long, the character is converted into a one-byte character using a preset encoding function; The transcoded character is then re-inserted into the position of its original counterpart in the file stream, and the file stream is updated to serve as the file stream corresponding to the data file.

3. The Excel data display and update monitoring method according to claim 1, characterized in that, The step of monitoring events during the initialization of the Excel file, and determining and updating the data in the Excel file after the corresponding preset event is triggered based on the event monitoring results, specifically includes: Based on a preset event monitor, it identifies whether there are data addition, deletion, or modification events in the Excel file generated during initialization; If any of the data addition, deletion, or modification events occur, the corresponding target data in the Excel file will be updated after the event is triggered.

4. The Excel data display and update monitoring method according to claim 3, characterized in that, The step of updating the corresponding target data in the Excel file after any of the data addition, deletion, or modification events is triggered specifically includes: After the event is triggered, obtain the data in the Excel file, the column names and row numbers corresponding to each data item; Based on the data in the Excel file, the column names and row numbers corresponding to each data item, the data is reorganized to generate the latest JSON format data corresponding to the Excel file; The latest JSON format data replaces the JSON format data reconstructed from the target data, thus completing the data update.

5. The Excel data display and update monitoring method according to claim 4, characterized in that, The step of reorganizing the data based on the data in the Excel file, the column names and row numbers corresponding to each data item, and generating the latest JSON format data corresponding to the Excel file specifically includes: Obtain the distinguishing identifier of the event trigger and use the distinguishing identifier as the outer key value of the latest JSON format data; The outer value of the latest JSON format data is constructed by obtaining the data in the Excel file and the column names corresponding to each data, thus completing the construction of the latest JSON format data. The step of obtaining the outer value of the latest JSON format data, which consists of the data in the Excel file and the column names corresponding to each data item, includes: Obtain the column name and use the column name as the name of each array within the outer value; Based on the column names and row numbers, the data in the Excel file are sequentially added to the corresponding arrays according to the row number sequence to complete the construction of the outer value.

6. An Excel data display and update monitoring device, characterized in that, The Excel data display and update monitoring device implements the steps of the Excel data display and update monitoring method as described in any one of claims 1 to 5, wherein the Excel data display and update monitoring device comprises: The data acquisition module is used to acquire data files uploaded by authorized personnel, wherein the data files refer to Word document format files stored in local files; The data parsing module is used to read the file stream corresponding to the data file based on a preset XLSX plugin, and parse the data file into the original data to be filled into a preset Excel file. The preset XLSX plugin includes an encoding process and a decoding process. The step of reading the file stream corresponding to the data file based on the preset XLSX plugin includes: The encoding process is performed on the file stream corresponding to the data file using a preset encoding function, and the data file is encoded into an ASCII string in Base64 encoding format; The ASCII string is decoded using a preset decoding function to obtain the decoded data that will be displayed in the Excel file; The format conversion module is used to convert the original data into JSON format data; An array construction module is used to add the values ​​corresponding to the same key to the array one by one in the order in the JSON data, using the key value in the JSON data as the array name; The data recombination module is used to obtain the target data to be filled into the Excel file based on the custom column names and the array names corresponding to each column name in the Excel file, and to reconstruct the target data in JSON format based on each column name; The initialization module is used to obtain the reorganized JSON format data one by one, map the key values ​​in the JSON format data to the corresponding column fill cells in the Excel file, and insert the elements in the array corresponding to the key values ​​into the row fill cells corresponding to the column names one by one according to the array sequence, thereby completing the initialization and generation of the Excel file and realizing the filling of data from the Word document format file into the Excel file. The monitoring and update module is used to monitor events during the initialization and generation of the Excel file, and based on the event monitoring results, determine and update the data in the Excel file after the corresponding preset event is triggered.

7. A computer device, comprising a memory and a processor, wherein the memory stores computer-readable instructions, and the processor executes the computer-readable instructions to implement the steps of the Excel data display and update monitoring method as described in any one of claims 1 to 5.

8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-readable instructions, which, when executed by a processor, implement the steps of the Excel data display and update monitoring method as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • General data entry method and device based on data model, equipment and medium

    CN114510478A