Communication message generation method and device and readable storage medium
By receiving user instructions on the web page to generate Morse messages, and converting and playing them, the high cost problems of mechanical transmitters for operators and software simulation sending are solved, and convenient and low-cost Morse messages are generated and played.
Patent Information
- Application Number
- CN202311224128.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-21
- Publication Date
- 2025-03-21
- Estimated Expiration
- 2043-09-21
AI Technical Summary
In the existing Morse newspaper technology, long-term use of mechanical transmitters has greatly worn the body of the operator, and the mechanical devices are bulky and difficult to carry. At the same time, software simulation sending requires installation and debugging, development costs and maintenance are high, and it is incompatible with the system update.
It provides a method for generating communication messages, receiving user-generated instructions through a web page, generating several groups of messages, and converting them into a dot-dash sequence according to the preset Morse code dictionary, defining the sound length, generating the target sound, and playing it.
It realizes that Morse messages can be generated and played without the need for specific operating system support, no need for plug-ins, and no need to connect to the Internet, solving the wear problems of mechanical transmitters for traffic operators and the high cost and maintenance problems of software simulation sending.
Smart Images

Figure CN119676322A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of telegraph communication technology, and in particular to a method and device for generating a communication message and a readable storage medium. Background Art
[0002] Morse mail (also translated as Morse mail) uses telegraph codes, which are simple, accurate, economical and practical. It is the basic method of modern telegraph communication. Due to its stable transmission characteristics under extreme conditions, it is currently widely used in maritime communications, field rescue, energy surveying, aviation emergency, military communications and other fields.
[0003] However, the existing Morse telegraphs are almost all used under extreme environmental conditions, and there are two problems: first, the long-term use of mechanical transmitters causes great wear and tear on the bodies of radio operators, causing irreversible damage over time, and the mechanical devices are bulky and difficult to carry; second, various types of software simulation messaging need to be installed and debugged, with high development costs and maintenance. Moreover, as the operating system iterates, the software architecture gradually becomes incompatible with the new system, and is eventually eliminated due to disrepair, requiring manpower-intensive secondary development. Summary of the invention
[0004] The technical problem to be solved by the present invention is to provide a method, device and readable storage medium for generating communication messages in view of the above-mentioned deficiencies in the prior art, so as to at least solve the problems in the prior art of long-term use of mechanical transmitters, which causes great wear and tear on the bodies of radio operators, and the mechanical devices are bulky and difficult to carry, as well as the use of various software simulations for sending messages, which require installation and debugging, and have high development costs and maintenance.
[0005] In a first aspect, the present invention provides a method for generating a communication message, the method
[0006] include:
[0007] Receiving a generation instruction submitted by a user based on a web page, and generating several groups of messages according to the generation instruction;
[0008] Converting the generated groups of messages into messages consisting of only dots, dashes, characters and words according to a preset Morse code dictionary;
[0009] Define the sound lengths corresponding to dots, dashes, characters and words in the converted message;
[0010] Obtaining a target sound corresponding to the converted message according to the sound length and a standard sound pre-generated at 440 Hz;
[0011] The target sound is matched according to the rules of the communication message and played.
[0012] Furthermore, before receiving the generation instruction submitted by the user based on the webpage, the method further includes:
[0013] A Morse code dictionary corresponding to each message type is defined, wherein the message type includes long code, short code, word code, mixed code and professional terminology.
[0014] Furthermore, the method of converting the generated plurality of groups of messages into messages having only dots, dashes, characters and words according to a preset Morse code dictionary specifically includes:
[0015] Determine whether there are Chinese characters in the generated groups of messages;
[0016] In response to the absence of Chinese characters in the generated plurality of groups of messages, the generated plurality of groups of messages are translated into dot-dash sequences according to a Morse code dictionary corresponding to the mixed code or a Morse code dictionary corresponding to the current message type;
[0017] In response to the presence of Chinese characters in the generated plurality of groups of messages, calling the xmorse module of the Morse code library to translate the generated plurality of groups of messages into dot-dash sequences;
[0018] Character and word control information is added to the dot-stroke sequence to obtain a message consisting of only dots, strokes, characters and words.
[0019] Furthermore, the definition of the sound length corresponding to the dot, stroke, character, or word in the converted message specifically includes:
[0020] Define the playback time and waiting time corresponding to the dots, dashes, characters and words in the converted message.
[0021] Furthermore, before obtaining the target sound corresponding to the converted message according to the sound length and the standard sound pre-generated at 440 Hz, the method further includes:
[0022] Define a 440 Hz sine wave;
[0023] The standard sounds corresponding to dots, strokes, characters, and words are defined on a 440 Hz sine wave. Further, the standard sounds corresponding to dots, strokes, characters, and words are defined on a 440 Hz sine wave, specifically including:
[0024] The standard sounds corresponding to dots, dashes, characters and words are defined on a 440 Hz sine wave according to the transmission speed set by the user.
[0025] Furthermore, before matching the target sound according to the rules of the communication message and playing it, the method further includes:
[0026] Determine whether background noise needs to be added;
[0027] In response to the need to add background noise, the background noise is added to the target sound.
[0028] In a second aspect, the present invention provides a communication message generation device, comprising:
[0029] A message generation module, used to receive a generation instruction submitted by a user based on a web page, and generate several groups of messages according to the generation instruction;
[0030] A message conversion module, connected to the message generation module, is used to convert the generated groups of messages into messages with only dots, dashes, characters and words according to a preset Morse code dictionary;
[0031] A sound length definition module, connected to the message conversion module, is used to define the sound lengths corresponding to dots, strokes, characters, and words in the converted message;
[0032] A target sound acquisition module, connected to the sound length definition module, for obtaining a target sound corresponding to the converted message according to the sound length and a standard sound pre-generated at 440 Hz;
[0033] The telegram playing module is connected to the target sound acquisition module and is used to match the target sound according to the rules of the communication message and play it.
[0034] In a third aspect, the present invention provides a device for generating a communication message, comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to implement the method for generating a communication message described in the first aspect above.
[0035] In a fourth aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the method for generating a communication message described in the first aspect above is implemented.
[0036] The invention provides a method, device and readable storage medium for generating communication messages. First, a generation instruction submitted by a user based on a web page is received, and several groups of messages are generated according to the generation instruction; then, the generated several groups of messages are converted into messages with only dots, dashes, characters and words according to a preset Morse code dictionary; and the sound length corresponding to the dots, dashes, characters and words in the converted message is defined; then, the target sound corresponding to the converted message is obtained according to the sound length and the standard sound generated in advance at 440 Hz; finally, the target sound is matched according to the rules of the communication message and played. The invention only requires the user to click on the web page to realize the generation and training of the communication message, does not require any specific operating system support, does not require installation, does not require additional installation of any plug-in, does not require connection to the Internet, does not require the arrangement of personnel for secondary development and maintenance, will not be incompatible with system updates, whether it is a mobile phone or a computer, as long as a browser is installed, it can be used by clicking it, which solves the problems of long-term use of mechanical transmitters in the prior art, large wear and tear on the body of the telegraph operator, and the heavy and difficult to carry mechanical devices, and the use of various software simulations for sending messages requires installation and debugging, and the development cost and maintenance are high. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] Figure 1 This is a flow chart of a method for generating a communication message according to Embodiment 1 of the present invention;
[0038] Figure 2 This is a flowchart of another method for generating a communication message according to Embodiment 1 of the present invention;
[0039] Figure 3 A schematic diagram of an interface of a method for generating a communication message according to an embodiment of the present invention;
[0040] Figure 4 A schematic diagram of an interface for generating a message and a dot-dash sequence according to an embodiment of the present invention;
[0041] Figure 5 A schematic diagram of an interface for translating messages according to an embodiment of the present invention;
[0042] Figure 6 A schematic diagram of an immediate translation interface according to an embodiment of the present invention;
[0043] Figure 7 This is a schematic diagram of the structure of a communication message generating device according to Embodiment 2 of the present invention;
[0044] Figure 8 This is a structural diagram of a communication message generating device according to Embodiment 3 of the present invention. DETAILED DESCRIPTION
[0045] In order to enable those skilled in the art to better understand the technical solution of the present invention, the embodiments of the present invention will be further described in detail below with reference to the accompanying drawings.
[0046] It should be understood that the specific embodiments and drawings described herein are only used to explain the present invention rather than to limit the present invention.
[0047] It can be understood that, in the absence of conflict, the various embodiments of the present invention and the various features in the embodiments can be combined with each other.
[0048] It can be understood that, for the convenience of description, the drawings of the present invention only show the parts related to the present invention, while the parts irrelevant to the present invention are not shown in the drawings.
[0049] It can be understood that each unit and module involved in the embodiments of the present invention may correspond to only one physical structure, or may be composed of multiple physical structures, or multiple units and modules may be integrated into one physical structure.
[0050] It can be understood that the terms "first", "second", etc. in the embodiments of the present invention are used to distinguish different objects, or to distinguish different processing of the same object, rather than to describe a specific order of objects.
[0051] It can be understood that, without conflict, the functions and steps marked in the flowcharts and block diagrams of the present invention may occur in an order different from that marked in the drawings.
[0052] It is understood that the flowcharts and block diagrams of the present invention illustrate the possible architectures, functions, and operations of the systems, devices, equipment, and methods according to the various embodiments of the present invention. Each box in the flowchart or block diagram may represent a unit, module, program segment, or code, which contains executable instructions for implementing the specified functions. Moreover, each box or combination of boxes in the block diagram and flowchart may be implemented by a hardware-based system that implements the specified functions, or may be implemented by a combination of hardware and computer instructions.
[0053] It can be understood that the units and modules involved in the embodiments of the present invention can be implemented by software or hardware. For example, the units and modules can be located in a processor.
[0054] Application Overview
[0055] Morse mail (also translated as Morse mail) uses telegraph codes, which are simple, accurate, economical and practical. It is the basic method of modern telegraph communication. Due to its stable transmission characteristics under extreme conditions, it is currently widely used in maritime communications, field rescue, energy surveying, aviation emergency, military communications and other fields.
[0056] In general communication units, new radio operators usually need to learn Morse code for 6-9 months. The basic steps of learning are as follows: the first stage is mainly to recognize, read, write and memorize the code symbols; the second stage is to listen to the Morse code recordings and copy the messages: translate the code symbols into numbers by ear and then write them directly on the telegraph paper; the third stage is high-intensity training in sending messages. After about half a year of training, new radio operators must copy more than 120 yards per minute. After about a year, they are usually competent for the job and can reach more than 180 yards per minute. Due to the need for good hearing, a sharp personality, sufficient coordination of eyes, brain and hands, and the tolerance of boring, lonely and repetitive training, the elimination rate of radio operators is very high.
[0057] Since Morse newspapers are almost always used in extreme environments, the basic training facilities are generally relatively simple and can be roughly divided into the following categories:
[0058] (1) Shortwave radio transmission: The advantage is that it can transmit automatically without manual typing. However, the radio is bulky, has a small communication capacity, and the transmission channel is unstable, making it easy to be eavesdropped by FM.
[0059] (2) Mechanical transmitter: The advantages are simplicity and portability. However, it requires manual tapping, which is not precise enough, and fingers often get blisters from being worn out. Many radio operators have a lump on the first section of their middle fingers from kneeling for a long time to send messages, and their bodies are severely worn out.
[0060] (3) Various mobile phone apps and computer software simulation messaging: The advantages are simplicity, portability, and the ability to send messages automatically. However, the software must be installed and is strongly associated with the operating system. In a few years, it may not be compatible with new operating systems such as win7, win10, and Android, and often crashes with errors. Some software also requires an internet connection to use, which is not suitable for the actual situation in harsh environments. In addition, the software also has installation, learning, and maintenance costs.
[0061] (4) Some other related proposals: They are basically aimed at improving the mechanical structure, but they cause great wear and tear on the radio operators and the mechanical devices are bulky and difficult to carry.
[0062] In response to the above technical problems, the idea of the present application is to provide a method, device and readable storage medium for generating communication messages. Based on the web page files generated by the front-end engineering method, the user only needs to click on the web page to realize the generation and training of communication messages (such as Morse messages). It does not require any specific operating system support, does not need to be installed, and does not require the installation of any additional plug-ins. It does not need to be connected to the Internet, does not need to arrange personnel for secondary development and maintenance, and will not be incompatible with system updates. Whether it is a mobile phone or a computer, as long as a browser is installed, you can use it by clicking it.
[0063] After introducing the basic principles of the present application, various non-limiting embodiments of the present application will be described in detail with reference to the accompanying drawings.
[0064] Embodiment 1:
[0065] This embodiment provides a method for generating a communication message, such as Figure 1 As shown, the method includes:
[0066] Step S101: receiving a generation instruction submitted by a user based on a web page, and generating several groups of messages according to the generation instruction.
[0067] In this embodiment, the web page is preferably a static web page, which is developed using a front-end engineering method and ultimately generates an html web page file or an htm web page file. When the user clicks, double-clicks, long presses, or touches a button on the web page (such as a "generate message" button), the system corresponding to the web page receives the generation instruction and generates several groups of messages according to the generation instruction.
[0068] Optionally, before receiving the generation instruction submitted by the user based on the webpage, the method further includes:
[0069] A Morse code dictionary corresponding to each message type is defined, wherein the message type includes long code, short code, word code, mixed code and professional terminology.
[0070] In this embodiment, the Morse code dictionary corresponding to each message type can be defined according to actual needs. In addition to supporting five message types, namely long code, short code, character code, mixed code and professional terminology, the Morse code dictionary can also be expanded according to needs. For example, the code for defining the Morse code dictionary corresponding to the five message types can be as follows:
[0071] function getmorse(){ / / Initialize various types of Morse code. The following demonstrates how to define five types of messages.
[0072]
[0073]
[0074]
[0075] Among them, the long code and the short code can be numbers, the character code can include 26 lowercase letters, the mixed code can include uppercase and lowercase letters, numbers and common symbols, and the professional terms can be pre-set professional terms.
[0076] Step S102: converting the generated groups of messages into messages consisting of only dots, dashes, characters and words according to a preset Morse code dictionary.
[0077] In this embodiment, the generated groups of messages include letters, numbers, symbols, etc. If the groups of messages do not include Chinese, the generated groups of messages are converted into messages containing only dots, strokes, characters, and words according to a preset Morse code dictionary.
[0078] Optionally, the converting of the generated plurality of groups of messages into messages consisting of only dots, dashes, characters and words according to a preset Morse code dictionary specifically includes:
[0079] Determine whether there are Chinese characters in the generated groups of messages;
[0080] In response to the absence of Chinese characters in the generated plurality of groups of messages, the generated plurality of groups of messages are translated into dot-dash sequences according to a Morse code dictionary corresponding to the mixed code or a Morse code dictionary corresponding to the current message type;
[0081] In response to the presence of Chinese characters in the generated plurality of groups of messages, calling the xmorse module of the Morse code library to translate the generated plurality of groups of messages into dot-dash sequences;
[0082] Character and word control information is added to the dot-stroke sequence to obtain a message consisting of only dots, strokes, characters and words.
[0083] In this embodiment, since letters, numbers, and symbols are generally encoded in ASCII, the operating system itself can parse them, but a plug-in is required to recognize Chinese encoding. The xmorse module is a Morse code library written in Javascript for browsers and nodejs environments, which can support unicode, that is, a Morse code library that supports Chinese. Therefore, when there are Chinese characters in the generated groups of messages, the Morse code library xmorse module is called to translate the generated groups of messages into dot-dash sequences.
[0084] In this embodiment, the user can first select the current message type corresponding to the message to be generated based on the webpage. After the user submits the generation instruction, the system can randomly generate several groups of messages corresponding to the current message type, and translate the generated several groups of messages into dot-dash sequences according to the Morse code dictionary corresponding to the current message type. For example, if the current message type is a long code, the generated several groups of messages are translated into dot-dash sequences according to the Morse code dictionary corresponding to the long code.
[0085] In this embodiment, after translating several groups of messages into dot-dash sequences, it is necessary to translate the translated messages (i.e., dot-dash sequences) into a format that can be played and recognized by the system. The idea is to convert the message string into an array, and wrap the array elements with span and insert them into DOM to realize the red marking of the following dictation characters, break the Morse code into dots and dashes, and add control information such as byte (character) and word (word). The code can be as follows:
[0086]
[0087]
[0088] It should be noted that the word and phrase control information is added to the dot-stroke sequence, that is, the sentence is segmented. For example, I Love You, I is represented by: (..), LOVE is represented by: (.-..---...-.), YOU is represented by: (-.-----..-), but they cannot be put together, such as: ...-..---...-.-.-----..-, which will lead to unclear meaning. Therefore, it is necessary to segment: I, love, you, these are three words, there must be two words in the middle, that is, word control information, similarly, the word love has four words, there must be three words in the middle, that is, byte control information. Usually, the duration of. is taken as the base t, byte=3t, word=7t.
[0089] Step S103: define the sound lengths corresponding to dots, strokes, characters and words in the converted message.
[0090] Specifically, the playing time and waiting time corresponding to the dots, strokes, characters and words in the converted message are defined.
[0091] In this embodiment, the generated message needs to be sent and encoded before sending. The duration of each encoding is determined first. Playing and waiting are used to define the duration t:
[0092] Point (·): (pronounced as “dit”, time occupies 1t)
[0093] Stroke (—): (pronounced as “dah”, takes up 3t of time)
[0094] Pause within a character (between a dot and a stroke): (time occupies 1t)
[0095] Pause between words (byte): (time occupied 3t)
[0096] Pause between words (word): (time occupied 7t)
[0097] Specifically, the code for processing the point, stroke, character, word and other events generated by the system and deciding how to play and wait can be as follows:
[0098]
[0099]
[0100] Step S104: obtaining a target sound corresponding to the converted message according to the sound length and a standard sound pre-generated at 440 Hz.
[0101] Optionally, before obtaining the target sound corresponding to the converted message according to the sound length and the standard sound pre-generated at 440 Hz, the method further includes:
[0102] Define a 440 Hz sine wave;
[0103] Define the standard sounds corresponding to dots, strokes, characters and words on a 440 Hz sine wave.
[0104] In this embodiment, the standard sounds corresponding to dots, dashes, characters and words can be defined on a 440 Hz sine wave according to the transmission speed set by the user.
[0105] Specifically, asynchronous operation is used to simulate the generation of dot sounds, scratch sounds, and other sounds (i.e., standard sounds). Taking dot sound generation as an example, a 440 Hz sine wave is first defined, and a rectangular filter is added to the sine wave and then modulated. The sound is approximately a dot within 1 perTime second at 440 Hz. perTime is mainly determined by the transmission speed set by the user. The code can be as follows:
[0106]
[0107] Step S105: Match the target sound according to the rules of the communication message and play it.
[0108] In this embodiment, after defining the time length of dots, dashes, characters, and words, the system timer is called to generate the time length, interval, and punctuation of dot sounds according to the rules of communication messages. The same is true for generating other sounds, except that the sound lengths are different. For generating dashes, the idea is the same as above, except that the time length is set to three times that of a dot. The code can be as follows:
[0109]
[0110]
[0111] Optionally, before matching the target sound according to the rule of the communication message and playing it, the method further includes:
[0112] Determine whether background noise needs to be added;
[0113] In response to the need to add background noise, the background noise is added to the target sound.
[0114] In this embodiment, in order to simulate the traffic scene in a complex environment, the user can choose whether to add background noise through the web page. When the system determines that the user needs to add background noise, the corresponding background noise is added and then played.
[0115] The present invention uses the front-end engineering method to finally generate an HTML webpage file. You only need to click on the webpage to realize the generation and training of communication messages (such as Morse messages). It does not require any specific operating system support, installation, or additional installation of any plug-ins, does not require Internet connection, does not require personnel to arrange secondary development and maintenance, and will not be incompatible with system updates. Whether it is a mobile phone or a computer, as long as a browser is installed, you can use it by clicking it. 。
[0116] In a specific embodiment, the communication message generation method may include the following steps:
[0117] 1. Use a Morse code dictionary to randomly generate (human-understandable) messages;
[0118] 2. Convert the generated message into a message (telegram) consisting of only dots, dashes, characters and words;
[0119] 3. Define the sound lengths corresponding to dots, strokes, characters, and words;
[0120] 4. Use the program to generate a standard sound at 440 Hz, and then derive the corresponding sound of dots and dashes based on the length of the sound;
[0121] 5. Use Telegram to match the sound and play it.
[0122] In another specific embodiment, Figure 2 As shown, the method for generating the communication message may include the following steps:
[0123] 1) Generate Morse code dictionaries corresponding to each message type, supporting Morse code dictionaries corresponding to five message types: long code, short code, character code, mixed code, and professional terminology;
[0124] 2) Randomly generate several groups of messages;
[0125] 3) Determine whether there are Chinese characters in the generated message groups. If so, call the xmorse module. If not, use the Morse code dictionary corresponding to the mixed code (referred to as the mixed code dictionary) to convert the generated message into a message with only dots, strokes, characters, and words;
[0126] 4) Process the point, stroke, character, word and other events generated by the system and decide how to play and wait;
[0127] 5) Generate the definition of dots, dashes, and spaces (i.e., characters and words) at 440 Hz;
[0128] 6) Translate the translated message into a format that can be played and recognized by the system, that is, convert the dots and dashes into electrical signals (convert . and - into 440hz sound waves of different sound lengths), and then form sound playback;
[0129] 7) Determine whether the user selects to add interference items such as background noise. If so, add background noise. If not, directly distinguish dots, dashes, characters, and words for playback.
[0130] In another specific embodiment, the corresponding system is developed using the front-end engineering method, and finally an html web page file is generated. The web page is directly opened through a browser, and the interface schematic diagram shown as Figure 3 is displayed. The user only needs to click on the web page to realize the generation and training of communication messages (such as Morse code). Specifically, as Figure 3 shown, the user can select the corresponding message type (including long code, short code, character code, mixed code, and professional terms) through the message type drop-down list box, and can also set the corresponding number of message groups and sending speed through the number of message groups and sending speed text boxes. For example, when the user selects the mixed code and sets the number of message groups to 20, and keeps other settings in the system default state, when the user clicks the generate message button, the displayed interface is as Figure 4 shown, which respectively displays 20 groups of randomly generated mixed code messages and the dot-dash sequences corresponding to the 20 groups of mixed code messages. When the user clicks start dictation again, the dictation starts.
[0131] Specifically, the user can also input the corresponding message on this web page. For example, when the user clicks the Figure 3 translate message button shown as Figure 5 shown, a pop-up interface as Figure 6 shown appears. When the user inputs the Chinese "你好" (Hello) and clicks the translate immediately button, a pop-up interface as
[0132]
[0133]
[0134] The method for generating a communication message provided by an embodiment of the present invention first receives a generation instruction submitted by a user based on a web page, and generates several groups of messages according to the generation instruction; then converts the generated several groups of messages into messages with only dots, dashes, characters, and words according to a preset Morse code dictionary; and defines the sound length corresponding to the dots, dashes, characters, and words in the converted message; then obtains the target sound corresponding to the converted message according to the sound length and the standard sound generated in advance at 440 Hz; finally matches the target sound according to the rules of the communication message and plays it. The present invention only requires the user to click on the web page to realize the generation and training of the communication message, does not require any specific operating system support, does not require installation, does not require additional installation of any plug-in, does not require connection to the Internet, does not require the arrangement of personnel for secondary development and maintenance, will not be incompatible with system updates, whether it is a mobile phone or a computer, as long as a browser is installed, it can be used by clicking it, which solves the problems of long-term use of mechanical transmitters in the prior art, large wear on the body of the telegraph operator, and the heavy mechanical device is not easy to carry, and the use of various software simulations requires installation and debugging, and the development cost and maintenance are high.
[0135] Embodiment 2:
[0136] like Figure 7 As shown, this embodiment provides a communication message generation device, which is used to execute the above communication message generation method, including:
[0137] The message generation module 11 is used to receive a generation instruction submitted by a user based on a web page, and generate several groups of messages according to the generation instruction;
[0138] A message conversion module 12, connected to the message generation module 11, is used to convert the generated groups of messages into messages with only dots, dashes, characters and words according to a preset Morse code dictionary;
[0139] A sound length definition module 13, connected to the message conversion module 12, is used to define the sound lengths corresponding to dots, strokes, characters, and words in the converted message;
[0140] A target sound acquisition module 14, connected to the sound length definition module 13, is used to obtain the target sound corresponding to the converted message according to the sound length and the standard sound pre-generated at 440 Hz;
[0141] The telegram playing module 15 is connected to the target sound acquiring module 14, and is used for matching the target sound according to the rules of the communication message and playing it.
[0142] Optionally, the device further comprises:
[0143] The dictionary definition module is used to define the Morse code dictionary corresponding to each message type, wherein the message type includes long code, short code, word code, mixed code and professional terms.
[0144] Optionally, the message conversion module 12 specifically includes:
[0145] A Chinese judgment unit, used for judging whether there are Chinese characters in the generated groups of messages;
[0146] A first translation unit is used for translating the generated groups of messages into dot-dash sequences according to a Morse code dictionary corresponding to the mixed code or a Morse code dictionary corresponding to the current message type in response to the absence of Chinese characters in the generated groups of messages;
[0147] The second translation unit is used for translating the generated groups of messages into dot-dash sequences by calling the xmorse module of the Morse code library in response to the presence of Chinese characters in the generated groups of messages;
[0148] The adding unit is used to add character and word control information to the dot-stroke sequence to obtain a message containing only dots, strokes, characters and words.
[0149] Optionally, the sound length definition module 13 is specifically used for:
[0150] Define the playback time and waiting time corresponding to the dots, dashes, characters and words in the converted message.
[0151] Optionally, the device further comprises:
[0152] Sine wave definition module, used to define 440 Hz sine wave;
[0153] The standard sound definition module is used to define the standard sounds corresponding to dots, strokes, characters and words on a 440 Hz sine wave.
[0154] Optionally, the standard sound definition module is specifically used for:
[0155] The standard sounds corresponding to dots, dashes, characters and words are defined on a 440 Hz sine wave according to the transmission speed set by the user.
[0156] Optionally, the device further comprises:
[0157] Background noise judgment module, used to judge whether background noise needs to be added;
[0158] The background noise adding module is used to add background noise to the target sound in response to the need to add background noise.
[0159] Embodiment 3:
[0160] refer to Figure 8This embodiment provides a communication message generation device, including a memory 21 and a processor 22, the memory 21 stores a computer program, and the processor 22 is configured to run the computer program to execute the communication message generation method in Example 1.
[0161] The memory 21 is connected to the processor 22. The memory 21 may be a flash memory, a read-only memory or other memory. The processor 22 may be a central processing unit or a single-chip microcomputer.
[0162] Embodiment 4:
[0163] This embodiment provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the method for generating a communication message in the above-mentioned embodiment 1 is implemented.
[0164] The computer-readable storage medium includes volatile or non-volatile, removable or non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, computer program modules or other data). Computer-readable storage media include, but are not limited to, RAM (Random Access Memory), ROM (Read-Only Memory), EEPROM (Electrically Erasable Programmable read only memory), flash memory or other memory technology, CD-ROM (Compact Disc Read-Only Memory), digital versatile disk (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store the desired information and can be accessed by a computer.
[0165] In summary, the communication message generation method, device and readable storage medium provided by the embodiment of the present invention first receive the generation instruction submitted by the user based on the web page, and generate several groups of messages according to the generation instruction; then convert the generated several groups of messages into messages with only dots, dashes, characters and words according to the preset Morse code dictionary; and define the sound length corresponding to the dots, dashes, characters and words in the converted message; then obtain the target sound corresponding to the converted message according to the sound length and the standard sound generated in advance at 440 Hz; finally match the target sound according to the rule of the communication message and play it. The present invention only requires the user to click on the web page to realize the generation and training of the communication message, does not require any specific operating system support, does not require installation, does not require additional installation of any plug-in, does not require connection to the Internet, does not require the arrangement of personnel for secondary development and maintenance, will not be incompatible with the system update, whether it is a mobile phone or a computer, as long as a browser is installed, it can be used by clicking it, which solves the problems of long-term use of mechanical transmitters in the prior art, large wear and tear on the body of the telegraph operator, and the heavy mechanical device is not easy to carry, and the use of various software simulations requires installation and debugging, and the development cost and maintenance are high.
[0166] It is to be understood that the above embodiments are merely exemplary embodiments used to illustrate the principles of the present invention, but the present invention is not limited thereto. For those of ordinary skill in the art, various modifications and improvements can be made without departing from the spirit and essence of the present invention, and these modifications and improvements are also considered to be within the scope of protection of the present invention.
Claims
1. A method for generating a communication message, characterized in that: include: Receiving a generation instruction submitted by a user based on a web page, and generating several groups of messages according to the generation instruction; Converting the generated groups of messages into messages consisting of only dots, dashes, characters and words according to a preset Morse code dictionary; Define the sound lengths corresponding to dots, dashes, characters and words in the converted message; Obtaining a target sound corresponding to the converted message according to the sound length and a standard sound pre-generated at 440 Hz; The target sound is matched according to the rules of the communication message and played.
2. The method according to claim 1, characterized in that: Before receiving the generation instruction submitted by the user based on the webpage, the method further includes: A Morse code dictionary corresponding to each message type is defined, wherein the message type includes long code, short code, word code, mixed code and professional terminology.
3. The method according to claim 2, characterized in that The method of converting the generated plurality of groups of messages into messages having only dots, dashes, characters and words according to a preset Morse code dictionary specifically includes: Determine whether there are Chinese characters in the generated groups of messages; In response to the absence of Chinese characters in the generated plurality of groups of messages, the generated plurality of groups of messages are translated into dot-dash sequences according to a Morse code dictionary corresponding to the mixed code or a Morse code dictionary corresponding to the current message type; In response to the presence of Chinese characters in the generated plurality of groups of messages, calling the xmorse module of the Morse code library to translate the generated plurality of groups of messages into dot-dash sequences; Character and word control information is added to the dot-stroke sequence to obtain a message consisting of only dots, strokes, characters and words.
4. The method according to claim 1, characterized in that The definition of the sound lengths corresponding to the dots, strokes, characters and words in the converted message specifically includes: Define the playback time and waiting time corresponding to the dots, dashes, characters and words in the converted message.
5. The method according to claim 1, characterized in that: Before obtaining the target sound corresponding to the converted message according to the sound length and the standard sound pre-generated at 440 Hz, the method further includes: Define a 440 Hz sine wave; Define the standard sounds corresponding to dots, strokes, characters and words on a 440 Hz sine wave.
6. The method according to claim 5, characterized in that The standard sounds corresponding to dots, strokes, characters and words are defined on a 440 Hz sine wave, specifically including: The standard sounds corresponding to dots, dashes, characters and words are defined on a 440 Hz sine wave according to the transmission speed set by the user.
7. The method according to claim 1, characterized in that Before matching the target sound according to the rules of the communication message and playing it, the method further includes: Determine whether background noise needs to be added; In response to the need to add background noise, the background noise is added to the target sound.
8. A communication message generating device, characterized in that: include: A message generation module, used to receive a generation instruction submitted by a user based on a web page, and generate several groups of messages according to the generation instruction; A message conversion module, connected to the message generation module, is used to convert the generated groups of messages into messages with only dots, dashes, characters and words according to a preset Morse code dictionary; A sound length definition module, connected to the message conversion module, is used to define the sound lengths corresponding to dots, strokes, characters, and words in the converted message; A target sound acquisition module, connected to the sound length definition module, for obtaining a target sound corresponding to the converted message according to the sound length and a standard sound pre-generated at 440 Hz; The telegram playing module is connected to the target sound acquisition module and is used to match the target sound according to the rules of the communication message and play it.
9. A communication message generating device, characterized in that: The method comprises a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to implement the method for generating a communication message according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method for generating a communication message according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Automatic message transmitting / receiving system and method
CN108390835A
Automatic newspaper reading and sending device and working method thereof
CN111464464A
Morse code recognition method and device based on newspaper machine, equipment and storage medium
CN112272150A
Morse code typing method and device, electronic equipment and storage medium
CN115480655A
Method and apparatus of using Morse code input combined with text-to-speech output for eyes-free, quiet, discreet and partially hands-free mobile text messaging
US20210266398A1