Detailed Description
Reference will now be made in detail to the embodiments of the present disclosure, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the drawings are exemplary and intended to be illustrative of the present disclosure, and should not be construed as limiting the present disclosure.
An online document retrieval method, an apparatus, and an electronic device according to embodiments of the present disclosure are described below with reference to the drawings.
Based on the description of the background art, it is understood that the existing document storage mode has technical defects in terms of storage pressure, reading speed and expandability, and in order to improve the technical defects, the present disclosure provides an improved online document retrieval method in which table contents and text contents are stored separately, thereby reducing the storage pressure of a retrieval system and improving the expansion convenience of tables by storing table information separately.
Specifically, fig. 2 is a flowchart of an online document retrieval method according to an embodiment of the present disclosure, as shown in fig. 2, the method including:
step 101, when the online document is in an online editing state, obtaining table information and text information in the current online document, wherein the text information includes a document address and text content of the online document, and the table information includes the document address and the table content of the online document.
The table information is table content information, and the text information includes character information, document name, document title, picture information and the like of non-table information.
Specifically, when the online document is in an online editing state, table information and text information in the current online document are acquired to record the table information and the document information in real time, wherein the table information and the document information can be distinguished based on information attributes in the online document, the text information table comprises a document address and text content of the online document where the text information table is located, the table information table comprises the document address and the table content of the document where the table information is located, the table content is text information in the table, and the document address of the document can be information which can uniquely locate the online document such as a document link, a document ID and the like.
Of course, considering that the user may not want to store the current online document in real time in some cases, the storage of the online document may also be actively controlled by the user, and the table information and the document information in the current online document are acquired when the storage operation of the user is received.
In an embodiment of the present disclosure, in order to further improve the storage efficiency, only the information updated this time by the online document may be stored, that is, the table information and the text information are respectively compared with the historical table information and the historical text information corresponding to the online document, which are stored last time in the retrieval system, and the updated table information and the updated text information are obtained according to the comparison result, and further, the updated information is updated to the historical table information and the historical text information corresponding to the online document, which are stored last time in the previous retrieval system.
Step 102, storing the table information in a first storage location of the retrieval system and storing the text information in a second storage location of the retrieval system.
Specifically, after the table information and the text information are acquired, in order to break the expansion limitation of the overall storage, relieve the storage pressure of the system and improve the retrieval speed, the first table information is stored in a first storage location of the retrieval system, and the text information is stored in a second storage location, where the first storage location and the second storage location may be locations corresponding to different memories in the retrieval system, for example, the first storage location may be a certain hardware memory in the retrieval system, and the second storage location may be a cloud server, and the like.
It should be noted that, according to different application scenarios, different ways of storing table information in a first storage location of a retrieval system and storing text information in a second storage location of the retrieval system are different, and as a possible implementation way, as shown in fig. 3, text information and table information are separately stored in a list form, where text content is stored in correspondence with an online document identifier, and table content is stored in correspondence with an online document identifier, and when table information is stored, tables are stored as a unit, and each table is stored in correspondence with an online document identifier, so that no matter whether text information is changed or table information is changed, storage change pressure is small, and extensibility is strong.
In this example, the table information further includes a table identifier, for example, a table ID, so that the updated table identifier in the updated table information is obtained, the target history table content corresponding to the updated table identifier is obtained at the first storage location, and the target history table content is updated according to the updated table content in the updated table information.
As another possible embodiment, in order to further reduce the storage pressure, the same part between different online documents is identified, and the same part is subjected to deduplication storage, for example, as shown in fig. 4, when an online document 1 containing table contents a + B and text contents a and an online document 2 containing table contents a + C and text contents a + C are stored, two online document addresses of online documents 1 and 2 are set for the table content a, and similarly, two online document addresses of online documents 1 and 2 are set for the text content a.
And 103, matching the search word input by the user in the search system with the table content and the text content in the search system.
Specifically, the search terms input by the user in the search system are obtained, and the search terms are matched with table contents and text contents in the search system, so that online documents meeting the search conditions of the user can be found conveniently.
In order to avoid that the online document which the user intends to search cannot be searched due to inaccuracy of the search term input by the user, in the embodiment of the present disclosure, a synonym and the like which are matched with the search term may be determined, and the search is performed according to the current search term, the matched synonym and the matched synonym, or the search is performed according to the corrected search term after the search term which obviously has errors is corrected.
And 104, acquiring the successfully matched target table content and/or the target document address corresponding to the target text content, and feeding back the target document address to the user.
Specifically, the text content has keywords matching the search word, the inserted table content has no keywords matching the search word, the second document address where the text content is located is returned, the text content has no keywords matching the search word, the inserted table content has keywords matching the search word, the first document address where the table content is located is returned, the text content has keywords matching the search word, the inserted table content has keywords matching the search word, the first document address or the second document address is returned to the user, the text content has no keywords matching the search word, the inserted table content has no keywords matching the search word, that is, if the target table content and the target text content matching the search word are not obtained, the information of failure search is fed back to the user, the search failure notification information may include a notification message that no matching document is currently searched, a prompt message that prompts the user to replace the search term, and the like.
In the actual execution process, the address identifier of the target document address can be displayed on the retrieval interface, so that a user can obtain the online document corresponding to the target document address according to the address identifier, or the online document corresponding to the target document address is directly provided for the user.
In summary, according to the online document retrieval method of the embodiment of the present disclosure, when an online document is in an online editing state, table information and text information in the current online document are obtained, where the text information includes a document address and a text content of the online document, the table information includes a document address and a table content of the online document, the table information is stored in a first storage location of a retrieval system, the text information is stored in a second storage location of the retrieval system, a retrieval word input by a user in the retrieval system is matched with the table content and the text content in the retrieval system, and then a target table content that is successfully matched and/or a target document address corresponding to the target text content is obtained, and the target document address is fed back to the user. Therefore, online documents are stored in a distributed mode, the storage pressure of a retrieval system is reduced, and the expansion convenience of the table is improved by independently storing table information.
In order to implement the above embodiments, the present disclosure further provides an online document retrieval device.
Fig. 5 is a schematic structural diagram of an online document retrieval apparatus according to an embodiment of the present disclosure, as shown in fig. 5, the online document retrieval apparatus includes: anacquisition module 10, astorage module 20, amatching module 30 and aretrieval feedback module 40, wherein,
the obtainingmodule 10 is configured to obtain form information and text information in a current online document when the online document is in an online editing state, where the text information includes a document address and text content of the online document where the text information is located, and the form information includes the document address and form content of the online document where the form information is located.
In one embodiment of the present disclosure, as shown in fig. 6, on the basis of the method shown in fig. 5, the obtainingmodule 10 includes acomparing unit 11 and afirst updating unit 12, wherein,
and a comparingunit 11 for comparing the table information and the text information with the history table information and the history text information corresponding to the online document, which are stored in the retrieval system last time, respectively.
And afirst updating unit 12, configured to obtain the updated form information and the updated text information according to the comparison result.
Thestorage module 20 is configured to store the table information in a first storage location of the retrieval system, and store the text information in a second storage location of the retrieval system.
In one embodiment of the present disclosure, as shown in fig. 7, on the basis as shown in fig. 5, thestorage module 20 includes a first obtainingunit 21, a second obtainingunit 22 and asecond updating unit 23, wherein,
a first obtainingunit 21, configured to obtain an update table identifier in the update table information.
Asecond obtaining unit 22, configured to obtain the target history table content corresponding to the update table identifier in the first storage location.
And a second updatingunit 23, configured to update the target history table content according to the update table content in the update table information.
And thematching module 30 is used for matching the search words input by the user in the search system with the table contents and the text contents in the search system.
And theretrieval feedback module 40 is used for acquiring the successfully matched target table content and/or the target document address corresponding to the target text content, and feeding back the target document address to the user.
In an embodiment of the present disclosure, theretrieval feedback module 40 is specifically configured to:
comparing whether a first document address corresponding to the target table content is consistent with a second document address corresponding to the target text content;
and when the first document address is consistent with the second document address, feeding back the first document address or the second document address to the user.
In one embodiment of the present disclosure, as shown in fig. 8, on the basis as shown in fig. 5, the apparatus further includes: and aprompt module 50, wherein theprompt module 50 is configured to feed back search failure notification information to the user when the target form content and the target text content matching the search term are not obtained.
It should be noted that the foregoing explanation on the embodiment of the online document retrieval method is also applicable to the online document retrieval device of the embodiment, and is not repeated herein.
In summary, the online document retrieval apparatus according to the embodiment of the present disclosure, when an online document is in an online editing state, obtains table information and text information in a current online document, where the text information includes a document address and a text content of the online document, and the table information includes a document address and a table content of the online document, stores the table information in a first storage location of a retrieval system, and stores the text information in a second storage location of the retrieval system, matches a retrieval word input by a user in the retrieval system with the table content and the text content in the retrieval system, and further obtains a target table content that is successfully matched, and/or a target document address corresponding to the target text content, and feeds back the target document address to the user. Therefore, online documents are stored in a distributed mode, the storage pressure of a retrieval system is reduced, and the expansion convenience of the table is improved by independently storing table information.
In order to implement the above embodiments, the present disclosure also provides an electronic device, including: at least one processor; and a memory communicatively coupled to the at least one processor;
wherein the memory stores instructions executable by the at least one processor, the instructions being arranged to perform the online document retrieval method set forth in the above embodiments. Referring now to FIG. 9, shown is a schematic diagram of an electronic device suitable for use in implementing embodiments of the present disclosure. The electronic devices in the embodiments of the present disclosure may include, but are not limited to, mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., car navigation terminals), and the like, and fixed terminals such as digital TVs, desktop computers, and the like. The electronic device shown in fig. 9 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 9, the electronic device may include a processing means (e.g., a central processing unit, a graphic processor, etc.) 901, which may perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM)902 or a program loaded from a storage means 908 into a Random Access Memory (RAM) 903. In theRAM 903, various programs and data necessary for the operation of the electronic apparatus are also stored. Theprocessing apparatus 901, theROM 902, and theRAM 903 are connected to each other through abus 904. An input/output (I/O)interface 905 is also connected tobus 904.
Generally, the following devices may be connected to the I/O interface 905:input devices 906 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; anoutput device 907 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like;storage 908 including, for example, magnetic tape, hard disk, etc.; and acommunication device 909. The communication means 909 may allow the electronic device to perform wireless or wired communication with other devices to exchange data. While fig. 9 illustrates an electronic device having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through thecommunication device 909, or installed from thestorage device 908, or installed from theROM 902. The computer program performs the above-described functions defined in the methods of the embodiments of the present disclosure when executed by theprocessing apparatus 901.
It should be noted that the computer readable medium in the present disclosure can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In contrast, in the present disclosure, a computer readable signal medium may comprise a propagated data signal with computer readable program code embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
The computer readable medium may be embodied in the electronic device; or may exist separately without being assembled into the electronic device.
The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: when the online document is in an online editing state, acquiring form information and text information in the current online document, wherein the text information comprises a document address and text content of the online document, and the form information comprises the document address and the form content of the online document;
storing the table information in a first storage location of a retrieval system and storing the text information in a second storage location of the retrieval system;
matching a search word input by a user in the search system with the table content and the text content in the search system;
and acquiring the successfully matched target table content and/or a target document address corresponding to the target text content, and feeding back the target document address to the user.
Alternatively, the computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to:
when the online document is in an online editing state, acquiring form information and text information in the current online document, wherein the text information comprises a document address and text content of the online document, and the form information comprises the document address and the form content of the online document;
storing the table information in a first storage location of a retrieval system and storing the text information in a second storage location of the retrieval system;
matching a search word input by a user in the search system with the table content and the text content in the search system;
and acquiring the successfully matched target table content and/or a target document address corresponding to the target text content, and feeding back the target document address to the user.
Computer program code for carrying out operations for aspects of the present disclosure may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present disclosure may be implemented by software or hardware. Where the name of an element does not in some cases constitute a limitation on the element itself.
To achieve the above embodiments, the present disclosure also proposes a non-transitory computer-readable storage medium storing computer instructions for causing a computer to execute the above embodiments of the present disclosure, and fig. 10 proposed by the above embodiments of the present disclosure is a schematic diagram illustrating a non-transitory computer-readable storage medium according to an embodiment of the present disclosure. As shown in fig. 10, a non-transitory computerreadable storage medium 1000 according to an embodiment of the disclosure has stored thereoncomputer instructions 1001. When thecomputer instructions 1001 are executed by a processor, all or part of the steps of the online document retrieval method according to the embodiments of the present disclosure are performed.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware. With this understanding, the above technical solutions may be embodied in the form of a software product, which may be stored in a non-transitory storage medium, such as a magnetic disk, an optical disk, a read-only memory (ROM) or a Random Access Memory (RAM), and so on, and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute the methods of the various embodiments or some parts of the embodiments.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solutions of the present disclosure, not to limit them; although the present disclosure has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present disclosure.