CN109815428B - Online table caching method and device - Google Patents

Online table caching method and device Download PDF

Info

Publication number
CN109815428B
CN109815428B CN201811624628.3A CN201811624628A CN109815428B CN 109815428 B CN109815428 B CN 109815428B CN 201811624628 A CN201811624628 A CN 201811624628A CN 109815428 B CN109815428 B CN 109815428B
Authority
CN
China
Prior art keywords
template
item
server
cached
oid
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201811624628.3A
Other languages
Chinese (zh)
Other versions
CN109815428A (en
Inventor
陈德芹
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Individual
Original Assignee
Individual
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Individual filed Critical Individual
Priority to CN201811624628.3A priority Critical patent/CN109815428B/en
Publication of CN109815428A publication Critical patent/CN109815428A/en
Application granted granted Critical
Publication of CN109815428B publication Critical patent/CN109815428B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention provides an online table caching method and device, wherein the method comprises the following steps: receiving a source version number and an ID number of an online form; judging whether the template table with the ID number is cached locally or not according to the ID number of each template table, if not, pulling the template table with the ID number, caching the template table locally, and taking the source version number of the template table as the local version number of the template table; and judging whether the item table with the ID number is cached locally or not according to the ID number of each item table, if not, pulling the item table with the ID number, determining the OID number of the item table and the corresponding template table with the OID number, merging the determined corresponding template table and the pulled item table to obtain an item table formed by merging results, locally caching the obtained item table, and generating a local version number of the cached item table. By applying the embodiment of the invention, the efficiency of obtaining the online form is improved.

Description

Online table caching method and device
Technical Field
The present invention relates to the field of online forms, and in particular, to an online form caching method and apparatus.
Background
The online form refers to a form which can be created on a network through a device such as a computer, a mobile phone or a tablet computer, and the form can be edited by multiple people, so that the form content has a large variability. Because the online forms support multi-user editing, and form data is easy to change, when a user performs operations such as reading, writing, or saving on the online forms through an electronic device, the prior art generally needs the electronic device to go to a server to retrieve the online forms, because a project may include a large number of online forms, for example, a project has 100 sub-projects, each sub-project may include 300 workbooks, each workbook includes 3 online forms, 9 ten thousand online forms are to be retrieved each time, the efficiency of retrieving the online forms is generally low, and further, the frequently-used operations such as opening and saving the forms have long waiting time, which seriously affects the user operation efficiency.
Therefore, there is a need to develop an online table caching method to solve the above problems.
Disclosure of Invention
The invention aims to overcome the defects of the prior art and provides an online form caching method and device so as to improve the efficiency of acquiring online forms.
The invention is realized by the following steps:
in a first aspect, the present invention provides an online table caching method, where the online table includes a template table and an item table, the item table is generated based on the template table, and an OID number of the item table is the same as an OID number of the template table used for generating the item table, and the method includes:
sending a loading request to a server; receiving a source version number and an ID number of an online form returned by the server aiming at the loading request;
judging whether the template table with the ID number is cached locally or not according to the received ID number of each template table, if not, pulling the template table with the ID number from a server, caching the pulled template table locally, and taking the source version number of the template table as the local version number of the template table;
and judging whether the item table with the ID number is cached locally or not according to the ID number of each received item table, if not, pulling the item table with the ID number from the server, determining the OID number of the pulled item table and the corresponding template table with the OID number, merging the determined corresponding template table and the pulled item table to obtain the item table formed by merging results, locally caching the item table formed by merging results, and generating the local version number of the cached item table.
Optionally, if the template table with the ID number is cached locally, the method further includes:
determining the local version number of the template form, and judging whether the local version number is the same as the source version number of the template form; if not, pulling the template table with the ID number from the server, and updating the cached template table with the ID number of the local template by using the pulled template table; if the template table is the same, the template table is not pulled from the server.
Optionally, if the entry table with the ID number is cached locally, the method further includes:
determining the local version number and the OID number of the project table and a corresponding template table with the OID number, and judging whether the local version number of the project table is the same as the source version number; if not, pulling the item table with the ID number from the server, updating the locally cached item table by using the pulled item table, and taking the updated item table as an item table to be merged; if the local cached item tables are the same, taking the locally cached item tables as item tables to be merged; merging the project table to be merged and the determined corresponding template table, updating the project table to be merged by using a merging result, and generating the updated local version number of the project table to be merged.
Optionally, sending a loading request to the server includes:
after an application program opening instruction is obtained, a loading request is sent to a server; or the like, or, alternatively,
and sending a loading request to the server after detecting that a refreshing button on the displayed interface is clicked.
Optionally, determining the corresponding template table with the OID number includes:
obtaining a source version number of the template table with the OID number from the server; judging whether the local version number of the template table with the OID number is the same as the source version number; if not, pulling the template table with the OID number from the server, updating the locally cached template table with the OID number by using the pulled template table, and determining the updated template table as the corresponding template table with the OID number; if the two template tables are the same, the template table with the OID number of the local cache is determined as the corresponding template table with the OID number.
Optionally, the template table with the ID number is pulled from the server as a compressed table, and before the pulled template table is locally cached, the method further includes decompressing the pulled template table;
and the local caching of the pulled template form comprises the local caching of the decompressed template form.
Optionally, generating a local version number of the cached entry table includes:
the MD5 value of the cached item table is calculated, and the calculated MD5 value is taken as the local version number of the cached item table.
In a second aspect, the present invention provides an online table caching apparatus, where the online table includes a template table and an item table, the item table is generated based on the template table, and an OID number of the item table is the same as an OID number of the template table used for generating the item table, the apparatus includes:
the sending module is used for sending a loading request to the server; receiving a source version number and an ID number of an online form returned by the server aiming at the loading request;
the first cache module is used for judging whether the received ID number of each template table caches the template table with the ID number locally, if not, the template table with the ID number is pulled from the server, the pulled template table is cached locally, and the source version number of the template table is used as the local version number of the template table;
and the second cache module is used for judging whether the item table with the ID number is cached locally or not according to the ID number of each received item table, if not, pulling the item table with the ID number from the server, determining the OID number of the pulled item table and the corresponding template table with the OID number, merging the determined corresponding template table and the pulled item table to obtain the item table formed by merging results, performing local cache on the item table formed by merging results, and generating the local version number of the cached item table.
Optionally, the first cache module is further configured to:
if the template form with the ID number is cached locally, determining the local version number of the template form, and judging whether the local version number is the same as the source version number of the template form or not; if not, pulling the template table with the ID number from the server, and updating the cached template table with the ID number of the local template by using the pulled template table; if the template table is the same, the template table is not pulled from the server.
Optionally, the second cache module is further configured to:
if the item table with the ID number is cached locally, determining a local version number and an OID number of the item table and a corresponding template table with the OID number, and judging whether the local version number of the item table is the same as the source version number; if not, pulling the item table with the ID number from the server, updating the locally cached item table by using the pulled item table, and taking the updated item table as an item table to be merged; if the local cached item tables are the same, taking the locally cached item tables as item tables to be merged; merging the project table to be merged and the determined corresponding template table, updating the project table to be merged by using a merging result, and generating the updated local version number of the project table to be merged.
The invention has the following beneficial effects: by applying the embodiment of the invention, the online form is cached locally, so that the server does not need to be required to obtain the online form when the online form is read, written or stored every time, the influence on the efficiency caused by continuously pulling the project form and the template form from the server is avoided, the efficiency of subsequently obtaining the online form is improved, the waiting time of common operations such as form opening and form storing is reduced, and the operation efficiency of a user is improved. And by comparing the version numbers, the consistency of the contents of the locally cached template table and the template table in the server and the consistency of the contents of the locally cached project table and the project table in the server are ensured, the timely update of the locally cached online table is realized, and the accuracy and the reliability of the locally cached online table are improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a schematic flow chart of an online table caching method according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of an online table caching apparatus according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that the online form caching method provided by the present invention can be applied to electronic devices, wherein in a specific application, the electronic device can be a computer, a personal computer, a tablet, a mobile phone, and the like, which is reasonable. In addition, the functional software for implementing the online form caching method provided by the embodiment of the invention can be special online form caching software or a plug-in software with an online form caching function. The operating system in the electronic device is not limited in the present invention, and may be, for example, a LINUX operating system, a Windows operating system, or a UNIX operating system.
Referring to fig. 1, an embodiment of the present invention provides an online table caching method, where an online table includes item tables and template tables, each item table is generated based on one template table, and an OID number of each item table is the same as an OID number of a template table used for generating the item table, and the method includes the following steps:
s101, sending a loading request to a server; receiving a source version number and an ID number of an online form returned by the server aiming at the loading request;
the loading request can be directly sent to the server every preset fixed time or every time a preset time point is reached, or the loading request can be sent to the server after an application program opening instruction is obtained; still alternatively, a load request may be sent to the server after detecting that a refresh button or a reload button on the displayed interface is clicked, the load request may be used to request that an online form different from the local cache be loaded from the server, and the loading of the online form different from the local cache from the server refers to the loading of an online form different from the local cache from the server.
The preset fixed time length and the preset time point can be preset according to requirements, for example, the preset time length is 1 hour, 2 hours, and the like, and the preset time point can be 9:00, 14:00, 18:00, and the like.
The electronic device (the execution main body of the present invention) may display an icon of an application program for implementing the functions of the present invention, and the user may click or double-click the icon, so that the electronic device may obtain an application program opening instruction, and may further send a loading request to the server. Alternatively, the electronic device may display an interface operable by the user, the interface may include a refresh button or a reload button, and the load request may be sent to the server when it is detected that the user clicks the refresh button or the reload button.
It should be noted that the template table and the item table of the present invention may each include an OID (Object Identifier) number and an ID (identification) number, where the OID number and the ID number of each template table may be the same, the OID number of the item table and the OID number of the template table used for generating the item table are the same, the OID number and the ID number of each item table may be different, the ID number of the template table is used for uniquely identifying the template table, and the ID number of the item table is used for uniquely identifying the item table. The relation between the project table and the template table can be quickly determined through the OID number, so that each project table generated by the same template table can be quickly determined. The specific form of the ID number and the OID number is not limited in the present invention, and may be, for example, a character string formed by one or a combination of characters such as numbers, letters, underlines, and the like.
The template form may be a pre-constructed basic form, and may generate a project form based on a template form, and the specific way of generating the project form based on the template form is not limited in the present invention, and may include the following steps, for example:
the method comprises the steps that firstly, a template form list is displayed on an operation interface, after a template form selected by a user in the template form list is detected, the template form selected by the user is copied to obtain template data, and the obtained template data are used for generating a project form; step two, after acquiring project data typed in the generated project table by a user, combining the template data existing in the project table and the project data by adopting a preset combination rule to obtain the project table formed by a combination result: the preset merging rule is that for the same cell, if the template data has a value in the cell, the value of the template data in the cell is taken as the value of the cell; and if the template data has no value in the cell, taking the value of the item data in the cell as the value of the cell.
The user can type the project data in the project table, if the template data exists in a certain cell, the value of the cell cannot change along with the change of the value of the newly-typed project data, and the normalization of the project table is ensured.
Specifically, merging the template data and the project data existing in the project table by using a preset merging rule to obtain a project table formed by merging results, may include: converting the template data and the project data existing in the project table into a first JSON object and a second JSON object respectively; for each cell in the item table, if the first JSON object has a value in the cell, taking the value of the first JSON object as the value of the cell; and if the first JSON object has no value in the cell, taking the value of the second JSON object in the cell as the value of the cell.
JSON (JavaScript Object Notation) is a lightweight data exchange format, and template data and project data can both be in the form of JSON character strings and are converted into JSON objects, so that data merging can be quickly realized. The invention does not limit the interconversion between the JSON object and the JSON character string, and can adopt the existing conversion mode for conversion.
Or in other embodiments, the preset merge rule may be designed in other manners, which is not limited in the present invention. For example, JQuery can also be used to merge two JSON objects.
By applying the embodiment of the invention, each project table in the project can be newly built by copying the template table, so that the efficiency of generating the project tables is improved, each project table in the project is formed by combining the template data and the project data, and if the project data and the template data have values in a certain cell, the value of the template data in the cell is taken as the final value of the cell; the method ensures the uniformity of the template data in each project table generated based on the same template table, ensures the consistency and the normalization of each project table in the same project, and achieves the aim of normalizing the project tables according to the template table.
After the project table is generated, the version number of the project table can be generated by using the template data and the project data contained in the project table; after the template table is constructed, the version number of the template table may be generated using template data included in the template table.
The template data of the template table may include fields in the table, field values for the fields, styles for cells, formulas in the cells, and so forth. The format may be Excel format, csv (Comma-Separated Values) format, xml (eXtensible Markup Language) format, or the like. The specific way of generating the project table by using the template data is not limited, for example, a method for generating the project table can be written in advance by adopting programming languages such as C #, ASP, NET and the like, or an Excel library can be directly referred to generate the Excel table.
The user can pre-build the template table through the SpreadJS online editor, and can type a cross-table function in the template table, by which a cross-table reference relationship of the template table with other template tables can be pre-established, which can be copied into a project table generated based on the template table. The parameter format of the cross-table function is: ("[ OID: sheetedex ] sheetname", cell), wherein OID represents the OID number of the target form to be referenced, sheetedex represents the index number of the target form where the data to be referenced is located, sheetname represents the name of the target form where the data to be referenced is located, and cell represents the cell area where the data to be referenced is located.
After the template form and the project form are constructed, the data in the forms can be modified respectively. The specific modification mode is not limited in the present invention, and for example, the specific contents of the table, such as the cross-table function, the field name, and the field value, in the table can be modified through the SpreadJS online editor. The project table can be adaptively modified according to the related content of the project, for example, the specific values of the fields related to the project are filled in, the cross-table reference relationship is modified, and the like, and the template table may not contain specific data values, but only contain content related to styles, such as the font, line height, and the like of cells.
The template table can usually meet the requirements of most items, but in the actual process of creating the items, the template of the items may need to be modified according to the conditions of the items, and since the OID number of the item table is the same as the OID number of the template table used for generating the item table, after the template table is modified, the content in the item table with the OID number can be uniformly modified.
By applying the embodiment of the invention, the project table is obtained by copying the template table instead of directly using the template table as the project table, so that the project table and the template table are independent from each other, and the modification of any party does not influence the other party. When a few project tables required by a project and the existing template tables exist, a user can still select to use the template tables to newly create the project and then independently modify the template data in the project tables, and for each project table uniformly generated by a certain template table, the OID numbers of the project tables are the same as the OID number of the template table, so that the OID numbers of the project tables are also the same, the template data in each project table can be uniformly modified along with the modification of the template data in a certain project table, the uniform modification of the template data of each project table by modifying the template data of one project table is realized, the modification process is simplified, and the uniformity of the templates of each project table is facilitated.
In addition, when the entry and exit of the project form required by the project and the existing template form are large, a user can create a set of template forms according to the project requirement so as to generate the project form, and the flexibility and the usability of the template forms are guaranteed.
The user can also pre-build a template form through the SpreadJS online editor, and can type a cross-table function in the template form, through which a cross-table reference relationship of the template form with other template forms can be pre-established, and the cross-table reference relationship can be copied into a project form built based on the template form.
In the process of calculating the preset cross-table function in the item table, the OID number of the item table may be used to search the template table with the OID number in a directory for storing the template table, determine OID numbers of other template tables preset in the template table and having a cross-table reference relationship with the template table, and use the determined OID numbers of the other template tables as the OID numbers of the target item table having a cross-table reference relationship with the item table, so that the cross-table function calculation may be completed using the OID numbers of the target item table.
By applying the embodiment of the invention, each project table in the project can be newly built by copying the preset template table so as to adapt to different project requirements and achieve the purpose of quickly building the project table. The project table and the template table can be regarded as a database for storing two data tables, if a cross-table reference function is preset in the template table, each project table generated based on copying the template table also comprises the cross-table reference function, and the cross-table reference function takes an OID number as one of parameters, and the OID number of the project table is the same as the OID number of the template table used for generating the project table, so that the preset cross-table reference relation can be directly copied into the project table, the project table directly obtains and uses the preset cross-table reference relation, a target function calculation formula does not need to be re-obtained in the project table to establish the same cross-table reference relation with the template table, the new establishment process of the table is simplified, and the required table is quickly established.
Each online table may further include a version number (version), which may be referred to as a source version number when it is stored in the server; when cached locally, its version number may be referred to as a local version number. In order to ensure the integrity and version accuracy of data, if the data (data) in the online form changes, the version number of the online form may change accordingly. version can be an MD5(Message-Digest Algorithm) value generated by using a string of data fields, MD5 is a widely used cryptographic hash function and can generate a 128-bit (16-byte) hash value (hash value), and MD5 values generated by using different strings are different, so that the version is different after data change, and the information transmission is complete and consistent.
The technical scheme of the invention can be executed by a plurality of electronic devices, each electronic device can generate an online table and the version number, ID number and OID number thereof, and can upload the generated online table to the server together with the version number, ID number and OID number thereof, so that the server can obtain and store the online tables of the plurality of electronic devices with the version numbers, ID numbers and OID numbers thereof, and after receiving a loading request of a certain electronic device, the server can return the source version number and ID number of each online table of the latest version uploaded recently to the electronic device, and further the electronic device can receive the source version number and ID number of the online table.
The electronic device sending the loading request can also directly load each online form of the latest version from the server without constructing the template form and the project form; alternatively, the electronic device that sends the load request may have constructed a template table in advance and generated an item table, and further, may determine whether to load each online table of the latest version from the server according to the received source version number and ID number.
After receiving the source version number and the ID number of the online table, the electronic device may use the ID number of the online table to search in the local cache database, and if the online table with the ID number is found, may compare whether the source version number and the local version number of the online table are consistent, and if not, centralize the ID number of the online table into an array, which may be referred to as dirtIds. After comparing the version numbers of the online forms identified by the received ID numbers, dirtIds can be sent to the server, so as to unify the online forms with the changed version numbers.
Thus, the server may return the presence table identified by each ID number in dirtIds, and it will be understood that the presence table identified by each ID number in dirtIds includes: the local uncached online form and the local cached online form with inconsistent local version number and source version number, so the online form pulled by the electronic device includes: a local uncached online table and a local cached online table with a local version number that is inconsistent with the source version number. For the online forms which are not cached locally, the electronic equipment can cache uniformly, and for the online forms which are cached locally, the electronic equipment can update. Specifically, the local cache may be a pouchDB, which is a local cache technology based on IndexedDB, and the IndexedDB is a transactional database system.
The electronic device can adopt different caching and updating modes for the template form and the project form respectively.
S102, judging whether the template table with the ID number is cached locally or not according to the received ID number of each template table, if not, pulling the template table with the ID number from a server, caching the pulled template table locally, and taking the source version number of the template table as the local version number of the template table;
in one implementation, if the template table with the ID number is cached locally, the method further includes:
determining the local version number of the template form, and judging whether the local version number is the same as the source version number of the template form; if not, pulling the template table with the ID number from the server, and updating the cached template table with the ID number of the local template by using the pulled template table; if the template table is the same, the template table is not pulled from the server.
In addition, in order to improve data transmission efficiency, the server may compress the online form requested to be loaded by the electronic device, and further transmit the compressed online form, so as to improve transmission efficiency, for example, the server may compress the online form using GZIP and/or LZ-string, so that the template form having the ID number pulled by the electronic device from the server may be a compressed form, and before locally caching the pulled template form, the method further includes: decompressing the pulled template form; the local caching is performed on the pulled template form, which may specifically be: and locally caching the decompressed template table.
S103, judging whether the item table with the ID number is cached locally or not according to the ID number of each received item table, if not, pulling the item table with the ID number from the server, determining the OID number of the pulled item table and the corresponding template table with the OID number, merging the determined corresponding template table and the pulled item table to obtain the item table formed by merging results, locally caching the item table formed by merging results, and generating the local version number of the cached item table.
The electronic device pulling the item table with the ID number from the server can also be a compressed table, and before merging the determined corresponding template table and the pulled item table, the method further includes: the pulled item table is decompressed.
Specifically, the determined corresponding template table and the pulled item table may be merged using the following merging principle: if the item table and the corresponding template table have values in a certain cell, taking the value of the corresponding template table as the final value of the cell; this ensures the standardization of the project table. Assuming that the data content of the corresponding template table is a ═ a:1, B: { B1:2, B2:3}, and c:2}, and the data content of the project table is B ═ a:2, d:3}, the result obtained by combining a and B is { a:1, B: { B1:2, B2:3}, c:2, d:3 }.
In one implementation, determining the corresponding template table with the OID number may include:
obtaining a source version number of the template table with the OID number from the server; judging whether the local version number of the template table with the OID number is the same as the source version number; if not, pulling the template table with the OID number from the server, updating the locally cached template table with the OID number by using the pulled template table, and determining the updated template table as the corresponding template table with the OID number; if the two template tables are the same, the template table with the OID number of the local cache is determined as the corresponding template table with the OID number.
Specifically, generating the local version number of the cached entry table includes:
the MD5 value of the cached item table is calculated, and the calculated MD5 value is taken as the local version number of the cached item table.
The MD5 value of the cached item table may be calculated by using an MD5 calculator, or a program for calculating the MD5 value may be written in advance by using a programming language such as Python, PHP, or the like, and the calculation of the MD5 value of the cached item table is realized by executing the program. In addition, in another implementation, a SHA (Secure Hash Algorithm) 1 value, a SHA256 value, or a SHA512 value of the cached entry table may be calculated, and the calculated SHA1 value, SHA256 value, or SHA512 value may be used as the local version number of the cached entry table.
In one implementation, if the entry table with the ID number is cached locally, the method further includes:
determining the local version number and the OID number of the project table and a corresponding template table with the OID number, and judging whether the local version number of the project table is the same as the source version number; if not, pulling the item table with the ID number from the server, updating the locally cached item table by using the pulled item table, and taking the updated item table as an item table to be merged; if the local cached item tables are the same, taking the locally cached item tables as item tables to be merged; merging the project table to be merged and the determined corresponding template table, updating the project table to be merged by using a merging result, and generating the updated local version number of the project table to be merged.
By applying the embodiment of the invention, the online form is cached locally, so that the server does not need to be required to obtain the online form when the online form is read, written or stored every time, the influence on the efficiency caused by continuously pulling the project form and the template form from the server is avoided, the efficiency of subsequently obtaining the online form is improved, the waiting time of common operations such as form opening and form storing is reduced, and the operation efficiency of a user is improved. And by comparing the version numbers, the consistency of the contents of the locally cached template table and the template table in the server and the consistency of the contents of the locally cached project table and the project table in the server are ensured, the timely update of the locally cached online table is realized, and the accuracy and the reliability of the locally cached online table are improved.
The template table and the item table may be cached in two cache data structures, respectively, and the cache data structure for storing the template table may include ID, data { }, version, and OID, which respectively represent an ID number, data, a local version number, and an OID number of the template table; the cache data structure for storing the item table may include ID, data { }, excel _ ID, project _ ID, version, and OID, which respectively represent an ID number, data, form number, item number, local version number, and OID number of the item table. In other embodiments, other data structures may be used to cache the template table and the item table, respectively, and the form of the specific data structure is not limited in the present invention.
Corresponding to the above method embodiment, the embodiment of the present invention further provides an online table caching apparatus.
Referring to fig. 2, fig. 2 is a schematic structural diagram of an online table caching apparatus according to an embodiment of the present invention, where the online table includes a template table and an item table, the item table is generated based on the template table, and an OID number of the item table is the same as an OID number of the template table used for generating the item table, and the apparatus includes:
a sending module 201, configured to send a loading request to a server; receiving a source version number and an ID number of an online form returned by the server aiming at the loading request;
a first caching module 202, configured to determine, for each received ID number of the template table, whether the template table with the ID number is cached locally, if not, pull the template table with the ID number from the server, perform local caching on the pulled template table, and use a source version number of the template table as a local version number of the template table;
the second caching module 203 is configured to determine, for the ID number of each received item table, whether the item table with the ID number is cached locally, if not, pull the item table with the ID number from the server, determine an OID number of the pulled item table and a corresponding template table with the OID number, merge the determined corresponding template table and the pulled item table to obtain an item table formed by a merging result, locally cache the item table formed by the merging result, and generate a local version number of the cached item table.
By applying the embodiment of the invention, the online form is cached locally, so that the server does not need to be required to obtain the online form when the online form is read, written or stored every time, the influence on the efficiency caused by continuously pulling the project form and the template form from the server is avoided, the efficiency of subsequently obtaining the online form is improved, the waiting time of common operations such as form opening and form storing is reduced, and the operation efficiency of a user is improved. And by comparing the version numbers, the consistency of the contents of the locally cached template table and the template table in the server and the consistency of the contents of the locally cached project table and the project table in the server are ensured, the timely update of the locally cached online table is realized, and the accuracy and the reliability of the locally cached online table are improved.
Optionally, the first cache module 202 is further configured to:
if the template form with the ID number is cached locally, determining the local version number of the template form, and judging whether the local version number is the same as the source version number of the template form or not; if not, pulling the template table with the ID number from the server, and updating the cached template table with the ID number of the local template by using the pulled template table; if the template table is the same, the template table is not pulled from the server.
Optionally, the second cache module 203 is further configured to:
if the item table with the ID number is cached locally, determining a local version number and an OID number of the item table and a corresponding template table with the OID number, and judging whether the local version number of the item table is the same as the source version number; if not, pulling the item table with the ID number from the server, updating the locally cached item table by using the pulled item table, and taking the updated item table as an item table to be merged; if the local cached item tables are the same, taking the locally cached item tables as item tables to be merged; merging the project table to be merged and the determined corresponding template table, updating the project table to be merged by using a merging result, and generating the updated local version number of the project table to be merged.
Optionally, the sending module 201 sends a loading request to the server, specifically:
after an application program opening instruction is obtained, a loading request is sent to a server; or the like, or, alternatively,
and sending a loading request to the server after detecting that a refreshing button on the displayed interface is clicked.
Optionally, the second caching module 203 determines the corresponding template table with the OID number, and specifically includes:
obtaining a source version number of the template table with the OID number from the server; judging whether the local version number of the template table with the OID number is the same as the source version number; if not, pulling the template table with the OID number from the server, updating the locally cached template table with the OID number by using the pulled template table, and determining the updated template table as the corresponding template table with the OID number; if the two template tables are the same, the template table with the OID number of the local cache is determined as the corresponding template table with the OID number.
Optionally, the apparatus further includes a decompression module, configured to decompress the pulled template table before locally caching the pulled template table;
the first caching module 202 locally caches the pulled template form, specifically locally caches the decompressed template form.
Optionally, the second caching module 203 generates a local version number of the cached item table, specifically:
the MD5 value of the cached item table is calculated, and the calculated MD5 value is taken as the local version number of the cached item table.
The present invention is not limited to the above preferred embodiments, and any modifications, equivalent substitutions, improvements, etc. within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (5)

1. An online table caching method, wherein the online table includes a template table and an item table, the item table is generated based on the template table, and the OID number of the item table is the same as the OID number of the template table used for generating the item table, the method comprising:
sending a loading request to a server; receiving a source version number and an ID number of an online form returned by the server aiming at the loading request;
judging whether the template table with the ID number is cached locally or not according to the received ID number of each template table, if not, pulling the template table with the ID number from a server, caching the pulled template table locally, and taking the source version number of the template table as the local version number of the template table; if the template table with the ID number is cached locally, the method further comprises the following steps:
determining the local version number of the template form, and judging whether the local version number is the same as the source version number of the template form; if not, pulling the template table with the ID number from the server, and updating the cached template table with the ID number of the local template by using the pulled template table; if the template form is the same as the template form, the template form is not pulled from the server;
pulling the template form with the ID number from the server as a compressed form, and before locally caching the pulled template form, decompressing the pulled template form; the local caching is carried out on the pulled template form, and the local caching is carried out on the decompressed template form; specifically, the determined corresponding template table and the pulled item table may be merged using the following merging principle: if the item table and the corresponding template table have values in a certain cell, taking the value of the corresponding template table as the final value of the cell;
judging whether the item table with the ID number is cached locally or not according to the ID number of each received item table, if not, pulling the item table with the ID number from the server, determining the OID number of the pulled item table and the corresponding template table with the OID number, merging the determined corresponding template table and the pulled item table to obtain an item table formed by merging results, locally caching the item table formed by merging results, and generating a local version number of the cached item table; if the item table with the ID number is cached locally, the method further comprises the following steps:
determining the local version number and the OID number of the project table and a corresponding template table with the OID number, and judging whether the local version number of the project table is the same as the source version number; if not, pulling the item table with the ID number from the server, updating the locally cached item table by using the pulled item table, and taking the updated item table as an item table to be merged; if the local cached item tables are the same, taking the locally cached item tables as item tables to be merged; merging the project table to be merged and the determined corresponding template table, updating the project table to be merged by using a merging result, and generating the updated local version number of the project table to be merged.
2. The method of claim 1, wherein sending a load request to a server comprises:
after an application program opening instruction is obtained, a loading request is sent to a server; or the like, or, alternatively,
and sending a loading request to the server after detecting that a refreshing button on the displayed interface is clicked.
3. The method of claim 1, wherein determining the corresponding template table with the OID number comprises:
obtaining a source version number of the template table with the OID number from the server; judging whether the local version number of the template table with the OID number is the same as the source version number; if not, pulling the template table with the OID number from the server, updating the locally cached template table with the OID number by using the pulled template table, and determining the updated template table as the corresponding template table with the OID number; if the two template tables are the same, the template table with the OID number of the local cache is determined as the corresponding template table with the OID number.
4. The method of claim 1, wherein generating a local version number of the cached item table comprises:
the MD5 value of the cached item table is calculated, and the calculated MD5 value is taken as the local version number of the cached item table.
5. An online form caching apparatus, wherein the online form includes a template form and an item form, the item form is generated based on the template form, and an OID number of the item form is the same as an OID number of the template form used to generate the item form, the apparatus comprising:
the sending module is used for sending a loading request to the server; receiving a source version number and an ID number of an online form returned by the server aiming at the loading request;
the first cache module is used for judging whether the received ID number of each template table caches the template table with the ID number locally, if not, the template table with the ID number is pulled from the server, the pulled template table is cached locally, and the source version number of the template table is used as the local version number of the template table; and is also used for:
if the template form with the ID number is cached locally, determining the local version number of the template form, and judging whether the local version number is the same as the source version number of the template form or not; if not, pulling the template table with the ID number from the server, and updating the cached template table with the ID number of the local template by using the pulled template table; if the template form is the same as the template form, the template form is not pulled from the server;
a second cache module, configured to determine, for the ID number of each received item table, whether the item table with the ID number is cached locally, if not, pull the item table with the ID number from the server, determine an OID number of the pulled item table and a corresponding template table with the OID number, merge the determined corresponding template table and the pulled item table to obtain an item table formed by a merging result, locally cache the item table formed by the merging result, and generate a local version number of the cached item table; and is also used for:
if the item table with the ID number is cached locally, determining a local version number and an OID number of the item table and a corresponding template table with the OID number, and judging whether the local version number of the item table is the same as the source version number; if not, pulling the item table with the ID number from the server, updating the locally cached item table by using the pulled item table, and taking the updated item table as an item table to be merged; if the local cached item tables are the same, taking the locally cached item tables as item tables to be merged; merging the project table to be merged and the determined corresponding template table, updating the project table to be merged by using a merging result, and generating the updated local version number of the project table to be merged.
CN201811624628.3A 2018-12-28 2018-12-28 Online table caching method and device Active CN109815428B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811624628.3A CN109815428B (en) 2018-12-28 2018-12-28 Online table caching method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811624628.3A CN109815428B (en) 2018-12-28 2018-12-28 Online table caching method and device

Publications (2)

Publication Number Publication Date
CN109815428A CN109815428A (en) 2019-05-28
CN109815428B true CN109815428B (en) 2021-04-20

Family

ID=66602712

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811624628.3A Active CN109815428B (en) 2018-12-28 2018-12-28 Online table caching method and device

Country Status (1)

Country Link
CN (1) CN109815428B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112764693A (en) * 2019-11-04 2021-05-07 北京京东振世信息技术有限公司 Method and apparatus for printing template management
CN116955300B (en) * 2023-09-18 2023-11-28 云南瀚文科技有限公司 File generation method and system based on label technology

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003140933A (en) * 2001-11-06 2003-05-16 Nec Soft Ltd General purpose database built-in system
CN101727446A (en) * 2008-10-27 2010-06-09 国际商业机器公司 Method and system for accessing mobile Web, corresponding server and mobile equipment
CN104391725A (en) * 2014-12-08 2015-03-04 畅捷通信息技术股份有限公司 Page display method and page display device
CN105302789A (en) * 2015-12-03 2016-02-03 万达信息股份有限公司 Editing method of health information shared document template buffer storage
CN107766314A (en) * 2017-10-20 2018-03-06 网易(杭州)网络有限公司 The data processing method and device of electrical form
CN107819870A (en) * 2017-11-21 2018-03-20 广州视睿电子科技有限公司 Increment pulling data method, apparatus, storage medium, terminal device and server

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003140933A (en) * 2001-11-06 2003-05-16 Nec Soft Ltd General purpose database built-in system
CN101727446A (en) * 2008-10-27 2010-06-09 国际商业机器公司 Method and system for accessing mobile Web, corresponding server and mobile equipment
CN104391725A (en) * 2014-12-08 2015-03-04 畅捷通信息技术股份有限公司 Page display method and page display device
CN105302789A (en) * 2015-12-03 2016-02-03 万达信息股份有限公司 Editing method of health information shared document template buffer storage
CN107766314A (en) * 2017-10-20 2018-03-06 网易(杭州)网络有限公司 The data processing method and device of electrical form
CN107819870A (en) * 2017-11-21 2018-03-20 广州视睿电子科技有限公司 Increment pulling data method, apparatus, storage medium, terminal device and server

Also Published As

Publication number Publication date
CN109815428A (en) 2019-05-28

Similar Documents

Publication Publication Date Title
CN109829144B (en) Method and device for cross-table referencing of online table
US11847438B2 (en) Offline capabilities for live applications in a cloud collaboration platform
JP6129153B2 (en) Method and system for providing a state model of an application program
CN109901834B (en) Document page generation method, device, computer equipment and storage medium
CN108304201A (en) Object updating method, device and equipment
CN109829141B (en) Project table generation method and device
CN109815428B (en) Online table caching method and device
CN111506300A (en) Applet generation method, device, equipment and storage medium
CN112596714A (en) Webpage development method, device, terminal, server and storage medium
CN113158101A (en) Visual page rendering method, device, equipment and storage medium
CN111104479A (en) Data labeling method and device
CN112654995A (en) Tracking content attribution in online collaborative electronic documents
US10705832B2 (en) Efficient storage and analysis of source code modification history data
CN115455058A (en) Cache data processing method and device, computer equipment and storage medium
CN111444171B (en) Method, device and storage medium for generating value-added tax payment statement
US10558624B2 (en) System and method for datastore management framework
KR20200001139A (en) Server for editing electronic document based on message including edit command and operating method thereof
CN110162301B (en) Form rendering method, form rendering device and storage medium
US20220284371A1 (en) Method, device and medium for a business function page
CN115687826A (en) Page refreshing method and device, computer equipment and storage medium
CN114756212A (en) Low-code application integration method, device, equipment and medium
CN113342450A (en) Page processing method and device, electronic equipment and computer readable medium
CN115248682A (en) Code development data processing method and device, computer equipment and storage medium
CN113253991A (en) Task visualization processing method and device, electronic equipment and storage medium
US20190317976A1 (en) Geolocation based reusable sign riders

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant