Data query method and device for online document, electronic equipment, computer readable storage medium and computer program product

By performing signature verification and timestamp verification on data query requests for online documents, the problem of low security in the prior art is solved, and efficient and accurate data query is achieved.

CN120162474APending Publication Date: 2025-06-17TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510252518.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-03
Publication Date
2025-06-17

AI Technical Summary

Technical Problem

The prior art has low security in the data query process of online documents, and is prone to problems of unauthorized access and data tampering.

Method used

By receiving the data query request from the terminal device, the signature is verified based on the query timestamp and data identification, ensuring the authenticity of the source and content of the query request, and data query is conducted when the signature verification is passed and the query timestamp is within the validity period.

Benefits of technology

Improves the security of data queries, prevents data tampering and unauthorized access, and ensures data timeliness and accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120162474A_ABST
    Figure CN120162474A_ABST
Patent Text Reader

Abstract

The invention provides an online document data query method and device, electronic equipment, a computer readable storage medium and a computer program product. The method comprises the steps that a first data query request of a first terminal device for an online document is received, the first data query request comprises a first query timestamp, a first data identifier and a first signature, and the first data identifier is used for representing to-be-queried data in the online document; verifying the first signature based on the first query timestamp and the first data identifier; determining a first time difference value between the first query timestamp and a deadline timestamp of a validity period of the to-be-queried data in response to passing of verification of the first signature; querying a second data identifier of the to-be-queried data in response to the fact that the first time difference value is smaller than a time threshold value; and in response to the fact that the first data identifier is the same as the second data identifier, sending the to-be-queried data to the first terminal equipment. Through the method and the device, the security of data query can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to data processing technologies, and in particular to a method, apparatus, electronic device, computer-readable storage medium, and computer program product for querying data in an online document. Background Art

[0002] In the digital age, the access and data query of online documents have become increasingly common. Enterprises and individuals often need to access documents stored on a server through the network and query the data therein. To ensure data security and privacy, it is necessary to verify the user's query request to prevent unauthorized access and data leakage. Related technologies often use a single verification method, and abnormal requests are likely to bypass detection and tamper with the data in the online document, resulting in low security for data query. Summary of the Invention

[0003] Embodiments of this application provide a method, apparatus, electronic device, computer-readable storage medium, and computer program product for querying data in an online document, which can improve the security of data query.

[0004] The technical solution of the embodiments of this application is implemented as follows:

[0005] Embodiments of this application provide a method for querying data in an online document, the method including:

[0006] Receiving a first data query request for an online document from a first terminal device, where the first data query request includes a first query timestamp, a first data identifier, and a first signature, and the first data identifier is used to represent the data to be queried in the online document;

[0007] Verifying the first signature based on the first query timestamp and the first data identifier;

[0008] In response to passing the verification of the first signature, determining a first time difference between the first query timestamp and the cutoff timestamp of the validity period of the data to be queried;

[0009] In response to the first time difference being less than a time threshold, querying a second data identifier of the data to be queried;

[0010] In response to the first data identifier being the same as the second data identifier, sending the data to be queried to the first terminal device.

[0011] Embodiments of this application provide a data query apparatus for an online document, the apparatus including:

[0012] A request receiving module, configured to receive a first data query request for an online document from a first terminal device, where the first data query request includes a first query timestamp, a first data identifier, and a first signature, and the first data identifier is used to represent the data to be queried in the online document;

[0013] A signature verification module, configured to verify the first signature based on the first query timestamp and the first data identifier;

[0014] A difference determination module, configured to, in response to the verification of the first signature passing, determine a first time difference between the first query timestamp and the expiration timestamp of the data to be queried;

[0015] An identifier query module, configured to, in response to the first time difference being less than a time threshold, query a second data identifier of the data to be queried;

[0016] A data sending module, configured to, in response to the first data identifier being the same as the second data identifier, send the data to be queried to the first terminal device.

[0017] An embodiment of the present application provides an electronic device, where the electronic device includes:

[0018] A memory, configured to store computer-executable instructions or a computer program;

[0019] A processor, configured to, when executing the computer-executable instructions or the computer program stored in the memory, implement the data query method for an online document provided by an embodiment of the present application.

[0020] An embodiment of the present application provides a computer-readable storage medium, storing a computer program or computer-executable instructions, which are configured to implement the data query method for an online document provided by an embodiment of the present application when being executed by a processor.

[0021] An embodiment of the present application provides a computer program product, including a computer program or computer-executable instructions, where the computer program or computer-executable instructions, when being executed by a processor, implement the data query method for an online document provided by an embodiment of the present application.

[0022] The embodiment of the present application has the following beneficial effects:

[0023] By verifying the first signature in the first data query request, the authenticity of the source and content of the first data query request can be ensured, preventing data from being tampered with or forged, and improving data security; by comparing the first query timestamp with the expiration timestamp of the data to be queried, data query is only performed when the signature verification passes and the first query timestamp is within the valid period, ensuring the timeliness of the data; when querying the data to be queried, the data identifiers are further compared to ensure that the first data identifier in the first data query request is consistent with the second data identifier of the queried data to be queried, improving data accuracy and consistency. Description of the Drawings

[0024] Figure 1 is a schematic diagram of the architecture of the data query system 100 for online documents provided by an embodiment of the present application;

[0025] Figure 2 is a schematic diagram of the structure of the server 200 provided by an embodiment of the present application;

[0026] Figure 3A is a first flowchart of the data query method for online documents provided by an embodiment of the present application;

[0027] Figure 3B is a second flowchart of the data query method for online documents provided by an embodiment of the present application;

[0028] Figure 3C is a third flowchart of the data query method for online documents provided by an embodiment of the present application;

[0029] Figure 3D is a fourth flowchart of the data query method for online documents provided by an embodiment of the present application;

[0030] Figure 3E is a fifth flowchart of the data query method for online documents provided by an embodiment of the present application;

[0031] Figure 3F is a sixth flowchart of the data query method for online documents provided by an embodiment of the present application;

[0032] Figure 3G is a seventh flowchart of the data query method for online documents provided by an embodiment of the present application;

[0033] Figure 3H is an eighth flowchart of the data query method for online documents provided by an embodiment of the present application;

[0034] Figure 3I is a ninth flowchart of the data query method for online documents provided by an embodiment of the present application;

[0035] Figure 3J is the tenth process schematic diagram of the data query method for online documents provided by the embodiments of the present application;

[0036] Figure 4A is the first schematic diagram of the preview content corresponding to the dynamic data provided by the embodiments of the present application;

[0037] Figure 4B is the second schematic diagram of the preview content corresponding to the dynamic data provided by the embodiments of the present application;

[0038] Figure 5A is the first schematic diagram of storing dynamic data provided by the embodiments of the present application;

[0039] Figure 5B is the second schematic diagram of storing dynamic data provided by the embodiments of the present application;

[0040] Figure 6 is the schematic diagram of updating the data identifier provided by the embodiments of the present application;

[0041] Figure 7 is the schematic diagram of storing data in the cache provided by the embodiments of the present application;

[0042] Figure 8 is the schematic diagram of verifying and accessing data provided by the embodiments of the present application.

[0043] It should be noted that the above "first" and "second" are only used to distinguish different solutions, and do not represent the distinction of the advantages and disadvantages of the solutions or the priority in the implementation process. Detailed implementation manners

[0044] In order to make the objectives, technical solutions and advantages of the present application clearer, the present application will be further described in detail below with reference to the accompanying drawings. The described embodiments should not be regarded as limitations of the present application. All other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the scope of protection of the present application.

[0045] In the following description, "some embodiments" are involved, which describe a subset of all possible embodiments. However, it can be understood that "some embodiments" can be the same subset or different subsets of all possible embodiments, and can be combined with each other without conflict.

[0046] In the following description, the terms "first / second / third" involved are only used to distinguish similar objects, and do not represent a specific order for the objects. It can be understood that "first / second / third" can be interchanged with a specific order or sequence when allowed, so that the embodiments of the present application described here can be implemented in an order other than that illustrated or described here.

[0047] In the embodiments of the present application, the term "module" or "unit" refers to a computer program with a predetermined function or a part of a computer program, which works together with other related parts to achieve a predetermined goal, and can be implemented in whole or in part by using software, hardware (such as a processing circuit or a memory), or a combination thereof. Similarly, one processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be a part of an overall module or unit that includes the function of that module or unit.

[0048] Unless otherwise specified, "at least one" as described below refers to the case of one or more, and "multiple" can refer to the case of two or more.

[0049] Unless otherwise defined, all technical and scientific terms used in the embodiments of the present application have the same meaning as commonly understood by those skilled in the technical field to which the present application belongs. The terms used in the embodiments of the present application are only for the purpose of describing the embodiments of the present application and are not intended to limit the present application.

[0050] In the embodiments of the present application, when collecting and processing relevant data in actual applications, the informed consent or separate consent of the personal information subject should be obtained in strict accordance with the requirements of relevant laws and regulations, and subsequent data use and processing behaviors should be carried out within the scope authorized by laws, regulations and the personal information subject.

[0051] Before further elaborating on the embodiments of the present application, the nouns and terms involved in the embodiments of the present application are described. The nouns and terms involved in the embodiments of the present application are applicable to the following explanations.

[0052] 1) Responsive to: used to indicate the conditions or states on which the executed operations depend. When the dependent conditions or states are met, one or more executed operations can be real-time or can have a set delay; without special instructions, there is no restriction on the execution order of the multiple executed operations.

[0053] 2) Human-computer interaction interface, an interface for providing human-computer interaction functions / an interface for displaying online documents.

[0054] For example, a graphical user interface (GUI) is presented, such as an augmented reality (AR) interface, a virtual reality (VR) interface, a voice user interface (VUI), an interactive projection interface (using projection technology to display information on a flat surface), an eye movement detection interface (an interface controlled by detecting the user's line of sight), a holographic interface (a three-dimensional hologram formed by projecting an image through holographic projection technology, allowing a stereoscopic image to be seen without wearing special glasses), a multimodal interface (an interactive interface that combines multiple interaction methods such as touch, vision, and hearing), a brain-machine interface (BMI) interface, etc.

[0055] 3) An electronic document, abbreviated as a document, is a document that depends on a computer system for storage and editing and has a certain editable format. For example, text-based documents represented by word processor application (Word) documents or text documents (TXT), table-based documents represented by spreadsheet (Excel) documents, presentation-based documents represented by presentation (PPT, PowerPoint) documents, and portable document format (PDF).

[0056] 4) The validity period refers to the specific time period during which the data to be queried is authorized for use. Determine the generation timestamp and the expiration timestamp of the data to be queried, and use the time period from the generation timestamp to the expiration timestamp as the validity period of the data to be queried. For example, if the generation timestamp of the data to be queried in an online document is 10:00:00 on April 1, 2023, and the expiration timestamp is 12:00:00 on April 1, 2023, then the validity period of the data to be queried is from 10:00:00 on April 1, 2023 to 12:00:00 on April 1, 2023.

[0057] 5) Static data refers to data that remains unchanged within a certain period of time. This type of data is not updated frequently or only changes under specific conditions. For example, the types of static data include paragraphs, headings, tables, rows, columns, and content in online documents.

[0058] 6) Dynamic data refers to a data object formed by combining static data with its corresponding second data identifier. This combination enables dynamic data to include not only the original data content but also the data identifier used to quickly identify and access the data, thereby improving the efficiency and flexibility of data management, enabling a faster response to query requests, and ensuring data security and consistency.

[0059] 7) Generation duration refers to the difference between the current time and the time when the second data identifier is generated, usually expressed in time units (such as seconds, minutes, hours, days, etc.). The generation duration is used to measure how much time has passed since the second data identifier was generated. When the generation duration exceeds the preset duration threshold, it indicates that the second data identifier has expired or needs to be updated.

[0060] 8) Validity period refers to the total time span from the time when the third data identifier is generated to the time when it expires, usually expressed in time units (such as seconds, minutes, hours, days, etc.). The validity period defines the valid usage period of the third data identifier. During this period, the third data identifier can be used to access or operate the corresponding data.

[0061] 9) Invalid operation refers to the process in which the modification operation performed by the user during the collaborative editing of the online document fails to successfully update the document content, or the modification operation does not meet the specified validity conditions. Invalid operations can be caused by a variety of reasons, including but not limited to user input errors, network problems, system limitations, etc. Invalid operations include any of the following: the data corresponding to the modification operation is invalid data, such as meaningless data in the link, which does not affect the successful jump of the link after modification; within the preset time, the new data corresponding to multiple modification operations in the online document is the same as the original data. For example, if the preset time is 2 seconds, an invalid operation may be deleting a character within 1 second and then adding the character to the original position.

[0062] 10) Target permissions refer to the rights and restrictions granted to the first terminal device to perform specific operations on the online document. These permissions determine what operations the first terminal device can perform on the document and under what conditions these operations can be performed. The setting of target permissions is usually based on factors such as the owner of the document, the role of the user, and the sensitivity of the document. Target permissions include at least one of the following: viewing online documents, that is, allowing users to view the content of online documents, but not allowing editing or modification; editing online documents, that is, allowing users to edit and modify the content of online documents; viewing online documents within a preset time, that is, allowing users to view the content of online documents within a certain time range; editing online documents within a preset time, that is, allowing users to edit and modify the content of online documents within a certain time range; sharing online documents, that is, allowing users to share online documents with other users or teams; exporting online documents, that is, allowing users to export online documents to other formats (such as PDF, Word, etc.).

[0063] When querying data in online documents, related technologies often use a single verification method, and abnormal requests can easily bypass detection and tamper with the data in the online documents, resulting in low security of data query.

[0064] Based on the above analysis, the applicant found that the data query method for online documents in the related art cannot avoid the problem of data tampering during the data query process. In view of the above problems, the embodiments of the present application provide a data query method for online documents, which can improve the security of data query.

[0065] The following describes the exemplary applications of the electronic device provided by the embodiments of the present application. The electronic device provided by the embodiments of the present application can be implemented as various types of terminal devices such as laptop computers, tablet computers, desktop computers, set-top boxes, smart phones, smart speakers, smart watches, smart TVs, in-vehicle terminals, etc., or can be implemented as a server. Below, the exemplary application when the electronic device is implemented as a server will be described.

[0066] See Figure 1 , Figure 1 FIG. 11 is a schematic diagram of the architecture of the data query system 100 for online documents provided by the embodiments of the present application. To support a data query application for an online document, terminal devices (exemplarily shown as terminal device 400-1 and terminal device 400-2) are connected to the server 200 through the network 300. The network 300 can be a wide area network, a local area network, or a combination of both.

[0067] In the online document scenario, the terminal device 400-1 (i.e., the first terminal device) logs in with the first object account of the first object, and the terminal device 400-2 (i.e., the second terminal device) logs in with the second object account of the second object. The second object is the object that creates the online document. The server 200 receives the data query request from the terminal device 400-1, verifies the signature, timestamp, and data identifier in sequence, and sends the data to be queried to the terminal device 400-1 after the verification passes, for display on the human-computer interaction interface 410-1 of the terminal device 400-1.

[0068] In response to the modification operation of the terminal device 400-2 on the online document, the modified online document is synchronized to the terminal device 400-1 through the server 200 and the network 300.

[0069] In some embodiments, the server 200 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, Content Delivery Network (CDN), and big data and artificial intelligence platforms. The terminal device and the server can be directly or indirectly connected through wired or wireless communication methods, which are not limited in the embodiments of the present application.

[0070] SeeFigure 2 , Figure 2 is a schematic structural diagram of the server 200 provided by an embodiment of the present application. Figure 2 The illustrated server 200 includes: at least one processor 210, a memory 230, and at least one network interface 220. Each component in the server 200 is coupled together through a bus system 240. It can be understood that the bus system 240 is used to implement the connection and communication between these components. In addition to the data bus, the bus system 240 also includes a power bus, a control bus, and a status signal bus. However, for the sake of clear illustration, in Figure 2 all kinds of buses are labeled as the bus system 240.

[0071] The processor 210 can be an integrated circuit chip with signal processing capabilities, such as a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor can be a microprocessor or any conventional processor, etc.

[0072] The memory 230 can be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid-state memories, hard disk drives, optical disc drives, etc. The memory 230 optionally includes one or more storage devices that are physically remote from the processor 210.

[0073] The memory 230 includes volatile memory or non-volatile memory, and can also include both volatile and non-volatile memory. The non-volatile memory can be a read-only memory (ROM, Read Only Memory), and the volatile memory can be a random access memory (RAM, Random Access Memory). The memory 230 described in the embodiments of the present application is intended to include any suitable type of memory.

[0074] In some embodiments, the memory 230 is capable of storing data to support various operations. Examples of such data include programs, modules, and data structures, or subsets or supersets thereof, which are described below by way of example.

[0075] An operating system 231, including system programs for processing various basic system services and performing hardware-related tasks, such as a framework layer, a core library layer, a driver layer, etc., for implementing various basic services and processing hardware-based tasks;

[0076] A network communication module 232 is used to reach other electronic devices via one or more (wired or wireless) network interfaces 220. Exemplary network interfaces 220 include: Bluetooth, Wireless Fidelity (WiFi), and Universal Serial Bus (USB), etc.;

[0077] In some embodiments, the device provided by the embodiments of the present application can be implemented in software. Figure 2 Shown is a data query device 233 for online documents stored in a memory 230, which can be software in the form of programs and plugins, etc. It includes the following software modules: a request receiving module 2331, a signature verification module 2332, a difference determination module 2333, an identification query module 2334, and a data sending module 2335. These modules are logical, so they can be combined arbitrarily or further split according to the functions implemented. The functions of each module will be described below.

[0078] In some embodiments, a terminal device or a server can implement the data query method for online documents provided by the embodiments of the present application by running various computer-executable instructions or computer programs. For example, the computer-executable instructions can be commands at the microprogram level, machine instructions, or software instructions. The computer program can be a native program or a software module in an operating system; it can be a local (Native) application (APPlication, APP), that is, a program that needs to be installed in the operating system to run, such as a document APP or an instant messaging APP; it can also be a small program that can be embedded in any APP, that is, a program that only needs to be downloaded to the browser environment to run. In short, the above computer-executable instructions can be instructions in any form, and the above computer programs can be application programs, modules, or plugins in any form.

[0079] The data query method for online documents provided by the embodiments of the present application will be described in combination with the exemplary applications and implementations of the server provided by the embodiments of the present application.

[0080] See Figure 3A , Figure 3A is the first process schematic diagram of the data query method for online documents provided by the embodiments of the present application. Taking the server as the main body, it will be described in combination with Figure 3A the steps shown.

[0081] In step 101, a first data query request for an online document is received from a first terminal device. The first data query request includes a first query timestamp, a first data identifier, and a first signature, where the first data identifier is used to characterize the data to be queried in the online document.

[0082] In some embodiments, the first data query request is used to request the data to be queried. The first query timestamp represents the moment when the first data query request is generated. The first signature is generated by the first terminal device based on the first query timestamp and the first data identifier.

[0083] Exemplarily, the first signature can be generated by the first terminal device through an asymmetric encryption algorithm and a hashing algorithm. Specifically: The first terminal device uses a hashing algorithm (such as SHA-256) to calculate the first query timestamp and the first data identifier, obtaining a fixed-length information digest. This digest can be regarded as the digital fingerprint of the information, and any minor change to the original information will cause a significant change in the digest. The first terminal device uses the private key to encrypt the generated information digest. The private key is the only key owned by the first terminal device, and the encrypted information digest is used as the first signature. The encrypted information digest (i.e., the first signature) is sent to the server together with or separately from the first query timestamp and the first data identifier.

[0084] In the embodiments of the present application, the first signature is generated by the private key of the first terminal device, ensuring the security of the data. The server can use the public key of the first terminal device to decrypt the first signature, obtain the information digest, and compare it with the digest obtained by performing a hashing operation on the first query timestamp and the first data identifier by itself. If the two are the same, it indicates that the request has not been tampered with during transmission, ensuring the consistency of the data.

[0085] In some embodiments, refer to Figure 3B , Figure 3B is the second process schematic diagram of the data query method for online documents provided by the embodiments of the present application. When performing step 101, "receiving the first data query request from the first terminal device for the online document", perform Figure 3B steps 201 to 204, which are specifically described below.

[0086] In step 201, receive the third data query request from the first terminal device for the online document, where the third data query request includes a third query timestamp, a first data identifier, and a fourth signature.

[0087] In some embodiments, the third data query request is used to request the data to be queried in the online document. The third query timestamp represents the moment when the third data query request is generated. The fourth signature is generated by the first terminal device based on the third query timestamp and the first data identifier.

[0088] Exemplarily, the fourth signature can be generated by the first terminal device in any of the following ways: asymmetric encryption algorithm, hash algorithm, Hash-based Message Authentication Code (HMAC), Digital Signature Algorithm (DSA). Taking the symmetric encryption algorithm as an example, the third query timestamp and the first data identifier are combined into a data block, which is usually converted into a binary format for easy encryption; an encryption algorithm is selected, for example, Advanced Encryption Standard (AES), Data Encryption Standard (DES), or Triple Data Encryption Standard (3DES), etc., to ensure that the length of the data block meets the block size threshold of the selected encryption algorithm. If the data block length is less than the block size threshold, padding is performed on the data block, for example, using the Public-Key Cryptography Standard Number 7 (PKCS#7) padding scheme. If the data block length is greater than the block size threshold, the data block is divided into multiple sub-data blocks; an encryption mode is selected to encrypt the multiple sub-data blocks to obtain multiple ciphertext blocks. Among them, the encryption mode can be any of the following: Electronic Code Book (ECB), Cipher-block chaining (CBC), Cipher Feedback (CFB), Output FeedBack (OFB), or CounTeR (CTR) mode. Taking ECB as an example, each data block is independently encrypted with the same key to obtain a ciphertext block; taking the CBC mode as an example, for each data block, after performing an exclusive OR operation on the data block and the previous ciphertext block, encryption is performed. The multiple ciphertext blocks are combined into the fourth signature.

[0089] In step 202, in response to the third query timestamp being within the identification validity period of the first data identifier, the fourth signature is verified based on the third query timestamp and the first data identifier.

[0090] In some embodiments, the identification validity period can be preset by the object creating the online document according to business requirements, or dynamically generated by analyzing factors such as historical data, the behavior pattern of the object, or system load, or can also be a preset default value. Compare the third query timestamp with the expiration timestamp of the identification validity period of the first data identification. If the third query timestamp is less than the expiration timestamp of the identification validity period of the first data identification, it is determined that the third query timestamp is within the identification validity period of the first data identification. Decrypt the fourth signature to obtain the encrypted hash value, where the encrypted hash value is obtained by the first terminal device performing a hash operation on the third query timestamp and the first data identification; the server performs a hash operation on the third query timestamp and the first data identification using the same hash algorithm to obtain the decrypted hash value. If the encrypted hash value is the same as the decrypted hash value, it is determined that the verification of the fourth signature passes; if the encrypted hash value is different from the decrypted hash value, it is determined that the verification of the fourth signature fails.

[0091] For example, if the first data identification is "DataID123", the validity period of the first data identification is from January 1, 2023 to December 31, 2023, and the third query timestamp is June 15, 2023. Since June 15, 2023 is between January 1, 2023 and December 31, 2023, the third query timestamp is within the identification validity period of the first data identification. Perform a hash operation on the first data identification "DataID123" and the third query timestamp "June 15, 2023" through the SHA-256 hash algorithm to obtain the encrypted hash value "HashValue123". Use the AES encryption algorithm and the pre-shared symmetric key, such as "SecretKey123", to encrypt the encrypted hash value as the fourth signature. The server decrypts the fourth signature using the pre-shared symmetric key and the same encryption algorithm to obtain the encrypted hash value "HashValue123". At the same time, perform a hash operation on the third query timestamp and the first data identification using the same hash algorithm as the first terminal device. For example, the server performs a hash operation on "DataID123" and "June 15, 2023 12:00:00" using the SHA-256 hash algorithm to obtain the decrypted hash value "HashValue123"; compare whether the encrypted hash value is the same as the decrypted hash value. Since the encrypted hash value "HashValue123" is the same as the decrypted hash value "HashValue123", the verification of the fourth signature passes.

[0092] In step 203, in response to the verification of the fourth signature passing, determine the third time difference between the third query timestamp and the expiration timestamp of the validity period of the data to be queried.

[0093] Continuing with the example in step 202, the third query timestamp is "June 15, 2023", and the validity period of the data to be queried is from January 1, 2023 to December 31, 2023. Then the end timestamp of the validity period of the data to be queried is "December 31, 2023", and the third time difference between the third query timestamp and the end timestamp of the validity period of the data to be queried is -199 days.

[0094] In step 204, in response to the third time difference being less than the time threshold, the data to be queried is sent to the first terminal device.

[0095] In some embodiments, the time threshold can be zero. When the third time difference is less than zero, it indicates that the third query timestamp is before the end timestamp of the validity period of the data to be queried, that is, the third query timestamp is still within the validity period, and then the data to be queried is sent to the first terminal device. When the third time difference is greater than zero, it indicates that the third query timestamp is after the end timestamp of the validity period of the data to be queried, that is, the third query timestamp is not within the validity period and the third data query request has expired, then the data to be queried is not sent to the first terminal device, or information indicating that the data sending has failed is sent to the first terminal device.

[0096] For example, the validity period of the data to be queried is from January 1, 2023 to December 31, 2023, and the end timestamp of the validity period of the data to be queried is December 31, 2023. If the third query timestamp is June 15, 2023, then the third time difference between the third query timestamp and the end timestamp of the validity period of the data to be queried is -199 days. At this time, the third time difference -199 is less than the time threshold 0, that is, the third query timestamp is before the end timestamp of the validity period of the data to be queried, and then the data to be queried is sent to the first terminal device; if the third query timestamp is February 15, 2024, then the third time difference between the third query timestamp and the end timestamp of the validity period of the data to be queried is 46 days. At this time, the third time difference 46 is greater than the time threshold 0, that is, the third query timestamp is after the end timestamp of the validity period of the data to be queried, and then the data to be queried is not sent to the first terminal device, or information indicating that the data sending has failed is sent to the first terminal device.

[0097] Continue to refer to Figure 3A In step 102, the first signature is verified based on the first query timestamp and the first data identifier.

[0098] In some embodiments, before "verifying the first signature based on the first query timestamp and the first data identifier", the first data query request is parsed to obtain the first query timestamp, the first data identifier, and the first signature.

[0099] For example, identify the format of the first data query request. For example, the format can be JavaScript Object Notation (JSON), Extensible Markup Language (XML), Uniform Resource Locator (URL) parameters, etc.; according to the format of the first data query request, use the corresponding parsing method to extract the first query timestamp, the first data identifier, and the first signature. For example, if the first data query request is in JSON format, parse the JSON object and extract the corresponding key-value pairs. If the first data query request is in XML format, parse the XML document and extract the content in the tags. If the first data query request is sent through URL parameters, parse the URL and extract the parameters in the query string.

[0100] In some embodiments, refer to Figure 3C , Figure 3C which is the third process schematic diagram of the data query method for online documents provided by the embodiments of the present application. Figure 3A Step 102 of Figure 3C can be implemented by steps 1021 to 1025 of

[0101] In step 1021, decrypt the first signature to obtain the first hash value, where the first hash value is obtained by the first terminal device performing a hash operation on the first query timestamp and the first data identifier.

[0102] In some embodiments, if the first signature is encrypted using the private key of the first terminal device, decrypt the first signature using the pre-shared public key to obtain the first hash value. The first hash value can be determined by performing the following process: the first terminal device combines the first query timestamp and the first data identifier to obtain a string, and inputs the string into a hash function to obtain the first hash value.

[0103] For example, the first terminal device sends a first data query request to the server, where the first data query request includes the first query timestamp "2023-04-01T12:00:00Z" and the first data identifier "DOC-12345". The first terminal device performs a hash operation on the first query timestamp and the first data identifier using the private key to obtain the first hash value "10045", and then encrypts the first hash value to generate the first signature "SIGNATURE-XYZ". After receiving the first data query request from the first terminal device, the server decrypts the first signature "SIGNATURE-XYZ" using the shared public key to obtain the first hash value "10045".

[0104] In step 1022, determine the second hash value of the first query timestamp and the first data identifier.

[0105] Here, perform a hash operation on the first query timestamp and the first data identifier using the same hash algorithm as the first terminal device to obtain the second hash value.

[0106] In some embodiments, refer to Figure 3D , Figure 3D which is the fourth process schematic diagram of the data query method for online documents provided by the embodiments of this application. Figure 3C Step 1022 of Figure 3D can be implemented by steps 10221 to 10224 of

[0107] In step 10221, concatenate the first query timestamp and the first data identifier to obtain a first string.

[0108] Exemplarily, if the first query timestamp is "2023-04-01T12:00:00Z" and the first data identifier is "DOC-12345", the concatenated first string is "2023-04-01T12:00:00ZDOC-12345".

[0109] In step 10222, in response to the first string being greater than a preset length, split the first string into multiple data blocks based on the preset length.

[0110] In some embodiments, split the first string into N data blocks based on the preset length, where N is a positive integer greater than 1. If the length of the first string is an integer multiple of the preset length, the lengths of the N data blocks are all equal to the preset length; if the length of the first string is not an integer multiple of the preset length, the lengths of the first N - 1 data blocks are equal to the preset length, and the length of the Nth data block is the remainder of the ratio of the length of the first string to the preset length.

[0111] Continuing with the example of step 10221 above, if the preset length is 10, split the first string "2023-04-01T12:00:00ZDOC-12345" into 3 data blocks, namely data block 1 "2023-04-01", data block 2 "T12:00:00", and data block 3 "ZDOC-12345".

[0112] In step 10223, perform a modulo operation on each data block to obtain the sub-hash value of the data block.

[0113] In some embodiments, the modulo operation is an operation to find the remainder after dividing two integers. For each data block, a modulo value is obtained, the remainder after dividing the data block by the modulo value is determined, and the remainder is used as the sub-hash value of the data block.

[0114] Continuing with the example of step 10222 above, if the modulo value is 100, the value corresponding to data block 1 "2023-04-01" is 20230401. After dividing by the modulo value 100, the remainder is 1, so the sub-hash value of data block 1 is 1. First, convert the value corresponding to data block 2 "T12:00:00" to a numerical form. Assuming the conversion result is 12000000, after dividing by the modulo value 100, the remainder is 00, so the sub-hash value of data block 2 is 00. Convert the value corresponding to data block 3 "ZDOC-12345" to a numerical form. Assuming the conversion result is 12345, after dividing by the modulo value 100, the remainder is 45, so the sub-hash value of data block 3 is 45.

[0115] In some embodiments, in addition to the modulo operation, AND, OR, NOT, XOR, and shift operations can also be performed on each data block to obtain the sub-hash value of the data block.

[0116] For example, taking the XOR operation as an example, the XOR operation means that when two corresponding binary bits are the same, the result is 0; when two corresponding binary bits are different, the result is 1. Assume a data block is "1010" (binary), and a fixed XOR key "1100" is selected. Then the result of the XOR operation is "0110", that is, the sub-hash value corresponding to this data block is "0110".

[0117] In step 10224, the sub-hash values corresponding to multiple data blocks are combined into a second hash value.

[0118] Continuing with the example of step 10223 above, combine the sub-hash value 1 of data block 1, the sub-hash value 00 of data block 2, and the sub-hash value 45 of data block 3 into the second hash value "10045".

[0119] In the embodiments of the present application, by splitting the long string and calculating the sub-hash values respectively, strings exceeding the preset length can be effectively processed, avoiding performance problems when the hash function processes long strings. When it is necessary to increase or decrease the size of the data block, it can be achieved by adjusting the preset length, which has good scalability.

[0120] Continue to refer to Figure 3C In step 1023, the first hash value and the second hash value are verified.

[0121] Here, the first hash value and the second hash value are compared element by element in the order from left to right. For example, if the first hash value is "10045" and the second hash value is "10045", the elements in the first hash value are "1", "0", "0", "4", "5" in the order from left to right, and the elements in the second hash value are "1", "0", "0", "4", "5" in the order from left to right. The elements at each same position are compared respectively.

[0122] In step 1024, if the first hash value and the second hash value are the same, it is determined that the verification of the first signature passes.

[0123] Continuing with the example in the above steps 1021 and 10224, if the first hash value is "10045" and the second hash value is "10045", it is determined that the verification of the first signature passes.

[0124] In step 1025, if the first hash value and the second hash value are different, it is determined that the verification of the first signature fails.

[0125] For example, if the first hash value is "10045" and the second hash value is "10245", it is determined that the verification of the first signature fails.

[0126] In the embodiments of the present application, by comparing the hash values, it can be ensured that the data is not tampered with during the transmission process, guaranteeing the integrity of the data. The signature provides traceability of the data. Through signature verification, the trust between the first terminal device and the server can be enhanced, ensuring the security and reliability of data exchange.

[0127] Continue to refer to Figure 3A , in step 103, in response to the verification of the first signature passing, determine the first time difference between the first query timestamp and the end timestamp of the validity period of the data to be queried.

[0128] For example, if the first query timestamp is "August 20, 2023", and the validity period of the data to be queried is from January 1, 2023 to December 31, 2023, then the end timestamp of the validity period of the data to be queried is "December 31, 2023", and the first time difference between the first query timestamp and the end timestamp of the validity period of the data to be queried is -133 days.

[0129] In step 104, in response to the first time difference being less than the time threshold, query the second data identifier of the data to be queried.

[0130] In some embodiments, the time threshold may be zero. When the first time difference is less than zero, it indicates that the first query timestamp is before the expiration timestamp of the data to be queried, that is, the first query timestamp is still within the valid period, and the data to be queried is sent to the first terminal device. When the first time difference is greater than zero, it indicates that the first query timestamp is after the expiration timestamp of the data to be queried, that is, the first query timestamp is not within the valid period and the first data query request has expired, and the data to be queried is not sent to the first terminal device, or information indicating that the data sending has failed is sent to the first terminal device.

[0131] Exemplarily, the valid period of the data to be queried is from January 1, 2023 to December 31, 2023, and the expiration timestamp of the valid period of the data to be queried is December 31, 2023. If the first time difference is less than the time threshold, that is, the first query timestamp is before the expiration timestamp of the data to be queried. For example, if the first query timestamp is August 20, 2023, the data to be queried is sent to the first terminal device; if the first time difference is greater than the time threshold, that is, the first query timestamp is after the expiration timestamp of the data to be queried. For example, if the first query timestamp is January 1, 2024, the data to be queried is not sent to the first terminal device, or information indicating that the data sending has failed is sent to the first terminal device.

[0132] In some embodiments, refer to Figure 3E , Figure 3E is the fifth process schematic diagram of the data query method for the online document provided by the embodiments of the present application. Before step 104 "query the second data identifier of the data to be queried", for each type of static data in the online document, perform Figure 3E steps 301 to 302, which are specifically described below.

[0133] In step 301, based on the characteristics of the static data of the type, a second data identifier corresponding to the static data of the type is generated.

[0134] Here, the characteristics of different types of static data are different, and the second data identifiers corresponding to different types of static data are different.

[0135] In some embodiments, the multiple types include paragraphs, headings, tables, rows, columns, and content of the online document. Refer to Figure 3F , Figure 3F is the sixth process schematic diagram of the data query method for the online document provided by the embodiments of the present application. Figure 3E Step 301 of Figure 3F can be implemented through steps 3011 to 3016 of

[0136] In step 3011, for each paragraph of the online document, the paragraph number of the paragraph is used as the second data identifier corresponding to the paragraph.

[0137] For example, the online document includes 3 paragraphs. The second data identifier corresponding to the first paragraph is "Paragraph 1", the second data identifier corresponding to the second paragraph is "Paragraph 2", and the third data identifier corresponding to the third paragraph is "Paragraph 3".

[0138] In step 3012, the first keyword is extracted from the title of the online document, encoded, and the encoded first keyword is used as the second data identifier corresponding to the title.

[0139] In some embodiments, the title of the online document is preprocessed to remove any unnecessary characters such as punctuation marks, special characters, etc., and only letters and numbers are retained. The title is converted to lowercase for unified processing. Using natural language processing techniques such as tokenization tools, the preprocessed title is split into multiple words or phrases. Keywords are identified from multiple words, which can be achieved by analyzing factors such as the importance of words, word frequency, position, etc. The keyword is converted into a symbolic representation through a predefined set of encoding rules. The encoding rules can be based on combinations of letters, numbers, abbreviations, or other symbols. For example, the first letter combination of the keyword can be selected, or a specific encoding algorithm can be used to convert the keyword into a symbolic representation as the second data identifier.

[0140] For example, if the title of the online document is: "First Quarter of 2023 - Sales Data Analysis Report". Remove the punctuation marks and special characters in the title and convert it to lowercase: "First Quarter of 2023 Sales Data Analysis Report". Use a tokenization tool to split the title into words or phrases, such as "2023 year", "First Quarter", "Sales", "Data Analysis", "Report". The Term Frequency-Inverse Document Frequency (TF-IDF) algorithm can be used to evaluate the importance of words, and the word with the highest importance is used as the keyword, such as "Sales Data Analysis". The first letter combination of the keyword is used as the second data identifier corresponding to the title. For example, the first letter of each character in "Sales Data Analysis" is "xssjfx" in sequence, then "xssjfx" is used as the second data identifier corresponding to the title "First Quarter of 2023 - Sales Data Analysis Report".

[0141] In step 3013, for each table in the online document, the serial number of the table is used as the second data identifier corresponding to the table.

[0142] For example, online document A includes 2 tables, which are Table 1, Table 2, and Table 3 in the order from front to back in the online document. Then, “Table 1” is used as the second data identifier corresponding to Table 1, “Table 2” is used as the second data identifier corresponding to Table 2, and “Table 3” is used as the second data identifier corresponding to Table 3.

[0143] In step 3014, for each row of the online document, the row number of the row is used as the second data identifier corresponding to the row.

[0144] For example, for the first row of the online document, “Row 1” is used as the second data identifier corresponding to the first row; for the second row of the online document, “Row 2” is used as the second data identifier corresponding to the second row; for the third row of the online document, “Row 3” is used as the second data identifier corresponding to the third row.

[0145] In step 3015, for each column of the online document, the column number of the column is used as the second data identifier corresponding to the column.

[0146] For example, for the first column of the online document, “Column 1” is used as the second data identifier corresponding to the first column; for the second column of the online document, “Column 2” is used as the second data identifier corresponding to the second column; for the third column of the online document, “Column 3” is used as the second data identifier corresponding to the third column.

[0147] In step 3016, the second keyword is extracted from the content of the online document, the second keyword is encoded, and the encoding result is used as the second data identifier corresponding to the content.

[0148] In some embodiments, the content of the online document is preprocessed, including removing punctuation marks, special characters, numbers, etc., converting the content to lowercase for unified processing. The preprocessed content is divided into words using a word segmentation tool. Common stop words such as “de” (of), “shi” (is), “zai” (in), etc. are removed, as these words usually do not carry important information. Keyword extraction algorithms such as TF-IDF, TextRank, etc. are used to identify important keywords in the content, and the keyword with the highest score is selected as the second keyword. Taking TF-IDF as an example, for each word, the following processing is performed: calculate the frequency of the word in the content; determine the target number of documents including the word, determine the sum of the target number and a preset value (such as 1), obtain the total number of documents, determine the logarithm of the ratio of the total number to the sum, and use the logarithm as the inverse document frequency of the word; determine the product of the frequency and the inverse document frequency, and use the product as the score of the word. A set of encoding rules is defined for converting keywords into codes, and the encoding rules can be based on combinations of letters, numbers, abbreviations, or other symbols. According to the defined encoding rules, the extracted second keyword is encoded to generate the second data identifier corresponding to the content.

[0149] For example, the content of the online document is: "In the first quarter of 2023, our sales data analysis showed that the sales volume increased by 10% year-on-year. This was mainly due to the exploration of new markets and the optimization of product lines." First, remove the punctuation marks and special characters from the content and convert it to lowercase: "In the first quarter of 2023 our sales data analysis showed that the sales volume increased by 10% year-on-year this was mainly due to the exploration of new markets and the optimization of product lines". Tokenize the preprocessed content, for example, "in", "2023", "the first quarter", "our", "sales", "data", "analysis", "showed", "sales volume", "increased by", "10%", "this", "mainly", "due to", "new", "market", "exploration", "and", "product line", "optimization". Filter out the stop words to get the remaining words, such as "2023", "the first quarter", "sales", "data", "analysis", "showed", "sales volume", "increased by", "10%", "mainly", "due to", "new", "market", "exploration", "product line", "optimization". Use the TF-IDF algorithm to identify the keywords, such as "sales data analysis", "increased by year-on-year", "new market exploration", "product line optimization", determine the score of each keyword, and take the keyword with the highest score as the second keyword. For example, for "sales data analysis", the first letters of each character are "xssjfx" in sequence, then "xssjfx" is used as the second data identifier corresponding to the content.

[0150] In the embodiments of the present application, by assigning a unique number or code, a unique second data identifier is assigned to each paragraph, table, row, column, and content, facilitating quick positioning and reference. The document content is structured, making the organization and management of the document more orderly, which is beneficial to automated processing and data analysis. The data identifier can improve the efficiency of document processing and reduce the time cost of manual search and management.

[0151] Continue to refer to Figure 3E , in step 302, the static data of type is combined with the second data identifier corresponding to the static data of type to form the dynamic data of type.

[0152] In some embodiments, each paragraph of the online document is combined with the paragraph number of each paragraph to form dynamic data; the title of the online document is combined with the first keyword extracted from the title after encoding to form dynamic data; each table of the online document is combined with the serial number of each table to form dynamic data; each row of the online document is combined with the row number of each row to form dynamic data; each column of the online document is combined with the column number of each column to form dynamic data; the content of the online document is combined with the second keyword extracted from the content after encoding to form the second data identifier.

[0153] Continuing with the examples of steps 3011 to 3016 above, the first paragraph and the second data identifier of the first paragraph "Paragraph 1" are combined into dynamic data; the title of the online document "First Quarter of 2023 - Sales Data Analysis Report" and the encoded first keyword "xssjfx" extracted from the title are combined into dynamic data; Table 1 of the online document and the serial number of Table 1 "Table 1" are combined into dynamic data; the first row of the online document and the row number of the first row "Row 1" are combined into dynamic data; the first column of the online document and the column number of the first column "Column 1" are combined into dynamic data; the content of the online document "In the first quarter of 2023, our sales data analysis showed that sales increased by 10% year-on-year, which was mainly due to the development of new markets and optimization of product lines" are combined with the encoded second keyword "xssjfx" extracted from the content into a second data identifier.

[0154] In some embodiments, after step 104 "querying the second data identifier of the data to be queried", the following processing is performed: the second data identifier of the data to be queried and the expiration timestamp of the validity period are stored in the cache; in response to the current time being greater than the expiration timestamp, the data to be queried in the cache is cleared.

[0155] In some embodiments, the second data identifier of the data to be queried and the expiration timestamp of the validity period are stored in the cache as a key-value pair, wherein the key is the second data identifier and the value is the expiration timestamp. A timed task or a periodic check mechanism is set to regularly check whether the current time is greater than the expiration timestamp stored in the cache. If the current time is greater than the expiration timestamp, the corresponding data to be queried in the cache is cleared.

[0156] For example, if the second data identifier of the data to be queried is "DOC-12345" and the expiration timestamp is "2023-04-30T23:59:59Z", the key-value pair can be expressed as<DOC-12345,2023-04-30T23:59:59Z> , store the key-value pair in the cache. Set the check period to 5 hours, and check every 5 hours whether the current time is greater than the deadline timestamp stored in the cache. If the current time is 2023-05-01T00:00:00Z, that is, the current time is greater than the deadline timestamp, clear the second data identifier "DOC-12345" in the cache.

[0157] The embodiment of the present application sets a validity period to ensure that the data in the cache will not be outdated, thereby improving the timeliness of the data. Expired data is cleared regularly to release cache space and optimize resource utilization. The data in the cache is ensured to be consistent with the actual data to avoid errors caused by using expired data.

[0158] Continue to see Figure 3A, in step 105, in response to the first data identifier being the same as the second data identifier, send the data to be queried to the first terminal device.

[0159] In some embodiments, the first terminal device is logged in with a first object account, and the online document is created by a second object account. Refer to Figure 3G , Figure 3G is the seventh process schematic diagram of the data query method for the online document provided by the embodiments of the present application. Figure 3A Step 105 of Figure 3G "sending the data to be queried to the first terminal device" can be implemented through

[0160] In step 1051, in response to a modification operation of the second terminal device logged in with the second object account for the data to be queried in the online document, detect the validity of the modification operation, where the validity indicates whether the modification operation is a valid operation.

[0161] In some embodiments, the modification operation includes any one of the following: an addition operation, a deletion operation, and a replacement operation.

[0162] For example, if the modification operation is that the second terminal device logged in with the second object account deletes the fourth character "is" in the second row of the content of the online document and inserts the character "is" at the original position one second later, detect whether the modification operation is a valid operation.

[0163] In step 1052, in response to the validity indicating that the modification operation is an invalid operation, synchronize the data to be queried to the first terminal device.

[0164] Continuing with the example in step 1051 above, if the modification operation of the second terminal device logged in with the second object account deleting the fourth character "is" in the second row of the content of the online document and inserting the character "is" at the original position one second later is an invalid operation, then synchronize the original data to be queried to the first terminal device, where the modification operation is invisible to the first terminal device.

[0165] In some embodiments, in response to the validity indicating that the modification operation is a valid operation, synchronize the modified data to be queried to the first terminal device.

[0166] For example, if the modification operation is that the second terminal device logged in with the second object account deletes the fourth character "is" in the second row of the content of the online document, if the modification operation is a valid operation, then synchronize the data to be queried with the fourth character "is" deleted in the second row to the first terminal device.

[0167] In some embodiments, the modification operation being an invalid operation includes any of the following cases: the data corresponding to the modification operation is invalid data; within a preset time period, the new data corresponding to multiple modification operations in the online document is the same as the original data.

[0168] For example, if the online document includes the link " / product / 123", in response to a modification operation on the link, such as modifying the link to " / product / 123##", since "##" is a meaningless character, that is, invalid data, and the invalid data does not affect the link jump, therefore, this modification operation is an invalid operation. If the preset time period is 3 seconds, and the modification operation is to delete the fourth character 'is' in the second line of the online document and insert the character 'is' at the original position one second later, then the new data of the online document is the same as the original data, and this modification operation is an invalid operation.

[0169] The embodiments of the present application ensure the consistency of the online document data on all terminal devices by detecting the validity of the modification operation and synchronizing according to the result, avoiding different versions of data being seen by different users, and improving the collaboration efficiency. It can identify and prevent invalid modification operations, such as entering meaningless data or repeated modifications, thus maintaining the accuracy of the data. Real-time synchronization ensures that the data viewed by users on different terminal devices is the latest. For valid operations, users can immediately see the modified result; for invalid operations, users can see the original data, ensuring the timeliness of the data.

[0170] In some embodiments, the above "synchronizing the modified data to be queried to the first terminal device" can be implemented by performing any of the following processes:

[0171] Process 1: In response to a viewing operation of the first terminal device on the online document, synchronize the modified data to be queried to the first terminal device.

[0172] For example, if the time to modify the data to be queried is 14:00 and the time of the viewing operation of the first terminal device on the online document is 16:00, then synchronize the modified data to be queried to the first terminal device at 16:00.

[0173] Process 2: When the edited duration of the data to be queried reaches the preset delay corresponding to the first terminal device, synchronize the modified data to be queried to the first terminal device, where the edited duration represents the difference between the current moment and the starting moment of editing the data to be queried.

[0174] For example, if the start time of the data to be queried for editing is 14:00 and the preset time delay corresponding to the first terminal device is 10 minutes, then at the current time of 14:10, the difference between the current time and the start time of the data to be queried for editing is 10 minutes, that is, the edited duration of the data to be queried reaches the preset time delay corresponding to the first terminal device, and the modified data to be queried is synchronized to the first terminal device.

[0175] The embodiments of the present application provide two ways to synchronize the modified data to be queried, which not only ensure real-time performance but also consider latency, enabling users to select a suitable synchronization method according to their needs and improving the flexibility of selection. By synchronizing after the edited duration reaches the preset time delay, unnecessary real-time synchronization requests can be reduced, thereby optimizing the use of network resources and reducing the load on the system. For users who need to view the latest data in real time, the modified data can be synchronized immediately to ensure that the latest information can be sent in a timely manner.

[0176] In some embodiments, multiple accounts corresponding to multiple objects are logged in to the online document, and the multiple objects have different permissions. Refer to Figure 3H , Figure 3H which is the eighth process schematic diagram of the data query method for the online document provided by the embodiments of the present application. Before step 105 "send the data to be queried to the first terminal device", steps 401 to 402 of Figure 3H are executed, which are specifically described below.

[0177] In step 401, query the target permission corresponding to the first terminal device.

[0178] In some embodiments, the target permission includes at least one of the following: viewing the online document, editing the online document, viewing the online document within a preset duration, editing the online document within a preset duration, sharing the online document, and exporting the online document.

[0179] For example, if the user of the first terminal device attempts to view the sales data in the online document, where the sales data is the data to be queried. Query the target permission corresponding to the first terminal device. For example, the target permission includes "viewing the online document" and "editing the online document".

[0180] In step 402, in response to the target permission indicating that the first terminal device has the permission to query the data to be queried, transfer to the step of sending the data to be queried to the first terminal device.

[0181] Continuing with the example of step 401 above, the first terminal device has the permission to "view the online document", that is, the permission to query the sales data. Therefore, the sales data is sent to the first terminal device.

[0182] Embodiments of the present application ensure that only users with corresponding permissions can query the data to be queried by querying and verifying the target permissions, improving data security. Different permissions can be set according to different users and documents, providing fine-grained control over data access. By automating the permission query and verification process, the query requests of users can be quickly responded to, improving work efficiency.

[0183] In some embodiments, before Figure 3A step 101 of " Figure 3A receiving a first data query request for an online document" from the first terminal device, the following processing is performed: sending verification information to the first terminal device, where the verification information includes a key pair, and the key pair includes a public key and a private key corresponding to the public key. When

[0184] step 105 of "

[0185] sending the data to be queried to the first terminal device" is executed, the following processing is performed: encrypting the data to be queried based on the public key, and sending the encrypted data to be queried to the first terminal device, so that the first terminal device decrypts the encrypted data to be queried through the private key corresponding to the public key to obtain the data to be queried. Exemplarily, data transmission can be performed through a secure communication protocol, such as the Secure Hypertext Transfer Protocol (HTTPS), through a symmetric algorithm. Specifically: First, through the secure handshake process of the asymmetric encryption algorithm, the server sends a public key (for example, the public key is 12345) to the first terminal device; the first terminal device encrypts a pre-master key using the public key and then sends the encrypted pre-master key back to the server; the server decrypts the pre-master key using its private key; the first terminal device and the server generate a session key using the pre-master key and the previously exchanged random number. The session key is a temporary symmetric key used to encrypt and decrypt the transmitted data; after generating the session key, the first terminal device and the server use the session key to encrypt and decrypt the data to start secure communication.

[0185] When encrypted data encrypted using a public key needs to be sent, the server first encrypts the data to be queried using the public key to obtain the encrypted data. Then, during transmission, the encrypted data is encrypted again using the session key, and the data after the second encryption is sent to the first terminal device. The first terminal device first decrypts the data after the second encryption using the session key to obtain the encrypted data, and then decrypts the encrypted data using the private key to obtain the data to be queried. For example, the public key is 12345 and the private key is 67890. When sending the data to be queried to the first terminal device, the data is encrypted using the public key 12345. For example, if the data to be queried is the value 98765, the encrypted data obtained after encryption is the value 43210. The encrypted data to be queried 43210 is encrypted again and sent to the first terminal device. After receiving the data after the second encryption, the first terminal device decrypts it using the session key to obtain the encrypted data to be queried 43210, and then decrypts the data using the private key 67890 corresponding to the public key 12345 to obtain the data to be queried 98765.

[0186] The method of using public key encryption and private key decryption in the embodiments of the present application ensures the security of data during transmission and prevents unauthorized access. Only the first terminal device with the corresponding private key can decrypt the data, ensuring the confidentiality of the data. The encryption process can also ensure the integrity of the data and prevent the data from being tampered with during transmission.

[0187] In some embodiments, after step 105 "sending the data to be queried to the first terminal device", step 106 is executed. In step 106, in response to the generation duration of the second data identifier being greater than the duration threshold, based on the characteristics of the data to be queried and the valid duration of the third data identifier, the second data identifier is updated to the third data identifier, where the generation duration represents the difference between the current time and the time when the second data identifier is generated.

[0188] For example, if the time when the second data is generated is 17:00 and the current time is 19:00, and the difference between the current time and the time when the second data identifier is generated is 2 hours, then the generation duration is 2 hours. If the duration threshold is 1 hour, then the generation duration of the second data identifier is greater than the duration threshold. If the data to be queried is the title of an online document, the characteristic of the data to be queried is the first keyword extracted from the title, such as "sales data analysis", and the valid duration of the third data identifier is 30 minutes, then the third data identifier can be "sales data identifier + 30 minutes", and the second data identifier is updated to the third data identifier.

[0189] Updating the data identifier regularly in the embodiments of the present application can reduce the risk of data leakage and improve data security. Determining the effective duration based on data characteristics can flexibly meet the security requirements of different data. By controlling the effective duration of the data identifier, the user's access rights to the data can be managed more effectively.

[0190] In some embodiments, refer to Figure 3I , Figure 3I which is the ninth process schematic diagram of the data query method for online documents provided by the embodiments of the present application. The above step 106 "update the second data identifier to the third data identifier based on the characteristics of the data to be queried and the effective duration of the third data identifier" can be implemented by Figure 3I steps 1061 to 1063, which are specifically described below.

[0191] In step 1061, extract the characteristics of the data to be queried, and encode the characteristics of the data to be queried to obtain the first feature vector.

[0192] In some embodiments, the characteristics of the data to be queried can be extracted by any of the following methods: word frequency statistics, which counts the number of times each word appears in the text and can be used to analyze the theme and key concepts of the text; N-gram analysis, which divides the text into combinations of N words and is used to analyze lexical combinations and language patterns; Bag of Words (BoW), which converts the text into a word frequency vector, where each dimension represents a word in the dictionary and the value represents the number of times the word appears in the text; TF-IDF, which evaluates the importance of a word for a document set or a single document, considering word frequency and inverse document frequency; Word Embedding: such as Word2Vec, GloVe, FastText, which represents words as dense vectors of fixed length and captures the semantic relationships between words. The characteristics of the data to be queried include the type, size, creation time, modification time, access frequency, sensitivity level, data format, etc. The encoding method may include One-Hot Encoding, Label Encoding, binary encoding, etc.

[0193] For example, if the keywords of the data to be queried are "report", the size is "1MB", and the access frequency is "high", and if "report" is encoded as 1, "1MB" is encoded as 2, and "high" is encoded as 3, then the first feature vector is [1, 2, 3].

[0194] In step 1062, encode the effective duration of the third data identifier to obtain the second feature vector, where the effective duration represents the difference between the expiration time of the third data identifier and the generation time of the third data identifier.

[0195] Exemplarily, if the expiration time of the third data identifier is 16:00 and the generation time of the third data identifier is 15:00, the effective duration of the third data identifier is 1 hour, and "1 hour" is encoded as 4, that is, the second feature vector is [4].

[0196] In step 1063, the first feature vector and the second feature vector are combined into a third data identifier.

[0197] Continuing with the example of steps 1061 and 1062 above, the first feature vector is [1, 2, 3], the second feature vector is [4], and the first feature vector and the second feature vector are combined into a third data identifier [1, 2, 3, 4].

[0198] The embodiments of the present application generate a third data identifier based on the characteristics of the data to be queried and the effective duration of the third data identifier, improving the security of the data. Different data identifiers can be generated according to different data characteristics and effective durations, improving flexibility and adaptability. Features can be automatically extracted, encoded, and combined into data identifiers, reducing the need for manual intervention and improving efficiency.

[0199] In some embodiments, refer to Figure 3J , Figure 3J is the tenth process schematic diagram of the data query method for online documents provided by the embodiments of the present application. After step 106 "updating the second data identifier to the third data identifier", perform Figure 3J steps 107 to 110, which are specifically described below.

[0200] In step 107, a second data query request for the data to be queried is received from a terminal device. The second data query request includes a second query timestamp, a fourth data identifier, and a third signature, and the fourth data identifier is generated based on the characteristics of the data to be queried and the second query timestamp.

[0201] In some embodiments, the second data query request is used to request the data to be queried in an online document. The second query timestamp represents the moment when the second data query request is generated, and the fourth data identifier is generated by the first terminal device performing a hash operation on the characteristics of the data to be queried and the second query timestamp.

[0202] Exemplarily, the third signature can be generated by the first terminal device in any of the following ways: symmetric encryption algorithm, asymmetric encryption algorithm, hashing algorithm, HMAC, DSA. Taking the symmetric encryption algorithm as an example, the second query timestamp and the fourth data identifier are combined into a data block, which is usually converted into a binary format for easy encryption; an encryption algorithm is selected to ensure that the length of the data block meets the block size threshold of the selected encryption algorithm. If the data block length is less than the block size threshold, the data block is padded. If the data block length is greater than the block size threshold, the data block is divided into multiple sub-data blocks; an encryption mode is selected to encrypt the multiple sub-data blocks to obtain multiple ciphertext blocks, and the multiple ciphertext blocks are combined into the fourth signature.

[0203] In step 108, the third signature is verified based on the second query timestamp and the fourth data identifier.

[0204] In some embodiments, when "verifying the third signature based on the second query timestamp and the fourth data identifier", the third signature is decrypted to obtain a first candidate hash value obtained by the first terminal device performing a hashing operation on the second query timestamp and the fourth data identifier. The server uses the same hashing algorithm as the first terminal device to perform a hashing operation on the second query timestamp and the fourth data identifier to obtain a second candidate hash value. The third signature is verified by comparing the first candidate hash value and the second candidate hash value. If the first candidate hash value and the second candidate hash value are the same, it is determined that the verification of the third signature passes. If the first candidate hash value and the second candidate hash value are different, it is determined that the verification of the third signature fails.

[0205] Exemplarily, the first candidate hash value obtained by the first terminal device performing a hashing operation on the second query timestamp and the fourth data identifier is "abc". The server uses the same hashing algorithm as the first terminal device to perform a hashing operation on the second query timestamp and the fourth data identifier to obtain a second candidate hash value of "abc". By comparing the first candidate hash value and the second candidate hash value, since the first candidate hash value and the second candidate hash value are the same, it is determined that the verification of the third signature passes.

[0206] In step 109, in response to the verification of the third signature passing, a second time difference between the second query timestamp and the expiration timestamp of the data to be queried is determined.

[0207] Exemplarily, if the second query timestamp is "September 30, 2023", and the validity period of the data to be queried is from January 1, 2023 to December 31, 2023, then the expiration timestamp of the validity period of the data to be queried is "December 31, 2023", and the second time difference between the second query timestamp and the expiration timestamp of the validity period of the data to be queried is -92 days.

[0208] In step 110, in response to the second time difference being less than the time threshold and the second query timestamp being within the valid duration of the third data identifier, the data to be queried is sent to the first terminal device.

[0209] In some embodiments, the time threshold can be zero. When the second time difference is less than zero, it indicates that the second query timestamp is before the expiration timestamp of the data to be queried, that is, the second query timestamp is still within the valid period. At the same time, if the second query timestamp is within the valid duration of the third data identifier, the data to be queried is sent to the first terminal device. When the second time difference is greater than zero, it indicates that the second query timestamp is after the expiration timestamp of the data to be queried, that is, the second query timestamp is not within the valid period and the second data query request has expired. Then, the data to be queried is not sent to the first terminal device, or information indicating that the data sending has failed is sent to the first terminal device.

[0210] Exemplarily, the valid period of the data to be queried is from January 1, 2023 to December 31, 2023, and the expiration timestamp of the valid period of the data to be queried is December 31, 2023. If the second time difference is less than the time threshold, that is, the second query timestamp is before the expiration timestamp of the data to be queried. For example, the second query timestamp is September 30, 2023. At the same time, if the generation time of the third data identifier is August 1, 2023 and the valid duration of the third data identifier is 150 days, that is, the expiration timestamp of the valid duration of the third data identifier is December 28, 2023, and the second query timestamp is within the valid duration of the third data identifier, the data to be queried is sent to the first terminal device; if the second time difference is greater than the time threshold, that is, the second query timestamp is after the expiration timestamp of the data to be queried. For example, the second query timestamp is February 15, 2024, then the data to be queried is not sent to the first terminal device, or information indicating that the data sending has failed is sent to the first terminal device.

[0211] In the embodiments of the present application, by using signature verification, the integrity of the query request and the reliability of the source are ensured. Checking the time difference ensures the timeliness of the data and prevents the query of expired data. By verifying whether the query timestamp is within the valid duration, fine-grained control of data access is achieved.

[0212] Next, an exemplary application of the embodiments of the present application in the application scenario of an online document APP will be described.

[0213] The embodiments of the present application are not limited to processing online documents in the scenario of an online document APP and are equally applicable in other scenarios, such as the scenario of an online document applet in an instant messaging APP or the scenario of a browser that can display and process online documents.

[0214] In the prior art, static data is usually used to store content, and the security of the accessed content is low. Once the static data is leaked, anyone can access the data through the data path in the static data, regardless of whether they have permission. There is a lack of an effective access control mechanism and it cannot prevent unauthorized access. The static path cannot implement the timeliness control of the content. Once the data content is created, it can be accessed permanently in theory, unless it is manually deleted or the path is changed.

[0215] See Figure 4A , Figure 4A which is the first schematic diagram showing the preview content corresponding to the dynamic data provided by the embodiment of the present application. See Figure 4B , Figure 4B which is the second schematic diagram showing the preview content corresponding to the dynamic data provided by the embodiment of the present application. In the left editing area is a dynamic data with a unique identifier objKey (i.e., the second data identifier), which is used to associate and retrieve data information and display it in the right editing area for the user to preview the content. When the dynamic data (i.e., the data to be queried) receives a data access request (i.e., the first data query request), the backend (such as the server 200 mentioned above) checks the data objKey record in the cache to verify whether the dynamic data is within the valid period. If it is valid, data access is provided; otherwise, the information is not displayed.

[0216] See Figure 5A , Figure 5A which is the first schematic diagram showing the storage of dynamic data provided by the embodiment of the present application. See Figure 5B , Figure 5B which is the second schematic diagram showing the storage of dynamic data provided by the embodiment of the present application. In response to receiving the uploaded dynamic data, the data is saved in a secure storage location, and then a unique data objKey value is generated for each type of data with different element formats such as paragraphs, headings, tables, rows and columns, and content (i.e., multiple types of static data). This objKey can be generated using UUID or other unique identifier generation methods to ensure that the identifier of each data is unique.

[0217] See Figure 6 , Figure 6 which is the schematic diagram showing the update of the data identifier provided by the embodiment of the present application. The backend (such as the server 200 mentioned above) combines the data objKey and the set valid time to generate content including a timestamp and a signature. The signature uses HMAC encryption technology to ensure the security of the content. The timestamp is used to mark the creation time of the content, and the signature is used to confirm the validity and integrity of the content in subsequent verification.

[0218] Timing of update: For the same piece of data (i.e., the data to be queried), different users (i.e., objects) correspond to different objKey values. The same user will also generate different objKey values when viewing the data at different time periods. Taking a picture sent on a social platform as an example, after user A posts the picture, user B opens the picture at 10 am and uses objKey_1 as the data identifier. User B opens the picture at 5 pm and uses objKey_2 as the data identifier.

[0219] See Figure 7 , Figure 7 is a schematic diagram of storing data in a cache provided by an embodiment of the present application. The access information of the data, including the data objKey and the expiration time (i.e., the end timestamp of the validity period of the data to be queried), is stored using a cache system. The expiration time of the cache entry is set to be the same as the valid time of the dynamic timeliness content.

[0220] See Figure 8 , Figure 8 is a schematic diagram of verifying and accessing data provided by an embodiment of the present application. When a user attempts to access data through timeliness content, the backend service first parses the objKey (i.e., the first data identifier), the timestamp (i.e., the first query timestamp), and the signature (i.e., the first signature) in the dynamic timeliness content. First, the HMAC encryption technology is used to verify the correctness of the signature to confirm that the request has not been tampered with. After the signature verification passes, it is confirmed whether the current time is within the validity period of the content. The data objKey (i.e., the second data identifier) in the cache is queried to check whether it exists and whether it is within the validity period. If all verifications pass, the data is transmitted to the user from the server in a stream form. If the verification fails, no relevant information is returned. When the cache entry expires, it automatically becomes invalid, thereby making the corresponding timeliness content also invalid.

[0221] In the online document scenario, if the current data is generated based on the operations of User A, before transmitting the data, if User A modifies the data (i.e., in response to the modification operation of the second terminal device logged in with the second object account for the data to be queried in the online document), it is necessary to determine whether the modification operation is an invalid operation. For example, if User A modifies meaningless characters (i.e., invalid data) in the picture link and the link can still jump to the original picture, then the modification operation is an invalid operation. Or, if User A deletes some characters in the document and then quickly restores them, then the modification operation is an invalid operation. These operations do not need to be synchronized to other users of the online document. At the same time, when synchronizing data, it is not necessary to synchronize all users of the online document simultaneously. It can be synchronized when other users open the document (i.e., in response to the viewing operation of the first terminal device for the online document), or different time delays (i.e., the preset time delay corresponding to the first terminal device) can be set for different users for synchronization. For example, User B is updated 5 minutes after the modification, and User C is updated 6 minutes after the modification.

[0222] Embodiments of the present application can generate time-sensitive dynamic content. Even if the content is leaked, the expiration limit of the content can effectively prevent long-term unauthorized access. The access rights of data can be controlled more precisely. For example, different access time limits can be set to adjust the accessibility of data according to different user needs. The automatic expiration feature of time-sensitive dynamic content can reduce the abuse of server resources because the expired content will no longer be valid, thus reducing invalid access requests. Through the cache management mechanism, the access efficiency of the system can be improved, the load on the server can be reduced, and the overall performance of the system can be enhanced. By providing a secure, reliable, and efficient data access method, the user experience can be improved and user satisfaction can be increased.

[0223] Next, the implementation of the data query device 233 for online documents provided by the embodiments of the present application as a software module will be further described. In some embodiments, as Figure 2 shown, the software module in the data query device 233 for online documents stored in the memory 230 may include:

[0224] A request receiving module 2331, configured to receive a first data query request from a first terminal device for an online document, where the first data query request includes a first query timestamp, a first data identifier, and a first signature, and the first data identifier is used to represent the data to be queried in the online document.

[0225] A signature verification module 2332, configured to verify the first signature based on the first query timestamp and the first data identifier.

[0226] The difference determination module 2333 is configured to determine a first time difference between the first query timestamp and the expiration timestamp of the data to be queried in response to the successful verification of the first signature.

[0227] The identification query module 2334 is configured to query a second data identification of the data to be queried in response to the first time difference being less than the time threshold.

[0228] The data sending module 2335 is configured to send the data to be queried to the first terminal device in response to the first data identification being the same as the second data identification.

[0229] In some embodiments, the request receiving module 2331 is further configured to receive a third data query request from the first terminal device for an online document, where the third data query request includes a third query timestamp, a first data identification, and a fourth signature; in response to the third query timestamp being within the identification validity period of the first data identification, verify the fourth signature based on the third query timestamp and the first data identification; in response to the successful verification of the fourth signature, determine a third time difference between the third query timestamp and the expiration timestamp of the data to be queried; and in response to the third time difference being less than the time threshold, send the data to be queried to the first terminal device.

[0230] In some embodiments, the signature verification module 2332 is further configured to decrypt the first signature to obtain a first hash value, where the first hash value is obtained by the first terminal device performing a hash operation on the first query timestamp and the first data identification; determine a second hash value of the first query timestamp and the first data identification; verify the first hash value and the second hash value; if the first hash value and the second hash value are the same, determine that the verification of the first signature is successful; if the first hash value and the second hash value are different, determine that the verification of the first signature fails.

[0231] In some embodiments, the signature verification module 2332 is further configured to concatenate the first query timestamp and the first data identification to obtain a first string; in response to the first string being greater than the preset length, split the first string into multiple data blocks based on the preset length; perform a modulo operation on each data block to obtain a sub-hash value of the data block; and combine the sub-hash values corresponding to the multiple data blocks into a second hash value.

[0232] In some embodiments, the identification query module 2334 is further configured to perform the following processing for each type of static data in the online document: generate a second data identification corresponding to the type of static data based on the characteristics of the type of static data; and combine the type of static data with the second data identification corresponding to the type of static data into type of dynamic data.

[0233] In some embodiments, the multiple types include paragraphs, headings, tables, rows, columns, and content of an online document. The identification query module 2334 is further configured to, for each paragraph of the online document, use the paragraph number of the paragraph as the second data identifier corresponding to the paragraph; extract a first keyword from the heading of the online document, encode the first keyword, and use the encoded first keyword as the second data identifier corresponding to the heading; for each table of the online document, use the serial number of the table as the second data identifier corresponding to the table; for each row of the online document, use the row number of the row as the second data identifier corresponding to the row; for each column of the online document, use the column number of the column as the second data identifier corresponding to the column; extract a second keyword from the content of the online document, encode the second keyword, and use the encoding result as the second data identifier corresponding to the content.

[0234] In some embodiments, the identification query module 2334 is further configured to store the second data identifier of the data to be queried and the end timestamp of the validity period in a cache; and in response to the current moment being greater than the end timestamp, clear the data to be queried in the cache.

[0235] In some embodiments, the first terminal device logs in with a first object account, and the online document is created by a second object account. The data sending module 2335 is further configured to, in response to a modification operation on the data to be queried in the online document by a second terminal device logged in with the second object account, detect the validity of the modification operation, where the validity characterizes whether the modification operation is a valid operation; and in response to the validity characterizing that the modification operation is an invalid operation, synchronize the data to be queried to the first terminal device.

[0236] In some embodiments, the data sending module 2335 is further configured to, in response to the validity characterizing that the modification operation is a valid operation, synchronize the modified data to be queried to the first terminal device.

[0237] In some embodiments, the modification operation being an invalid operation includes any of the following cases: the data corresponding to the modification operation is invalid data; within a preset time period, the new data corresponding to multiple modification operations in the online document is the same as the original data.

[0238] In some embodiments, the data sending module 2335 is further configured to perform any of the following processes: in response to a viewing operation on the online document by the first terminal device, synchronize the modified data to be queried to the first terminal device; when the edited duration of the data to be queried reaches a preset time delay corresponding to the first terminal device, synchronize the modified data to be queried to the first terminal device, where the edited duration represents the difference between the current moment and the start moment of editing the data to be queried.

[0239] In some embodiments, the online document logs in accounts corresponding to multiple objects respectively, and the multiple objects have different permissions. The data sending module 2335 is further configured to query the target permission corresponding to the first terminal device; in response to the target permission indicating that the first terminal device has the permission to query the data to be queried, proceed to the step of sending the data to be queried to the first terminal device.

[0240] In some embodiments, the target permission includes at least one of the following: viewing the online document, editing the online document, viewing the online document within a preset duration, editing the online document within a preset duration, sharing the online document, and exporting the online document.

[0241] In some embodiments, the request receiving module 2331 is further configured to send verification information to the first terminal device, where the verification information includes a key pair, and the key pair includes a public key and a private key corresponding to the public key. The data sending module 2335 is further configured to encrypt the data to be queried based on the public key and send the encrypted data to be queried to the first terminal device, so that the first terminal device decrypts the encrypted data to be queried through the private key corresponding to the public key to obtain the data to be queried.

[0242] In some embodiments, the data sending module 2335 is further configured to, in response to the generation duration of the second data identifier being greater than the duration threshold, update the second data identifier to a third data identifier based on the characteristics of the data to be queried and the valid duration of the third data identifier, where the generation duration represents the difference between the current moment and the moment when the second data identifier is generated.

[0243] In some embodiments, the data sending module 2335 is further configured to extract the characteristics of the data to be queried, encode the characteristics of the data to be queried to obtain a first feature vector; encode the valid duration of the third data identifier to obtain a second feature vector, where the valid duration represents the difference between the expiration moment and the generation moment of the third data identifier; and combine the first feature vector and the second feature vector into a third data identifier.

[0244] In some embodiments, the data sending module 2335 is further configured to receive a second data query request from the terminal device for the data to be queried, where the second data query request includes a second query timestamp, a fourth data identifier, and a third signature, and the fourth data identifier is generated based on the characteristics of the data to be queried and the second query timestamp; verify the third signature based on the second query timestamp and the fourth data identifier; in response to the verification of the third signature passing, determine a second time difference between the second query timestamp and the expiration timestamp of the validity period of the data to be queried; and in response to the second time difference being less than the time threshold and the second query timestamp being within the valid duration of the third data identifier, send the data to be queried to the first terminal device.

[0245] An embodiment of the present application provides a computer program product, which includes a computer program or computer-executable instructions stored in a computer-readable storage medium. The processor of the electronic device reads the computer-executable instructions from the computer-readable storage medium, and the processor executes the computer-executable instructions, so that the electronic device executes the data query method for online documents in the above embodiments of the present application.

[0246] An embodiment of the present application provides a computer-readable storage medium storing computer-executable instructions, in which computer-executable instructions or a computer program are stored. When the computer-executable instructions or the computer program are executed by a processor, the processor will be caused to execute the data query method for online documents provided by the embodiments of the present application. For example, as Figure 3A the data query method for the online document shown.

[0247] In some embodiments, the computer-readable storage medium may be a memory such as RAM, ROM, flash memory, magnetic surface memory, optical disc, or CD-ROM; or it may be various devices including one or any combination of the above memories.

[0248] In some embodiments, the computer-executable instructions may be in the form of a program, software, software module, script, or code, and may be written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including being deployed as an independent program or being deployed as a module, component, subroutine, or other unit suitable for use in a computing environment.

[0249] As an example, the computer-executable instructions may or may not correspond to a file in the file system, and may be stored as part of a file that stores other programs or data. For example, they may be stored in one or more scripts in a Hyper Text Markup Language (HTML) document, stored in a single file dedicated to the program under discussion, or stored in multiple cooperating files (for example, files that store one or more modules, subroutines, or code portions).

[0250] As an example, the computer-executable instructions may be deployed to execute on one electronic device, or on multiple electronic devices located at one location, or on multiple electronic devices distributed at multiple locations and interconnected by a communication network.

[0251] In summary, through the embodiments of the present application, by verifying the first signature in the first data query request, the authenticity of the source and content of the first data query request can be ensured, preventing data from being tampered with or forged, and improving data security; by comparing the first query timestamp with the expiration timestamp of the data to be queried, data query is performed only when the signature verification is passed and the first query timestamp is within the valid period, ensuring the timeliness of the data; when querying the data to be queried, the data identifiers are further compared to ensure that the first data identifier in the first data query request is consistent with the second data identifier of the queried data to be queried, improving the accuracy and consistency of the data. By setting the valid period, it is ensured that the data in the cache will not become obsolete, improving the timeliness of the data. Expired data is regularly cleared to release cache space and optimize resource utilization. It is ensured that the data in the cache is consistent with the actual data, avoiding errors caused by using expired data. By detecting the effectiveness of the modification operation and synchronizing according to the result, the consistency of the online document data on all terminal devices is ensured, avoiding different users seeing different versions of the data and improving the collaboration efficiency. Invalid modification operations, such as entering meaningless data or duplicate modifications, can be identified and blocked, thus maintaining the accuracy of the data. Real-time synchronization ensures that the data viewed by users on different terminal devices is up-to-date. For valid operations, users can immediately see the modified results; for invalid operations, users can see the original data, ensuring the timeliness of the data.

[0252] As described above, the above are only the embodiments of the present application and are not intended to limit the protection scope of the present application. Any modifications, equivalent replacements, and improvements made within the spirit and scope of the present application are all included in the protection scope of the present application.

Claims

1. A data query method for online documents, characterized in that: The method comprises: Receiving a first data query request for an online document from a first terminal device, wherein the first data query request includes a first query timestamp, a first data identifier, and a first signature, and the first data identifier is used to represent the data to be queried in the online document; verifying the first signature based on the first query timestamp and the first data identifier; In response to the first signature being verified successfully, determining a first time difference between the first query timestamp and an expiration timestamp of a validity period of the data to be queried; In response to the first time difference being less than a time threshold, querying a second data identifier of the data to be queried; In response to the first data identifier being the same as the second data identifier, sending the data to be queried to the first terminal device.

2. The method according to claim 1, characterized in that The verifying the first signature based on the first query timestamp and the first data identifier includes: Decrypting the first signature to obtain a first hash value, wherein the first hash value is obtained by the first terminal device performing a hash operation on the first query timestamp and the first data identifier; Determine a second hash value of the first query timestamp and the first data identifier; Verifying the first Hash value and the second Hash value; If the first hash value and the second hash value are the same, it is determined that the first signature verification is successful; If the first hash value and the second hash value are different, it is determined that the first signature verification fails.

3. The method according to claim 2, characterized in that The determining the first query timestamp and the second hash value of the first data identifier includes: Concatenate the first query timestamp and the first data identifier to obtain a first character string; In response to the first character string being greater than a preset length, dividing the first character string into a plurality of data blocks based on the preset length; Performing a modulo operation on each of the data blocks to obtain a sub-hash value of the data block; The sub-hash values ​​corresponding to the multiple data blocks are combined into the second hash value.

4. The method according to any one of claims 1 to 3, characterized in that: Before querying the second data identifier of the data to be queried, the method further includes: For each type of static data in the online document, the following processing is performed: Based on the characteristics of the static data of the type, generating the second data identifier corresponding to the static data of the type; The static data of the type and the second data identifier corresponding to the static data of the type are combined into dynamic data of the type.

5. The method according to claim 4, characterized in that The plurality of types include paragraphs, headings, tables, rows, columns, and content of the online document; The generating, based on the feature of the static data of the type, the second data identifier corresponding to the static data of the type includes: For each of the paragraphs of the online document, using the paragraph number of the paragraph as the second data identifier corresponding to the paragraph; extracting a first keyword from the title of the online document, encoding the first keyword, and using the encoded first keyword as the second data identifier corresponding to the title; For each of the tables in the online document, using the serial number of the table as the second data identifier corresponding to the table; For each of the lines of the online document, using the line number of the line as the second data identifier corresponding to the line; For each column of the online document, using the column number of the column as the second data identifier corresponding to the column; A second keyword is extracted from the content of the online document, the second keyword is encoded, and the encoding result is used as the second data identifier corresponding to the content.

6. The method according to any one of claims 1 to 5, characterized in that: After sending the data to be queried to the first terminal device, the method further includes: In response to the generation duration of the second data identifier being greater than a duration threshold, the second data identifier is updated to the third data identifier based on the characteristics of the data to be queried and the effective duration of the third data identifier, wherein the generation duration represents the difference between the current moment and the moment when the second data identifier is generated.

7. The method according to claim 6, characterized in that The updating of the second data identifier to the third data identifier based on the feature of the data to be queried and the valid time of the third data identifier includes: Extracting features of the data to be queried, encoding the features of the data to be queried, and obtaining a first feature vector; Encoding the effective duration of the third data identifier to obtain a second feature vector, wherein the effective duration represents a difference between an expiration time of the third data identifier and a generation time of the third data identifier; The first feature vector and the second feature vector are combined into a third data identifier.

8. The method according to claim 6, characterized in that After the second data identifier is updated to a third data identifier, the method further includes: receiving a second data query request of the first terminal device for the data to be queried, wherein the second data query request includes a second query timestamp, a fourth data identifier, and a third signature, and the fourth data identifier is generated based on the characteristics of the data to be queried and the second query timestamp; verifying the third signature based on the second query timestamp and the fourth data identifier; In response to the third signature being verified successfully, determining a second time difference between the second query timestamp and an expiration timestamp of the validity period of the data to be queried; In response to the second time difference being less than the time threshold and the second query timestamp being within the valid duration of the third data identifier, the data to be queried is sent to the first terminal device.

9. The method according to any one of claims 1 to 8, characterized in that: After querying the second data identifier of the data to be queried, the method further includes: storing the second data identifier of the data to be queried and the expiration timestamp of the validity period in a cache; In response to the current time being greater than the deadline timestamp, the to-be-queried data in the cache is cleared.

10. The method according to any one of claims 1 to 9, characterized in that: When receiving the first data query request for the online document from the first terminal device, the method further includes: receiving a third data query request for the online document from the first terminal device, wherein the third data query request includes a third query timestamp, the first data identifier, and a fourth signature; In response to the third query timestamp being within the validity period of the first data identifier, verifying the fourth signature based on the third query timestamp and the first data identifier; In response to the fourth signature being verified successfully, determining a third time difference between the third query timestamp and an expiration timestamp of the validity period of the data to be queried; In response to the third time difference being less than the time threshold, sending the data to be queried to the first terminal device.

11. The method according to any one of claims 1 to 9, characterized in that: The first terminal device is logged in with a first target account, and the online document is created by a second target account; The sending the data to be queried to the first terminal device includes: In response to a modification operation of the second terminal device logged in with the second object account on the data to be queried in the online document, detecting validity of the modification operation, wherein the validity indicates whether the modification operation is a valid operation; In response to the validity characterization that the modification operation is an invalid operation, synchronizing the data to be queried to the first terminal device; The method further comprises: In response to the validity characterization that the modification operation is a valid operation, the modified data to be queried is synchronized to the first terminal device.

12. The method according to claim 11, characterized in that The modification operation being an invalid operation includes any of the following situations: the data corresponding to the modification operation is invalid data; within a preset time period, the new data corresponding to the modification operation in the online document is the same as the original data for multiple times.

13. The method according to claim 11, characterized in that The step of synchronizing the modified data to be queried to the first terminal device includes: Perform any of the following: In response to a viewing operation of the first terminal device on the online document, synchronizing the modified data to be queried to the first terminal device; When the edited duration of the data to be queried reaches the preset delay corresponding to the first terminal device, the modified data to be queried is synchronized to the first terminal device, wherein the edited duration represents the difference between the current moment and the start moment of editing the data to be queried.

14. The method according to any one of claims 1 to 9, characterized in that: Before receiving the first data query request for the online document from the first terminal device, the method further includes: Sending verification information to the first terminal device, wherein the verification information includes a key pair, and the key pair includes a public key and a private key corresponding to the public key; When sending the data to be queried to the first terminal device, the method further includes: The data to be queried is encrypted based on the public key, and the encrypted data to be queried is sent to the first terminal device, so that the first terminal device decrypts the encrypted data to be queried using the private key corresponding to the public key to obtain the data to be queried.

15. The method according to any one of claims 1 to 9, characterized in that: The online document is logged with accounts corresponding to a plurality of objects respectively, and the plurality of objects have different permissions; Before sending the data to be queried to the first terminal device, the method further includes: Querying the target authority corresponding to the first terminal device; In response to the target authority characterizing that the first terminal device has the authority to query the data to be queried, the process proceeds to the step of sending the data to be queried to the first terminal device.

16. The method according to claim 15, characterized in that The target permission includes at least one of the following: viewing the online document, editing the online document, viewing the online document within a preset time, editing the online document within a preset time, sharing the online document, and exporting the online document.

17. A data query device for an online document, characterized in that: The device comprises: A request receiving module, configured to receive a first data query request from a first terminal device for an online document, wherein the first data query request includes a first query timestamp, a first data identifier, and a first signature, and the first data identifier is used to represent the data to be queried in the online document; a signature verification module, configured to verify the first signature based on the first query timestamp and the first data identifier; a difference determination module, configured to determine, in response to passing the verification of the first signature, a first time difference between the first query timestamp and an expiration timestamp of the validity period of the data to be queried; an identification query module, configured to query a second data identification of the data to be queried in response to the first time difference being less than a time threshold; A data sending module is used to send the data to be queried to the first terminal device in response to the first data identifier being the same as the second data identifier.

18. An electronic device, characterized in that: The electronic device comprises: A memory for storing computer executable instructions or computer programs; The processor is used to implement the online document data query method according to any one of claims 1 to 16 when executing the computer executable instructions or computer programs stored in the memory.

19. A computer-readable storage medium storing computer-executable instructions or a computer program, characterized in that: When the computer executable instructions or computer program are executed by a processor, the online document data query method according to any one of claims 1 to 16 is implemented.

20. A computer program product comprising computer executable instructions or a computer program, characterized in that When the computer executable instructions or computer program are executed by a processor, the online document data query method according to any one of claims 1 to 16 is implemented.