[ summary of the invention ]
Aspects of the present invention provide a method and an apparatus for processing an emoticon, so as to reduce the processing load of a processing engine.
One aspect of the present invention provides a method for processing an emoticon, including:
acquiring page resources of a page, wherein the page resources comprise a specified page tag, and the specified page tag is used for defining specified page elements;
acquiring an input sequence related to the designated page element according to the designated page tag;
obtaining at least one emoticon according to the input sequence;
and outputting the at least one emoticon for a user to select one emoticon as input content related to the specified page element.
The above-described aspects and any possible implementations further provide an implementation in which the specified page tag includes at least one of an Input tag and a Textarea tag.
The above aspect and any possible implementation manner further provide an implementation manner, where the obtaining an input sequence related to the specified page element according to the specified page tag includes:
monitoring an input event inside the specified page element according to the specified page tag;
and acquiring an input sequence related to the specified page element according to the monitored input event inside the specified page element.
The above-described aspects and any possible implementations further provide an implementation in which the emoticon includes at least one of a character emoticon and a graphic emoticon.
The above aspect and any possible implementation manner further provide an implementation manner, where obtaining at least one emoticon according to the input sequence includes:
according to the input sequence, matching processing is carried out in an expression library of the application where the page is located, so that at least one expression symbol is obtained; or
According to the input sequence, matching processing is carried out in an expression library of a browser application displaying the page to obtain at least one expression symbol; or
According to the input sequence, matching processing is carried out in an expression library of the called input method application to obtain at least one expression symbol; or
And performing matching processing in an expression library of the terminal according to the input sequence to obtain at least one expression symbol.
In another aspect of the present invention, there is provided an emoticon processing apparatus, including:
the resource acquisition unit is used for acquiring page resources of a page, wherein the page resources comprise a specified page tag, and the specified page tag is used for defining specified page elements;
the sequence acquisition unit is used for acquiring an input sequence related to the specified page element according to the specified page tag;
the expression matching unit is used for obtaining at least one expression symbol according to the input sequence;
and the expression output unit is used for outputting the at least one expression symbol so that a user can select one expression symbol as the input content related to the specified page element.
The above-described aspects and any possible implementations further provide an implementation in which the specified page tag includes at least one of an Input tag and a Textarea tag.
The above-mentioned aspect and any possible implementation manner further provide an implementation manner, and the sequence acquiring unit is specifically configured to
Monitoring an input event inside the specified page element according to the specified page tag; and
and acquiring an input sequence related to the specified page element according to the monitored input event inside the specified page element.
The above-described aspects and any possible implementations further provide an implementation in which the emoticon includes at least one of a character emoticon and a graphic emoticon.
The above-mentioned aspects and any possible implementation manners further provide an implementation manner, and the expression matching unit is specifically configured to
According to the input sequence, matching processing is carried out in an expression library of the application where the page is located, so that at least one expression symbol is obtained; or
According to the input sequence, matching processing is carried out in an expression library of a browser application displaying the page to obtain at least one expression symbol; or
According to the input sequence, matching processing is carried out in an expression library of the called input method application to obtain at least one expression symbol; or
And performing matching processing in an expression library of the terminal according to the input sequence to obtain at least one expression symbol.
As can be seen from the foregoing technical solutions, in the embodiments of the present invention, by obtaining a page resource of a page, where the page resource includes a specified page tag, the specified page tag is used to define a specified page element, and then obtaining an input sequence related to the specified page element according to the specified page tag, so that at least one emoticon can be obtained and output according to the input sequence, so that a user can select one emoticon as an input content related to the specified page element, and because the emoticon is no longer completely displayed depending on the triggering of a specified function control, but the emoticon is obtained and output according to the input sequence related to the specified page element, the output emoticon can substantially meet the input intention of the user, and therefore, it is possible to avoid that in the prior art, a satisfactory emoticon can be selected by the user through repeatedly browsing the presented emoticon, and the increase of applications and the use of the applications can be avoided Thereby reducing the processing load of the processing engine.
In addition, by adopting the technical scheme provided by the invention, the emoticons are not displayed by completely depending on the triggering of the designated function control, but the emoticons are obtained and output according to the input sequence related to the designated page element, so that the output emoticons can basically meet the input intention of the user, and the effectiveness of the output emoticons can be effectively improved.
In addition, by adopting the technical scheme provided by the invention, the emoticons are not displayed by completely depending on the triggering of the specified function control, but the emoticons are obtained and output according to the input sequence related to the specified page elements, so that the matched emoticons can be directly output for the user to select without waiting for the user to trigger the specified function control, and the input efficiency of the emoticons can be effectively improved.
In addition, by adopting the technical scheme provided by the invention, the emoticons are not displayed by completely depending on the triggering of the specified function control, but the emoticons are obtained and output according to the input sequence related to the specified page elements, so that the output emoticons can basically meet the input intention of the user, and the user experience can be greatly improved.
[ detailed description ] embodiments
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be obtained by a person skilled in the art without any inventive step based on the embodiments of the present invention, are within the scope of the present invention.
It should be noted that the terminal involved in the embodiments of the present invention may include, but is not limited to, a mobile phone, a Personal Digital Assistant (PDA), a wireless handheld device, a tablet computer (tablet computer), a Personal Computer (PC), an MP3 player, an MP4 player, a wearable device (e.g., smart glasses, smart watch, smart bracelet, etc.), and the like.
In addition, the term "and/or" herein is only one kind of association relationship describing an associated object, and means that there may be three kinds of relationships, for example, a and/or B, which may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the character "/" herein generally indicates that the former and latter related objects are in an "or" relationship.
Fig. 1 is a flowchart illustrating a method for processing an emoticon according to an embodiment of the present invention, as shown in fig. 1.
101. The method comprises the steps of obtaining page resources of a page, wherein the page resources comprise a specified page tag, and the specified page tag is used for defining specified page elements.
The page may also be referred to as a world wide Web (Web) page, and may be a Web page (HTML) written based on a hypertext markup language (HTML), that is, an HTML page, or may also be a Web page written based on HTML and a Java language, that is, a Java Server Page (JSP), or may also be a Web page written in another language, which is not particularly limited in this embodiment. A Web page may include a display area defined by one or more page tags, such as hypertext markup language (HTML) tags, JSP tags, etc., referred to as page elements, such as words, pictures, hyperlinks, buttons, input boxes, drop-down boxes, etc.
The page resources of the page mainly comprise page main resources and page sub-resources. The page main resource is a page source code, and the page sub-resource is other resources except the page main resource in the Web page, for example, a picture, a streaming media, a JavaScript script file, a Cascading Style Sheets (CSS) resource, and the like.
Wherein,
the designated page tag may include, but is not limited to, at least one of an Input (Input) tag and a text area (Textarea) tag, which is not particularly limited in this embodiment.
The specified page element may include, but is not limited to, at least one of an Input box defined by an Input tag and a text box defined by a Textarea tag, which is not particularly limited in this embodiment.
The Input tag can be used for defining an Input box, namely a range of an Input field, wherein a user can Input data; a Textarea tag for defining a text box, i.e., a range of a text region in which a user can input data.
102. And acquiring an input sequence related to the designated page element according to the designated page tag.
103. And obtaining at least one emoticon according to the input sequence.
Optionally, in a possible implementation manner of this embodiment, the emoticon may include, but is not limited to, at least one of a character emoticon and a graphic emoticon, which is not particularly limited in this embodiment.
Wherein,
character emoticons, meaning patterns composed of characters and symbols, e.g. characters composed of ASCII characters such asIndicating happy, -D, etc.
Graphic emoticons, i.e. patterns composed of images, animations, etc., e.g. to indicate distractionAnd the like.
104. And outputting the at least one emoticon for a user to select one emoticon as input content related to the specified page element.
It should be noted that part or all of the execution subjects of 101 to 104 may be an application located at the local terminal, or may also be a functional unit such as a plug-in or Software Development Kit (SDK) set in the application located at the local terminal, or may also be a processing engine located in a server on the network side, or may also be a distributed system located on the network side, which is not particularly limited in this embodiment.
It is to be understood that the application may be a native app (native app) installed on the terminal, or may also be a web page program (webApp) of a browser on the terminal, and this embodiment is not particularly limited thereto.
In this way, by acquiring a page resource of a page, where the page resource includes a specified page tag, the specified page tag is used to define a specified page element, and then acquiring an input sequence related to the specified page element according to the specified page tag, so that at least one emoticon can be obtained and output according to the input sequence, so that a user can select one emoticon as input content related to the specified page element, and because the emoticon is no longer completely displayed by depending on triggering of a specified function control, but the emoticon is obtained and output according to the input sequence related to the specified page element, so that the output emoticon can substantially meet the input intention of the user, it is possible to avoid increasing data interaction between an application and a processing engine used by the application due to the fact that the user can select a satisfactory emoticon by repeatedly browsing the presented emoticon through the application in the prior art Thereby reducing the processing burden of the processing engine.
Optionally, in a possible implementation manner of this embodiment, in 101, specifically, a page resource of the page may be traversed, and whether a specified page tag, for example, an Input tag, exists is searched, so as to determine whether a specified page element having an inputtable region, for example, an Input box, is included in the page. If the specified page tag exists, the steps can be continuously executed 102-104; otherwise, 102-104 need not be executed.
Optionally, in a possible implementation manner of this embodiment, in 102, an input event inside the specified page element may be monitored specifically according to the specified page tag, and then, an input sequence related to the specified page element may be acquired according to the monitored input event inside the specified page element.
In a specific implementation process, the JavaScript language function may be specifically adopted to execute 102. For example, using an OnMouseDown function or the like, an input event inside the specified page element, for example, an event triggered at the instant when a mouse button is pressed inside the specified page element, or the like, is monitored. Generally, before a user performs an input operation within a designated page element, the user moves the cursor to a position within the designated page element, so that once an event triggered by the instant when the mouse button is pressed down within the designated page element is monitored, it can be said that the user is about to perform the input operation, that is, the input event within the designated page element is monitored.
In another specific implementation process, if an input event inside the specified page element is monitored, a GetValue function or the like may be used to obtain an input sequence related to the specified page element.
The input sequence may be an input character directly input by the input device, or may also be an input character obtained by performing an input operation using an input method based on an input character directly input by the input device, which is not particularly limited in the present embodiment.
The input method application refers to encoding methods adopted for inputting various characters into a terminal, and various input methods exist in different languages, countries or regions, such as a dog search pinyin input method, a Baidu input method, a QQ pinyin input method, and the like. Generally, an input method application may present, according to an input character directly input by a user using an input device, a plurality of candidate items corresponding to the input character to the user, so that the user selects one candidate item to complete an input operation of the input character, for example, a screen-up operation.
Specifically, the user may input characters corresponding to different languages in the provided input environment, where the input characters may be a pinyin sequence, a roman sequence, a font sequence, or the like, and this embodiment is not particularly limited.
In another specific implementation, if the input event inside the specified page element is monitored, the input character input by the user inside the specified page element may be obtained in real time by using an asynchronous loading technology, such as Ajax asynchronous loading or Jsonp asynchronous loading. Specifically, interfaces such as Ajax interfaces or json interfaces may be provided, the interfaces may be written using languages such as Java and hypertext preprocessor (PHP), and the specific call may be written using languages such as Jquery or native JavaScript.
Optionally, in a possible implementation manner of this embodiment, in 103, specifically, according to the input sequence, matching processing may be performed in an emoticon of an application in which the page is located, so as to obtain at least one emoticon.
The expression library is self-contained by the application where the page is located and is used for describing the corresponding relation between the input sequence and the expression symbols.
Optionally, in a possible implementation manner of this embodiment, in 103, specifically, according to the input sequence, a matching process may be performed in an emoticon of a browser application that presents the page, so as to obtain at least one emoticon.
The expression library is self-contained for a browser application displaying the page and is used for describing the corresponding relation between the input sequence and the expression symbols.
Optionally, in a possible implementation manner of this embodiment, in 103, specifically, according to the input sequence, matching processing may be performed in an emoticon of the invoked input method application to obtain at least one emoticon.
The expression library is self-contained for the called input method application and is used for describing the corresponding relation between the input sequence and the expression symbols.
Optionally, in a possible implementation manner of this embodiment, in 103, specifically, according to the input sequence, a matching process may be performed in an emoticon of the terminal, so as to obtain at least one emoticon.
The expression library is carried by the terminal and is used for describing the corresponding relation between the input sequence and the expression symbols.
So far, according to the input sequence, the technical solution disclosed in any of the above several possible implementation manners may be adopted, and the at least one emoticon may be obtained as a candidate emoticon. For example, the input sequence is "haha", and the representation of the obtained candidate emoticons can be as shown in fig. 3.
In the above several possible implementations, before 103, an expression library used may be further established, and the specific form of the expression library may be a database or a file system, which is not particularly limited in this embodiment.
The database may be a relational database, such as an Oracle database, a DB2 database, a Structured Query Language (SQL) Server (Server) database, a MySQL database, or a Key-Value database, such as a non-SQL (notonly SQL) NoSQL database, a Redis database, which is not limited in this embodiment.
Then, after the pre-established expression library is obtained, the pre-established expression library may be further stored. Specifically, the created expression library may be stored in a storage device of the terminal.
In a specific implementation process, the storage device of the terminal may be a slow storage device, specifically, a hard disk of a computer system, or may also be a non-operating memory of a mobile phone, that is, a physical memory, such as a Read-only memory (ROM), a memory card, and the like, which is not limited in this embodiment.
In another specific implementation process, the storage device of the terminal may also be a fast storage device, specifically, a memory of a computer system, or may also be a running memory of a mobile phone, that is, a system memory, for example, a Random Access Memory (RAM), and the like, which is not particularly limited in this embodiment.
In this embodiment, by obtaining a page resource of a page, where the page resource includes a specified page tag, where the specified page tag is used to define a specified page element, and further, according to the specified page tag, an input sequence related to the specified page element is obtained, so that at least one emoticon can be obtained and output according to the input sequence, so that a user can select one emoticon as an input content related to the specified page element, and because the emoticon is no longer completely displayed depending on triggering of a specified function control, but according to the input sequence related to the specified page element, the emoticon is obtained and output, so that the output emoticon can substantially meet an input intention of the user, therefore, it is possible to avoid that in the prior art, a user can select a satisfactory emoticon by repeatedly browsing the displayed emoticon through an application, and data between an application and a processing engine used by the application is increased Interaction, thereby reducing the processing burden on the processing engine.
In addition, by adopting the technical scheme provided by the invention, the emoticons are not displayed by completely depending on the triggering of the designated function control, but the emoticons are obtained and output according to the input sequence related to the designated page element, so that the output emoticons can basically meet the input intention of the user, and the effectiveness of the output emoticons can be effectively improved.
In addition, by adopting the technical scheme provided by the invention, the emoticons are not displayed by completely depending on the triggering of the specified function control, but the emoticons are obtained and output according to the input sequence related to the specified page elements, so that the matched emoticons can be directly output for the user to select without waiting for the user to trigger the specified function control, and the input efficiency of the emoticons can be effectively improved.
In addition, by adopting the technical scheme provided by the invention, the emoticons are not displayed by completely depending on the triggering of the specified function control, but the emoticons are obtained and output according to the input sequence related to the specified page elements, so that the output emoticons can basically meet the input intention of the user, and the user experience can be greatly improved.
It should be noted that, for simplicity of description, the above-mentioned method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present invention is not limited by the order of acts, as some steps may occur in other orders or concurrently in accordance with the invention. Further, those skilled in the art should also appreciate that the embodiments described in the specification are preferred embodiments and that the acts and modules referred to are not necessarily required by the invention.
In the foregoing embodiments, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
Fig. 2 is a schematic structural diagram of an emoticon processing apparatus according to another embodiment of the present invention, as shown in fig. 2. The processing apparatus of emoticons of the present embodiment may include a resource acquisition unit 21, a sequence acquisition unit 22, an emotion matching unit 23, and an emotion output unit 24. The resource acquiring unit 21 is configured to acquire a page resource of a page, where the page resource includes a specified page tag, and the specified page tag is used to define a specified page element; a sequence obtaining unit 22, configured to obtain an input sequence related to the specified page element according to the specified page tag; the expression matching unit 23 is configured to obtain at least one emoticon according to the input sequence; and an emoticon output unit 24, configured to output the at least one emoticon, so that the user can select one emoticon as input content related to the specified page element.
It should be noted that, part or all of the processing apparatus of the emoticon provided in this embodiment may be an application located in the local terminal, or may also be a functional unit such as a plug-in or Software Development Kit (SDK) provided in the application located in the local terminal, or may also be a processing engine located in a server on the network side, or may also be a distributed system located on the network side, which is not particularly limited in this embodiment.
It is to be understood that the application may be a native app (native app) installed on the terminal, or may also be a web page program (webApp) of a browser on the terminal, and this embodiment is not particularly limited thereto.
Optionally, in a possible implementation manner of this embodiment, the specified page tag may include, but is not limited to, at least one of an Input (Input) tag and a text area (Textarea) tag, which is not particularly limited in this embodiment.
The specified page element may include, but is not limited to, at least one of an Input box defined by an Input tag and a text box defined by a Textarea tag, which is not particularly limited in this embodiment.
Optionally, in a possible implementation manner of this embodiment, the emoticon may include, but is not limited to, at least one of a character emoticon and a graphic emoticon, which is not particularly limited in this embodiment.
Optionally, in a possible implementation manner of this embodiment, the sequence obtaining unit 22 may be specifically configured to monitor an input event inside the specified page element according to the specified page tag; and acquiring an input sequence related to the specified page element according to the monitored input event inside the specified page element.
Optionally, in a possible implementation manner of this embodiment, the expression matching unit 23 may be specifically configured to perform matching processing in an expression library of an application in which the page is located according to the input sequence, so as to obtain at least one emoticon.
Optionally, in a possible implementation manner of this embodiment, the emotion matching unit 23 may be specifically configured to perform matching processing in an emotion library of a browser application that presents the page according to the input sequence, so as to obtain at least one emoticon.
Optionally, in a possible implementation manner of this embodiment, the expression matching unit 23 may be specifically configured to perform matching processing in an expression library of the invoked input method application according to the input sequence, so as to obtain at least one emoticon.
Optionally, in a possible implementation manner of this embodiment, the expression matching unit 23 may be specifically configured to perform matching processing in an expression library of the terminal according to the input sequence, so as to obtain at least one emoticon.
It should be noted that the method in the embodiment corresponding to fig. 1 may be implemented by the processing device of the emoticon provided in this embodiment. For a detailed description, reference may be made to relevant contents in the embodiment corresponding to fig. 1, and details are not described here.
In this embodiment, a resource obtaining unit obtains a page resource of a page, where the page resource includes a specified page tag, the specified page tag is used to define a specified page element, and then a sequence obtaining unit obtains an input sequence related to the specified page element according to the specified page tag, so that an expression matching unit can obtain at least one emoticon according to the input sequence, and an expression output unit outputs at least one emoticon for a user to select one emoticon as input content related to the specified page element The problem of increasing data interaction between an application and the processing engine used by the application as a result of selecting a satisfactory emoticon, thereby reducing the processing burden on the processing engine.
In addition, by adopting the technical scheme provided by the invention, the emoticons are not displayed by completely depending on the triggering of the designated function control, but the emoticons are obtained and output according to the input sequence related to the designated page element, so that the output emoticons can basically meet the input intention of the user, and the effectiveness of the output emoticons can be effectively improved.
In addition, by adopting the technical scheme provided by the invention, the emoticons are not displayed by completely depending on the triggering of the specified function control, but the emoticons are obtained and output according to the input sequence related to the specified page elements, so that the matched emoticons can be directly output for the user to select without waiting for the user to trigger the specified function control, and the input efficiency of the emoticons can be effectively improved.
In addition, by adopting the technical scheme provided by the invention, the emoticons are not displayed by completely depending on the triggering of the specified function control, but the emoticons are obtained and output according to the input sequence related to the specified page elements, so that the output emoticons can basically meet the input intention of the user, and the user experience can be greatly improved.
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 embodiments provided in the present invention, it should be understood that the disclosed system, apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized 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. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The 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 addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional unit.
The integrated unit implemented in the form of a software functional unit may be stored in a computer readable storage medium. The software functional unit is stored in a storage medium and includes several instructions to enable a computer device (which may be a personal computer, a server, or a network device) or a processor (processor) to execute some steps of the methods according to the embodiments of the present invention. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-only memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will 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 invention.