Disclosure of Invention
The embodiment of the application provides a method for remotely acquiring a word stock, an Internet of things terminal and a readable storage medium, which are used for solving the problem that the word stock in a lightweight Internet of things terminal in the prior art occupies a large storage space.
The embodiment of the invention provides a method for remotely acquiring a word stock, which comprises the following steps:
the Internet of things terminal acquires a user operation instruction and generates one or more character codes based on the user operation;
after judging that the one or more character codes are not stored in the local word stock, the Internet of things terminal sends a character acquisition request to a word stock server, wherein the character acquisition request message comprises the one or more character codes;
the Internet of things terminal receives word stock information sent by the word stock server, wherein the word stock information is an incomplete word stock and comprises word stocks corresponding to the one or more character codes;
and the Internet of things terminal loads the word stock information and displays characters in the word stock.
Optionally, before the terminal of the internet of things obtains the user operation instruction, the method further includes:
after a starting instruction is started, the Internet of things terminal initializes a locally stored word library module, loads a locally stored character lattice cache, and displays the locally stored character lattice on a display screen of the Internet of things terminal.
Optionally, the obtaining, by the internet of things terminal, a user operation instruction and one or more character codes based on the user operation includes:
and receiving user-defined character input information of the user, and generating a character code corresponding to the character input information based on the user-defined character input information.
Optionally, the loading, by the internet of things terminal, the word stock information and displaying characters in the word stock include:
the Internet of things terminal acquires character lattice cache of the word stock information;
and the terminal of the Internet of things displays the character lattice on an interface.
Optionally, the internet of things terminal interacts with the word stock server through an HTTP protocol.
Optionally, the internet of things terminal is an interphone.
The embodiment of the invention also provides an internet of things terminal for remotely acquiring the word stock, which comprises:
the acquisition module is used for acquiring a user operation instruction and generating one or more character codes based on the user operation;
the sending module is used for sending a character acquisition request to the word stock server after judging that the one or more character codes are not stored in the local word stock, wherein the character acquisition request message comprises the one or more character codes;
the receiving module is used for receiving the word stock information sent by the word stock server, wherein the word stock information is an incomplete word stock and comprises a word stock corresponding to the one or more character codes;
and the display module is used for loading the word stock information and displaying the characters in the word stock.
The embodiment of the invention also provides electronic equipment which is characterized by comprising a memory and a processor, wherein the memory stores computer executable instructions, and the processor realizes the method when running the computer executable instructions on the memory.
Embodiments of the present invention further provide a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the method is implemented.
By the method provided by the embodiment of the invention, the lightweight Internet of things terminal does not need to store all word stock information locally, but obtains the required word stock from the remote server as required, so as to obtain the specific and targeted character lattice and load and display the character lattice, the low-frequency specific (non-common) character loading effect is obvious, the storage resource is saved, and the loading efficiency of common characters is improved.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some, but not all, embodiments of the present application. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
It will be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It is also to be understood that the terminology used in the description of the present application herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in the specification of the present application and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
It should be further understood that the term "and/or" as used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
As used in this specification and the appended claims, the term "if" may be interpreted contextually as "when", "upon" or "in response to a determination" or "in response to a detection". Similarly, the phrase "if it is determined" or "if a [ described condition or event ] is detected" may be interpreted contextually to mean "upon determining" or "in response to determining" or "upon detecting [ described condition or event ]" or "in response to detecting [ described condition or event ]".
Fig. 1 is a flowchart of a method for remotely obtaining a word stock according to an embodiment of the present invention. As shown in fig. 1, the method includes:
s101, the Internet of things terminal acquires a user operation instruction and generates one or more character codes based on the user operation;
in the embodiment of the invention, the terminal of the internet of things is a lightweight terminal of the internet of things, has a special purpose, has small storage space, and only needs to store a necessary special function realization module and a necessary character lattice so as to be loaded on a display screen. Such as walkie-talkies, legacy mobile terminals (non-smart phones), etc. The terminal of the internet of things can interact with the external remote server through a specific wireless connection protocol, for example, the terminal of the internet of things can interact with the terminal of the internet of things or the external remote server through the Ethernet protocol.
The terminal of the Internet of things receives the user-defined character input information, and generates a character code corresponding to the character input information based on the user-defined character input information. The method specifically comprises the following steps: when a user operates the terminal of the internet of things, an input tool is often required to be called to input characters, typically, the characters can be input through a built-in input method, such as pinyin, wubi and other input methods, and an operation instruction of the user is an input instruction of the user, after the user inputs a specific pinyin or wubi, the terminal of the internet of things is internally converted to generate a character code corresponding to the characters, such as a GB2312 code or a UNICODE code. The character code can be regarded as an index, and if the character lattice corresponding to the character code is not stored locally in the terminal of the internet of things, the corresponding character lattice information can be acquired from the server through the index.
S102, after judging that the one or more character codes are not stored in the local word stock, the Internet of things terminal sends a character acquisition request to a word stock server, wherein the character acquisition request message comprises the one or more character codes;
after the terminal of the internet of things generates character code information, whether the character code is stored locally is judged, if the character code is stored locally, a character lattice corresponding to the character code is directly loaded locally and displayed on an interface, and if the character code is not stored, a character acquisition request needs to be sent to a word stock server to acquire a word stock corresponding to the character code.
The word stock server stores character codes and a complete word stock, stores a corresponding relation table of the character codes and the word stock, searches the corresponding word stock from the corresponding relation table after the word stock server obtains the character codes, and sends the corresponding word stock to the Internet of things terminal.
Optionally, the terminal of the internet of things communicates with the word stock server through an HTTP protocol.
S103, the Internet of things terminal receives word stock information sent by the word stock server, wherein the word stock information is an incomplete word stock and comprises word stocks corresponding to the one or more character codes;
in the embodiment of the invention, the word stock information is incomplete and targeted partial word stock information, and all the word stock information is not required to be sent completely, but is sent as required.
S104, the Internet of things terminal loads the word stock information and displays characters in the word stock.
With the word stock information, characters can be displayed based on the word stock information. And the Internet of things terminal acquires the character lattice cache of the word stock information and displays the character lattice on an interface based on the lattice cache.
Optionally, before the terminal of the internet of things obtains the user operation instruction, the internet of things needs to load a local interface after being started up, and the method specifically includes:
after a starting instruction is started, the Internet of things terminal initializes a locally stored word library module, loads a locally stored character lattice cache, and displays the locally stored character lattice on a display screen of the Internet of things terminal.
An embodiment of the present invention further provides an internet of things terminal 20 for remotely obtaining a word stock, as shown in fig. 2, the internet of things terminal 20 includes:
the obtaining module 21 is configured to obtain a user operation instruction, and generate one or more character codes based on the user operation;
in the embodiment of the invention, the terminal of the internet of things is a lightweight terminal of the internet of things, has a special purpose, has small storage space, and only needs to store a necessary special function realization module and a necessary character lattice so as to be loaded on a display screen. Such as walkie-talkies, legacy mobile terminals (non-smart phones), etc. The terminal of the internet of things can interact with the external remote server through a specific wireless connection protocol, for example, the terminal of the internet of things can interact with the terminal of the internet of things or the external remote server through the Ethernet protocol.
The obtaining module 21 receives the user-defined character input information of the user, and generates a character code corresponding to the character input information based on the user-defined character input information. The method specifically comprises the following steps: when a user operates the terminal of the internet of things, an input tool is often required to be called to input characters, typically, the characters can be input through a built-in input method, such as pinyin, wubi and other input methods, and an operation instruction of the user is an input instruction of the user, after the user inputs a specific pinyin or wubi, the terminal of the internet of things is internally converted to generate a character code corresponding to the characters, such as a GB2312 code or a UNICODE code. The character code can be regarded as an index, and if the character lattice corresponding to the character code is not stored locally in the terminal of the internet of things, the corresponding character lattice information can be acquired from the server through the index.
A sending module 22, configured to send a character acquisition request to a word stock server after determining that the one or more character codes are not stored in the local word stock, where the character acquisition request message includes the one or more character codes;
after the obtaining module 21 generates the character code information, it determines whether the character code is stored locally, if so, directly loads the character lattice corresponding to the character code locally and displays the character lattice on the interface, and if not, it needs to send a character obtaining request to the word stock server through the sending module 22 to obtain the word stock corresponding to the character code.
The word stock server stores character codes and a complete word stock, stores a corresponding relation table of the character codes and the word stock, searches the corresponding word stock from the corresponding relation table after the word stock server obtains the character codes, and sends the corresponding word stock to the Internet of things terminal.
Optionally, the terminal of the internet of things communicates with the word stock server through an HTTP protocol.
A receiving module 23, configured to receive the word stock information sent by the word stock server, where the word stock information is an incomplete word stock and the word stock information includes a word stock corresponding to the one or more character codes;
in the embodiment of the invention, the word stock information is incomplete and targeted partial word stock information, and all the word stock information is not required to be sent completely, but is sent as required.
And the display module 24 is configured to load the word stock information and display characters in the word stock.
With the word stock information, characters can be displayed based on the word stock information. The display module 24 obtains a character lattice cache of the word stock information, and displays the character lattice on an interface based on the lattice cache.
The embodiment of the invention also provides electronic equipment which is characterized by comprising a memory and a processor, wherein the memory stores computer executable instructions, and the processor realizes the method when running the computer executable instructions on the memory. Optionally, the electronic device is an intercom.
Embodiments of the present invention further provide a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the method is implemented.
By the method and the Internet of things terminal provided by the embodiment of the invention, the lightweight Internet of things terminal does not need to store all word stock information locally, but obtains the required word stock from the remote server as required, so that the specific and targeted character lattice is obtained and loaded and displayed, the loading effect on low-frequency specific (non-common) characters is obvious, the storage resource is saved, and the loading efficiency of common characters is improved.
In one embodiment provided herein, the internet of things terminal further includes a processor, an input device, an output device, and a memory. The input device, the output device, the memory and the processor are connected with each other through a bus.
The memory includes, but is not limited to, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), or a portable read-only memory (CD-ROM), which is used for storing instructions and data.
The input means are for inputting data and/or signals and the output means are for outputting data and/or signals. The output means and the input means may be separate devices or may be an integral device.
The processor may include one or more processors, for example, one or more Central Processing Units (CPUs), and in the case of one CPU, the CPU may be a single-core CPU or a multi-core CPU. The processor may also include one or more special purpose processors, which may include GPUs, FPGAs, etc., for accelerated processing.
The memory is used to store program codes and data of the network device.
The processor is used for calling the program codes and data in the memory and executing the steps in the method embodiment. Specifically, reference may be made to the description of the method embodiment, which is not repeated herein.
In practical applications, the terminals of the internet of things may further include necessary other elements, including but not limited to any number of input/output devices, processors, controllers, memories, etc., and all terminals of the internet of things that can implement the embodiments of the present application are within the scope of the present application.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other ways. For example, the division of the unit is only one logical function division, and other division may be implemented in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. The shown or discussed mutual coupling, direct coupling or communication connection may be an indirect coupling or communication connection of devices or units through some interfaces, and may be in an electrical, mechanical or other form.
Units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. The procedures or functions according to the embodiments of the present application are wholly or partially generated when the computer program instructions are loaded and executed on a computer. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored on or transmitted over a computer-readable storage medium. The computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by wire (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)), or wirelessly (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that includes one or more of the available media. The usable medium may be a read-only memory (ROM), or a Random Access Memory (RAM), or a magnetic medium, such as a floppy disk, a hard disk, a magnetic tape, a magnetic disk, or an optical medium, such as a Digital Versatile Disk (DVD), or a semiconductor medium, such as a Solid State Disk (SSD).
The above description is only for the specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily conceive various equivalent modifications or substitutions within the technical scope of the present application, and these modifications or substitutions should be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.