CN112487765A - Method and device for generating notification text - Google Patents

Method and device for generating notification text Download PDF

Info

Publication number
CN112487765A
CN112487765A CN202011325813.XA CN202011325813A CN112487765A CN 112487765 A CN112487765 A CN 112487765A CN 202011325813 A CN202011325813 A CN 202011325813A CN 112487765 A CN112487765 A CN 112487765A
Authority
CN
China
Prior art keywords
text
notification text
notification
word number
sent
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202011325813.XA
Other languages
Chinese (zh)
Other versions
CN112487765B (en
Inventor
李长斌
袁媛
陈大平
胡江
常江奇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Construction Bank Corp
Original Assignee
CCB Finetech Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by CCB Finetech Co Ltd filed Critical CCB Finetech Co Ltd
Priority to CN202011325813.XA priority Critical patent/CN112487765B/en
Publication of CN112487765A publication Critical patent/CN112487765A/en
Application granted granted Critical
Publication of CN112487765B publication Critical patent/CN112487765B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/166Editing, e.g. inserting or deleting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/12Use of codes for handling textual entities
    • G06F40/126Character encoding
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/12Messaging; Mailboxes; Announcements
    • H04W4/14Short messaging services, e.g. short message services [SMS] or unstructured supplementary service data [USSD]

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Health & Medical Sciences (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Artificial Intelligence (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a method and a device for generating a notification text, and relates to the technical field of computers. One embodiment of the method comprises: acquiring a to-be-sent notification text corresponding to the current service, and determining a first word number of the to-be-sent notification text; when the first word number is larger than a preset word number threshold, generating a target notification text according to a keyword associated with the current service in the notification text to be sent, wherein the second word number of the target notification text is not larger than the preset word number threshold; and sending the target notification text to a user corresponding to the current service. The implementation mode not only reduces the data volume of transmission and saves communication resources, but also reduces invalid information displayed to the user and improves user experience.

Description

Method and device for generating notification text
Technical Field
The invention relates to the technical field of computers, in particular to a method and a device for generating a notification text.
Background
With the advent of the information age, notification texts received by users on intelligent terminals are increasing. Taking the short message as an example, the user receives a plurality of notification short messages sent by a bank, an operator or an e-commerce platform every day so as to remind the user of paying attention to related information such as a bank card account, a mobile phone number or an e-commerce account.
In the process of implementing the invention, the inventor finds that at least the following problems exist in the prior art:
for short messages there is a word count limit set by the operator, and for other notification texts there is also a word count limit on the notification bar on the user's smart terminal. If the number of the words of the notification text exceeds the word number limit, the data quantity needing to be transmitted is increased, communication resources are consumed, meanwhile, invalid information displayed on the intelligent terminal is increased, and user experience is influenced.
Disclosure of Invention
In view of this, embodiments of the present invention provide a method and an apparatus for generating a notification text, where when a first word number of a notification text to be sent is greater than a preset word number threshold, a target notification text whose second word number is not greater than the preset word number threshold can be generated according to a keyword associated with a current service in the notification text to be sent, and then the target notification text is sent to a corresponding user, so that not only is a data amount of transmission reduced, communication resources saved, but also invalid information shown to the user is reduced, and user experience is improved.
To achieve the above object, according to an aspect of an embodiment of the present invention, there is provided a method of generating a notification text.
The method for generating the notification text in the embodiment of the invention comprises the following steps:
acquiring a to-be-sent notification text corresponding to the current service, and determining a first word number of the to-be-sent notification text;
when the first word number is larger than a preset word number threshold, generating a target notification text according to a keyword associated with the current service in the notification text to be sent, wherein the second word number of the target notification text is not larger than the preset word number threshold;
and sending the target notification text to a user corresponding to the current service.
Alternatively,
generating a target notification text according to keywords associated with the current service in the notification text to be sent, wherein the generating comprises the following steps:
dividing a notification text to be sent to obtain at least two word segments;
determining at least one keyword associated with the current service from the at least two participles;
and generating a target notification text according to the keywords.
Alternatively,
and dividing the notification text to be transmitted by utilizing the UTF-8 encoding rule.
Alternatively,
the current business is a financial business, and the notification text to be sent comprises any two or three of the following: chinese characters, english characters, and/or numeric characters;
and dividing Chinese characters, English characters and numeric characters of the text to be notified by using the UTF-8 encoding rule, and obtaining word segmentation according to the division result of the UTF-8 encoding rule.
Alternatively,
and dividing the UTF-8 encoding rule into continuous English characters or digital characters as a word segmentation.
Alternatively,
determining a first word count for a notification text to be sent, comprising:
the first word count is determined based on the UTF-8 encoding of the text to be notified.
Alternatively,
determining a current UTF-8 coding value corresponding to each character in a text to be notified, and determining a first word number according to the size relationship between the current UTF-8 coding value and standard UTF-8 coding values corresponding to different types of characters.
Alternatively,
generating a target notification text according to the keywords, wherein the target notification text comprises the following steps:
and filling the keywords into a preset notification template to generate a target notification text.
Alternatively,
selecting a target notification template to be filled from a plurality of preset notification templates according to the difference value between the total word number of the keywords and the preset word number threshold value, and filling the keywords into the target notification template; wherein the total number of words of the target notification template is less than the difference.
Alternatively,
determining at least one keyword associated with the current service from the at least two participles, comprising:
determining keywords from at least two participles according to the service element table; the business element list comprises at least one vocabulary for representing business elements.
Alternatively,
aiming at each participle in the text to be notified: respectively calculating the similarity between the participle and each vocabulary in the service element list; and when the similarity is greater than a preset similarity threshold, determining the word segmentation as the keyword.
Alternatively,
determining the corresponding relation between the keywords and the vocabularies in the service element table according to the similarity;
filling the keywords into the notification template according to the corresponding relation; wherein the notification template includes: at least one position to be filled and the service elements required for each position to be filled.
Alternatively,
generating a target notification text according to keywords associated with the current service in the notification text to be sent, wherein the generating comprises the following steps:
and deleting other words except the keywords in the notification text to be sent to generate a target notification text.
Alternatively,
after deleting other words except the keywords in the text of the notification to be sent, the method further comprises the following steps:
and generating a target notification text according to the keywords by using a natural language processing algorithm.
Alternatively,
deleting other words except the keywords in the notification text to be sent to generate a target notification text, wherein the deleting comprises the following steps:
circularly executing the following steps until the word number of the current notification text is not greater than a preset word number threshold, and taking the current notification text as a target notification text:
deleting the first other words except the keywords according to the character arrangement sequence of the notification text to be sent, and judging whether the word number of the deleted current notification text is greater than a preset word number threshold value or not; if so, the next other word is deleted in the rank order.
To achieve the above object, according to still another aspect of an embodiment of the present invention, there is provided an apparatus for generating a notification text.
The device for generating the notification text comprises a word number determining module, a text generating module and a text sending module; wherein:
the word number determining module is used for acquiring a to-be-sent notification text corresponding to the current service and determining a first word number of the to-be-sent notification text;
the text generation module is used for generating a target notification text according to a keyword associated with the current service in the notification text to be sent when the first word number is greater than a preset word number threshold, wherein the second word number of the target notification text is not greater than the preset word number threshold;
and the text sending module is used for sending the target notification text to the user corresponding to the current service.
To achieve the above object, according to still another aspect of embodiments of the present invention, there is provided an electronic device that generates a notification text.
An electronic device for generating a notification text according to an embodiment of the present invention includes: one or more processors; the storage device is used for storing one or more programs, and when the one or more programs are executed by one or more processors, the one or more processors implement the method for generating the notification text according to the embodiment of the invention.
To achieve the above object, according to still another aspect of embodiments of the present invention, there is provided a computer-readable storage medium.
A computer-readable storage medium of an embodiment of the present invention has stored thereon a computer program that, when executed by a processor, implements a method of generating a notification text of an embodiment of the present invention.
One embodiment of the above invention has the following advantages or benefits: when the first word number of the notification text to be sent is greater than the preset word number threshold, a target notification text with the second word number not greater than the preset word number threshold can be generated according to the keywords associated with the current service in the notification text to be sent, and then the target notification text is sent to the corresponding user, so that the data volume of transmission is reduced, the communication resources are saved, the invalid information displayed to the user is reduced, and the user experience is improved.
Further effects of the above-mentioned non-conventional alternatives will be described below in connection with the embodiments.
Drawings
The drawings are included to provide a better understanding of the invention and are not to be construed as unduly limiting the invention. Wherein:
FIG. 1 is a schematic diagram of the main steps of a method of generating a notification text according to an embodiment of the invention;
FIG. 2 is a code screenshot of an implementation of a method for determining a first word count according to an embodiment of the invention;
FIG. 3 is a diagram illustrating the main steps of a method for generating a target notification text according to an embodiment of the present invention;
FIG. 4 is a diagram illustrating the main steps of another method for generating a target notification text according to an embodiment of the present invention;
FIG. 5 is a diagram illustrating the main steps of yet another method for generating a target notification text according to an embodiment of the present invention;
FIG. 6 is a code screenshot for implementing a method of intercepting a target text to be notified according to an embodiment of the present invention;
FIG. 7 is a schematic diagram of the main modules of an apparatus for generating notification text according to an embodiment of the present invention;
FIG. 8 is an exemplary system architecture diagram in which embodiments of the present invention may be employed;
fig. 9 is a schematic structural diagram of a computer system suitable for implementing a terminal device or a server according to an embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present invention are described below with reference to the accompanying drawings, in which various details of embodiments of the invention are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
It should be noted that the embodiments of the present invention and the technical features of the embodiments may be combined with each other without conflict.
Fig. 1 is a schematic diagram of main steps of a method for generating a notification text according to an embodiment of the present invention.
As shown in fig. 1, a method for generating a notification text according to an embodiment of the present invention mainly includes the following steps:
step S101: and acquiring a to-be-sent notification text corresponding to the current service, and determining the first word number of the to-be-sent notification text.
In the embodiment of the invention, the text to be notified corresponds to the current service, and can be a short message or information push popped up on the intelligent terminal.
In an embodiment of the present invention, the first word count may be determined based on the UTF-8 encoding of the text to be notified. The UTF-8 encoding is a variable-length character encoding which can represent different types of characters such as Chinese characters, English characters, numeric characters and the like, and for the different types of characters, the UTF-8 encoding rules respectively correspond to standard UTF-8 encoding values.
In a preferred embodiment of the present invention, as shown in the code in fig. 2, a current UTF-8 encoding value corresponding to each character in a text to be notified may be determined, and the first word count may be determined according to a size relationship between the current UTF-8 encoding value and a standard UTF-8 encoding value corresponding to each character of different types. For example, if the current UTF-8 encoding value of the first 8 bits of a character in the text to be notified is not less than 224 and not more than 240, it indicates that the character is a chinese character, and marks the character of 3 bytes as a word; if the current UTF-8 code value of another character in the text to be notified is not less than 65 and not more than 90, or not less than 97 and not more than 122, the character is an English character, and the character with 1 byte is marked as a character; if the current UTF-8 encoding value of another character in the text to be notified is not less than 48 and not more than 57, the character is indicated as a numeric character, and the character of 1 byte is recorded as a word. And performing the operation on each character in the notification text to be sent, so as to determine the first word number of the notification text to be sent.
In the embodiment of the invention, since the situation that the first word number of the text to be notified is larger than the UTF-8 coded length of the text to be notified does not occur under normal conditions, whether the first word number is larger than the UTF-8 coded length of the corresponding text to be notified can be determined after the first word number of the text to be notified is determined, if so, the determined first word number is indicated to have a problem, and the UTF-8 coded length of the text to be notified can be taken as the first word number at this moment, so as to avoid the occurrence of an unknown error.
Step S102: and when the first word number is greater than a preset word number threshold, generating a target notification text according to a keyword associated with the current service in the notification text to be sent, wherein the second word number of the target notification text is not greater than the preset word number threshold.
In the embodiment of the present invention, the keyword refers to a transaction element that is associated with the current service and is more critical to the user in the to-be-sent notification text, such as transaction time, transaction amount, transaction account, transaction object, and the like.
In an embodiment of the present invention, when the first word number is greater than the preset word number threshold, a method for generating a target notification text is shown in fig. 3, and mainly includes the following steps:
step S301: and dividing the notification text to be sent to obtain at least two word segments.
In the embodiment of the invention, the notification text to be sent can be divided by utilizing the UTF-8 encoding rule. Specifically, if the current service is a financial service, the notification text to be sent includes any two or three of the following: chinese characters, english characters, and/or numeric characters; and dividing Chinese characters, English characters and numeric characters of the text to be notified by using the UTF-8 encoding rule, and obtaining word segmentation according to the division result of the UTF-8 encoding rule. In a preferred embodiment of the present invention, the UTF-8 encoding rule is divided into consecutive english characters or numeric characters as a word segmentation.
Step S302: at least one keyword associated with the current service is determined from the at least two participles.
In the embodiment of the invention, the keywords can be determined from at least two participles according to the service element table; the business element list comprises at least one vocabulary for representing business elements.
In a preferred embodiment of the present invention, the following steps may be performed for each word segmentation in the text to be notified: calculating the similarity between the word and each vocabulary in the service element list; and when the similarity is greater than a preset similarity threshold, determining the word segmentation as the keyword.
Step S303: and generating a target notification text according to the keywords.
In the embodiment of the invention, after the keywords are determined, the keywords can be extracted and filled into a preset notification template to generate a target notification text; or deleting other words except the keywords in the notification text to be sent to generate the target notification text.
Another method for generating a target notification text provided by the embodiment of the present invention is described below by taking an example in which a keyword is extracted and the keyword is filled in a preset notification template to generate the target notification text.
Fig. 4 is a schematic diagram of main steps of another method for generating a target notification text according to an embodiment of the present invention, the method mainly includes the following steps:
step S401: determining the corresponding relation between the keywords and the vocabularies in the service element table according to the similarity;
step S402: filling the keywords into a preset notification template according to the corresponding relation to generate a target notification text; wherein the notification template includes: at least one position to be filled and the service elements required for each position to be filled.
In the embodiment of the invention, due to the existence of the preset word number threshold, a plurality of notification templates can be preset, and further, a target notification template to be filled is selected from the plurality of preset notification templates according to the difference value between the total word number of the keyword and the preset word number threshold, and the keyword is filled into the target notification template; wherein the total number of words of the target notification template is less than the difference.
Next, a method for generating a target notification text provided by the embodiment of the present invention is described by taking an example of deleting other words except for the keyword in a notification text to be sent and generating the target notification text.
Fig. 5 is a schematic diagram of main steps of a further method for generating a target notification text according to an embodiment of the present invention, the method mainly includes the following steps:
step S501: deleting the first other words except the keywords according to the character arrangement sequence of the notification text to be sent, and judging whether the word number of the deleted current notification text is greater than a preset word number threshold value or not;
step S502: when the number of words of the deleted current notification text is larger than a preset word number threshold, deleting the next other words according to the arrangement sequence;
step S503: and when the number of words of the deleted current notification text is not more than a preset word number threshold, taking the current notification text as a target notification text.
In the embodiment of the present invention, the words other than the keywords refer to words that are not related to the current service in the to-be-notified text or transaction elements that are meaningless to the user, such as connection words or transaction opponent names in the to-be-notified text. In a preferred embodiment of the present invention, the method of intercepting the target text to be notified is shown by the codes in fig. 6.
In the embodiment of the present invention, after deleting other words except the keyword in the notification text to be sent, a natural language processing algorithm may be used to generate the target notification text according to the keyword.
Step S103: and sending the target notification text to a user corresponding to the current service.
According to the method for generating the notification text, provided by the embodiment of the invention, when the first word number of the notification text to be sent is greater than the preset word number threshold, the target notification text with the second word number not greater than the preset word number threshold can be generated according to the keyword associated with the current service in the notification text to be sent, and then the target notification text is sent to the corresponding user, so that the transmitted data volume is reduced, the communication resources are saved, the invalid information displayed to the user is reduced, and the user experience is improved.
Fig. 7 is a schematic diagram of main blocks of an apparatus for generating a notification text according to an embodiment of the present invention.
As shown in fig. 7, an apparatus 700 for generating a notification text according to an embodiment of the present invention includes a word number determining module 701, a text generating module 702, and a text transmitting module 703; wherein:
a word number determining module 701, configured to obtain a to-be-sent notification text corresponding to a current service, and determine a first word number of the to-be-sent notification text;
a text generating module 702, configured to generate a target notification text according to a keyword associated with a current service in a notification text to be sent when the first word number is greater than a preset word number threshold, where a second word number of the target notification text is not greater than the preset word number threshold;
a text sending module 703, configured to send the target notification text to a user corresponding to the current service.
In this embodiment of the present invention, the text generation module 702 is further configured to: dividing a notification text to be sent to obtain at least two word segments; determining at least one keyword associated with the current service from the at least two participles; and generating a target notification text according to the keywords.
In this embodiment of the present invention, the text generation module 702 is further configured to: and dividing the notification text to be transmitted by utilizing the UTF-8 encoding rule.
In the embodiment of the present invention, the current service is a financial service, and the notification text to be sent includes any two or three of the following: chinese characters, english characters, and/or numeric characters; the text generation module 702 is further configured to: and dividing Chinese characters, English characters and numeric characters of the text to be notified by using the UTF-8 encoding rule, and obtaining word segmentation according to the division result of the UTF-8 encoding rule.
In this embodiment of the present invention, the text generation module 702 is further configured to: and dividing the UTF-8 encoding rule into continuous English characters or digital characters as a word segmentation.
In an embodiment of the present invention, the word count determining module 701 is further configured to: the first word count is determined based on the UTF-8 encoding of the text to be notified.
In an embodiment of the present invention, the word count determining module 701 is further configured to: determining a current UTF-8 coding value corresponding to each character in a text to be notified, and determining a first word number according to the size relationship between the current UTF-8 coding value and standard UTF-8 coding values corresponding to different types of characters.
In this embodiment of the present invention, the text generation module 702 is further configured to: and filling the keywords into a preset notification template to generate a target notification text.
In this embodiment of the present invention, the text generation module 702 is further configured to: selecting a target notification template to be filled from a plurality of preset notification templates according to the difference value between the total word number of the keywords and the preset word number threshold value, and filling the keywords into the target notification template; wherein the total number of words of the target notification template is less than the difference.
In this embodiment of the present invention, the text generation module 702 is further configured to: determining keywords from at least two participles according to the service element table; the business element list comprises at least one vocabulary for representing business elements.
In this embodiment of the present invention, the text generation module 702 is further configured to: aiming at each participle in the text to be notified: respectively calculating the similarity between the participle and each vocabulary in the service element list; and when the similarity is greater than a preset similarity threshold, determining the word segmentation as the keyword.
In this embodiment of the present invention, the text generation module 702 is further configured to: determining the corresponding relation between the keywords and the vocabularies in the service element table according to the similarity; filling the keywords into the notification template according to the corresponding relation; wherein the notification template includes: at least one position to be filled and the service elements required for each position to be filled.
In this embodiment of the present invention, the text generation module 702 is further configured to: and deleting other words except the keywords in the notification text to be sent to generate a target notification text.
In this embodiment of the present invention, after deleting other words except the keyword in the text to be notified, the text generating module 702 is further configured to: and generating a target notification text according to the keywords by using a natural language processing algorithm.
In this embodiment of the present invention, the text generation module 702 is further configured to: circularly executing the following steps until the word number of the current notification text is not greater than a preset word number threshold, and taking the current notification text as a target notification text: deleting the first other words except the keywords according to the character arrangement sequence of the notification text to be sent, and judging whether the word number of the deleted current notification text is greater than a preset word number threshold value or not; if so, the next other word is deleted in the rank order.
According to the device for generating the notification text, provided by the embodiment of the invention, when the first word number of the notification text to be sent is greater than the preset word number threshold, the target notification text with the second word number not greater than the preset word number threshold can be generated according to the keyword associated with the current service in the notification text to be sent, and then the target notification text is sent to the corresponding user, so that the transmitted data volume is reduced, the communication resources are saved, the invalid information displayed to the user is reduced, and the user experience is improved.
Fig. 8 illustrates an exemplary system architecture 800 of a method of generating a notification text or an apparatus for generating a notification text to which embodiments of the invention may be applied.
As shown in fig. 8, the system architecture 800 may include terminal devices 801, 802, 803, a network 804, and a server 805. The network 804 serves to provide a medium for communication links between the terminal devices 801, 802, 803 and the server 805. Network 804 may include various types of connections, such as wire, wireless communication links, or fiber optic cables, to name a few.
A user may use the terminal devices 801, 802, 803 to interact with a server 805 over a network 804 to receive or send messages or the like. The terminal devices 801, 802, 803 may have installed thereon various communication client applications, such as shopping applications, web browser applications, search applications, instant messaging tools, mailbox clients, social platform software, and the like.
The terminal devices 801, 802, 803 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like.
The electronic device 805 may be a server that provides various services, such as a background management server that supports shopping websites browsed by users using the terminal devices 801, 802, 803. The background management server may analyze and perform other processing on the received data such as the product information query request, and feed back a processing result (e.g., target push information and product information) to the terminal device.
It should be noted that, a method for generating a notification text provided by the embodiment of the present invention is generally performed by the electronic device 805, and accordingly, an apparatus for generating a notification text is generally disposed in the electronic device 805.
It should be understood that the number of terminal devices, networks, and servers in fig. 8 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Referring now to FIG. 9, shown is a block diagram of a computer system 900 suitable for use with a terminal device implementing an embodiment of the present invention. The terminal device shown in fig. 9 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present invention.
As shown in fig. 9, the computer system 900 includes a Central Processing Unit (CPU)901 that can perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)902 or a program loaded from a storage section 908 into a Random Access Memory (RAM) 903. In the RAM903, various programs and data necessary for the operation of the system 900 are also stored. The CPU901, ROM902, and RAM903 are connected to each other via a bus 904. An input/output (I/O) interface 905 is also connected to bus 904.
The following components are connected to the I/O interface 905: an input portion 906 including a keyboard, a mouse, and the like; an output section 907 including components such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage portion 908 including a hard disk and the like; and a communication section 909 including a network interface card such as a LAN card, a modem, or the like. The communication section 909 performs communication processing via a network such as the internet. The drive 910 is also connected to the I/O interface 905 as necessary. A removable medium 911 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 910 as necessary, so that a computer program read out therefrom is mounted into the storage section 908 as necessary.
In particular, according to the embodiments of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 909, and/or installed from the removable medium 911. The above-described functions defined in the system of the present invention are executed when the computer program is executed by a Central Processing Unit (CPU) 901.
It should be noted that the computer readable medium shown in the present invention can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present invention, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present invention, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules described in the embodiments of the present invention may be implemented by software or hardware. The described modules may also be provided in a processor, which may be described as: a processor includes a word count determination module, a text generation module, and a text transmission module. The names of these modules do not constitute a limitation to the module itself in some cases, and for example, the word number determination module may also be described as "a module for acquiring a text to be notified corresponding to a current service and determining a first word number of the text to be notified".
As another aspect, the present invention also provides a computer-readable medium that may be contained in the apparatus described in the above embodiments; or may be separate and not incorporated into the device. The computer readable medium carries one or more programs which, when executed by a device, cause the device to comprise: acquiring a to-be-sent notification text corresponding to the current service, and determining a first word number of the to-be-sent notification text; when the first word number is larger than a preset word number threshold, generating a target notification text according to a keyword associated with the current service in the notification text to be sent, wherein the second word number of the target notification text is not larger than the preset word number threshold; and sending the target notification text to a user corresponding to the current service.
According to the technical scheme of the embodiment of the invention, when the first word number of the notification text to be sent is greater than the preset word number threshold, the target notification text with the second word number not greater than the preset word number threshold can be generated according to the keywords associated with the current service in the notification text to be sent, and then the target notification text is sent to the corresponding user, so that the transmitted data volume is reduced, the communication resources are saved, the invalid information displayed to the user is reduced, and the user experience is improved.
The above-described embodiments should not be construed as limiting the scope of the invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions can occur, depending on design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (18)

1. A method of generating notification text, comprising:
acquiring a to-be-sent notification text corresponding to a current service, and determining a first word number of the to-be-sent notification text;
when the first word number is larger than a preset word number threshold, generating a target notification text according to a keyword associated with the current service in the notification text to be sent, wherein the second word number of the target notification text is not larger than the preset word number threshold;
and sending the target notification text to a user corresponding to the current service.
2. The method according to claim 1, wherein the generating a target notification text according to the keyword associated with the current service in the notification text to be sent comprises:
dividing the notification text to be sent to obtain at least two word segments;
determining at least one keyword associated with the current service from the at least two participles;
and generating the target notification text according to the keywords.
3. The method of claim 2,
and dividing the text to be notified by utilizing an UTF-8 encoding rule.
4. The method according to claim 3, wherein the current business is a financial business, and the notification text to be sent comprises any two or three of the following: chinese characters, english characters, and/or numeric characters;
and dividing the Chinese characters, English characters and numeric characters of the text to be notified by using the UTF-8 encoding rule, and obtaining the word segmentation according to the division result of the UTF-8 encoding rule.
5. The method of claim 4,
and using continuous English characters or digital characters obtained by dividing the UTF-8 encoding rule as the word segmentation.
6. The method of claim 1, wherein determining the first word count for the text to be notified comprises:
and determining the first word number according to the UTF-8 code of the text to be notified.
7. The method of claim 6,
and determining a current UTF-8 coding value corresponding to each character in the text to be notified, and determining the first word number according to the size relationship between the current UTF-8 coding value and standard UTF-8 coding values corresponding to different types of characters.
8. The method of claim 2, wherein the generating the target notification text according to the keyword comprises:
and filling the keywords into a preset notification template to generate the target notification text.
9. The method of claim 8,
selecting a target notification template to be filled from a plurality of preset notification templates according to the difference value between the total word number of the keyword and the preset word number threshold, and filling the keyword into the target notification template; wherein the total number of words of the target notification template is less than the difference.
10. The method of claim 8, wherein the determining at least one keyword associated with the current service from the at least two participles comprises:
determining the keywords from the at least two participles according to a service element table; the business element table comprises at least one vocabulary for representing business elements.
11. The method of claim 10,
aiming at each word segmentation in the notification text to be sent: respectively calculating the similarity between the word segmentation and each word in the service element list; and when the similarity is greater than a preset similarity threshold, determining the word segmentation as the keyword.
12. The method of claim 11,
determining the corresponding relation between the keywords and the vocabularies in the service element list according to the similarity;
filling the keywords into the notification template according to the corresponding relation; wherein the notification template comprises: at least one position to be filled and the service elements required by each of the positions to be filled.
13. The method according to claim 1, wherein the generating a target notification text according to the keyword associated with the current service in the notification text to be sent comprises:
deleting other words except the keywords in the notification text to be sent so as to generate the target notification text.
14. The method according to claim 13, wherein after deleting the other words except the keyword in the text of the notification to be sent, the method further comprises:
and generating the target notification text according to the keywords by using a natural language processing algorithm.
15. The method according to claim 13, wherein deleting other words except the keyword in the to-be-sent notification text to generate the target notification text comprises:
circularly executing the following steps until the word number of the current notification text is not greater than the preset word number threshold, and taking the current notification text as the target notification text:
deleting a first other word except the keyword according to the character arrangement sequence of the notification text to be sent, and judging whether the word number of the deleted current notification text is greater than a preset word number threshold value; and if so, deleting the next other words according to the arrangement sequence.
16. An apparatus for generating a notification text, comprising a word count determining module, a text generating module, and a text transmitting module; wherein:
the word number determining module is used for acquiring a to-be-sent notification text corresponding to the current service and determining a first word number of the to-be-sent notification text;
the text generation module is configured to generate a target notification text according to a keyword associated with the current service in the to-be-sent notification text when the first word number is greater than a preset word number threshold, where a second word number of the target notification text is not greater than the preset word number threshold;
and the text sending module is used for sending the target notification text to the user corresponding to the current service.
17. An electronic device that generates notification text, comprising:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-15.
18. A computer-readable medium, on which a computer program is stored, which, when being executed by a processor, carries out the method according to any one of claims 1-15.
CN202011325813.XA 2020-11-23 2020-11-23 Method and device for generating notification text Active CN112487765B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011325813.XA CN112487765B (en) 2020-11-23 2020-11-23 Method and device for generating notification text

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011325813.XA CN112487765B (en) 2020-11-23 2020-11-23 Method and device for generating notification text

Publications (2)

Publication Number Publication Date
CN112487765A true CN112487765A (en) 2021-03-12
CN112487765B CN112487765B (en) 2022-10-04

Family

ID=74933237

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011325813.XA Active CN112487765B (en) 2020-11-23 2020-11-23 Method and device for generating notification text

Country Status (1)

Country Link
CN (1) CN112487765B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115333685A (en) * 2022-10-10 2022-11-11 永鼎行远(南京)信息科技有限公司 Intelligent information allocation system based on big data

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107808007A (en) * 2017-11-16 2018-03-16 百度在线网络技术(北京)有限公司 Information processing method and device
CN109508448A (en) * 2018-07-17 2019-03-22 网易传媒科技(北京)有限公司 Short information method, medium, device are generated based on long article and calculate equipment
CN110750707A (en) * 2018-07-23 2020-02-04 北京字节跳动网络技术有限公司 Keyword recommendation method and device and electronic equipment
CN110750708A (en) * 2018-07-23 2020-02-04 北京字节跳动网络技术有限公司 Keyword recommendation method and device and electronic equipment
CN110874532A (en) * 2018-08-30 2020-03-10 北京京东尚科信息技术有限公司 Method and device for extracting keywords of feedback information
CN110909122A (en) * 2019-10-10 2020-03-24 重庆金融资产交易所有限责任公司 Information processing method and related equipment
CN111401045A (en) * 2020-03-16 2020-07-10 腾讯科技(深圳)有限公司 Text generation method and device, storage medium and electronic equipment
CN111444330A (en) * 2020-03-09 2020-07-24 中国平安人寿保险股份有限公司 Method, device and equipment for extracting short text keywords and storage medium

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107808007A (en) * 2017-11-16 2018-03-16 百度在线网络技术(北京)有限公司 Information processing method and device
CN109508448A (en) * 2018-07-17 2019-03-22 网易传媒科技(北京)有限公司 Short information method, medium, device are generated based on long article and calculate equipment
CN110750707A (en) * 2018-07-23 2020-02-04 北京字节跳动网络技术有限公司 Keyword recommendation method and device and electronic equipment
CN110750708A (en) * 2018-07-23 2020-02-04 北京字节跳动网络技术有限公司 Keyword recommendation method and device and electronic equipment
CN110874532A (en) * 2018-08-30 2020-03-10 北京京东尚科信息技术有限公司 Method and device for extracting keywords of feedback information
CN110909122A (en) * 2019-10-10 2020-03-24 重庆金融资产交易所有限责任公司 Information processing method and related equipment
CN111444330A (en) * 2020-03-09 2020-07-24 中国平安人寿保险股份有限公司 Method, device and equipment for extracting short text keywords and storage medium
CN111401045A (en) * 2020-03-16 2020-07-10 腾讯科技(深圳)有限公司 Text generation method and device, storage medium and electronic equipment

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115333685A (en) * 2022-10-10 2022-11-11 永鼎行远(南京)信息科技有限公司 Intelligent information allocation system based on big data
CN115333685B (en) * 2022-10-10 2023-02-28 永鼎行远(南京)信息科技有限公司 Intelligent information allocation system based on big data

Also Published As

Publication number Publication date
CN112487765B (en) 2022-10-04

Similar Documents

Publication Publication Date Title
CN109376234B (en) Method and device for training abstract generation model
CN112184367B (en) Order processing method and device
CN111447257B (en) Message conversion method and device
CN110471848B (en) Method and device for dynamically returning message
CN112527649A (en) Test case generation method and device
WO2018053594A1 (en) Emoji images in text messages
CN111368551A (en) Method and device for determining event subject
CN111368697A (en) Information identification method and device
CN113761565B (en) Data desensitization method and device
CN112487765B (en) Method and device for generating notification text
CN110852057A (en) Method and device for calculating text similarity
CN110705271B (en) System and method for providing natural language processing service
US20230076471A1 (en) Training method, text translation method, electronic device, and storage medium
CN112948138A (en) Method and device for processing message
CN110895655A (en) Method and device for extracting text core phrase
CN113127561B (en) Method and device for generating service single number, electronic equipment and storage medium
CN114374686A (en) File processing method, device and equipment based on browser
CN111339790B (en) Text translation method, device, equipment and computer readable storage medium
CN114429629A (en) Image processing method and device, readable storage medium and electronic equipment
CN113987118A (en) Corpus acquisition method, apparatus, device and storage medium
CN115686229A (en) Expression input method, expression input device and computer program storage medium
CN109426357B (en) Information input method and device
CN112749353A (en) Processing method and device of webpage icon
CN110929512A (en) Data enhancement method and device
CN115374320B (en) Text matching method and device, electronic equipment and computer medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20220920

Address after: 25 Financial Street, Xicheng District, Beijing 100033

Applicant after: CHINA CONSTRUCTION BANK Corp.

Address before: 12 / F, 15 / F, No. 99, Yincheng Road, Shanghai pilot Free Trade Zone, 200120

Applicant before: Jianxin Financial Science and Technology Co.,Ltd.

GR01 Patent grant
GR01 Patent grant