Short message display method and device, electronic equipment and program
By downloading and updating the latest card recognition content files and algorithm packages on the client, the problem that card recognition algorithms in the prior art cannot meet user needs is solved, and card display that matches user needs in real time is realized, improving user experience.
Patent Information
- Application Number
- CN202411478462.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-22
- Publication Date
- 2025-02-18
AI Technical Summary
Existing card recognition algorithms cannot meet the changing user needs, resulting in users needing to update clients frequently, resulting in poor user experience.
By sending interface request signals to the server, downloading the latest version of the card identification content file and algorithm package, and indexing the terminal through the latest version of the algorithm package, determining the terminal's location information in the card identification content file, thereby generating and matching the SMS Adapted card template.
It realizes real-time matching of user needs and displays any required card information to users, avoids the need for users to frequently update clients and improves user experience.
Smart Images

Figure CN119484454A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present specification relate to the field of communication technology, and in particular, to a method, device, electronic device and program for displaying short messages. Background Art
[0002] At present, when sending text messages to users, card-style short messages can be generated, so as to highlight the key information that users are concerned about, such as card-style train ticket text messages, card-style plane ticket text messages, card-style group purchase coupon text messages, card-style bill text messages, etc.
[0003] With the continuous development of social and business environments and the increase in application scenarios, user needs may change, making the existing card recognition algorithms no longer meet these needs. Summary of the invention
[0004] In response to the above technical problems, the embodiments of this specification provide a method, device, electronic device and program for displaying short messages, which can match user needs in real time and display card information to users.
[0005] The embodiment of this specification provides a method for displaying a short message, which is applied to a client. The method for displaying a short message includes:
[0006] Sending an interface request signal to the server, wherein the interface request signal includes the current version of the card recognition content file and the current version of the algorithm package in the local offline file;
[0007] In response to the pre-download signal from the server, download the latest version of the card recognition content file and algorithm package adapted to the interface request signal from the server, and replace the card recognition content file and algorithm package in the local offline file;
[0008] Get the SMS sent by the terminal;
[0009] Performing an index operation on the terminal through the latest version of the algorithm package to determine the location information of the terminal in the latest version of the card identification content file;
[0010] Generate a card template adapted to the text message based on the location information of the terminal in the latest version of the card identification content file and the content information of the text message;
[0011] Based on the pre-configured layout file, the card template and the content information of the text message are loaded, and the card corresponding to the text message is displayed.
[0012] Optionally, sending an interface request signal to the server includes at least one of the following:
[0013] Sending the interface request signal to the server according to a preset period;
[0014] When receiving the short message sent by the terminal and determining that a card compatible with the short message cannot be generated, the interface request signal is sent to the server.
[0015] Optionally, the local offline file further includes: a number index file and / or a signature index file;
[0016] The step of performing an index operation on the terminal through the latest version of the algorithm package to determine the location information of the terminal in the latest version of the card identification content file includes:
[0017] Using the reflection mechanism, calling the process interface in the latest version of the algorithm package, reading the content information of the terminal, the text message, and the card identification content file;
[0018] Performing an indexing operation on the content information of the SMS through the number index file and / or the signature index file, so as to index and determine the subject information of the terminal from the content information of the SMS;
[0019] Based on the pre-configured relationship between the main information of the terminal and the card identification content file, the position information of the terminal in the latest version of the card identification content file is determined.
[0020] Optionally, based on the number index file and / or the signature index file, a binary search algorithm is used to perform an indexing operation on the content information of the text message, so as to index and determine the main body information of the terminal from the content information of the text message.
[0021] Optionally, the generating a card template adapted to the text message based on the location information of the terminal in the latest version of the card identification content file and the content information of the text message includes:
[0022] Determine the rule JSON of the terminal in the latest version of the algorithm package based on the location information of the terminal in the latest version of the card recognition content file;
[0023] Extract key information from the content information of the short message as a trigger condition, and trigger the rule JSON when it is determined that the key information matches the rule JSON;
[0024] According to the triggered rule JSON, a template JSON corresponding to the rule JSON is selected from the latest version of the card recognition content file;
[0025] Based on the selected template JSON, a match is performed with the content information of the SMS, and the template JSON with the highest matching degree is selected as the card template.
[0026] Optionally, the loading operation on the card template and the content information of the text message based on a preconfigured layout file to display a card corresponding to the text message includes:
[0027] Convert the card template into an entity class of an object recognized by the client system;
[0028] Loading a pre-configured XML layout file on the client through Layout inflater;
[0029] Based on the entity class of the object and the content information of the text message, a card corresponding to the text message is generated in the XML layout file and displayed, including: extracting key-value pair information in the content information of the text message, and filling the key-value pair information into the entity class of the corresponding object.
[0030] The embodiment of this specification also provides a method for displaying a short message, which is applied to a server. The method for displaying a short message includes:
[0031] Receiving an interface request signal from a client, wherein the interface request signal includes a current version of a card recognition content file and a current version of an algorithm package in a local offline file;
[0032] A pre-download signal is generated based on the current version of the card identification content file and the current version of the algorithm package, as well as the latest version of the card identification content file and the latest version of the algorithm package. The pre-download signal is used to enable the client to download the latest version of the card identification content file and the algorithm package that are compatible with the interface request signal, so that the client displays a card that is compatible with the text message sent by the terminal.
[0033] The embodiment of the present specification also provides a text message display device, which is applied to a client, and the text message display device includes:
[0034] A signal sending unit, adapted to send an interface request signal to the server, wherein the interface request signal includes a current version of the card recognition content file and a current version of the algorithm package in the local offline file;
[0035] A file download unit, adapted to respond to a pre-download signal from the server, download the latest version of the card recognition content file and algorithm package adapted to the interface request signal from the server, and replace the card recognition content file and algorithm package in the local offline file;
[0036] An information acquisition unit, adapted to acquire a short message sent by a terminal;
[0037] a processing unit adapted to perform an indexing operation on the terminal through the latest version of the algorithm package, determine the location information of the terminal in the latest version of the card identification content file; and generate a card template adapted to the text message based on the location information of the terminal in the latest version of the card identification content file and the content information of the text message;
[0038] The display unit is adapted to load the card template and the content information of the short message based on a pre-configured layout file, and display a card corresponding to the short message.
[0039] The embodiment of the present specification also provides a text message display device, which is applied to a server, and the text message display device includes:
[0040] A signal receiving unit, adapted to receive an interface request signal from a client, wherein the interface request signal includes a current version of a card recognition content file and a current version of an algorithm package in a local offline file;
[0041] The signal generating unit is adapted to generate a pre-download signal according to the current version of the card identification content file and the current version of the algorithm package, as well as the latest version of the card identification content file and the latest version of the algorithm package. The pre-download signal is used to enable the client to download the latest version of the card identification content file and the algorithm package that are compatible with the interface request signal, so that the client displays a card that is compatible with the text message sent by the terminal.
[0042] An embodiment of the present specification also provides an electronic device, comprising: at least one processor and at least one memory, wherein the memory stores one or more computer executable instructions, and the processor calls the one or more computer executable instructions to execute the text message display method as described in any of the above items.
[0043] The embodiments of the present specification also provide a computer program product, including computer instructions, which, when executed by a processor, implement any of the aforementioned methods for displaying text messages.
[0044] According to the SMS display method provided in the embodiment of the present specification, since the interface request signal sent to the server includes the current version of the card recognition content file and the current version of the algorithm package in the local offline file, the server can send a pre-download signal when determining that the version number is inconsistent, so that the latest version of the card recognition content file and the algorithm package that are compatible with the interface request signal can be downloaded from the server, and the card recognition content file and the algorithm package can be updated by performing a replacement operation, so that the client can obtain the latest local offline file. In this way, after obtaining the SMS sent by the terminal, the terminal can be indexed by the latest version of the algorithm package to determine the location information of the terminal in the latest version of the card recognition content file, and then based on the location information of the terminal in the latest version of the card recognition content file and the SMS, a card template compatible with the SMS can be generated, that is, a component for generating card-type information can be found, and then based on the pre-configured layout file, the card template and the content information of the SMS can be loaded, and the card corresponding to the SMS can be displayed. Since the local offline file of the client is the latest, it can match the user's needs in real time and display any required card information for the user. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.
[0046] Figure 1 A flowchart of a method for displaying text messages in an embodiment of this specification is shown;
[0047] Figure 2 A schematic diagram of the structure of a text message is shown;
[0048] Figure 3 A schematic diagram of the structure of card-type information is shown;
[0049] Figure 4 A method for confirming terminal location information in an embodiment of this specification is shown;
[0050] Figure 5 A flowchart of a method for obtaining a card template in an embodiment of this specification is shown;
[0051] Figure 6 An interactive schematic diagram of a method for displaying short messages in an embodiment of this specification is shown;
[0052] Figure 7A schematic diagram of the structure of a text message display device in an embodiment of this specification is shown;
[0053] Figure 8 A flowchart of another method for displaying text messages in an embodiment of this specification is shown;
[0054] Fig. 9 A schematic diagram of the structure of another short message display device in an embodiment of this specification is shown. DETAILED DESCRIPTION
[0055] As described in the background art, with the increase of different application scenarios and fields, the original card recognition algorithm will no longer meet these requirements, and such requirements change frequently, so that users need to frequently update the client, resulting in a very poor user experience.
[0056] The reason for the above situation is that the SMS display algorithm built into the client can only recognize cards of one terminal. For example, the previous SMS cardization can only recognize cards related to arrears of telecommunications operators. When users want to purchase or refund train tickets with successful cards, they can only do so by updating the client, which makes the generation process of card-type SMS more complicated.
[0057] In order to solve the above technical problems, the embodiment of the specification provides a method for displaying short messages, which is applied to the client. Since the interface request signal sent to the server includes the current version of the card recognition content file and the current version of the algorithm package in the local offline file, the server can send a pre-download signal when determining that the version number is inconsistent, so that the latest version of the card recognition content file and the algorithm package that are compatible with the interface request signal can be downloaded from the server, and the card recognition content file and the algorithm package can be updated by performing a replacement operation, so that the client can obtain the latest local offline file. In this way, after obtaining the short message sent by the terminal, the terminal can be indexed by the latest version of the algorithm package to determine the location information of the terminal in the latest version of the card recognition content file, and then based on the location information of the terminal in the latest version of the card recognition content file and the short message, a card template that is compatible with the short message can be generated, that is, a component for generating card-type information can be found, and then based on the pre-configured layout file, the card template and the content information of the short message are loaded, and the card corresponding to the short message can be displayed. Since the local offline file of the client is the latest, it can match the user's needs in real time and display any required card information for the user.
[0058] In order to enable those skilled in the art to better understand the inventive concept, working principle and advantages of the embodiments of this specification, the merchant name confirmation scheme in the embodiments of this specification is described in detail below.
[0059] See also Figure 1The flowchart of a method for displaying a text message in an embodiment of this specification is shown in FIG. 1 , which is applied to a client. In some embodiments, such as Figure 1 As shown, the following steps can be performed:
[0060] S11, sending an interface request signal to the server, wherein the interface request signal includes the current version of the card recognition content file and the current version of the algorithm package in the local offline file.
[0061] In the specific implementation, the interface request signal is actively sent by the client to the server to verify whether the current version of the card recognition content file and the current version of the algorithm package in the local offline file are consistent with the version of the card recognition content file and the version of the algorithm package on the server. In this way, it can be known whether the client's local offline file is the latest.
[0062] In some embodiments, the client may send the interface request signal to the server according to a preset period.
[0063] The preset period may be 1 day, 2 days, a week or real time, and is set according to user needs.
[0064] It is to be understood that the durations listed in the above examples are merely illustrative and should not be construed as limitations of the present invention.
[0065] In some embodiments, when a short message sent by a terminal is received and it is determined that a card compatible with the short message cannot be generated, the interface request signal is sent to the server.
[0066] Specifically, there may be some periods when the local offline files currently stored in the client cannot meet the card-style generation requirements of the SMS sent by the terminal, indicating that the version number of the client's offline files is not the latest version number. At this time, the client can send an interface request signal to the server.
[0067] In a specific implementation, the algorithm package in the local offline file is used to read the SMS sent by the terminal, and the card identification content file in the local offline file is used to provide a card compatible with the SMS, so that a card-type SMS can be generated through the cooperation between the two.
[0068] In some embodiments, the algorithm package may be a dex package, which is an operating file format in the Android operating system. By loading the algorithm package, a subsequent card-type information generation process may be executed.
[0069] In some embodiments, the client is located on the user's mobile device and the server is set up online.
[0070] S12, in response to the pre-download signal from the server, downloading the latest version of the card recognition content file and algorithm package adapted to the interface request signal from the server, and replacing the card recognition content file and algorithm package in the local offline file.
[0071] In a specific implementation, when the server obtains the interface request signal sent by the client, it can parse and process the local offline file in the interface request signal, thereby determining the current version of the card identification content file and algorithm package, and matching the two with the version of the card identification content file and algorithm package in the server respectively. Based on the matching results, a pre-download signal can be sent to the client.
[0072] Among them, when it is determined that the current version of the card recognition content file and algorithm package in the local offline file is inconsistent with the version of the card recognition content file and algorithm package in the server, the client can perform a download operation based on the received pre-download signal, thereby obtaining the latest version of the card recognition content file and algorithm package that is compatible with the interface request signal.
[0073] As an optional implementation example, after server parsing, it is found that the version number of the client's algorithm package is 1.0, and the version number of the card recognition content file is 1.0.0. If the version number of the algorithm package on the server is 1.1, and the version number of the card recognition content file is 1.0.1, then through hot update (i.e. automatic online update), the client can download the latest version of the algorithm package and card recognition content file from the server so as to automatically load the new algorithm package.
[0074] In the specific implementation, since the latest version of the algorithm package and card recognition content file is downloaded from the server, it will inevitably overwrite the functions of the previous algorithm package and card recognition content file. Therefore, a replacement operation can be performed to replace the card recognition content file and algorithm package in the local offline file, so that the local offline file has the latest version of the card recognition content file and algorithm package.
[0075] In some embodiments, the latest dex algorithm package downloaded from the Internet is loaded through Dex Class Loader (where Dex Class Loader can load files in jar, dex, apk, zip and other formats in any directory of the client) to replace the algorithm package in the local offline file.
[0076] In some other embodiments, after the server parses and processes, it is found that the version number of the algorithm package of the client is 1.0 and the version number of the card recognition content file is 1.0.0. If the version number of the algorithm package on the server is 1.0 and the version number of the card recognition content file is 1.0.0, the download operation may not be performed.
[0077] It should be noted that the reasons for updating the local offline file are: first, SMS is the privacy of the user and is not allowed to be uploaded to other networks such as servers; second, the local offline file can more quickly identify the card compatible with the SMS.
[0078] S13, obtaining the text message sent by the terminal.
[0079] Among them, the terminal is generally the SMS sender, and the terminal is generally the server of the SMS merchant (such as SMS operator, 12306, etc.).
[0080] In some examples, the SMS generally includes the name of the SMS merchant, the merchant number, and the SMS body, etc. For example, see Figure 2 A schematic diagram of the structure of a text message, such as Figure 2 As shown, the terminal shown is 12306, and the content of the text message is information related to ticket booking, for example: the content of the text message is "
[12306] XX successfully purchased the ticket, G168 on August 27, departing from Nanjing South Station at 14:21. For details, click s.12306.cn / s / c / igbtMf", which is the prompt information "Train reminder and G186 timetable".
[0081] In some embodiments, the text message may include the sender (for example, 12306) and / or the service (ticket purchasing service) provided by the sender, that is, the type of the text message may be the sender to which the target text message belongs, and / or the service provided by the sender to which the target text message belongs. Therefore, identifying the type of the text message may be a text message that identifies the sender of the text message and identifies the type of service of the sender to which the text message belongs.
[0082] S14, performing an index operation on the terminal through the latest version of the algorithm package to determine the location information of the terminal in the latest version of the card identification content file.
[0083] In a specific implementation, by executing steps S11 and S12, the algorithm package of the version and the latest version of the card recognition content file can be obtained. The latest version of the card recognition content file contains other card information, which changes the logic of generating card-type SMS on the client. In this way, the terminal can be indexed, so as to obtain the position information of the terminal in the latest version of the card recognition content file, that is, a specific content file in the card recognition content file corresponding to the terminal.
[0084] S15, generating a card template adapted to the text message based on the location information of the terminal in the latest version of the card identification content file and the content information of the text message.
[0085] In a specific implementation, the location information can represent the card information of the terminal in the card identification content file, and the information sent by the same terminal may need to be adapted to different cards. For example, the key information of the text message sent by 12306 can indicate a successful ticket purchase; for example, the key information of the text message sent by 12306 can indicate a successful ticket refund. Therefore, after obtaining the location information, the text message can also be parsed and processed to obtain a card template that is adapted to the text message.
[0086] In some embodiments, after receiving the content information of the text message, the content information of the text message can be parsed and processed using the card parsing engine provided by the Android system, and the processing methods include syntactic and semantic analysis, information extraction, text mining, etc.
[0087] S16, based on the pre-configured layout file, the card template and the content information of the text message are loaded, and the card corresponding to the text message is displayed.
[0088] In a specific implementation, after obtaining the card template, the already configured layout file can be used to load the card template and the content information of the SMS at the same time, so as to generate a card corresponding to the SMS.
[0089] For example, see Figure 3 The structural diagram of a card-type information shown in the figure adopts the SMS display method in the embodiment of this specification to generate a card corresponding to 12306, wherein the card mainly displays the train number (G168), departure time (14:20), departure station (Nanjing South) and arrival station (Beijing South), etc.
[0090] It should be noted that Figure 2 and Figure 3 The illustrated contents are merely examples, and are used to indicate that text messages can be converted into card-type messages for display, and should not be construed as limiting the present invention.
[0091] In short, the embodiments of this specification update the card recognition algorithm in real time through hot update, so there is no need to update the client, so that it can match user needs in real time and display any required card information to the user (for example, at least one of card-type train ticket SMS, card-type airline ticket SMS, card-type group purchase coupon SMS, and card-type bill SMS).
[0092] In order to enable those skilled in the art to better understand and implement the embodiments of this specification, the following is a detailed description with reference to the accompanying drawings and through specific examples.
[0093] In a specific implementation, based on the current version of the card recognition content file and the current version of the algorithm package in the local offline file, it can be determined whether the current version is the latest version, so that the latest version of the file can be downloaded from the server.
[0094] In some embodiments, the local offline file may also include: a number index file (the merchant's number) and / or a signature index file (the merchant's name), wherein the number index file contains the numbers of multiple merchants, such as the numbers of different merchants, or multiple numbers of the same merchant. The merchant name of the terminal can be determined through the number index file; the signature index file contains the signatures of multiple merchants, such as the signatures of different merchants, or multiple signatures of the same merchant. Based on the signature index file, the merchant name of the terminal can also be determined.
[0095] In this case, see Figure 4 In the embodiment of the present specification shown in FIG. 1 , a method for confirming terminal location information is provided. Figure 4 As shown, the following steps can be performed:
[0096] S21, using the reflection mechanism, calling the process interface in the latest version of the algorithm package to read the terminal, the content information of the short message, and the card identification content file.
[0097] In the specific implementation, the algorithm package is loaded in the client. By adopting the reflection mechanism, the logic in the algorithm package can be called, and then the content information of the terminal and text messages, as well as the card recognition content file can be read through the process interface in the algorithm package, thereby facilitating the execution of the recognition operation.
[0098] Among them, the process interface can be considered as the algorithm interface of the algorithm package.
[0099] S22: indexing the content information of the SMS through the number index file and / or the signature index file to determine the subject information of the terminal from the content information of the SMS.
[0100] In a specific implementation, after the terminal information is read, an index matching operation can be performed through the number index file and / or the signature index file. Since the number index file contains the numbers of multiple merchants and the signature index file contains the signatures of multiple merchants, the main information of the terminal can be determined.
[0101] For example, when receiving a text message sent by 12306, the built-in number index file can be used first to search for a file containing 12306 from the number index file, so that after searching for the corresponding information, it can be determined that the terminal is 12306.
[0102] For example, when receiving a text message sent by 12306, the built-in number index file is used, and no file containing 12306 is found. At this time, the signature index file can be used. After the corresponding information is indexed in the signature index file, it can be determined that the terminal is 12306. The signature information of 12306 can be found in Figure 2 and Figure 3
[12306] in.
[0103] In some embodiments, based on the number index file and / or signature index file, a binary search algorithm may be used to perform an indexing operation on the content information of the SMS to index and determine the main body information of the terminal from the content information of the SMS.
[0104] S23: determining the location information of the terminal in the latest version of the card identification content file based on the pre-configured relationship between the terminal's main information and the card identification content file.
[0105] In a specific implementation, the card identification content file contains card information of multiple different merchants, and also includes cards in different states of the same card, such as ticket purchase, travel, etc. (Answer: Yes, travel, bank, hotel, operator, express delivery, etc., or, in other words, the card identification content file has multiple card information corresponding to merchants one by one, that is, a position in the card identification content file corresponds to the main body information of a terminal, so that after executing steps S21 and S22 and determining the main body information of the terminal, the position information of the terminal in the latest version of the card identification content file can be determined based on the pre-configured setting relationship.
[0106] In one embodiment, assuming that after indexing through the number index file and / or the signature index file, the main information of the terminal is determined to be 10086, then based on the set relationship between 10086 and the pre-configured terminal main information and card identification content file, the determined location information is 1001, 1002 and 1003, wherein the card information corresponding to 1001 and 1002 (for example, arrears) is the same, and different from the card information corresponding to 1003 (for example, recharge).
[0107] By adopting the above method, the content information of the text message can be indexed through the number index file and / or signature index file based on the latest version of the loaded algorithm package, and the location information of the terminal in the latest version of the card identification content file can be accurately determined. In this way, text messages sent by different types of terminals can be processed to adapt an exact location for different types of terminals.
[0108] In some embodiments of the present specification, the scheme in the above example is adopted to determine the location information of the terminal in the latest version of the card recognition content file, wherein one location information corresponds to at least one regular JSON, and one regular JSON corresponds to at least one template JSON.
[0109] For details, see Figure 5 A flowchart of a method for obtaining a card template in an embodiment of this specification is shown in FIG. Figure 5 As shown, the following steps can be performed:
[0110] S31, determining a rule JSON of the terminal in the latest version of the algorithm package based on the location information of the terminal in the latest version of the card recognition content file.
[0111] In a specific implementation, one position information corresponds to one or more rule JSONs. When the position information of the terminal in the latest version of the card recognition content file is determined, a corresponding rule JSON can be determined.
[0112] As an example, referring to the above example, if the determined location information is 1001, 1002 and 1003, 1001 and 1002 correspond to the arrears rule JSON, and 1003 corresponds to the recharge rule JSON. It can be understood that the above example is only an example to illustrate the correspondence between location information and rule JSON, and cannot be understood as a limitation of the present invention.
[0113] S32, extracting key information from the content information of the short message as a trigger condition, and triggering the rule JSON when it is determined that the key information matches the rule JSON.
[0114] In the specific implementation, referring to step S31, there is a situation where one location information corresponds to multiple rule JSONs. In order to further improve the accuracy of the subsequently formed cards, key information in the content information of the text message (such as arrears, expenses, fees, etc.) can be extracted. These key information can be used as trigger conditions to execute matching operation rule matching operations.
[0115] S33, according to the triggered rule JSON, selecting a template JSON corresponding to the rule JSON from the latest version of the card recognition content file.
[0116] In a specific implementation, when a matching operation is performed and it is determined that these key information exists in the rule JSON, the content information of the SMS corresponds to the rule JSON, and the rule JSON can be triggered. Based on the triggered rule JSON, the template JSON for displaying the rule JSON can be determined.
[0117] S34, matching the selected template JSON with the content information of the SMS, and selecting the template JSON with the highest matching degree as the card template.
[0118] In a specific implementation, when executing step S33, multiple template JSONs may be selected. At this time, the template JSON can be matched with the content information of the SMS to obtain the matching degree corresponding to each template JSON, so that the template JSON with the highest matching degree or the most SMS content features can be used as the card template to perform subsequent card generation and display operations.
[0119] By configuring rule JSON and template JSON, you can select a card template that matches the SMS, which can improve the accuracy of the generated card-style SMS.
[0120] Next, by loading the card template and the content information of the text message, a card corresponding to the content information of the text message can be displayed.
[0121] More specifically, it includes: converting the card template into the entity class of the object recognized by the system of the client; loading a pre-configured XML layout file on the client through Layout inflater; generating a card corresponding to the text message in the XML layout file based on the entity class of the object and the content information of the text message, and displaying it, including: extracting key-value pair information in the content information of the text message, and filling the key-value pair information into the entity class of the corresponding object.
[0122] To facilitate understanding of the SMS display method in the embodiments of this specification, a specific example is provided below for explanation.
[0123] See also Figure 6 The interactive schematic diagram of a method for displaying short messages in an embodiment of this specification is shown in FIG. Figure 6 As shown, the following steps may be included:
[0124] S1, the client sends an interface request signal, which includes the current version of the card recognition content file and the current version of the algorithm package in the local offline file.
[0125] S2, the server identifies the current version of the card identification content file and algorithm package in the interface request signal, and performs a matching operation with the latest card identification content file and algorithm package to generate a pre-download signal.
[0126] S3: The server sends a pre-download signal to the client.
[0127] S4, in response to the pre-download signal, download the latest version of the card recognition content file and algorithm package adapted to the interface request signal from the server, and replace the current version of the card recognition content file and algorithm package in the local offline file.
[0128] S5, the terminal sends a text message.
[0129] S6, using the reflection mechanism, calls the process interface in the latest version of the algorithm package, as well as the number index file and / or signature index file in the local offline file, to index the content information of the SMS to determine the main information of the terminal from the SMS.
[0130] S7, determining the location information of the terminal in the latest version of the card identification content file based on the pre-configured relationship between the terminal's main information and the card identification content file.
[0131] S8, based on the location information of the terminal in the latest version of the card recognition content file, determine the rule JSON of the terminal in the latest version of the algorithm package, and based on the rule JSON and the content information of the SMS, use the selected template JSON as the card template.
[0132] S9, through Layout inflater, load the template JSON and the content information of the SMS to form the card information of the NML layout.
[0133] It should be noted that steps S1 to S9 described here may correspond to the aforementioned embodiment.
[0134] This specification also provides a text message display device corresponding to the text message display method, which is described in detail below through specific embodiments with reference to the accompanying drawings.
[0135] Reference Figure 7 The structure diagram of a text message display device in the embodiment of this specification is shown in FIG. Figure 7 As shown, the short message display device 100 may include:
[0136] The signal sending unit 110 is adapted to send an interface request signal to the server, wherein the interface request signal includes a current version of the card recognition content file and a current version of the algorithm package in the local offline file;
[0137] The file download unit 120 is adapted to download the latest version of the card recognition content file and algorithm package adapted to the interface request signal from the server in response to the pre-download signal from the server, and replace the card recognition content file and algorithm package in the local offline file;
[0138] The information acquisition unit 130 is adapted to acquire the short message sent by the terminal;
[0139] The processing unit 140 is adapted to perform an index operation on the terminal through the latest version of the algorithm package to determine the location information of the terminal in the latest version of the card identification content file; and generate a card template adapted to the text message based on the location information of the terminal in the latest version of the card identification content file and the content information of the text message;
[0140] The display unit 150 is adapted to load the card template and the content information of the short message based on a pre-configured layout file, and display a card corresponding to the short message.
[0141] It is understandable that the division of the above units is only a division of logical functions, and in actual implementation, they can be fully or partially integrated into one physical entity, or physically separated. In addition, the above units can be implemented in the form of a processor calling software.
[0142] In order to enable those skilled in the art to better understand and implement, a specific implementation example of the short message display device is described below by way of example.
[0143] In a specific implementation, the signal sending unit may send the interface request signal to the server according to a preset period.
[0144] The preset period may be 1 day, 2 days, a week or real time, and is set according to user needs.
[0145] It is to be understood that the durations listed in the above examples are merely illustrative and should not be construed as limitations of the present invention.
[0146] In a specific implementation, when the signal sending unit receives the short message sent by the terminal and determines that a card compatible with the short message cannot be generated, it can send the interface request signal to the server.
[0147] Specifically, there may be some periods when the local offline files currently stored in the client cannot meet the card-style generation requirements of the SMS sent by the terminal, indicating that the version number of the client's offline files is not the latest version number. At this time, the client can send an interface request signal to the server.
[0148] In a specific implementation, the algorithm package in the local offline file is used to read the SMS sent by the terminal, and the card identification content file in the local offline file is used to provide a card compatible with the SMS, so that a card-type SMS can be generated through the cooperation between the two.
[0149] In some embodiments, the algorithm package may be a dex package, which is an operating file format in the Android operating system. By loading the algorithm package, a subsequent card-type information generation process may be executed.
[0150] In a specific implementation, when the server obtains the interface request signal sent by the client, it can parse and process the local offline file in the interface request signal, thereby determining the current version of the card identification content file and the algorithm package, and matching the two with the version of the card identification content file and the algorithm package in the server respectively; based on the matching result, a pre-download signal can be sent to the file download unit.
[0151] Among them, when it is determined that the current version of the card recognition content file and algorithm package in the local offline file is inconsistent with the version of the card recognition content file and algorithm package in the server, the client can perform a download operation based on the received pre-download signal, thereby obtaining the latest version of the card recognition content file and algorithm package that is compatible with the interface request signal.
[0152] As an optional implementation example, after server parsing, it is found that the version number of the algorithm package on the client is 1.0, and the version number of the card recognition content file is 1.0.0. If the version number of the algorithm package on the server is 1.1, and the version number of the card recognition content file is 1.0.1, then through hot update (i.e. automatic online update), the file download unit can download the latest version of the algorithm package and card recognition content file from the server so as to automatically load the new algorithm package.
[0153] In the specific implementation, since the latest version of the algorithm package and card recognition content file is downloaded from the server, it will inevitably overwrite the functions of the previous algorithm package and card recognition content file. Therefore, a replacement operation can be performed to replace the card recognition content file and algorithm package in the local offline file, so that the local offline file has the latest version of the card recognition content file and algorithm package.
[0154] In a specific implementation, the processing unit can obtain the algorithm package of the version and the latest version of the card recognition content file, and the latest version of the card recognition content file contains other card information, which changes the logic of generating card-type SMS on the client. In this way, the terminal can be indexed to obtain the location information of the terminal in the latest version of the card recognition content file, that is, a specific content file in the card recognition content file corresponding to the terminal.
[0155] Specifically, the processing unit can adopt a reflection mechanism to call the process interface in the latest version of the algorithm package to read the content information of the terminal and the text message; then, the content information of the text message is indexed through the number index file and / or signature index file to index and determine the main information of the terminal from the content information of the text message; secondly, based on the set relationship between the pre-configured terminal main information and the card identification content file, the location information of the terminal in the latest version of the card identification content file is determined.
[0156] In some embodiments of the present specification, the solution in the above example is adopted to determine the location information of the terminal in the latest version of the card recognition content file, wherein one location information corresponds to at least one rule JSON and template JSON.
[0157] In this case, the processing unit can determine the rule JSON of the terminal in the latest version of the algorithm package based on the position information of the terminal in the latest version of the card identification content file; extract key information in the content information of the text message as a trigger condition, and trigger the rule JSON when it is determined that the key information matches the rule JSON; according to the triggered rule JSON, select a template JSON corresponding to the rule JSON from the latest version of the card identification content file; based on the selected template JSON, match it with the content information of the text message, and select the template JSON with the highest matching degree as the card template.
[0158] Finally, the display unit can convert the card template into the entity class of the object recognized by the client's system, and then load the pre-configured XML layout file on the client through Layout inflater. Finally, based on the entity class of the object and the content information of the text message, a card corresponding to the text message is generated in the XML layout file and displayed, including: extracting key-value pair information in the content information of the text message, and filling the key-value pair information into the entity class of the corresponding object.
[0159] The embodiments of this specification also provide a method for displaying short messages, which is applied to a server. In some embodiments, see Figure 8 The flowchart of another method for displaying short messages shown in FIG. 1 may specifically perform the following steps:
[0160] S41, receiving an interface request signal from a client, wherein the interface request signal includes a current version of a card recognition content file and a current version of an algorithm package in a local offline file.
[0161] S42, generates a pre-download signal based on the current version of the card identification content file and the current version of the algorithm package, as well as the latest version of the card identification content file and the latest version of the algorithm package. The pre-download signal is used to enable the client to download the latest version of the card identification content file and the algorithm package that are compatible with the interface request signal, so that the client displays a card that is compatible with the text message sent by the terminal.
[0162] In other words, the server stores the latest version of the card recognition content file and algorithm package, so that after the client obtains the latest version of the card recognition content file and algorithm package, it can match user needs in real time and display any required card information to the user.
[0163] This specification also provides a text message display device corresponding to the text message display method, which is described in detail below through specific embodiments with reference to the accompanying drawings.
[0164] Reference Fig. 9 The structure diagram of a text message display device in the embodiment of this specification is shown in FIG. Fig. 9 As shown, the short message display device 200 may include:
[0165] The signal receiving unit 210 is adapted to receive an interface request signal from a client, wherein the interface request signal includes a current version of a card recognition content file and a current version of an algorithm package in a local offline file;
[0166] The signal generating unit 220 is adapted to generate a pre-download signal based on the current version of the card identification content file and the current version of the algorithm package, as well as the latest version of the card identification content file and the latest version of the algorithm package. The pre-download signal is used to enable the client to download the latest version of the card identification content file and the algorithm package that are compatible with the interface request signal, so that the client displays a card that is compatible with the text message sent by the terminal.
[0167] It is understandable that the division of the above units is only a division of logical functions, and in actual implementation, they can be fully or partially integrated into one physical entity, or physically separated. In addition, the above units can be implemented in the form of a processor calling software.
[0168] The embodiment of this specification also provides an electronic device suitable for implementing the method for displaying short messages, wherein the electronic device includes a central processing unit (CPU), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) or a program loaded from a storage part to a random access memory (RAM), such as executing the method described in the above embodiment. Various programs and data required for system operation are also stored in the RAM. The CPU, ROM, and RAM are connected to each other via a bus. The input / output (I / O) interface is also connected to the bus.
[0169] The following components are connected to the I / O interface: an input part including a keyboard, a mouse, etc.; an output part including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker; a storage part including a hard disk, etc.; and a communication part including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication part performs communication processing via a network such as the Internet. The drive 310 is also connected to the I / O interface as needed. Removable media, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., are installed on the drive as needed so that the computer program read therefrom is installed into the storage part as needed.
[0170] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a computer program for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication part, and / or installed from a removable medium. When the computer program is executed by a central processing unit (CPU), various functions defined in the system of the present application are executed.
[0171] It should be noted that the computer-readable medium shown in the embodiment of the present application can be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium can be, for example, but not limited to, a system, device or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above. More specific examples of computer-readable storage media can include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (Compact Disc Read-Only Memory, CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0172] In the present application, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, apparatus, or device. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable computer program. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in combination with an instruction execution system, apparatus, or device. The computer program contained on the computer-readable medium may be transmitted using any suitable medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0173] The flowchart and block diagram in the accompanying drawings illustrate the possible architecture, functions and operations of the system, method and computer program product according to various embodiments of the present application. Wherein, each box in the flowchart or block diagram can represent a module, a program segment, or a part of the code, and the above-mentioned module, program segment, or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0174] The units involved in the embodiments of the present invention may be implemented by software or hardware, and the units described may also be arranged in a processor. The names of these units do not, in some cases, limit the units themselves.
[0175] According to one aspect of the present application, a computer program product or a computer program is provided, the computer program product or the computer program comprising computer instructions, the computer instructions being stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the methods provided in the above-mentioned various optional implementations.
[0176] As another aspect, the present application also provides a computer-readable medium, which may be included in the electronic device described in the above embodiment; or may exist independently without being assembled into the electronic device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by an electronic device, the electronic device implements the method described in the above embodiment.
[0177] It should be noted that, although several modules or units of the equipment for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into being embodied by multiple modules or units.
[0178] Through the description of the above implementation methods, it is easy for those skilled in the art to understand that the example implementation methods described here can be implemented by software or by combining software with necessary hardware. Therefore, the technical solution according to the implementation methods of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a touch terminal, or a network device, etc.) to execute the method according to the implementation methods of the present application.
[0179] Although the embodiments of this specification are disclosed as above, the present invention is not limited thereto. Any person skilled in the art can make various changes and modifications without departing from the spirit and scope of the present invention, so the protection scope of the present invention shall be subject to the scope defined by the claims.
Claims
1. A method for displaying short messages, applied to a client, characterized in that: The text message display method comprises: Sending an interface request signal to the server, wherein the interface request signal includes the current version of the card recognition content file and the current version of the algorithm package in the local offline file; In response to the pre-download signal from the server, download the latest version of the card recognition content file and algorithm package adapted to the interface request signal from the server, and replace the card recognition content file and algorithm package in the local offline file; Get the SMS sent by the terminal; Performing an index operation on the terminal through the latest version of the algorithm package to determine the location information of the terminal in the latest version of the card identification content file; Generate a card template adapted to the text message based on the location information of the terminal in the latest version of the card identification content file and the content information of the text message; Based on the pre-configured layout file, the card template and the content information of the text message are loaded, and the card corresponding to the text message is displayed.
2. The method for displaying short messages according to claim 1, characterized in that: The sending of an interface request signal to the server includes at least one of the following: Sending the interface request signal to the server according to a preset period; When receiving the short message sent by the terminal and determining that a card compatible with the short message cannot be generated, the interface request signal is sent to the server.
3. The method for displaying short messages according to claim 1, characterized in that: The local offline file also includes: a number index file and / or a signature index file; The step of performing an index operation on the terminal through the latest version of the algorithm package to determine the location information of the terminal in the latest version of the card identification content file includes: Using the reflection mechanism, calling the process interface in the latest version of the algorithm package, reading the content information of the terminal, the text message, and the card identification content file; Performing an indexing operation on the content information of the SMS through the number index file and / or the signature index file, so as to index and determine the subject information of the terminal from the content information of the SMS; Based on the pre-configured relationship between the main information of the terminal and the card identification content file, the position information of the terminal in the latest version of the card identification content file is determined.
4. The method for displaying short messages according to claim 3, characterized in that: Based on the number index file and / or the signature index file, a binary search algorithm is used to perform an index operation on the content information of the text message, so as to index and determine the main body information of the terminal from the content information of the text message.
5. The method for displaying short messages according to claim 1, characterized in that: The generating a card template adapted to the text message based on the location information of the terminal in the latest version of the card identification content file and the content information of the text message comprises: Determine the rule JSON of the terminal in the latest version of the algorithm package based on the location information of the terminal in the latest version of the card recognition content file; Extract key information from the content information of the short message as a trigger condition, and trigger the rule JSON when it is determined that the key information matches the rule JSON; According to the triggered rule JSON, a template JSON corresponding to the rule JSON is selected from the latest version of the card recognition content file; Based on the selected template JSON, a match is performed with the content information of the SMS, and the template JSON with the highest matching degree is selected as the card template.
6. The method for displaying short messages according to claim 1, characterized in that: The loading operation on the card template and the content information of the short message based on the pre-configured layout file to display the card corresponding to the short message includes: Convert the card template into an entity class of an object recognized by the client system; Loading a pre-configured XML layout file on the client through Layout inflater; Based on the entity class of the object and the content information of the text message, a card corresponding to the text message is generated in the XML layout file and displayed, including: extracting key-value pair information in the content information of the text message, and filling the key-value pair information into the entity class of the corresponding object.
7. A method for displaying short messages, applied to a server, characterized in that: The text message display method comprises: Receiving an interface request signal from a client, wherein the interface request signal includes a current version of a card recognition content file and a current version of an algorithm package in a local offline file; A pre-download signal is generated based on the current version of the card identification content file and the current version of the algorithm package, as well as the latest version of the card identification content file and the latest version of the algorithm package. The pre-download signal is used to enable the client to download the latest version of the card identification content file and the algorithm package that are compatible with the interface request signal, so that the client displays a card that is compatible with the text message sent by the terminal.
8. A short message display device, applied to a client, characterized in that: The short message display device comprises: A signal sending unit, adapted to send an interface request signal to the server, wherein the interface request signal includes a current version of the card recognition content file and a current version of the algorithm package in the local offline file; A file download unit, adapted to respond to a pre-download signal from the server, download the latest version of the card recognition content file and algorithm package adapted to the interface request signal from the server, and replace the card recognition content file and algorithm package in the local offline file; An information acquisition unit, adapted to acquire a short message sent by a terminal; a processing unit adapted to perform an indexing operation on the terminal through the latest version of the algorithm package, determine the location information of the terminal in the latest version of the card identification content file; and generate a card template adapted to the text message based on the location information of the terminal in the latest version of the card identification content file and the content information of the text message; The display unit is adapted to load the card template and the content information of the short message based on a pre-configured layout file, and display a card corresponding to the short message.
9. A short message display device, applied to a server, characterized in that: The short message display device comprises: A signal receiving unit, adapted to receive an interface request signal from a client, wherein the interface request signal includes a current version of a card recognition content file and a current version of an algorithm package in a local offline file; The signal generating unit is adapted to generate a pre-download signal according to the current version of the card identification content file and the current version of the algorithm package, as well as the latest version of the card identification content file and the latest version of the algorithm package. The pre-download signal is used to enable the client to download the latest version of the card identification content file and the algorithm package that are compatible with the interface request signal, so that the client displays a card that is compatible with the text message sent by the terminal.
10. An electronic device, characterized in that: include: At least one processor and at least one memory, the memory storing one or more computer executable instructions, the processor calling the one or more computer executable instructions to execute the text message display method according to any one of claims 1 to 6 or the text message display method according to claim 7.
11. A computer program product, characterized in that The method comprises computer instructions, which, when executed by a processor, implement the text message display method according to any one of claims 1 to 6 or the text message display method according to claim 7.