WO2017024978A1 - 短信息的发送、接收方法及装置 - Google Patents

短信息的发送、接收方法及装置 Download PDF

Info

Publication number
WO2017024978A1
WO2017024978A1 PCT/CN2016/093187 CN2016093187W WO2017024978A1 WO 2017024978 A1 WO2017024978 A1 WO 2017024978A1 CN 2016093187 W CN2016093187 W CN 2016093187W WO 2017024978 A1 WO2017024978 A1 WO 2017024978A1
Authority
WO
WIPO (PCT)
Prior art keywords
byte
preset
data
short message
character set
Prior art date
Application number
PCT/CN2016/093187
Other languages
English (en)
French (fr)
Inventor
李亮
Original Assignee
阿里巴巴集团控股有限公司
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 阿里巴巴集团控股有限公司 filed Critical 阿里巴巴集团控股有限公司
Priority to EP16834602.1A priority Critical patent/EP3337200A4/en
Priority to KR1020187004083A priority patent/KR20180042857A/ko
Priority to JP2018506870A priority patent/JP6906498B2/ja
Publication of WO2017024978A1 publication Critical patent/WO2017024978A1/zh
Priority to US15/893,483 priority patent/US20180184260A1/en

Links

Images

Classifications

    • 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]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/903Querying
    • G06F16/90335Query processing
    • G06F16/90344Query processing by using string matching techniques
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L51/00User-to-user messaging in packet-switching networks, transmitted according to store-and-forward or real-time protocols, e.g. e-mail
    • H04L51/06Message adaptation to terminal or network requirements
    • H04L51/066Format adaptation, e.g. format conversion or compression
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W12/00Security arrangements; Authentication; Protecting privacy or anonymity
    • H04W12/02Protecting privacy or anonymity, e.g. protecting personally identifiable information [PII]

Definitions

  • the present invention relates to the field of Internet technologies, and in particular, to a method and an apparatus for transmitting and receiving short messages.
  • SMS Short Message Service
  • SMS only supports the transmission of Unicode text content, length 70, due to the length limit of the text message, and the content is publicly readable. Making it as a complex communication can be very limited.
  • a related solution for mobile phone anti-theft provided by the related art is to send an instruction to a target mobile phone through a mobile phone of a relative friend.
  • their implementation methods only send pre-specified instruction codes, and can not carry more specific parameters, and their security and use range is very limited.
  • the embodiment of the invention provides a method and a device for sending and receiving short messages, so as to at least solve the technical problem that the use range of the short message is limited due to the limitation of the length of the short message content.
  • a method for transmitting short information includes: converting a message content of a short message to be converted into byte data; and searching for a character corresponding to the byte data from the pre-stored character set, Character data, wherein the character set includes: preset byte data, preset characters, and a mapping relationship between preset byte data and preset characters, and the preset characters are characters supported by the short message. ; Send character data in the form of a short message.
  • a method for receiving short information includes: receiving short information from a sender; and searching for byte data corresponding to message content of the short message from a pre-stored character set;
  • the character set includes: preset byte data, preset characters, and preset byte data and preset characters. Mapping relationship; restores the found byte data to the original message content of the short message.
  • a short message sending apparatus including: a converting module, configured to convert message content of a short message to be converted into byte data; and a query module, configured to pre-store The character set searches for characters corresponding to the byte data to obtain character data, wherein the character set includes: preset byte data, preset characters, and a mapping relationship between the preset byte data and the preset characters.
  • the preset character is a character supported by the short message; the sending module is configured to send the character data in the form of a short message.
  • a receiving apparatus for short information including: a receiving module, configured to receive short information from a sender; and a query module, configured to search for short messages from a pre-stored character set.
  • the byte data corresponding to the message content; wherein the character set includes: preset byte data, preset characters, and a mapping relationship between the preset byte data and the preset characters; and a restoration module, configured to: Restores the found byte data to the original message content of the short message.
  • the message content of the short message to be sent is converted into byte data, and the mapping relationship between the preset byte data and the preset character in the pre-stored character set is in the pre-stored character set.
  • the byte data is converted into text that can be transmitted by the short message, and the purpose of transmitting the message content of the complex communication is achieved, thereby solving the technical problem that the use range of the short message is limited due to the limitation of the length of the short message content, and expanding the use range of the short message. .
  • FIG. 1 is a block diagram showing the hardware structure of a computer terminal for transmitting a short message according to an embodiment of the present invention
  • FIG. 2 is a flowchart of a method for transmitting short information according to Embodiment 1 of the present invention
  • FIG. 3 is a flowchart of a method for receiving short messages according to Embodiment 2 of the present invention.
  • FIG. 4 is a block diagram 1 of a structure of a short message transmitting apparatus according to an embodiment of the present invention.
  • FIG. 5 is a second structural block diagram of a short message sending apparatus according to an embodiment of the present invention.
  • FIG. 6 is a structural block diagram 3 of a short message transmitting apparatus according to an embodiment of the present invention.
  • FIG. 7 is a structural block diagram 4 of a short message transmitting apparatus according to an embodiment of the present invention.
  • FIG. 8 is a block diagram 1 of a structure of a short message receiving apparatus according to an embodiment of the present invention.
  • FIG. 9 is a structural block diagram 2 of a short message receiving apparatus according to an embodiment of the present invention.
  • Figure 10 is a block diagram showing the structure of a computer terminal according to Embodiment 5 of the present invention.
  • FIG. 1 is a hardware structural block diagram of a computer terminal for transmitting a short message according to an embodiment of the present invention.
  • computer terminal 10 may include one or more (only one shown) processor 102 (processor 102 may include, but is not limited to, a processing device such as a microprocessor MCU or a programmable logic device FPGA)
  • processor 102 may include, but is not limited to, a processing device such as a microprocessor MCU or a programmable logic device FPGA)
  • a memory 104 for storing data
  • a transmission module 106 for communication functions.
  • computer terminal 10 may also include more or fewer components than those shown in FIG. 1, or have a different configuration than that shown in FIG.
  • the memory 104 can be used to store software programs and modules of application software, such as program instructions/modules corresponding to the method for transmitting short messages in the embodiment of the present invention, and the processor 102 executes by executing software programs and modules stored in the memory 104.
  • Various functional applications and data processing that is, a method of transmitting short messages of the above-described application.
  • Memory 104 may include high speed random access memory, and may also include non-volatile memory such as one or more magnetic storage devices, flash memory, or other non-volatile solid state memory.
  • memory 104 may further include memory remotely located relative to processor 102, which may be coupled to computer terminal 10 via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
  • the transmission module 106 is configured to receive or transmit data via a network.
  • the network specific examples described above may include a wireless network provided by a communication provider of the computer terminal 10.
  • the transport module 106 includes a Network Interface Controller (NIC) that can be connected to other network devices through a base station to communicate with the Internet.
  • the transmission module 106 can be a Radio Frequency (RF) module for communicating with the Internet wirelessly.
  • NIC Network Interface Controller
  • RF Radio Frequency
  • FIG. 2 is a flowchart of a method for transmitting short information according to Embodiment 1 of the present invention. As shown in FIG. 2, the method includes the following steps:
  • Step S202 converting the message content of the short message to be sent into byte data
  • the method may be implemented by acquiring a string corresponding to the content of the message; The value of the string; the extracted values are used as the constituent elements of the array to form a byte array, and the elements in the byte array are taken as byte data.
  • the string is simplified by extracting the value of the string corresponding to the content of the message, and a byte array is generated, which reduces the length of the content of the message to be sent to a certain extent.
  • the short message content to be sent is encoded by the conventional encoding or the pre-stored character set below does not exceed the length that a short message can be sent, the simplified process may not be performed, but directly The message content is converted to byte data.
  • the data type of the constituent elements in the byte array may be adaptively defined.
  • each byte of the constituent elements in the byte array may be adjusted according to the length of each component element in the byte array.
  • the data type of the constituent elements where different data types have different byte lengths.
  • the values in the string are extracted, and the array is [5,48000000 , 1418269187005, 863121027176726, 123456, 1418269187005, 1418269187005, 1418269187005], according to the data length of each constituent element in the array, the data type of each constituent element can be adapted, for example, the first constituent element is 5, then only If you need 1 byte to represent, you can limit the data type of the first component to byte. You don't need to limit the data type to int or long. For other components, use a similar method.
  • the data types of the constituent elements of the array are: [byte, long, long, long, int, long, long, long] From this, it can be seen that the array at this time only needs 53 bytes to be expressed. By the preferred embodiment, it can be seen that after the above processing method Therefore, the data that originally needs 142 characters can be expressed, only 53 bytes can be expressed, and the above data becomes a byte array of length 53.
  • Step S204 Find characters corresponding to the byte data from the pre-stored character set to obtain character data, where the character set includes: preset byte data, preset characters, and preset byte data and presets.
  • the preset characters are characters supported by short messages.
  • the pre-stored character set may be determined by selecting a preset number of characters according to a preset rule from a character set supported by the short message, and the selected characters are not repeated, and each byte data is established and A preset number of mappings of selected characters.
  • the character set supported by the short message may be a character set supporting transmission of unicode.
  • selecting a preset number of characters from the character set may be selected according to a certain rule, or may be randomly selected, as long as the preset number is extracted. Characters are not repeated.
  • the preset number may be 256, that is, a range that one byte can represent.
  • the technique can be changed to the left.
  • the right stone is covered with the dragon.
  • the East Card is occupied by the old Shuai and the head of the eye is called the ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ Lost in the hills and pays for the griefs of the celestial ceremonies.
  • the mapping relationship between the position of each character in the pre-stored character set or the sequence number and the character may be each byte data and the A preset number of mapping relationships of selected characters, but is not limited thereto.
  • step S206 the character data is transmitted in the form of short message.
  • An array of bytes for example: [114,86,50,67,88,81,54,78,68,65,66,104,114,71,108,76,
  • the pre-stored characters are assumed.
  • the set is a pre-stored character set in the above embodiment, and the value of each byte in the byte array corresponds to one character in the pre-stored character set, and then the byte array is encoded and becomes: There is no Guardian between the horses and the horses.
  • the length is 24. That is to say the character data obtained is: Mao does not fork the dog Yiyi special horse blade Xiri Mao Wang no gangs are not wide and less guard. Therefore, by using the pre-stored character set in the embodiment of the present invention for encoding, the length of the short message content sent by the short message is greatly reduced, thereby increasing the complexity of the message content, thereby expanding the use range of the short message.
  • the message content of the short message to be sent is converted into byte data, and the mapping between the preset byte data and the preset character in the pre-stored character set is searched for in the pre-stored character set.
  • the character data corresponding to the byte data converted by the message content, and then the manner of transmitting the character data in the form of short information, thereby converting the message content of the short message into byte data without increasing the data length.
  • the text that can be transmitted into the short message can achieve the purpose of transmitting the message content of the complex communication, thereby solving the technical problem of limited use of the short message due to the limitation of the length of the short message content, and expanding the use range of the short message.
  • the method before the step S204, the method further includes: encrypting an element in the byte array.
  • the elements in the byte array can be encrypted by the AES algorithm.
  • the AES algorithm is an algorithm in the prior art, and is not described here.
  • the length of the byte array may be increased to a certain extent.
  • 128-bit encryption may be used, and the encrypted byte array may have a certain degree of increase, but in the present invention
  • the length of the message content of the short message to be sent during the transmission process is shortened, so that the message of the short message can be encrypted to ensure that the message content of the short message is in the transmission process. safety.
  • the embodiment of the present invention is mainly used to solve the problem that when the length of the byte array itself is smaller than the length of a short message, but the length of the byte array exceeds the length of a short message after the conventional encoding, such as base64 encoding, the embodiment of the present invention uses the foregoing text.
  • the introduced pre-stored character set is encoded without using the conventional encoding method, so that when the byte array becomes a text that can be transmitted by short information, the data length thereof is unchanged, and thus can be transmitted by a short message.
  • the preferred embodiment provided by the embodiment of the present invention simplifies, encrypts, and encodes data, and the processed content can be sent by using a short message.
  • the character dictionary (corresponding to the pre-stored character set in step S204 of FIG. 1) needs to be generated and used.
  • the character dictionary is original in the embodiment of the present invention, and is to solve the problem that the short message is sent by the byte data. The essential.
  • the above character dictionary is generated by randomly extracting 256 non-repeating characters in a character set allowed by the short message (for example, Unicode in China), and generating a dictionary corresponding to a range that a byte can represent, for example, in a character set allowed by the short message.
  • the 256 non-repeating characters generated by the dictionary are randomly selected: "One E.
  • the above character dictionary is used by traversing the byte array to find a character dictionary according to the value inside, and generating a character string, and when decoding, the character string is restored to a byte array according to the character string and the same character dictionary.
  • a 64-byte byte array will become: the function of the fork, the Baba, the Chuanchuan, the sage, the singer, the Ding Shi, and the sect of the sect.
  • Yangshan has been the king of the king, and the dog is a singer. The length will not increase, but it can already be sent via SMS.
  • the original data is reduced into an array [5, 123456, 48000000, 1418269187005, 863121027176726, 1418269187005, 1418269187005, 1418269187005]; wherein the data type of the array can be adjusted according to the data length, and thus the data type of the array can be further limited to [byte, int, long, long, long, long, long].
  • the data that originally required 142 characters can be expressed, and only 53 bytes can be expressed.
  • the above data becomes a byte array of length 53.
  • AES encryption is performed on the data of the simplified byte array. According to the choice of the AES algorithm, the length will increase a little. In applications, 128-bit encryption is typically used. The byte array of length 53 becomes 64.
  • the data becomes text that can be transmitted by the short message without changing the data length.
  • each data packet can be transmitted in a size of 53 bytes (depending on the encryption method, the length is variable, and the maximum is not more than 70.
  • the protocol can be defined by the protocol itself. More complicated communication.
  • the sending method of the short message according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be through hardware, but many In the case of the former is a better implementation.
  • the technical solution of the present invention which is essential or contributes to the prior art, may be embodied in the form of a software product stored in a storage medium (such as ROM/RAM, disk,
  • the optical disc includes a number of instructions for causing a terminal device (which may be a cell phone, a computer, a server, or a network device, etc.) to perform the methods described in various embodiments of the present invention.
  • Embodiment 2 of the present application can be executed in a mobile terminal, a computer terminal or the like.
  • running on a computer terminal can be implemented by a hardware block diagram of the computer terminal shown in FIG. 1.
  • FIG. 3 is a flowchart of a method for receiving short information according to Embodiment 2 of the present invention. As shown in FIG. 3, the method includes the following steps:
  • Step S302 receiving short information from the sender
  • the short message may be the short message sent in the foregoing Embodiment 1, and the short message may be expressed in character data encoded by a pre-stored character set, or a simplified, encrypted, and pre-stored character set.
  • the character data after encoding is performed, but is not limited thereto.
  • Step S304 searching for byte data corresponding to the message content of the short message from the pre-stored character set; wherein the character set includes: preset byte data, preset characters, and preset byte data and preset The mapping relationship between characters;
  • the pre-stored character set may be determined by selecting a preset number of characters according to a preset rule from a character set supported by the short message, and the selected characters are not repeated, and establishing each byte data and a preset number of characters The mapping relationship of the selected characters.
  • the character set supported by the short message may be a character set supporting transmission of unicode.
  • selecting a preset number of characters from the character set may be selected according to a certain rule, or may be randomly selected, as long as the preset number is extracted. Characters are not repeated.
  • the preset number may be 256, that is, a range that one byte can represent.
  • the technique can be changed to the left.
  • the right stone is covered with the dragon.
  • the East Card is occupied by the old Shuai and the head of the eye is called the ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ Lost in the hills and pays for the griefs of the celestial ceremonies.
  • the mapping relationship between the position of the character in the pre-stored character set or the sequence number and the character may be a mapping relationship between each byte data and the preset number of selected characters, but is not limited thereto.
  • step S304 may include: searching a byte array corresponding to the message content from the pre-stored character set, wherein an element in the byte array is determined by a value of the string, and the string is used for Represents the original message content of the short message.
  • Step S306 restoring the found byte data to the original message content of the short message.
  • the character data of the received short message is [the hair is not forked, the dog is specialized, the horse blade is in the middle of the horse, the horse is not in the vicinity, and the guard is not widely distributed], and the short message is received.
  • the method may be expressed as: searching, in the pre-stored character set, a sequence number or a position of each character in the character data in the pre-stored character set, to find a sequence number of each character in the pre-stored character set in the character data is
  • the result of the above character data search is byte data [114, 86, 50, 67, 88, 81, 54, 78, 68, 65, 66, 104, 114, 71, 108, 76, 106, 102, 99, 86, 51, 103, 61, 61]
  • the byte data corresponding to the message content of the short message is searched in the pre-stored character set according to the mapping relationship between the preset byte data and the preset character in the pre-stored character set, and then the search will be performed.
  • the method of restoring the byte data to the original message content of the short message so that the short information encoded by the pre-stored character set is decoded by using the same pre-stored character set, and restored to the original message content of the short message, thereby achieving The purpose of transmitting the message content of the complex communication, thereby solving the technical problem of limited use of the short message due to the limitation of the length of the short message content, and expanding the use range of the short message.
  • the method further includes decrypting the data found from the pre-stored character set to obtain a byte array corresponding to the message content.
  • step S2011 to step S2013 of the preferred embodiment of the method for transmitting short messages in the first embodiment after the short message is sent out through step S2011 to step S2013, the receiver should use the short message after receiving the short message.
  • the same dictionary i.e., the character dictionary of the preferred embodiment
  • decodes each byte data acquires the encrypted data body, and then decrypts the data body. You can get the contents of the packet.
  • the method for receiving short messages according to the above embodiments can be implemented by means of software plus a necessary general hardware platform, and of course, can also be through hardware, but many In the case of the former is a better implementation.
  • the technical solution of the present invention which is essential or contributes to the prior art, may be embodied in the form of a software product stored in a storage medium (such as ROM/RAM, disk,
  • the optical disc includes a number of instructions for causing a terminal device (which may be a cell phone, a computer, a server, or a network device, etc.) to perform the methods described in various embodiments of the present invention.
  • FIG. 4 is a block diagram of a structure of a short message sending apparatus according to an embodiment of the present invention, as shown in FIG. , the device includes:
  • the converting module 42 is configured to convert the message content of the short message to be sent into byte data
  • FIG. 5 is a block diagram showing the structure of a short message sending apparatus according to an embodiment of the present invention.
  • the converting module 42 includes: an obtaining unit 422, configured to acquire a content corresponding to the message content.
  • the characterizing unit 424 is connected to the obtaining unit 422 for extracting the value of the character string;
  • the constructing unit 426 is connected to the extracting unit 424, and is configured to use the extracted values as constituent elements of the array to form a byte array.
  • the elements in the byte array are treated as byte data.
  • the conversion module 42 extracts the value of the character string corresponding to the message content to simplify the character string, and generates a byte array, which reduces the length of the message content that needs to be sent to a certain extent. It should be noted that if the content of the short message to be sent is not simplified, the length of the short message can be transmitted after the encoding by the conventional encoding or the pre-stored character set below, and the simplified process may not be performed. Instead, the message content is directly converted to byte data. Thus, the above extraction module 424 is optional.
  • FIG. 6 is a structural block diagram 3 of the short message sending apparatus according to the embodiment of the present invention.
  • the apparatus further includes: an adjustment module 62, coupled to the conversion module 42, configured to adjust data types of each of the constituent elements according to a byte length of each constituent element in the byte array, wherein different data types have different Byte length.
  • the adjustment module 62 is connected to the construction unit 426 in the conversion module 42.
  • the length of the string is 142 characters.
  • the extracting unit 424 extracts each value in the string, and obtains an array of [5,48000000, 1418269187005, 863121027176726, 123456, 1418269187005, 1418269187005, 1418269187005], and the adjusting module 62 according to the array
  • the data length of each component element can be adapted to the data type of each component element. For example, if the first component element is 5, then it can be represented by only 1 byte, then the first component can be composed.
  • the data type of the element is limited to the byte type, and the data type need not be limited to the int type or the long type.
  • the query module 44 is connected to the conversion module 42 and is configured to search for characters corresponding to the byte data from the pre-stored character set to obtain character data, where the character set includes: preset byte data, preset characters, and pre- The mapping relationship between the set byte data and the preset character, and the preset character is a character supported by the short message;
  • the pre-stored character set is determined by selecting a preset number of characters according to a preset rule from a character set supported by the short message, and the selected characters are not repeated, and each byte data and a preset number are selected.
  • the character set supported by the short message may be a character set supporting transmission of unicode.
  • selecting a preset number of characters from the character set may be selected according to a certain rule, or may be randomly selected, as long as the preset number is extracted. Characters are not repeated.
  • the preset number may be 256, that is, a range that one byte can represent.
  • the mapping relationship between the position of the character in the pre-stored character set or the sequence number and the character may be a mapping relationship between each byte data and the preset number of selected characters, but is not limited thereto.
  • the sending module 46 is configured to send the character data in the form of short messages.
  • the apparatus of the foregoing embodiment is assumed to be: the pre-stored character set is the pre-stored character set in the foregoing embodiment, and the byte array is corresponding to one character in the pre-stored character set by the value of each byte in the byte array.
  • the encoding it becomes: b, no, cf, art, special horse blade, r, the king, no pqo, no m, less guard, the length is 24. That is to say the character data is: b not cf Yiyi special horse blade learning r Mao Wang no pqo not m less Weiwei. Therefore, by using the pre-stored character set in the embodiment of the present invention for encoding, the length of the short message content sent by the short message is greatly reduced, thereby increasing the complexity of the message content, thereby expanding the use range of the short message.
  • the byte data converted into the short message content can be converted into the text that can be transmitted by the short message without increasing the data length, thereby achieving the purpose of transmitting the message content of the complex communication. Further, the technical problem of limited use of short messages caused by the limitation of the length of the short message content is solved, and the use range of the short information is expanded.
  • FIG. 7 is a block diagram showing the structure of a short message transmitting apparatus according to an embodiment of the present invention.
  • the apparatus further includes an encryption module 72 coupled to the conversion module 42 for pairing elements in the byte array. Encrypt.
  • the cryptographic module 72 can encrypt the elements in the byte array by using the AES algorithm.
  • the AES algorithm is an algorithm in the prior art, and details are not described herein again. After being encrypted by the AES algorithm, the length of the byte array may be increased to a certain extent.
  • 128-bit encryption may be used, and the encrypted byte array may have a certain degree of increase, but in the present invention
  • the length of the message content of the short message to be sent during the transmission process is shortened, so that the message of the short message can be encrypted to ensure that the message content of the short message is in the transmission process. safety.
  • the embodiment of the present invention is mainly used to solve the problem that when the length of the byte array itself is smaller than the length of a short message, but the length of the byte array exceeds the length of a short message after the conventional encoding, such as base64 encoding, the embodiment of the present invention passes the foregoing apparatus.
  • the query module 44 uses the pre-stored character set for encoding without using the conventional encoding method, so that when the byte array becomes text that can be transmitted by the short message, the data length thereof is not increased, and thus can be transmitted by a short message.
  • FIG. 8 is a block diagram showing the structure of a short message receiving apparatus according to an embodiment of the present invention. As shown in FIG. 8, the apparatus includes:
  • the receiving module 82 is configured to receive short messages from the sender
  • the short message may be represented by character data encoded by a pre-stored character set, or character data after being encoded by a simplified, encrypted, and pre-stored character set, but is not limited thereto.
  • the query module 84 is connected to the receiving module 82, and is configured to search, from the pre-stored character set, byte data corresponding to the message content of the short message; wherein the character set includes: preset byte data, preset characters, and pre- a mapping relationship between the set byte data and the preset characters;
  • the pre-stored character set may be determined by selecting a preset number of characters according to a preset rule from a character set supported by the short message, and the selected characters are not repeated, and establishing each byte data and a preset number of characters The mapping relationship of the selected characters.
  • the character set supported by the short message may be a character set supporting transmission of unicode.
  • selecting a preset number of characters from the character set may be selected according to a certain rule, or may be randomly selected, as long as the preset number is extracted. Characters are not repeated.
  • the preset number may be 256, that is, a range that one byte can represent.
  • the mapping relationship between the position of the character in the pre-stored character set or the sequence number and the character may be a mapping relationship between each byte data and the preset number of selected characters, but is not limited thereto.
  • the query module 84 is further configured to search, from a pre-stored character set, a byte array corresponding to the message content, where an element in the byte array is determined by a value of a string, and the string is used by The original message content indicating the short message.
  • the restore module 86 is coupled to the query module 84 for restoring the found byte data to the original message content of the short message.
  • the query module 84 is in the pre-stored character Concentrating, searching for the serial number or position of each character in the character data in the pre-stored character set, to find the serial number of each character in the character data in the pre-stored character set as an example, the result of the above character data is Byte data [114, 86, 50, 67, 88, 81, 54, 78, 68, 65, 66, 104, 114, 71, 108, 76, 106, 102, 99, 86, 51, 103, 61, 61], and the raw data corresponding to the byte data
  • the byte data corresponding to the message content of the short message is searched in the pre-stored character set according to the mapping relationship between the preset byte data and the preset character in the pre-stored character set, and then the search will be performed.
  • the method of restoring the byte data to the original message content of the short message so that the short information encoded by the pre-stored character set is decoded by using the same pre-stored character set, and restored to the original message content of the short message, thereby achieving The purpose of transmitting the message content of the complex communication, thereby solving the technical problem of limited use of the short message due to the limitation of the length of the short message content, and expanding the use range of the short message.
  • FIG. 9 is a block diagram showing the structure of a short message receiving apparatus according to an embodiment of the present invention.
  • the apparatus further includes: a decrypting module 92 connected to the query module 84 for searching from a pre-stored character set. The data is decrypted to obtain a byte array corresponding to the content of the message.
  • the process of decryption is the reverse process of the encryption process when sending the short message, and the encryption is performed when the short message is sent, then the decryption is needed during the receiving process, and if the encryption is not performed at the time of sending, Decryption is also not required during reception, so the decryption module is optional.
  • Embodiments of the present invention may provide a computer terminal, which may be any one of computer terminal groups.
  • the foregoing computer terminal may also be replaced with a terminal device such as a mobile terminal.
  • the computer terminal may be located in at least one network device of the plurality of network devices of the computer network.
  • the computer terminal may execute the program code of the following steps in the method for transmitting short information of the application program: converting the message content of the short message to be converted into byte data; and searching for byte data from the pre-stored character set. Corresponding characters are obtained, wherein the character set includes: preset byte data, preset characters, and a mapping relationship between preset byte data and preset characters, and the preset characters are short. Characters supported by the message; character data is sent as a short message.
  • FIG. 10 is a structural block diagram of a computer terminal according to Embodiment 5 of the present invention.
  • the computer terminal A may include: one or more (only one shown in the figure) processor 101, memory 103, And a transmission module 105.
  • the memory 103 can be used to store software programs and modules, such as the method for transmitting short messages and the program instructions/modules corresponding to the devices in the embodiment of the present invention.
  • the processor 101 runs the software programs and modules stored in the memory 103, thereby The above-described method of transmitting short messages is implemented by performing various function applications and data processing.
  • Memory 103 may include high speed random access memory, and may also include non-volatile memory such as one or more magnetic storage devices, flash memory, or other non-volatile solid state memory.
  • memory 103 can further include memory remotely located relative to processor 101, which can be connected to terminal A over a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
  • the above transmission module 105 is for receiving or transmitting data via a network.
  • Specific examples of the above network may include a wired network and a wireless network.
  • the transport module 105 includes a Network Interface Controller (NIC) that can be connected to other network devices and routers via a network cable to communicate with the Internet or a local area network.
  • the transmission module 105 is a Radio Frequency (RF) module for communicating with the Internet wirelessly.
  • NIC Network Interface Controller
  • RF Radio Frequency
  • the memory 103 is configured to store preset action conditions and information of the preset rights user, and an application.
  • the memory 103 is configured to store program code for implementing the following steps: acquiring a character string corresponding to the message content; extracting the value of the string; and extracting each value as a constituent element of the array to form a byte array, and The elements in the byte array are treated as byte data.
  • the memory 103 is further configured to store program code for implementing the following steps: adjusting the data type of each component element according to the byte length of each component element in the byte array, wherein different data types have different Byte length.
  • a solution for a method for transmitting short messages of an application program by a computer terminal is provided. Converting the message content of the short message to be converted into byte data, and searching according to the mapping relationship between the preset byte data and the preset character in the pre-stored character set in the pre-stored character set and converting the message content The character data corresponding to the byte data is then sent in the form of short message, so that the byte data converted into the message content of the short message can be converted into a short message without increasing the data length.
  • the transmitted text achieves the purpose of transmitting the message content of the complex communication, thereby solving the technical problem of limited use of the short message due to the limitation of the length of the short message content, and expanding the use range of the short message.
  • FIG. 10 is merely illustrative, and the computer terminal can also be a smart phone (such as an Android mobile phone, an iOS mobile phone, etc.), a tablet computer, an applause computer, and a mobile Internet device (Mobile Internet Devices, MID). ), PAD and other terminal devices.
  • FIG. 10 does not limit the structure of the above electronic device.
  • computer terminal A may also include more or fewer components than shown in FIG. 10 (eg, a network interface, A display device or the like) or has a configuration different from that shown in FIG.
  • Embodiments of the present invention may provide a computer terminal, which may be any one of computer terminal groups.
  • the foregoing computer terminal may also be replaced with a terminal device such as a mobile terminal.
  • the computer terminal may be located in at least one network device of the plurality of network devices of the computer network.
  • the computer terminal may execute the program code of the following steps in the method for receiving short information of the application program: receiving short information from the sender; and searching for bytes corresponding to the message content of the short message from the pre-stored character set. Data; wherein the character set includes: preset byte data, preset characters, and a mapping relationship between the preset byte data and the preset characters; and restoring the found byte data to the short message Original message content.
  • the structure of the computer terminal in the embodiment of the present invention may be the same as or different from the structure of the computer terminal in the foregoing embodiment 5.
  • the transmission module 105 in the embodiment 5 may be used to receive the short message.
  • a receiving module independent of the transmission module 105 can be separately provided.
  • the computer terminal in the fifth embodiment is used to execute the program code of the steps in the short message transmission method
  • the computer terminal in the present embodiment is used to execute the program code of the steps in the short message reception method.
  • the memory 103 may further store program code for implementing the following steps: searching a byte array corresponding to the message content from the pre-stored character set, wherein the elements in the byte array are determined by the value of the string, and The string is used to represent the original message content of the short message.
  • the embodiment of the present invention provides a solution for a method for receiving short messages of an application program by using a mapping relationship between preset byte data and preset characters in a pre-stored character set.
  • the pre-stored character set finds the byte data corresponding to the message content of the short message, and then restores the found byte data to the original message content of the short message, thereby making the short message encoded by the pre-stored character set used.
  • the same pre-stored character set is decoded and restored to the original message content of the short message, thereby realizing the purpose of transmitting the message content of the complex communication, thereby solving the technology that the use range of the short message is limited due to the limitation of the length of the short message content.
  • the problem has expanded the use of short messages.
  • Embodiments of the present invention also provide a storage medium.
  • the foregoing storage medium may be used to save the program code executed by the sending method of the short information provided in the first embodiment.
  • the foregoing storage medium may be located in any one of the computer terminal groups in the computer network, or in any one of the mobile terminal groups.
  • the storage medium is configured to store program code for performing the following steps: converting the message content of the short message to be sent into byte data; searching from the pre-stored character set to correspond to the byte data Characters, which obtain character data, wherein the character set includes: preset byte data, preset characters, and a mapping relationship between preset byte data and preset characters, and the preset characters are short messages. Supported characters; send character data in the form of short messages.
  • any one of the above computer terminal groups can establish a communication relationship with the website server and the scanner, and the scanner can scan the value command of the web application executed by php on the computer terminal.
  • Embodiments of the present invention also provide a storage medium.
  • the foregoing storage medium may be used to save the program code executed by the receiving method of the short information provided in the first embodiment.
  • the foregoing storage medium may be located in any one of the computer terminal groups in the computer network, or in any one of the mobile terminal groups.
  • the storage medium is configured to store program code for performing the following steps: receiving short information from the sender; and searching for byte data corresponding to the message content of the short message from the pre-stored character set
  • the character set includes: preset byte data, preset characters, and a mapping relationship between the preset byte data and the preset characters; restoring the found byte data to the original of the short message; Message content.
  • any one of the above computer terminal groups can establish a communication relationship with the website server and the scanner, and the scanner can scan the value command of the web application executed by php on the computer terminal.
  • the disclosed client may be implemented in other manners.
  • the device embodiments described above are merely illustrative.
  • the division of the unit is only a logical function division.
  • multiple units or components may be combined or may be Integrate into another system, or some features can be ignored or not executed.
  • Another point, shown or discussed The coupling or direct coupling or communication connection between the two may be an indirect coupling or communication connection through some interfaces, units or modules, and may be in an electrical or other form.
  • the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
  • each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
  • the above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
  • the integrated unit if implemented in the form of a software functional unit and sold or used as a standalone product, may be stored in a computer readable storage medium.
  • the technical solution of the present invention which is essential or contributes to the prior art, or all or part of the technical solution, may be embodied in the form of a software product stored in a storage medium.
  • a number of instructions are included to cause a computer device (which may be a personal computer, server or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention.
  • the foregoing storage medium includes: a U disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic disk, or an optical disk, and the like. .

Abstract

本发明公开了一种短信息的发送、接收方法及装置。其中,该方法包括:将待发短信息的消息内容转换成字节数据;从预存的字符集中查找与字节数据对应的字符,得到字符数据,其中,字符集包括:预设的字节数据、预设的字符、以及预设的字节数据与预设的字符之间的映射关系,预设的字符为短信息所支持的字符;通过短信息的形式发送字符数据。本发明解决了由于短信内容长度的限制而造成的短信使用范围有限的技术问题。

Description

短信息的发送、接收方法及装置
本申请要求2015年08月13日递交的申请号为201510498533.1、发明名称为“短信息的发送、接收方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本发明涉及互联网技术领域,具体而言,涉及一种短信息的发送、接收方法及装置。
背景技术
服务器与客户端最常用的通信方式就是建立网络链接,但是在有一些环境下没有网络链接,在这种情况下,可以通过短信使客户端与服务器端进行数据通讯。此外,短信也应用于一些针对手机号码的通讯。然而一般地,短信只支持传输Unicode的文本内容,长度为70,由于短信有长度限制,以及内容公开可读。使它作为复杂通讯能发送的内容受到很大的限制。
相关技术提供的一种手机防盗的方案是通过亲友手机向目标手机发送指令。但是,由于短信的诸多限制,目前它们的实现方式仅发送预先规定的指令code,也无法携带更具体的参数,其安全和使用范围非常有限。
针对上述的问题,目前尚未提出有效的解决方案。
发明内容
本发明实施例提供了一种短信息的发送、接收方法及装置,以至少解决由于短信内容长度的限制而造成的短信使用范围有限的技术问题。
根据本发明实施例的一个方面,提供了一种短信息的发送方法,包括:将待发短信息的消息内容转换成字节数据;从预存的字符集中查找与字节数据对应的字符,得到字符数据,其中,字符集包括:预设的字节数据、预设的字符、以及预设的字节数据与预设的字符之间的映射关系,预设的字符为短信息所支持的字符;通过短信息的形式发送字符数据。
根据本发明实施例的另一方面,还提供了一种短信息的接收方法,包括:接收来自发送方的短信息;从预存的字符集中查找与短信息的消息内容对应的字节数据;其中,字符集包括:预设的字节数据、预设的字符、以及预设的字节数据与预设的字符之间的 映射关系;将查找到的字节数据还原为短信息的原始消息内容。
根据本发明实施例的另一方面,还提供了一种短信息的发送装置,包括:转换模块,用于将待发短信息的消息内容转换成字节数据;查询模块,用于从预存的字符集中查找与字节数据对应的字符,得到字符数据,其中,字符集包括:预设的字节数据、预设的字符、以及预设的字节数据与预设的字符之间的映射关系,预设的字符为短信息所支持的字符;发送模块,用于通过短信息的形式发送字符数据。
根据本发明实施例的另一方面,还提供了一种短信息的接收装置,包括:接收模块,用于接收来自发送方的短信息;查询模块,用于从预存的字符集中查找与短信息的消息内容对应的字节数据;其中,字符集包括:预设的字节数据、预设的字符、以及预设的字节数据与预设的字符之间的映射关系;还原模块,用于将查找到的字节数据还原为短信息的原始消息内容。
在本发明实施例中,采用将待发短信息的消息内容转换成字节数据,根据预存的字符集中的预设的字节数据与预设的字符之间的映射关系在该预存的字符集中查找与上述将消息内容转化后的字节数据对应的字符数据,然后通过短信息的形式发送这些字符数据的方式,进而使得在数据长度不增加的情况下,将短信息的消息内容转换为的字节数据转变为短信可传输的文本,达到了能够传输复杂通讯的消息内容的目的,进而解决了由于短信内容长度的限制而造成的短信使用范围有限的技术问题,扩大了短信息的使用范围。
附图说明
此处所说明的附图用来提供对本发明的进一步理解,构成本申请的一部分,本发明的示意性实施例及其说明用于解释本发明,并不构成对本发明的不当限定。在附图中:
图1是本发明实施例的一种短信息的发送方法的计算机终端的硬件结构框图;
图2是根据本发明实施例1的短信息的发送方法的流程图;
图3是根据本发明实施例2的短信息的接收方法的流程图;
图4是本发明实施例的短信息的发送装置的结构框图一;
图5是本发明实施例的短信息的发送装置的结构框图二;
图6是本发明实施例的短信息的发送装置的结构框图三;
图7是本发明实施例的短信息的发送装置的结构框图四;
图8是本发明实施例的短信息的接收装置的结构框图一;
图9是本发明实施例的短信息的接收装置的结构框图二;
图10是根据本发明实施例5的一种计算机终端的结构框图。
具体实施方式
为了使本技术领域的人员更好地理解本发明方案,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分的实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都应当属于本发明保护的范围。
需要说明的是,本发明的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的本发明的实施例能够以除了在这里图示或描述的那些以外的顺序实施。此外,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含,例如,包含了一系列步骤或单元的过程、方法、系统、产品或设备不必限于清楚地列出的那些步骤或单元,而是可包括没有清楚地列出的或对于这些过程、方法、产品或设备固有的其它步骤或单元。
实施例1
根据本发明实施例,还提供了一种短信息的发送的方法实施例,需要说明的是,在附图的流程图示出的步骤可以在诸如一组计算机可执行指令的计算机系统中执行,并且,虽然在流程图中示出了逻辑顺序,但是在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤。
本申请实施例1所提供的方法实施例可以在移动终端、计算机终端或者类似的运算装置中执行。以运行在计算机终端上为例,图1是本发明实施例的一种短信息的发送方法的计算机终端的硬件结构框图。如图1所示,计算机终端10可以包括一个或多个(图中仅示出一个)处理器102(处理器102可以包括但不限于微处理器MCU或可编程逻辑器件FPGA等的处理装置)、用于存储数据的存储器104、以及用于通信功能的传输模块106。本领域普通技术人员可以理解,图1所示的结构仅为示意,其并不对上述电子装置的结构造成限定。例如,计算机终端10还可包括比图1中所示更多或者更少的组件,或者具有与图1所示不同的配置。
存储器104可用于存储应用软件的软件程序以及模块,如本发明实施例中的短信息的发送方法对应的程序指令/模块,处理器102通过运行存储在存储器104内的软件程序以及模块,从而执行各种功能应用以及数据处理,即实现上述的应用程序的短信息的发送方法。存储器104可包括高速随机存储器,还可包括非易失性存储器,如一个或者多个磁性存储装置、闪存、或者其他非易失性固态存储器。在一些实例中,存储器104可进一步包括相对于处理器102远程设置的存储器,这些远程存储器可以通过网络连接至计算机终端10。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。
传输模块106用于经由一个网络接收或者发送数据。上述的网络具体实例可包括计算机终端10的通信供应商提供的无线网络。在一个实例中,传输模块106包括一个网络适配器(Network Interface Controller,NIC),其可通过基站与其他网络设备相连从而可与互联网进行通讯。在一个实例中,传输模块106可以为射频(Radio Frequency,RF)模块,其用于通过无线方式与互联网进行通讯。
在上述运行环境下,本申请提供了如图2所示的短信息的发送方法。图2是根据本发明实施例1的短信息的发送方法的流程图,如图2所示,该方法包括以下步骤:
步骤S202,将待发短信息的消息内容转换成字节数据;
需要说明的是,将待发短信息的消息内容转换成字节数据的方式可以有多种,在一个优选的实施例中,可以通过以下方式实现:获取与消息内容对应的字符串;提取上述字符串的取值;将提取的各个取值作为数组的组成元素,构成字节数组,并将字节数组中的元素作为字节数据。通过提取该消息内容对应的字符串的取值对该字符串进行简化,生成一个字节数组,在一定程度上减少了需要发送的消息内容的长度。需要说明的是,如果待发送的短信息内容通过传统编码或者下文的预存的字符集进行编码后不会超出一个短信息能够发送的长度的话,也可以不执行这种简化流程,而是直接将消息内容转化为字节数据。
在本发明实施例中,可以对上述字节数组中的组成元素的数据类型进行自适应定义,在一个优选的实施例中,可以按照上述字节数组中各个组成元素的字节长度来调整各个组成元素的数据类型,其中,不同的数据类型具有不同的字节长度。通过上述自适应定义字节数据中的数据类型的方式,可以节省字节数组所需要的字节数。
以短信息的消息内容对应的字符串为“[command=5,cmdid=48000000,timestamp=1418269187005,imei=863121027176726,pwd=123456,data1=1418269187005,dat a2=1418269187005,data3=1418269187005]”为例,该字符串的长度为142个字符,在具体实施例中,对上述字符串,提取该字符串中的各个取值,得到数组为[5,48000000,1418269187005,863121027176726,123456,1418269187005,1418269187005,1418269187005],根据该数组中的每个组成元素的数据长度,可以自适应每个组成元素的数据类型,比如第一个组成元素为5,那么其只需要1个字节就能够表示,那么可以将该第一个组成元素的数据类型限制为byte型的,无需将数据类型限制为int型或者long型的,对于其他的组成元素采用类似的方法自适应定义该组成元素的数据类型;对于上述数组,通过自适应定义数据类型的方式,该数组的组成元素的数据类型分别为:[byte,long,long,long,int,long,long,long],由此可以看出,此时的数组只需要53个字节就能够表达。通过该优选实施例,可以看出,经过上述处理方法,使得原本需要142个字符才能表达的数据,只需要53个字节就能表示,同时,上面的数据就变成了一个长度为53的字节数组。
步骤S204,从预存的字符集中查找与字节数据对应的字符,得到字符数据,其中,字符集包括:预设的字节数据、预设的字符、以及预设的字节数据与预设的字符之间的映射关系,预设的字符为短信息所支持的字符;
需要说明的是,上述预存的字符集可以通过以下方式确定:从短信息所支持的字符集中按照预设规则选择预设数量的字符,且被选择的字符不重复,并建立各个字节数据与预设数量的被选择的字符的映射关系。上述短信息所支持的字符集可以是支持传输unicode的字符集,另外,从该字符集中选择预设数量的字符可以是按照一定的规则进行选择,也可以随意抽取,只要抽取的预设数量的字符是不重复的即可。优选地,预设数量可以是256,即一个byte能够表示的范围。
比如,从unicode的字符集中选择256个不重复的字符,得到预存的字符集为:一乙二十丁厂七卜人入八九几儿了力乃刀又三于干亏士工土才寸下大丈与万上小口巾山千乞川亿个勺久凡及夕丸么广亡门义之尸弓己已子卫也女飞刃习叉马乡丰王井开夫天无元专云扎艺木五支厅不太犬区历尤友匹车巨牙屯比互切瓦止少日中冈贝内水见午牛手毛气升长仁什片仆化仇币仍仅斤爪反介父从今凶分乏公仓月氏勿欠风丹匀乌凤勾文六方火为斗忆订计户认心尺引丑巴孔队办以允予劝双书幻玉刊示末未击打巧正扑扒功扔去甘世古节本术可丙左厉右石布龙平灭轧东卡北占业旧帅归且旦目叶甲申叮电号田由史只央兄叼叫另叨叹四生失禾丘付仗代仙们仪白仔他斥瓜乎丛令用甩印乐。其中,每个字符在该预存的字符集中的位置或者顺序序号与该字符之间的映射关系可以为各个字节数据与所述 预设数量的被选择的字符的映射关系,但不限于此。
步骤S206,通过短信息的形式发送字符数据。
以发送的短信息的消息内容对应的数据为:{pwd=12345}为例,转变成这样的
一个byte数组,例如:[114,86,50,67,88,81,54,78,68,65,66,104,114,71,108,76,
106,102,99,86,51,103,61,61],如果把这个byte数组的内容当作String传输,则它的长度是80,已经超过一条短信了,通过上述实施例的方式,假设上述预存的字符集是上述实施例中的预存的字符集,通过byte数组中的每个byte的值在上述预存的字符集中对应一个字符,那么上述byte数组经过编码之后为变为:毛不么叉犬艺义专马刃习日毛王内无冈止互不广少卫卫,长度是24。即得到的字符数据为:毛不么叉犬艺义专马刃习日毛王内无冈止互不广少卫卫。因而,通过使用本发明实施例中的预存的字符集进行编码,使得通过短信发送的短信息内容的长度大大减少,进而增加了该消息内容的复杂度,进而扩大了短信息的使用范围。
通过上述步骤,采用将待发短信息的消息内容转换成字节数据,根据预存的字符集中的预设的字节数据与预设的字符之间的映射关系在该预存的字符集中查找与上述将消息内容转化后的字节数据对应的字符数据,然后通过短信息的形式发送这些字符数据的方式,进而使得在数据长度不增加的情况下,将短信息的消息内容转换为的字节数据转变为短信可传输的文本,达到了能够传输复杂通讯的消息内容的目的,进而解决了由于短信内容长度的限制而造成的短信使用范围有限的技术问题,扩大了短信息的使用范围。
在本发明实施例中,在步骤S204之前,上述方法还包括:对上述字节数组中的元素进行加密。
需要说明的是,可以通过AES算法对上述字节数组中的元素进行加密,AES算法是现有技术中的算法,此处不再赘述。通过AES算法加密之后,字节数组的长度会有一定程度的增加,在一个优选的实施例中,可以使用128位的加密,加密后的字节数组可能有一定程度的增加,但是在本发明实施例中能够通过对字节数组进行加密使得在传输的过程中待发送的短信息的消息内容的长度会缩短,因而可以对短信息的消息进行加密,保证短信息的消息内容在传输过程的安全性。
需要说明的是,本发明实施例主要用于解决当byte数组的长度本身小于一条短信的长度,但是经过传统编码比如base64编码后其长度会超出一条短信长度的情况,本发明实施例通过使用前文介绍的预存的字符集进行编码,而不使用传统的编码方式,使得byte数组变为短信息可传输的文本时,其数据长度未变,因而可以通过一条短信息进行传输。
为了更好的理解本发明,以下结合优选的实施例对本发明上述实施例作进一步的解释。
本发明实施例所提供的优选实施例会对数据进行简化,加密,编码等处理,处理后的内容就可以通过短信发送了。
在采用本发明的优选实施例之前,需要进行字符字典(相当于图1步骤S204中的预存的字符集)的生成与使用,字符字典是本发明实施例的原创,是解决短信发送byte数据的关键。
上述字符字典的生成方法是,在短信允许的字符集里(如中国是Unicode)随意抽取256个不重复字符,生成一个字典,对应一个byte能表示的范围,例如,在短信允许的字符集里随意抽取的256个不重复字符生成的字典为:"一乙二十丁厂七卜人入八九几儿了力乃刀又三于干亏士工土才寸下大丈与万上小口巾山千乞川亿个勺久凡及夕丸么广亡门义之尸弓己已子卫也女飞刃习叉马乡丰王井开夫天无元专云扎艺木五支厅不太犬区历尤友匹车巨牙屯比互切瓦止少日中冈贝内水见午牛手毛气升长仁什片仆化仇币仍仅斤爪反介父从今凶分乏公仓月氏勿欠风丹匀乌凤勾文六方火为斗忆订计户认心尺引丑巴孔队办以允予劝双书幻玉刊示末未击打巧正扑扒功扔去甘世古节本术可丙左厉右石布龙平灭轧东卡北占业旧帅归且旦目叶甲申叮电号田由史只央兄叼叫另叨叹四生失禾丘付仗代仙们仪白仔他斥瓜乎丛令用甩印乐"。
上述字符字典的使用方法是,遍历byte数组根据里面的值查找字符字典,生成字符串,解码的时候根据字符串以及同一份字符字典还原成byte数组。
例如:经过编码后,一个64个字节的byte数组就会变为:功见叉贝巴川川丘生士号予户丁世劝木从与户文申厂王区凤东示仁日文于术央山已东王比工犬订乏乐大们口丈末亿乎艺甩且贝才女友广乙卡风占气。长度不会增加,但已经能通过短信发送了。
下面是整个短信处理的流程,包括以下步骤:
S2011,简化
原始数据:[command=5,cmdid=48000000,timestamp=1418269187005,imei=863121027176726,pwd=123456,data1=1418269187005,data2=1418269187005,data3=1418269187005],长度为142;
将该原始数据简化成数组[5,123456,48000000,1418269187005,863121027176726,1418269187005,1418269187005,1418269187005];其中,可以根据数据长度调整该数组的数据类型,因而该数组的数据类型可以进一步限制为 [byte,int,long,long,long,long,long,long]。
经过简化处理后原本需要142个字符才能表达的数据,只需要53个byte就能表示。由此上面的数据就变成了一个长度为53的byte数组。
S2012,加密
对简化后的byte数组的数据进行AES加密。根据AES算法的选择,长度会有一点增加。在应用中,一般使用128位的加密。长度为53的byte数组变为了64。
S2013,编码
64个字节的byte数组如果直接转换成string会变成乱码,在短信上无法识别。使用常用的base64编码后。数据长度会增加,64字节的数据会变为90字节。已经超过了一条短信能传输的长度。
但是通过上述优选实施例介绍的字符字典进行编码,就可以在数据长度未变的情况下,数据变为短信可传输的文本。
根据本发明优选实施例,每个数据包能传输的大小达到53个字节(根据采用加密方式不同,这个长度可变,最高不超过70。在这个长度里,可以用协议自己定义格式,完成更复杂的通讯。
需要说明的是,对于前述的各方法实施例,为了简单描述,故将其都表述为一系列的动作组合,但是本领域技术人员应该知悉,本发明并不受所描述的动作顺序的限制,因为依据本发明,某些步骤可以采用其他顺序或者同时进行。其次,本领域技术人员也应该知悉,说明书中所描述的实施例均属于优选实施例,所涉及的动作和模块并不一定是本发明所必须的。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到根据上述实施例的短信息的发送方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,或者网络设备等)执行本发明各个实施例所述的方法。
实施例2
根据本发明实施例,还提供了一种短信息的接收的方法实施例,需要说明的是,在附图的流程图示出的步骤可以在诸如一组计算机可执行指令的计算机系统中执行,并且, 虽然在流程图中示出了逻辑顺序,但是在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤。
本申请实施例2所提供的方法实施例可以在移动终端、计算机终端或者类似的运算装置中执行。以运行在计算机终端上为例,其可以通过图1所示的计算机终端的硬件结构框图进行实现。
在上述运行环境下,本申请提供了如图3所示的短信息的接收方法。图3是根据本发明实施例2的短信息的接收方法的流程图,如图3所示,该方法包括以下步骤:
步骤S302,接收来自发送方的短信息;
需要说明的是,上述短信息可以是上述实施例1中发送的短信息,该短信息的表现形式可以为经过预存的字符集进行编码后的字符数据,或者经过简化、加密以及预存的字符集进行编码之后的字符数据,但不限于此。
步骤S304,从预存的字符集中查找与短信息的消息内容对应的字节数据;其中,字符集包括:预设的字节数据、预设的字符、以及预设的字节数据与预设的字符之间的映射关系;
上述预存的字符集可以通过以下方式确定:从短信息所支持的字符集中按照预设规则选择预设数量的字符,且被选择的字符不重复,并建立各个字节数据与预设数量的被选择的字符的映射关系。上述短信息所支持的字符集可以是支持传输unicode的字符集,另外,从该字符集中选择预设数量的字符可以是按照一定的规则进行选择,也可以随意抽取,只要抽取的预设数量的字符是不重复的即可。优选地,预设数量可以是256,即一个byte能够表示的范围。
比如,从unicode的字符集中选择256个不重复的字符,得到预存的字符集为:一乙二十丁厂七卜人入八九几儿了力乃刀又三于干亏士工土才寸下大丈与万上小口巾山千乞川亿个勺久凡及夕丸么广亡门义之尸弓己已子卫也女飞刃习叉马乡丰王井开夫天无元专云扎艺木五支厅不太犬区历尤友匹车巨牙屯比互切瓦止少日中冈贝内水见午牛手毛气升长仁什片仆化仇币仍仅斤爪反介父从今凶分乏公仓月氏勿欠风丹匀乌凤勾文六方火为斗忆订计户认心尺引丑巴孔队办以允予劝双书幻玉刊示末未击打巧正扑扒功扔去甘世古节本术可丙左厉右石布龙平灭轧东卡北占业旧帅归且旦目叶甲申叮电号田由史只央兄叼叫另叨叹四生失禾丘付仗代仙们仪白仔他斥瓜乎丛令用甩印乐。其中,每个字符在该预存的字符集中的位置或者顺序序号与该字符之间的映射关系可以为各个字节数据与所述预设数量的被选择的字符的映射关系,但不限于此。
在本发明的实施例中,步骤S304可以包括:从预存的字符集中查找与消息内容对应的字节数组,其中,字节数组中的元素由字符串的取值确定,并且,字符串用于表示所述短信息的原始消息内容。
步骤S306,将查找到的字节数据还原为短信息的原始消息内容。
以上述预存的字符集为例,假设接收到的短信息的字符数据为[毛不么叉犬艺义专马刃习日毛王内无冈止互不广少卫卫],短信息的接收方法可以表现为:在该预存的字符集中,查找该字符数据中的每个字符在该预存的字符集中的序号或者位置,以查找字符数据中的每个字符在该预存的字符集中的序号为例,上述字符数据查找到的结果为字节数据[114,86,50,67,88,81,54,78,68,65,66,104,114,71,108,76,106,102,99,86,51,103,61,61],而该字节数据对应的原始数据为{pwd=12345},这样就将短信息的原始消息内容还原出来了。
通过上述步骤,采用根据预存的字符集中的预设的字节数据与预设的字符之间的映射关系在该预存的字符集中查找与短信息的消息内容对应的字节数据,然后将将查找到的字节数据还原为短信息的原始消息内容的方式,进而使得经过上述预存的字符集编码的短信息使用相同的该预存的字符集进行解码,还原为短信息的原始消息内容,进而达到了能够传输复杂通讯的消息内容的目的,进而解决了由于短信内容长度的限制而造成的短信使用范围有限的技术问题,扩大了短信息的使用范围。
在本发明的优选实施例中,如果在短信息发送时进行了加密,那么上述方法还包括:对从预存的字符集中查找到的数据进行解密,得到与所述消息内容对应的字节数组。
为了更好的理解本发明,以下结合优选的实施例对本发明上述实施例做进一步的解释。
以上述实施例1中的短信息的发送方法的优选实施例的步骤S2011至步骤S2013为例,在经过步骤S2011至步骤S2013将短信息发送出去后,接收方收到该短信息后,应当使用与上述实施例1中的优选实施例中的同样的字典(即本优选实施例的字符字典),对每个byte数据进行解码,获取出加密后的数据体,然后对数据体进行解密。就可以获取到数据包内容了。
需要说明的是,对于前述的各方法实施例,为了简单描述,故将其都表述为一系列的动作组合,但是本领域技术人员应该知悉,本发明并不受所描述的动作顺序的限制,因为依据本发明,某些步骤可以采用其他顺序或者同时进行。其次,本领域技术人员也应该知悉,说明书中所描述的实施例均属于优选实施例,所涉及的动作和模块并不一定是本发明所必须的。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到根据上述实施例的短信息的接收方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,或者网络设备等)执行本发明各个实施例所述的方法。
实施例3
根据本发明实施例,还提供了一种用于实施上述实施例1的短信息的发送方法的装置,图4是本发明实施例的短信息的发送装置的结构框图一,如图4所示,该装置包括:
转换模块42,用于将待发短信息的消息内容转换成字节数据;
图5是本发明实施例的短信息的发送装置的结构框图二,如图5所示,在一个优选的实施例中,上述转换模块42包括:获取单元422,用于获取与消息内容对应的字符串;提取单元424,与获取单元422连接,用于提取字符串的取值;构建单元426与提取单元424连接,用于将提取的各个取值作为数组的组成元素,构成字节数组,并将字节数组中的元素作为字节数据。通过该转换模块42提取该消息内容对应的字符串的取值对该字符串进行简化,生成一个字节数组,在一定程度上减少了需要发送的消息内容的长度。需要说明的是,如果待发送的短信息内容不进行简化,通过传统编码或者下文的预存的字符集进行编码后不会超出一个短信息能够发送的长度的话,也可以不做这种简化流程,而是直接将消息内容转化为字节数据。因而,上述提取模块424是可选的。
可以对上述字节数组中的组成元素的数据类型进行自适应定义,图6是本发明实施例的短信息的发送装置的结构框图三,如图6所示,在本发明的一个优选实施例中,上述装置还包括:调整模块62,与转换模块42连接,用于按照字节数组中各个组成元素的字节长度调整各个所述组成元素的数据类型,其中,不同的数据类型具有不同的字节长度。通过上述自适应定义字节数据中的数据类型的方式,可以节省字节数组所需要的字节数。
优选地,在本发明实施例中,调整模块62与转换模块42中的构建单元426连接。
以短信息的消息内容对应的字符串为“[command=5,cmdid=48000000,timestamp=1418269187005,imei=863121027176726,pwd=123456,data1=1418269187005,data2=1418269187005,data3=1418269187005]”为例,该字符串的长度为142个字符,在具 体实施例中,对上述字符串,提取单元424提取该字符串中的各个取值,得到数组为[5,48000000,1418269187005,863121027176726,123456,1418269187005,1418269187005,1418269187005],调整模块62根据该数组中的每个组成元素的数据长度,可以自适应每个组成元素的数据类型,比如第一个组成元素为5,那么其只需要1个字节就能够表示,那么可以将该第一个组成元素的数据类型限制为byte型的,无需将数据类型限制为int型或者long型的,对于其他的组成元素采用类似的方法自适应定义该组成元素的数据类型;对于上述数组,通过自适应定义数据类型的方式,该数组的组成元素的数据类型分别为:[byte,long,long,long,int,long,long,long],由此可以看出,此时的数组只需要53个字节就能够表达。通过该优选实施例,可以看出,经过上述处理方法,使得原本需要142个字符才能表达的数据,只需要53个字节就能表示,同时,上面的数据就变成了一个长度为53的字节数组。
查询模块44,与转换模块42连接,用于从预存的字符集中查找与字节数据对应的字符,得到字符数据,其中,字符集包括:预设的字节数据、预设的字符、以及预设的字节数据与预设的字符之间的映射关系,预设的字符为短信息所支持的字符;
上述预存的字符集通过以下方式确定:从短信息所支持的字符集中按照预设规则选择预设数量的字符,且被选择的字符不重复,并建立各个字节数据与预设数量的被选择的字符的映射关系。上述短信息所支持的字符集可以是支持传输unicode的字符集,另外,从该字符集中选择预设数量的字符可以是按照一定的规则进行选择,也可以随意抽取,只要抽取的预设数量的字符是不重复的即可。优选地,预设数量可以是256,即一个byte能够表示的范围。
比如,从unicode的字符集中选择256个不重复的字符,得到预存的字符集为:
一乙二十丁厂七k人入八九几l了力乃刀又n于干亏士工土才寸下大丈与万上小口巾山千乞川亿个勺久凡及夕丸么m亡门义之尸弓己已子卫也女飞刃习c马乡丰王井开夫天无元专云扎艺木五支厅不太f区历尤友匹车巨牙屯比o切瓦q少r中p贝内水见午牛手b气升长仁什片仆化仇币仍仅斤g反介父从今凶分乏公仓月氏勿欠风丹匀乌凤勾文六方火为斗忆订计户认心尺ae巴孔队办以允d劝双j幻玉刊示末未u打巧正扑扒功扔去甘世古s本术可丙左厉右石布h平灭轧东卡i占业旧帅归且t目叶甲申叮电号田由史只央兄叼叫另叨叹四生失禾丘付仗代仙们仪白仔他斥瓜乎丛令用甩印乐。
其中,每个字符在该预存的字符集中的位置或者顺序序号与该字符之间的映射关系可以为各个字节数据与所述预设数量的被选择的字符的映射关系,但不限于此。
发送模块46,用于通过短信息的形式发送字符数据。
上述装置以发送的短信息的消息内容对应的数据为:{pwd=12345}为例,转换模块42将其转变成这样的一个byte数组,例如:[114,86,50,67,88,81,54,78,68,65,66,104,114,71,108,76,106,102,99,86,51,103,61,61],如果把这个byte数组的内容当做String传输,则它的长度是80,已经超过一条短信了,此时通过上述实施例的装置:假设上述预存的字符集是上述实施例中的预存的字符集,通过byte数组中的每个byte的值在上述预存的字符集中对应一个字符,那么上述byte数组经过编码之后为变为:b不么cf艺义专马刃习r毛王内无pqo不m少卫卫,长度是24。即得到的字符数据为:b不么cf艺义专马刃习r毛王内无pqo不m少卫卫。因而,通过使用本发明实施例中的预存的字符集进行编码,使得通过短信发送的短信息内容的长度大大减少,进而增加了该消息内容的复杂度,进而扩大了短信息的使用范围。
通过上述装置中的各个模块,可以使得在数据长度不增加的情况下,将短信息的消息内容转换为的字节数据转变为短信可传输的文本,达到了能够传输复杂通讯的消息内容的目的,进而解决由于短信内容长度的限制而造成的短信使用范围有限的技术问题,扩大了短信息的使用范围。
图7是本发明实施例的短信息的发送装置的结构框图四,如图7所示,上述装置还包括:加密模块72,与转换模块42连接,用于对所述字节数组中的元素进行加密。需要说明的是,加密模块72可以通过AES算法对上述字节数组中的元素进行加密,AES算法是现有技术中的算法,此处不再赘述。通过AES算法加密之后,字节数组的长度会有一定程度的增加,在一个优选的实施例中,可以使用128位的加密,加密后的字节数组可能有一定程度的增加,但是在本发明实施例中能够通过对字节数组进行加密使得在传输的过程中待发送的短信息的消息内容的长度会缩短,因而可以对短信息的消息进行加密,保证短信息的消息内容在传输过程的安全性。
需要说明的是,本发明实施例主要用于解决当byte数组的长度本身小于一条短信的长度,但是经过传统编码比如base64编码后其长度会超出一条短信长度的情况,本发明实施例通过上述装置中的查询模块44使用预存的字符集进行编码,而不使用传统的编码方式,使得byte数组变为短信息可传输的文本时,其数据长度未增加,因而可以通过一条短信息进行传输。
实施例4
根据本发明实施例,还提供了一种用于实施上述实施例2的短信息的接收方法的装 置,图8是本发明实施例的短信息的接收装置的结构框图一,如图8所示,该装置包括:
接收模块82,用于接收来自发送方的短信息;
需要说明的是,该短信息的表现形式可以为经过预存的字符集进行编码后的字符数据,或者经过简化、加密以及预存的字符集进行编码之后的字符数据,但不限于此。
查询模块84,与接收模块82连接,用于从预存的字符集中查找与短信息的消息内容对应的字节数据;其中,字符集包括:预设的字节数据、预设的字符、以及预设的字节数据与预设的字符之间的映射关系;
上述预存的字符集可以通过以下方式确定:从短信息所支持的字符集中按照预设规则选择预设数量的字符,且被选择的字符不重复,并建立各个字节数据与预设数量的被选择的字符的映射关系。上述短信息所支持的字符集可以是支持传输unicode的字符集,另外,从该字符集中选择预设数量的字符可以是按照一定的规则进行选择,也可以随意抽取,只要抽取的预设数量的字符是不重复的即可。优选地,预设数量可以是256,即一个byte能够表示的范围。
比如,从unicode的字符集中选择256个不重复的字符,得到预存的字符集为:
一乙二十丁厂七k人入八九几l了力乃刀又n于干亏士工土才寸下大丈与万上小口巾山千乞川亿个勺久凡及夕丸么m亡门义之尸弓己已子卫也女飞刃习c马乡丰王井开夫天无元专云扎艺木五支厅不太f区历尤友匹车巨牙屯比o切瓦q少r中p贝内水见午牛手b气升长仁什片仆化仇币仍仅斤g反介父从今凶分乏公仓月氏勿欠风丹匀乌凤勾文六方火为斗忆订计户认心尺ae巴孔队办以允d劝双j幻玉刊示末未u打巧正扑扒功扔去甘世古s本术可丙左厉右石布h平灭轧东卡i占业旧帅归且t目叶甲申叮电号田由史只央兄叼叫另叨叹四生失禾丘付仗代仙们仪白仔他斥瓜乎丛令用甩印乐。
其中,每个字符在该预存的字符集中的位置或者顺序序号与该字符之间的映射关系可以为各个字节数据与所述预设数量的被选择的字符的映射关系,但不限于此。
上述查询模块84,还用于从预存的字符集中查找与所述消息内容对应的字节数组,其中,所述字节数组中的元素由字符串的取值确定,并且,所述字符串用于表示所述短信息的原始消息内容。
还原模块86,与查询模块84连接,用于将查找到的字节数据还原为短信息的原始消息内容。
以上述预存的字符集为例,假设接收装置中的接收模块82接收到的短信息的字符数据为[b不么cf艺义专马刃习r毛王内无pqo不m少卫卫],查询模块84在该预存的字符 集中,查找该字符数据中的每个字符在该预存的字符集中的序号或者位置,以查找字符数据中的每个字符在该预存的字符集中的序号为例,上述字符数据查找到的结果为字节数据[114,86,50,67,88,81,54,78,68,65,66,104,114,71,108,76,106,102,99,86,51,103,61,61],而该字节数据对应的原始数据为{pwd=12345},那么还原模块86则将上述字节数据还原为原始数据{pwd=12345},这样就将短信息的原始消息内容还原出来了。
通过上述装置,采用根据预存的字符集中的预设的字节数据与预设的字符之间的映射关系在该预存的字符集中查找与短信息的消息内容对应的字节数据,然后将将查找到的字节数据还原为短信息的原始消息内容的方式,进而使得经过上述预存的字符集编码的短信息使用相同的该预存的字符集进行解码,还原为短信息的原始消息内容,进而达到了能够传输复杂通讯的消息内容的目的,进而解决了由于短信内容长度的限制而造成的短信使用范围有限的技术问题,扩大了短信息的使用范围。
图9是本发明实施例的短信息的接收装置的结构框图二,如图9所示,上述装置还包括:解密模块92,与查询模块84连接,用于对从预存的字符集中查找到的数据进行解密,得到与所述消息内容对应的字节数组。需要说明的是,该解密的过程与发送短信息时的加密过程是相反的过程,在短信息发送时进行了加密,那么在接收过程时则需要解密,如果在发送时并未进行加密,则在接收过程中也不需要进行解密,因此,该解密模块是可选的。
实施例5
本发明的实施例可以提供一种计算机终端,该计算机终端可以是计算机终端群中的任意一个计算机终端。可选地,在本实施例中,上述计算机终端也可以替换为移动终端等终端设备。
可选地,在本实施例中,上述计算机终端可以位于计算机网络的多个网络设备中的至少一个网络设备。
在本实施例中,上述计算机终端可以执行应用程序的短信息的发送方法中以下步骤的程序代码:将待发短信息的消息内容转换成字节数据;从预存的字符集中查找与字节数据对应的字符,得到字符数据,其中,字符集包括:预设的字节数据、预设的字符、以及预设的字节数据与预设的字符之间的映射关系,预设的字符为短信息所支持的字符;通过短信息的形式发送字符数据。
可选地,图10是根据本发明实施例5的一种计算机终端的结构框图。如图10所示,该计算机终端A可以包括:一个或多个(图中仅示出一个)处理器101、存储器103、 以及传输模块105。
其中,存储器103可用于存储软件程序以及模块,如本发明实施例中的短信息的发送方法和装置对应的程序指令/模块,处理器101通过运行存储在存储器103内的软件程序以及模块,从而执行各种功能应用以及数据处理,即实现上述的短信息的发送方法。存储器103可包括高速随机存储器,还可以包括非易失性存储器,如一个或者多个磁性存储装置、闪存、或者其他非易失性固态存储器。在一些实例中,存储器103可进一步包括相对于处理器101远程设置的存储器,这些远程存储器可以通过网络连接至终端A。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。
上述的传输模块105用于经由一个网络接收或者发送数据。上述的网络具体实例可包括有线网络及无线网络。在一个实例中,传输模块105包括一个网络适配器(Network Interface Controller,NIC),其可通过网线与其他网络设备与路由器相连从而可与互联网或局域网进行通讯。在一个实例中,传输模块105为射频(Radio Frequency,RF)模块,其用于通过无线方式与互联网进行通讯。
其中,具体地,存储器103用于存储预设动作条件和预设权限用户的信息、以及应用程序。例如存储器103用于存储用于实现以下步骤的程序代码:获取与消息内容对应的字符串;提取上述字符串的取值;将提取的各个取值作为数组的组成元素,构成字节数组,并将字节数组中的元素作为字节数据。可选地,存储器103还用于存储用于实现以下步骤的程序代码:按照上述字节数组中各个组成元素的字节长度来调整各个组成元素的数据类型,其中,不同的数据类型具有不同的字节长度。
采用本发明实施例,提供了一种计算机终端可以执行应用程序的短信息的发送方法的方案。采用将待发短信息的消息内容转换成字节数据,根据预存的字符集中的预设的字节数据与预设的字符之间的映射关系在该预存的字符集中查找与上述将消息内容转化后的字节数据对应的字符数据,然后通过短信息的形式发送这些字符数据的方式,进而使得在数据长度不增加的情况下,将短信息的消息内容转换为的字节数据转变为短信可传输的文本,达到了能够传输复杂通讯的消息内容的目的,进而解决了由于短信内容长度的限制而造成的短信使用范围有限的技术问题,扩大了短信息的使用范围。
本领域普通技术人员可以理解,图10所示的结构仅为示意,计算机终端也可以是智能手机(如Android手机、iOS手机等)、平板电脑、掌声电脑以及移动互联网设备(Mobile Internet Devices,MID)、PAD等终端设备。图10其并不对上述电子装置的结构造成限定。例如,计算机终端A还可包括比图10中所示更多或者更少的组件(如网络接口、 显示装置等),或者具有与图10所示不同的配置。
本领域普通技术人员可以理解上述实施例的各种方法中的全部或部分步骤是可以通过程序来指令终端设备相关的硬件来完成,该程序可以存储于一计算机可读存储介质中,存储介质可以包括:闪存盘、只读存储器(Read-Only Memory,ROM)、随机存取器(Random Access Memory,RAM)、磁盘或光盘等。
实施例6
本发明的实施例可以提供一种计算机终端,该计算机终端可以是计算机终端群中的任意一个计算机终端。可选地,在本实施例中,上述计算机终端也可以替换为移动终端等终端设备。
可选地,在本实施例中,上述计算机终端可以位于计算机网络的多个网络设备中的至少一个网络设备。
在本实施例中,上述计算机终端可以执行应用程序的短信息的接收方法中以下步骤的程序代码:接收来自发送方的短信息;从预存的字符集中查找与短信息的消息内容对应的字节数据;其中,字符集包括:预设的字节数据、预设的字符、以及预设的字节数据与预设的字符之间的映射关系;将查找到的字节数据还原为短信息的原始消息内容。
需要说明的是,在本发明实施例中的计算机终端的结构可以与上述实施例5中的计算机终端的结构相同或不同,例如可以采用实施例5中的传输模块105来实现接收短信息,也可以单独设置一个与传输模块105独立的接收模块。但是实施例5中的计算机终端用于执行短信息的发送方法中的步骤的程序代码,而本实施例中的计算机终端用于执行短信息的接收方法中的步骤的程序代码。
可选地,存储器103还可以存储用于实现以下步骤的程序代码:从预存的字符集中查找与消息内容对应的字节数组,其中,字节数组中的元素由字符串的取值确定,并且,字符串用于表示所述短信息的原始消息内容。
采用本发明实施例,提供了一种计算机终端可以执行应用程序的短信息的接收方法的方案,通过根据预存的字符集中的预设的字节数据与预设的字符之间的映射关系在该预存的字符集中查找与短信息的消息内容对应的字节数据,然后将将查找到的字节数据还原为短信息的原始消息内容的方式,进而使得经过上述预存的字符集编码的短信息使用相同的该预存的字符集进行解码,还原为短信息的原始消息内容,进而实现了能够传输复杂通讯的消息内容的目的,进而解决了由于短信内容长度的限制而造成的短信使用范围有限的技术问题,扩大了短信息的使用范围。
实施例7
本发明的实施例还提供了一种存储介质。可选地,在本实施例中,上述存储介质可以用于保存上述实施例一所提供的短信息的发送方法所执行的程序代码。
可选地,在本实施例中,上述存储介质可以位于计算机网络中计算机终端群中的任意一个计算机终端中,或者位于移动终端群中的任意一个移动终端中。
可选地,在本实施例中,存储介质被设置为存储用于执行以下步骤的程序代码:将待发短信息的消息内容转换成字节数据;从预存的字符集中查找与字节数据对应的字符,得到字符数据,其中,字符集包括:预设的字节数据、预设的字符、以及预设的字节数据与预设的字符之间的映射关系,预设的字符为短信息所支持的字符;通过短信息的形式发送字符数据。
此处需要说明的是,上述计算机终端群中的任意一个可以与网站服务器和扫描器建立通信关系,扫描器可以扫描计算机终端上php执行的web应用程序的值命令。
实施例8
本发明的实施例还提供了一种存储介质。可选地,在本实施例中,上述存储介质可以用于保存上述实施例一所提供的短信息的接收方法所执行的程序代码。
可选地,在本实施例中,上述存储介质可以位于计算机网络中计算机终端群中的任意一个计算机终端中,或者位于移动终端群中的任意一个移动终端中。
可选地,在本实施例中,存储介质被设置为存储用于执行以下步骤的程序代码:接收来自发送方的短信息;从预存的字符集中查找与短信息的消息内容对应的字节数据;其中,字符集包括:预设的字节数据、预设的字符、以及预设的字节数据与预设的字符之间的映射关系;将查找到的字节数据还原为短信息的原始消息内容。
此处需要说明的是,上述计算机终端群中的任意一个可以与网站服务器和扫描器建立通信关系,扫描器可以扫描计算机终端上php执行的web应用程序的值命令。
上述本发明实施例序号仅仅为了描述,不代表实施例的优劣。
在本发明的上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述的部分,可以参见其他实施例的相关描述。
在本申请所提供的几个实施例中,应该理解到,所揭露的客户端,可通过其它的方式实现。其中,以上所描述的装置实施例仅仅是示意性的,例如所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨 论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,单元或模块的间接耦合或通信连接,可以是电性或其它的形式。
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
另外,在本发明各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可为个人计算机、服务器或者网络设备等)执行本发明各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、移动硬盘、磁碟或者光盘等各种可以存储程序代码的介质。
以上所述仅是本发明的优选实施方式,应当指出,对于本技术领域的普通技术人员来说,在不脱离本发明原理的前提下,还可以做出若干改进和润饰,这些改进和润饰也应视为本发明的保护范围。

Claims (19)

  1. 一种短信息的发送方法,其特征在于,包括:
    将待发短信息的消息内容转换成字节数据;
    从预存的字符集中查找与所述字节数据对应的字符,得到字符数据,其中,所述字符集包括:预设的字节数据、预设的字符、以及所述预设的字节数据与所述预设的字符之间的映射关系,所述预设的字符为短信息所支持的字符;
    通过短信息的形式发送所述字符数据。
  2. 根据权利要求1所述的方法,其特征在于,所述预存的字符集通过以下方式确定:
    从短信息所支持的字符集中按照预设规则选择预设数量的字符,且被选择的字符不重复,并建立各个字节数据与所述预设数量的被选择的字符的映射关系。
  3. 根据权利要求2所述的方法,其特征在于,所述预设数量为256。
  4. 根据权利要求1至3中任一项所述的方法,其特征在于,将待发短信息的消息内容转换成字节数据,包括:
    获取与所述消息内容对应的字符串;
    提取所述字符串的取值;
    将提取的各个所述取值作为数组的组成元素,构成字节数组,并将所述字节数组中的元素作为所述字节数据。
  5. 根据权利要求4所述的方法,其特征在于,从预存的字符集中查找与所述字节数据对应的字符之前,所述方法还包括:
    按照所述字节数组中各个所述组成元素的字节长度调整所述各个所述组成元素的数据类型,其中,不同的所述数据类型具有不同的字节长度。
  6. 根据权利要求4所述的方法,其特征在于,从预存的字符集中查找与所述字节数据对应的字符之前,所述方法还包括:
    对所述字节数组中的元素进行加密。
  7. 一种短信息的接收方法,其特征在于,包括:
    接收来自发送方的短信息;
    从预存的字符集中查找与所述短信息的消息内容对应的字节数据;其中,所述字符集包括:预设的字节数据、预设的字符、以及所述预设的字节数据与所述预设的字符之间的映射关系;
    将查找到的所述字节数据还原为所述短信息的原始消息内容。
  8. 根据权利要求7所述的方法,其特征在于,所述预存的字符集通过以下方式确定:
    从短信息所支持的字符集中按照预设规则选择预设数量的字符,且被选择的字符不重复,并建立各个字节数据与所述预设数量的被选择的字符的映射关系。
  9. 根据权利要求7所述的方法,其特征在于,从预存的字符集中查找与所述短信息的消息内容对应的字节数据,包括:
    从预存的字符集中查找与所述消息内容对应的字节数组,其中,所述字节数组中的元素由字符串的取值确定,并且,所述字符串用于表示所述短信息的原始消息内容。
  10. 根据权利要求9所述的方法,其特征在于,所述字节数组为加密的数组;从预存的字符集中查找与所述消息内容对应的字节数组之前,所述方法还包括:
    对从预存的字符集中查找到的数据进行解密,得到与所述消息内容对应的字节数组。
  11. 一种短信息的发送装置,其特征在于,包括:
    转换模块,用于将待发短信息的消息内容转换成字节数据;
    查询模块,用于从预存的字符集中查找与所述字节数据对应的字符,得到字符数据,其中,所述字符集包括:预设的字节数据、预设的字符、以及所述预设的字节数据与所述预设的字符之间的映射关系,所述预设的字符为短信息所支持的字符;
    发送模块,用于通过短信息的形式发送所述字符数据。
  12. 根据权利要求11所述的装置,其特征在于,所述预存的字符集通过以下方式确定:
    从短信息所支持的字符集中按照预设规则选择预设数量的字符,且被选择的字符不重复,并建立各个字节数据与所述预设数量的被选择的字符的映射关系。
  13. 根据权利要求11所述的装置,其特征在于,所述转换模块包括:
    获取单元,用于获取与所述消息内容对应的字符串;
    提取单元,用于提取所述字符串的取值;
    构建单元,用于将提取的各个所述取值作为数组的组成元素,构成字节数组,并将所述字节数组中的元素作为所述字节数据。
  14. 根据权利要求13所述的装置,其特征在于,所述装置还包括:
    调整模块,用于按照所述字节数组中各个所述组成元素的字节长度调整所述各个所 述组成元素的数据类型,其中,不同的所述数据类型具有不同的字节长度。
  15. 根据权利要求13所述的装置,其特征在于,所述装置还包括:
    加密模块,用于对所述字节数组中的元素进行加密。
  16. 一种短信息的接收装置,其特征在于,包括:
    接收模块,用于接收来自发送方的短信息;
    查询模块,用于从预存的字符集中查找与所述短信息的消息内容对应的字节数据;其中,所述字符集包括:预设的字节数据、预设的字符、以及所述预设的字节数据与所述预设的字符之间的映射关系;
    还原模块,用于将查找到的所述字节数据还原为所述短信息的原始消息内容。
  17. 根据权利要求16所述的装置,其特征在于,所述预存的字符集通过以下方式确定:
    从短信息所支持的字符集中按照预设规则选择预设数量的字符,且被选择的字符不重复,并建立各个字节数据与所述预设数量的被选择的字符的映射关系。
  18. 根据权利要求16所述的装置,其特征在于,所述查询模块,用于从预存的字符集中查找与所述消息内容对应的字节数组,其中,所述字节数组中的元素由字符串的取值确定,并且,所述字符串用于表示所述短信息的原始消息内容。
  19. 根据权利要求18所述的装置,其特征在于,所述装置还包括:
    解密模块,用于对从预存的字符集中查找到的数据进行解密,得到与所述消息内容对应的字节数组。
PCT/CN2016/093187 2015-08-13 2016-08-04 短信息的发送、接收方法及装置 WO2017024978A1 (zh)

Priority Applications (4)

Application Number Priority Date Filing Date Title
EP16834602.1A EP3337200A4 (en) 2015-08-13 2016-08-04 METHOD AND DEVICE FOR TRANSMITTING AND RECEIVING SHORT MESSAGES
KR1020187004083A KR20180042857A (ko) 2015-08-13 2016-08-04 메시지를 송신하고 수신하는 방법 및 장치
JP2018506870A JP6906498B2 (ja) 2015-08-13 2016-08-04 メッセージ送信及び受信方法及び装置
US15/893,483 US20180184260A1 (en) 2015-08-13 2018-02-09 Message Sending and Receiving Methods and Apparatuses

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510498533.1A CN106454772B (zh) 2015-08-13 2015-08-13 短信息的发送、接收方法及装置
CN201510498533.1 2015-08-13

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US15/893,483 Continuation US20180184260A1 (en) 2015-08-13 2018-02-09 Message Sending and Receiving Methods and Apparatuses

Publications (1)

Publication Number Publication Date
WO2017024978A1 true WO2017024978A1 (zh) 2017-02-16

Family

ID=57983001

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/093187 WO2017024978A1 (zh) 2015-08-13 2016-08-04 短信息的发送、接收方法及装置

Country Status (6)

Country Link
US (1) US20180184260A1 (zh)
EP (1) EP3337200A4 (zh)
JP (1) JP6906498B2 (zh)
KR (1) KR20180042857A (zh)
CN (1) CN106454772B (zh)
WO (1) WO2017024978A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113746848A (zh) * 2021-09-07 2021-12-03 烽火通信科技股份有限公司 一种并行可编程组包器和方法
CN115828332A (zh) * 2023-02-24 2023-03-21 三未信安科技股份有限公司 一种加强pci密码卡抵御计时攻击的方法及系统

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107066116B (zh) * 2017-04-13 2021-07-30 海信视像科技股份有限公司 字符串生成方法、字符解析方法及装置
CN107911570B (zh) * 2017-11-27 2019-11-29 公安部交通管理科学研究所 一种对图片特征进行压缩及解压的方法
CN108989458A (zh) * 2018-08-21 2018-12-11 凡己科技(苏州)有限公司 一种轻量级的物联网远程消息推送方法
CN109361399A (zh) * 2018-10-19 2019-02-19 上海达梦数据库有限公司 一种获取字节序列的方法、装置、设备及存储介质
CN111211887B (zh) * 2019-12-23 2022-11-29 中移(杭州)信息技术有限公司 资源加密方法、系统、装置及计算机可读存储介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1256605A (zh) * 1998-11-04 2000-06-14 三星电子株式会社 用于移动通信终端的短消息发送设备和方法
CN1635804A (zh) * 2003-12-31 2005-07-06 厦门雅迅网络股份有限公司 一种在短信通信平台上实现传输不可见字符的方法
CN102592160A (zh) * 2012-01-17 2012-07-18 浙江工商大学 一种面向短信的字符二维码编码方法和解码方法
CN103152708A (zh) * 2011-11-02 2013-06-12 通用汽车有限责任公司 使用二进制数据的文本编码进行车辆远程信息处理通信
CN103379457A (zh) * 2012-04-27 2013-10-30 深圳富泰宏精密工业有限公司 文字编码与解码系统及方法

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
AU6158394A (en) * 1993-03-10 1994-09-26 Awacs Communications (New Zealand) Limited Enhanced one way radio seven bit data network
US7606363B1 (en) * 2005-07-26 2009-10-20 Rockwell Collins, Inc. System and method for context switching of a cryptographic engine
KR100736210B1 (ko) * 2005-10-25 2007-07-06 (주)폴리다임 외형 변환에 의한 단문 메시지의 장식 방법
CN1845618A (zh) * 2006-04-30 2006-10-11 广东移动通信有限责任公司 一种长短信收发系统及实现方法
JP5420317B2 (ja) * 2009-06-05 2014-02-19 株式会社日立システムズ 変換パラメータ生成システム及び同変換プログラム
US8385953B2 (en) * 2010-06-23 2013-02-26 At&T Mobility Ii Llc Systems, methods, and computer program products for automatic mapping between parlay-X short messaging service message element XML encoding and native SMPP protocol data coding scheme
CN102014352B (zh) * 2010-08-19 2016-03-23 上海闻泰电子科技有限公司 一种短信编码格式的转换方法

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1256605A (zh) * 1998-11-04 2000-06-14 三星电子株式会社 用于移动通信终端的短消息发送设备和方法
CN1635804A (zh) * 2003-12-31 2005-07-06 厦门雅迅网络股份有限公司 一种在短信通信平台上实现传输不可见字符的方法
CN103152708A (zh) * 2011-11-02 2013-06-12 通用汽车有限责任公司 使用二进制数据的文本编码进行车辆远程信息处理通信
CN102592160A (zh) * 2012-01-17 2012-07-18 浙江工商大学 一种面向短信的字符二维码编码方法和解码方法
CN103379457A (zh) * 2012-04-27 2013-10-30 深圳富泰宏精密工业有限公司 文字编码与解码系统及方法

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP3337200A4 *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113746848A (zh) * 2021-09-07 2021-12-03 烽火通信科技股份有限公司 一种并行可编程组包器和方法
CN113746848B (zh) * 2021-09-07 2023-04-18 烽火通信科技股份有限公司 一种并行可编程组包器和方法
CN115828332A (zh) * 2023-02-24 2023-03-21 三未信安科技股份有限公司 一种加强pci密码卡抵御计时攻击的方法及系统
CN115828332B (zh) * 2023-02-24 2024-04-19 三未信安科技股份有限公司 一种加强pci密码卡抵御计时攻击的方法及系统

Also Published As

Publication number Publication date
KR20180042857A (ko) 2018-04-26
EP3337200A4 (en) 2019-01-23
CN106454772A (zh) 2017-02-22
JP6906498B2 (ja) 2021-07-21
US20180184260A1 (en) 2018-06-28
CN106454772B (zh) 2019-11-26
JP2018528533A (ja) 2018-09-27
EP3337200A1 (en) 2018-06-20

Similar Documents

Publication Publication Date Title
WO2017024978A1 (zh) 短信息的发送、接收方法及装置
CN105262772B (zh) 一种数据传输方法、系统及相关装置
CN111201749A (zh) 用于安全数据通信的方法和系统
JP2015057704A5 (zh)
CN104052658A (zh) 一种基于社交网络的隐私保护系统及方法
JP2016513825A (ja) 安全通信方法および装置
CN105227566A (zh) 密钥处理方法、密钥处理装置及密钥处理系统
US20200213858A1 (en) Method and device for protecting privacy
JP6328123B2 (ja) アドレス可能な無線装置
CN105978909B (zh) 基于传输层封包的数据传输方法、数据传输装置及系统
US11303617B2 (en) Methods and apparatuses for oblivious transfer using trusted environment
CN109150508A (zh) 设备控制和受控方法、装置、计算机设备和存储介质
CN107003909B (zh) 从数据处理设备访问远程资源的方法
US9654455B2 (en) Communication system, communication device, key management apparatus, and communication method
CN112491832A (zh) 一种文件传输方法及装置
CN102045343B (zh) 基于数字证书的通讯加密安全控制方法、服务器及系统
KR101737345B1 (ko) 클라우드 기반의 IoT 시스템에서 IoT 디바이스를 인증하기 위한 방법 및 장치
Wyrembelski et al. Secrecy in broadcast channels with receiver side information
CN111277605A (zh) 数据分享方法、装置、计算机设备以及存储介质
CN108270546A (zh) 一种信息传输的方法及系统
CN104618355B (zh) 一种安全存储和传输数据的方法
JPWO2009157048A1 (ja) 無線通信認証方法及び無線通信システムと無線センサ
TW201828654A (zh) 簡訊的發送、接收方法及裝置
CN105871646A (zh) 网关设备及网关配置方法
US20220150224A1 (en) Encryption using recursive key

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 16834602

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 20187004083

Country of ref document: KR

Kind code of ref document: A

Ref document number: 2018506870

Country of ref document: JP

Kind code of ref document: A

NENP Non-entry into the national phase

Ref country code: DE

WWE Wipo information: entry into national phase

Ref document number: 2016834602

Country of ref document: EP