Message data processing method and device, electronic equipment and storage medium
Patent Information
- Application Number
- CN202310071900.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-01-13
- Publication Date
- 2026-10-23
- Estimated Expiration
- 2043-01-13
AI Technical Summary
[0003]在实现本公开构思的过程中,发明人发现相关技术中至少存在如下问题:首先报文转码目前由人工执行,工作效率低且难以避免人工失误,其次,在发报行将汉字转电报码或者报行将电报码转汉字的过程中,存在转码不精确的问题,例如,在将汉字转电报码的过程中存在转换后的格式与柜员录入的不一致的问题
[0053]根据本公开的实施例提供的报文数据处理方法、装置、设备、介质和程序产品,通过执行数据接收、字符数量计算、转码、解析、输出的操作,且在数据处理过程中保留传递待转码的汉语报文中的文字、字符内容和格式信息,实现了通过计算机自动执行转码处理的过程,解放了人力,提高了工作效率,避免了人工失误。并且,基于SWIFT报文有一定的长度格式要求,在进行转码前,计算各个第一元素集分别对应的转码字符数量,并且,进一步地,在多个第一元素集各自对应的转码字符数量均小于等于预设字符数量的情况下,再逐行执行转码处理,反之则不会按照该方法进行转码。如此,保证了转码后的报文不会出现个别行字符超长的问题。并且,按照集合序号和元素序号逐行一对一转码,也保证了转码后的内容不会出现串行,从而导致转换后的格式与柜员录入的不一致的问题,提升汉字与电报码自动化转换能力,提高了互转准确性,降低从业人员资质要求,提高了报文处理效率,降低了运营成本。
Smart Images

Figure CN116108809B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of information security technology, specifically to a message data processing method, apparatus, device, medium, and program product. Background Technology
[0002] Currently, many countries and regions around the world widely use Chinese characters, and local residents and banks are accustomed to using Chinese characters in their daily financial transactions, especially in cross-border remittances between these countries or regions. At present, the mainstream global cross-border remittance SWIFT message does not support the direct transmission of Chinese characters. It requires the sending bank to convert them into telegraphic codes, and the receiving bank to convert the telegraphic codes back into Chinese characters after receiving the message.
[0003] In the process of realizing the present invention, the inventors discovered that the related technology has at least the following problems: First, message transcoding is currently performed manually, which is inefficient and difficult to avoid human error. Second, in the process of the sending bank converting Chinese characters to telegraphic codes or the reporting bank converting telegraphic codes to Chinese characters, there is a problem of inaccurate transcoding. For example, in the process of converting Chinese characters to telegraphic codes, there is a problem that the converted format is inconsistent with the one entered by the teller. Summary of the Invention
[0004] In view of the above problems, this disclosure provides a message data processing method, apparatus, device, medium and program product.
[0005] One aspect of this disclosure provides a message data processing method, including:
[0006] Receive the first type of message data to be transcoded, wherein the first type of message data to be transcoded includes M sets of first elements, each set of first elements is marked with a set number, each first element in the set of first elements is marked with an element number, and the type of each first element includes at least Chinese characters, where M is a positive integer.
[0007] Calculate the number of transcoded characters corresponding to each first element set;
[0008] When the number of transcoded characters corresponding to each of the M first element sets is less than or equal to the preset number of characters, based on the set index and element index, the first type of transcoding processing is performed on each of the M first element sets to obtain M first telegraph code sets. The Chinese meaning represented by the Lth first telegraph code set is the same as the Chinese meaning represented by the Lth first element set. Each first telegraph code set includes at least a number of four-corner code characters, where L is a positive integer and L is less than or equal to M.
[0009] After parsing the M sets of first telegraph codes, output M lines of first destination telegraph code messages.
[0010] According to embodiments of this disclosure, the type of each first element further includes a number type and a separator type. After performing a first type of transcoding process on each of the M first element sets, M first telegraph code sets are obtained, including:
[0011] Based on the arrangement order represented by the set index and the element index, the first elements belonging to the Chinese character type in the M first element sets are converted into four-corner codes, and the first elements belonging to the number type and the separator type in the first element sets are retained to obtain the M first telegraph code sets.
[0012] According to embodiments of this disclosure, calculating the number of transcoded characters corresponding to each first element set includes:
[0013] Determine the number of Chinese characters, numbers, and separators in the first element set;
[0014] The number of target characters corresponding to the number of Chinese characters is calculated based on the number of Chinese characters in the first element set and the preset telegraph code combination format;
[0015] Calculate the sum of the number of target characters, the number of digits, and the number of separators to obtain the number of transcoded characters corresponding to the first element set.
[0016] According to embodiments of this disclosure, the above method further includes:
[0017] If the number of transcoded characters corresponding to any first element set is greater than the preset number of characters, convert M first element sets into N second telegraph code sets. The Chinese meaning represented by the Kth second telegraph code set is different from the Chinese meaning represented by the Kth first element set. K is a positive integer, K is less than or equal to M, and K is less than or equal to N.
[0018] After parsing N sets of second telegraph codes, output N lines of second target telegraph code messages.
[0019] According to embodiments of this disclosure, converting the M sets of first elements into N sets of second telegraph codes includes:
[0020] Based on the set index and the element index, a basic element set is obtained by sequentially concatenating the first elements of the M first element sets.
[0021] After performing the first type of transcoding on each basic element in the basic element set in sequence, a basic telegraph code set is obtained.
[0022] According to the preset limit on the number of characters per line, the basic telegraph code set is divided into N second telegraph code sets.
[0023] According to embodiments of this disclosure, the above method further includes:
[0024] Receive the second type of message data to be transcoded, wherein the second type of message data to be transcoded includes S third telegraph code sets, each third telegraph code set is marked with a set number, and each third telegraph code set includes at least a number of four-corner code characters, where S is a positive integer;
[0025] Based on the set sequence number and the preset telegraph code combination rules, after performing the second type of transcoding on the S third telegraph code sets in sequence, S second element sets are obtained. The type of the second element in each second element set includes at least Chinese character type and number type.
[0026] After parsing the S sets of second elements, output S lines of the target Chinese message.
[0027] According to embodiments of this disclosure, S sets of third telegraph codes are sequentially subjected to a second type of transcoding process to obtain S sets of second elements, including:
[0028] Based on the preset telegraph code combination format, the multiple four-corner code characters in the third telegraph code set are divided into multiple character unit groups;
[0029] Multiple character unit groups are divided into a first type of character unit group and a second type of character unit group. The four-corner code characters in the first type of character unit group meet the preset telegraph code combination rules, while the four-corner code characters in the second type of character unit group do not meet the preset telegraph code combination rules.
[0030] Based on the first type of character unit group and the second type of character unit group, multiple character unit groups in the S third telegraph code sets are subjected to the second type of transcoding to obtain S second element sets.
[0031] According to embodiments of this disclosure, the process of obtaining S second element sets by performing second-type transcoding on multiple character unit groups in S third telegraph code sets based on first-type and second-type character unit groups includes:
[0032] Traverse multiple character unit groups in the third telegraph code set. If two or more consecutive character unit groups are of the first type, perform second type transcoding on the two or more consecutive first type character unit groups to obtain the second element set.
[0033] Another aspect of this disclosure provides a message data processing apparatus, including a first receiving module, a calculation module, a first transcoding module, and a first parsing module.
[0034] The first receiving module is used to receive the first type of message data to be transcoded, wherein the first type of message data to be transcoded includes M first element sets, each first element set is marked with a set number, each first element in the first element set is marked with an element number, and the type of each first element includes at least Chinese characters, where M is a positive integer.
[0035] The calculation module is used to calculate the number of transcoded characters corresponding to each first element set;
[0036] The first transcoding module is used to perform first-type transcoding on each of the M first element sets based on the set index and element index to obtain M first telegraph code sets when the number of transcoded characters corresponding to each of the M first element sets is less than or equal to the preset number of characters. The Chinese meaning represented by the Lth first telegraph code set is the same as the Chinese meaning represented by the Lth first element set. Each first telegraph code set includes at least a number of four-corner code characters, where L is a positive integer and L is less than or equal to M.
[0037] The first parsing module is used to parse M sets of first telegraph codes and output M lines of first target telegraph code messages.
[0038] According to embodiments of this disclosure, the type of each first element further includes a numeric type and a separator type. The first transcoding module includes a first transcoding unit, which is used to convert the first elements belonging to the Chinese character type in the M first element sets into four-corner codes based on the arrangement order represented by the set index and the element index, and to obtain M first telegraph code sets after retaining the first elements belonging to the numeric type and the separator type in the first element sets.
[0039] According to embodiments of this disclosure, the calculation module includes a determining unit, a first calculation unit, and a second calculation unit.
[0040] The unit is configured to determine the number of Chinese characters, numbers, and separators in the first element set; the first calculation unit is configured to calculate the number of target characters corresponding to the number of Chinese characters based on the number of Chinese characters in the first element set and a preset telegraph code combination format; and the second calculation unit is configured to calculate the sum of the number of target characters, numbers, and separators to obtain the number of transcoded characters corresponding to the first element set.
[0041] According to embodiments of this disclosure, the apparatus further includes a second transcoding module and a second parsing module.
[0042] The second transcoding module is used to convert M first element sets into N second telegraph code sets when the number of transcoded characters corresponding to any first element set is greater than the preset number of characters. The Chinese meaning represented by the Kth second telegraph code set is different from the Chinese meaning represented by the Kth first element set. K is a positive integer, K is less than or equal to M, and K is less than or equal to N. The second parsing module is used to parse the N second telegraph code sets and output N lines of second target telegraph code messages.
[0043] According to embodiments of this disclosure, the second transcoding module includes a splicing unit, a second transcoding unit, and a segmentation unit.
[0044] The concatenation unit is used to concatenate the first elements of M first element sets sequentially based on the set index and element index to obtain a basic element set; the second transcoding unit is used to perform first-type transcoding processing on each basic element in the basic element set to obtain a basic telegraph code set; and the segmentation unit is used to segment the basic telegraph code set according to a preset single-line character limit to obtain N second telegraph code sets.
[0045] According to embodiments of this disclosure, the above-described apparatus further includes a second receiving module, a third transcoding module, and a third parsing module.
[0046] The second receiving module is used to receive a second type of message data to be transcoded, which includes S third telegraph code sets, each of which is marked with a set number and includes at least a number of four-corner code characters, where S is a positive integer. The third transcoding module is used to perform second-type transcoding processing on the S third telegraph code sets sequentially based on the set number and a preset telegraph code combination rule to obtain S second element sets, where the type of the second element in each second element set includes at least Chinese characters and numbers. The third parsing module is used to parse the S second element sets and output S lines of target Chinese message.
[0047] According to embodiments of this disclosure, the third transcoding module includes a partitioning unit, a classification unit, and a third transcoding unit.
[0048] The system includes: a partitioning unit, used to divide multiple four-corner code characters in the third telegraph code set into multiple character unit groups based on a preset telegraph code combination format; a classification unit, used to divide the multiple character unit groups into a first type of character unit group and a second type of character unit group, wherein the four-corner code characters in the first type of character unit group satisfy the preset telegraph code combination rules, and the four-corner code characters in the second type of character unit group do not satisfy the preset telegraph code combination rules; and a third transcoding unit, used to perform second-type transcoding processing on the multiple character unit groups in the S third telegraph code set based on the first type of character unit group and the second type of character unit group to obtain S second element sets.
[0049] According to an embodiment of this disclosure, the third transcoding unit includes a transcoding subunit, which is used to traverse multiple character unit groups in the third telegraph code set. When two or more consecutive character unit groups are first type character unit groups, the two or more consecutive first type character unit groups are subjected to second type transcoding processing to obtain a second element set.
[0050] Another aspect of this disclosure provides an electronic device, including: one or more processors; and a memory for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors perform the above-described message data processing method.
[0051] Another aspect of this disclosure provides a computer-readable storage medium having executable instructions stored thereon, which, when executed by a processor, cause the processor to perform the above-described message data processing method.
[0052] Another aspect of this disclosure provides a computer program product, including a computer program that, when executed by a processor, implements the above-described message data processing method.
[0053] According to the message data processing method, apparatus, device, medium, and program product provided in the embodiments of this disclosure, by performing operations of data reception, character count calculation, transcoding, parsing, and output, and retaining the text, character content, and format information of the Chinese message to be transcoded during the data processing, the transcoding process is automatically executed by a computer, freeing up manpower, improving work efficiency, and avoiding human error. Furthermore, based on the certain length and format requirements of SWIFT messages, before transcoding, the number of transcoded characters corresponding to each first element set is calculated. Further, if the number of transcoded characters corresponding to multiple first element sets is less than or equal to a preset number of characters, transcoding is performed line by line; otherwise, transcoding is not performed according to this method. This ensures that the transcoded message does not have individual lines with excessively long characters. Furthermore, the one-to-one transcoding according to the set number and element number ensures that the transcoded content will not be serialized, thus preventing inconsistencies between the converted format and the teller's input. This improves the automated conversion capability between Chinese characters and telegraphic codes, enhances the accuracy of mutual conversion, reduces the qualification requirements for practitioners, improves message processing efficiency, and reduces operating costs. Attached Figure Description
[0054] The foregoing contents, as well as other objects, features, and advantages of this disclosure, will become clearer from the following description of embodiments with reference to the accompanying drawings, in which:
[0055] Figure 1 The illustration shows an application scenario diagram of a message data processing method, apparatus, device, medium, and program product according to embodiments of the present disclosure;
[0056] Figure 2 A flowchart illustrating a message data processing method according to an embodiment of the present disclosure is shown schematically.
[0057] Figure 3A flowchart illustrating a message data processing method according to another embodiment of this disclosure is shown schematically;
[0058] Figure 4 A flowchart illustrating a method for performing a second type of transcoding processing on a third telegraph code set according to an embodiment of the present disclosure is shown.
[0059] Figure 5 A schematic block diagram of a message data processing apparatus according to embodiments of the present disclosure is shown; and
[0060] Figure 6 A block diagram schematically illustrates an electronic device suitable for implementing a message data processing method according to an embodiment of the present disclosure. Detailed Implementation
[0061] The embodiments of the present disclosure will now be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the disclosure. In the following detailed description, numerous specific details are set forth to provide a thorough understanding of the embodiments of the present disclosure for ease of explanation. However, it will be apparent that one or more embodiments may be practiced without these specific details. Furthermore, descriptions of well-known structures and techniques are omitted in the following description to avoid unnecessarily obscuring the concepts of the present disclosure.
[0062] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit this disclosure. The terms “comprising,” “including,” etc., as used herein indicate the presence of the stated features, steps, operations, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, or components.
[0063] All terms used herein (including technical and scientific terms) have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein are to be interpreted in a manner consistent with the context of this specification, and not in an idealized or overly rigid way.
[0064] When using expressions such as "at least one of A, B, and C", they should generally be interpreted in accordance with the meaning that is commonly understood by a person skilled in the art (e.g., "a system having at least one of A, B, and C" should include, but is not limited to, a system having A alone, a system having B alone, a system having C alone, a system having A and B, a system having A and C, a system having B and C, and / or a system having A, B, and C, etc.).
[0065] In the embodiments disclosed herein, the collection, updating, analysis, processing, use, transmission, provision, disclosure, and storage of data (e.g., including but not limited to user personal information) comply with relevant laws and regulations, are used for legitimate purposes, and do not violate public order and good morals. In particular, necessary measures have been taken to prevent unauthorized access to user personal information data and to safeguard user personal information security, network security, and national security.
[0066] In the embodiments disclosed herein, user authorization or consent is obtained before acquiring or collecting user personal information.
[0067] It should be noted that the message data processing method, apparatus, electronic device, and storage medium disclosed herein can be applied to the field of information security technology, the field of financial technology, and any field other than the field of information security technology and the field of financial technology. The embodiments of this disclosure do not limit the application field of the above message data processing method, apparatus, electronic device, and storage medium.
[0068] Currently, many countries and regions worldwide widely use Chinese characters, and local residents and banks are accustomed to using Chinese characters in daily financial transactions, especially in cross-border remittances between these countries or regions. At present, the mainstream global cross-border remittance SWIFT message does not support the direct transmission of Chinese characters. It requires the sending bank to convert them into telegraphic code, and the receiving bank to convert the telegraphic code back to Chinese characters after receiving the message. Message encoding is currently performed manually, which is inefficient and prone to human error. Inaccurate encoding can occur during the process of the sending bank converting Chinese characters to telegraphic code or the receiving bank converting telegraphic code back to Chinese characters. For example, the converted format may differ from the one entered by the teller.
[0069] In view of this, embodiments of the present disclosure provide a message data processing method, including:
[0070] Receive the first type of message data to be transcoded, which includes M sets of first elements. Each set of first elements is marked with a set index, and each first element in the set is marked with an element index. The type of each first element includes at least Chinese characters, and M is a positive integer. Calculate the number of transcoded characters corresponding to each set of first elements. If the number of transcoded characters corresponding to each of the M sets of first elements is less than or equal to a preset number of characters, perform the first type of transcoding on each first element in the M sets of first elements based on the set index and element index to obtain M sets of first telegraph codes. The Chinese meaning represented by the Lth set of first telegraph codes is the same as that represented by the Lth element set. Each set of first telegraph codes includes at least multiple four-corner code characters, and L is a positive integer, less than or equal to M. After parsing the M sets of first telegraph codes, output M lines of first target telegraph code messages.
[0071] Figure 1 The illustration shows an application scenario diagram of a message data processing method, apparatus, device, medium, and program product according to embodiments of the present disclosure.
[0072] like Figure 1 As shown, application scenario 100 according to this embodiment may include a first terminal device 101, a second terminal device 102, a third terminal device 103, a network 104, and a server 105. The network 104 serves as a medium for providing a communication link between the first terminal device 101, the second terminal device 102, the third terminal device 103, and the server 105. The network 104 may include various connection types, such as wired or wireless communication links, or fiber optic cables, etc.
[0073] Users can interact with server 105 via network 104 using at least one of the first terminal device 101, second terminal device 102, and third terminal device 103 to receive or send messages, etc. Various communication client applications can be installed on the first terminal device 101, second terminal device 102, and third terminal device 103, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social media platform software, etc. (for example only).
[0074] The first terminal device 101, the second terminal device 102, and the third terminal device 103 can be various electronic devices with displays and support web browsing, including but not limited to smartphones, tablets, laptops, and desktop computers.
[0075] Server 105 can be a server that provides various services, such as a backend management server that supports websites browsed by users using the first terminal device 101, the second terminal device 102, and the third terminal device 103 (this is just an example). The backend management server can analyze and process data such as received user requests, and feed back the processing results (such as web pages, information, or data obtained or generated according to user requests) to the terminal devices.
[0076] In the application scenario of this disclosure embodiment, financial institution business personnel can initiate a user request to obtain transcoding results to server 105 through first terminal device 101, second terminal device 102, and third terminal device 103. In response to the user request, server 105 can execute the message data processing method of this disclosure embodiment, perform transcoding processing on the data to be transcoded to obtain the transcoding result, output the transcoded message, and display it to financial institution business personnel through first terminal device 101, second terminal device 102, and third terminal device 103.
[0077] It should be noted that the message data processing method provided in this embodiment can generally be executed by server 105. Correspondingly, the message data processing device provided in this embodiment can generally be located in server 105. The message data processing method provided in this embodiment can also be executed by a server or server cluster that is different from server 105 and capable of communicating with the first terminal device 101, the second terminal device 102, the third terminal device 103, and / or server 105. Correspondingly, the message data processing device provided in this embodiment can also be located in a server or server cluster that is different from server 105 and capable of communicating with the first terminal device 101, the second terminal device 102, the third terminal device 103, and / or server 105.
[0078] It should be understood that Figure 1 The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included.
[0079] The following will be based on Figure 1 The described scene, through Figures 2-6 The message data processing method of the disclosed embodiments is described in detail.
[0080] Figure 2 A flowchart illustrating a message data processing method according to an embodiment of the present disclosure is shown schematically.
[0081] like Figure 2 As shown, the message data processing method of this embodiment includes operations S210 to S240.
[0082] In operation S210, the first type of message data to be transcoded is received, wherein the first type of message data to be transcoded includes M sets of first elements, each set of first elements is marked with a set number, each first element in the set of first elements is marked with an element number, and the type of each first element includes at least Chinese characters, where M is a positive integer.
[0083] In operation S220, the number of transcoded characters corresponding to each first element set is calculated;
[0084] In operation S230, when the number of transcoded characters corresponding to each of the M first element sets is less than or equal to the preset number of characters, based on the set index and element index, the first type of transcoding processing is performed on each of the M first element sets to obtain M first telegraph code sets. The Chinese meaning represented by the Lth first telegraph code set is the same as the Chinese meaning represented by the Lth first element set. Each first telegraph code set includes at least a number of four-corner code characters, where L is a positive integer and L is less than or equal to M.
[0085] After operating S240 and parsing M sets of first telegraph codes, M lines of first target telegraph code messages are output.
[0086] In common cross-border remittance or fund transfer messages, the remitter or recipient information often needs to include Chinese characters. Currently, the mainstream global cross-border remittance SWIFT messages do not support the direct transmission of Chinese characters. The sender is required to convert the message into telegraphic code before sending it, and the recipient must then convert the telegraphic code back to Chinese characters upon receiving the message. The message data processing method described in this embodiment can be executed by a financial institution's message transcoding system. This method is applied in the stage where the sender converts the Chinese message into telegraphic code, and the transcoding process can be automatically performed by a computer, freeing up manpower.
[0087] According to an embodiment of this disclosure, in the above operation S210, the first type of message data to be transcoded received can be the data obtained after character recognition and format extraction of the Chinese message to be transcoded. The Chinese message to be transcoded can include multiple lines of messages, and each line of messages can include Chinese characters, Arabic numerals, and separators (such as spaces). The obtained first type of message data to be transcoded retains the text, character content, and format information (line information, line order information, character order information, etc.) in the Chinese message to be transcoded.
[0088] Specifically, the first type of message data to be transcoded may include M sets of first elements, each set containing multiple first elements. These first elements can be in formats such as Chinese characters, spaces, or numbers, reflecting the specific message content. For example, multi-line messages in cross-border remittance SWIFT Chinese messages may include recipient's bank, recipient's address, remitter's bank, remitter's address, and a comment line. It should be noted that before performing the above operation S210, obtaining the Chinese message to be transcoded requires user consent or authorization. For example, a request to obtain user information can be sent to the user. If the user agrees or authorizes the acquisition of user information, the above operation S210 can be performed.
[0089] M sets of first elements correspond one-to-one with M lines of the Chinese message to be encoded. Each set of first elements is labeled with a set index, which can be the corresponding line number. Each first element within a set is labeled with an element index, which can be the order of the elements (Chinese characters, spaces, numeric characters, etc.) in each line of the message. In this way, the first type of message data to be encoded can preserve the text, character content, and formatting information of the Chinese message to be encoded.
[0090] According to the embodiments of this disclosure, SWIFT messages have certain format requirements, such as requiring each line to have no more than 35 characters. After transcoding, Chinese messages may have characters in some lines that are too long. To avoid this problem, before transcoding, in the above operation S220, the number of transcoded characters corresponding to each first element set (i.e., the number of characters after each line of Chinese content is converted into telegraph code) is calculated.
[0091] Furthermore, in the aforementioned operation S230, if the number of transcoded characters corresponding to each of the M first element sets is less than or equal to the preset number of characters (the maximum number of characters per line required by a SWIFT message), then transcoding processing is performed again. Specifically, the transcoding processing can be performed on each of the first elements in the M first element sets based on the set sequence number and the element sequence number, resulting in M first telegraph code sets. The M first telegraph code sets are also each marked with a corresponding set sequence number (representing the line sequence number).
[0092] Specifically, this can involve converting the Chinese characters in the first element set into four-corner codes while retaining the numbers and spaces, etc., separators in the first element set. The above encoding method involves encoding each element in the first element set one by one according to the arrangement order (row number) of the first element set, and for multiple elements in each first element set, encoding is performed one by one according to the element number of each element in the set (the arrangement order of each element in each row). Therefore, the resulting M first telegraph code sets correspond one-to-one with the M first element sets, and the contents of the corresponding telegraph code sets also correspond to the contents of the corresponding first element sets.
[0093] For example: The content of the first (sequence number) first element set in the M first element set is multiple elements arranged in sequence: “Receive”, “Payment”, “Person”, “” (space), “Zhang”, “Three”. After transcoding, the content of the first (sequence number) first telegraph code set is: multiple four-corner codes (retaining space characters) that correspond one-to-one with the above multiple Chinese characters and their order.
[0094] According to an embodiment of this disclosure, in the above operation S240, after parsing M first telegraph code sets, outputting M lines of first target telegraph code messages can be done by outputting multiple lines of telegraph code messages in the order of the rows arranged according to the sequence number (corresponding row number) of the M first telegraph code sets, as the final SWIFT message to be sent to the recipient.
[0095] According to embodiments of this disclosure, the above-described message data processing method performs data reception, character count calculation, transcoding, parsing, and output operations. During data processing, the text, character content, and format information of the Chinese message to be transcoded are preserved, enabling automated transcoding by a computer, freeing up manpower, improving work efficiency, and avoiding human error. Furthermore, given the specific length and format requirements of SWIFT messages, the number of transcoded characters corresponding to each first element set is calculated before transcoding. Moreover, if the number of transcoded characters corresponding to multiple first element sets is less than or equal to a preset number of characters, transcoding is performed line by line; otherwise, transcoding is not performed according to this method. This ensures that the transcoded message does not have individual lines with excessively long characters. Furthermore, the one-to-one transcoding according to the set number and element number ensures that the transcoded content will not be serialized, thus preventing inconsistencies between the converted format and the teller's input (for example, if the first line is the Chinese name and the second to fourth lines are the address, some addresses will be moved to the first line after conversion). This improves the automated conversion capability between Chinese characters and telegraphic codes, increases the accuracy of mutual conversion, reduces the qualification requirements for practitioners, improves message processing efficiency, and reduces operating costs.
[0096] According to embodiments of this disclosure, the type of each first element further includes a number type and a separator type. In the above operation S230, after performing a first type of transcoding process on each of the M first elements in the first element set, M first telegraph code sets are obtained. Specifically, based on the arrangement order represented by the set number and the element number, the first elements belonging to the Chinese character type in the M first element sets are converted into four-corner codes, and the first elements belonging to the number type and the separator type in the first element set are retained to obtain M first telegraph code sets.
[0097] The above transcoding method involves transcoding each element in the first element set one by one according to the arrangement order (row number) of the first element set. Furthermore, for multiple elements in each first element set, transcoding is performed one by one according to the element number of each element in the set (the arrangement order of each element in each row) (Chinese characters are converted to four-corner codes, while other symbols are retained). Therefore, the resulting M first telegraph code sets correspond one-to-one with the M first element sets, and the contents of the corresponding telegraph code sets also correspond to the contents of the corresponding first element sets.
[0098] One method to convert Chinese characters to their corresponding four-corner codes is to call a Chinese character-four-corner code mapping table and convert the Chinese characters to their corresponding four-corner codes according to the mapping relationship in the table.
[0099] According to embodiments of this disclosure, in the above operation S220, calculating the number of transcoded characters corresponding to each first element set may specifically include the following operations:
[0100] First, determine the number of Chinese characters, numbers, and separators in the first element set.
[0101] Then, based on the number of Chinese characters in the first element set and the preset telegraph code combination format, the target character count corresponding to the number of Chinese characters is calculated. The preset telegraph code combination format can be the character count format requirement for the telegraph code corresponding to each Chinese character. Specifically, after the Chinese characters are converted to four-corner code, the four-corner code corresponding to each Chinese character includes four numeric characters. For example, if the previous step calculated that the number of Chinese characters in a certain element set (corresponding to one line of message) is 10, after converting the Chinese characters to four-corner code, the target character count corresponding to the number of Chinese characters is calculated to be 4 * 10 = 40.
[0102] Next, the sum of the number of target characters, the number of digits, and the number of separators is calculated to obtain the number of transcoded characters corresponding to the first element set.
[0103] According to embodiments of this disclosure, by pre-calculating the number of transcoded characters corresponding to each first element set, the problem of excessively long characters in individual lines of Chinese messages after transcoding can be avoided by pre-exclusion, thereby improving the automated conversion capability between Chinese characters and telegraph codes.
[0104] According to embodiments of this disclosure, the above-described message data processing method further includes:
[0105] If the number of transcoded characters corresponding to any first element set is greater than the preset number of characters, convert M first element sets into N second telegraph code sets. The Chinese meaning represented by the Kth second telegraph code set is different from the Chinese meaning represented by the Kth first element set. K is a positive integer, K is less than or equal to M, and K is less than or equal to N. After parsing the N second telegraph code sets, output N lines of second target telegraph code messages.
[0106] According to embodiments of this disclosure, before transcoding, the number of transcoded characters corresponding to each first element set (i.e., the number of characters after converting each line of Chinese content into telegraph code) is calculated. The aforementioned embodiments provide a method for line-by-line transcoding when the number of transcoded characters corresponding to each first element set is less than or equal to a preset number of characters (see the description in the aforementioned embodiments). Conversely, if the number of transcoded characters corresponding to any first element set is greater than the preset number of characters, i.e., there is a situation where the number of characters after transcoding one or more lines of Chinese is too long, such as a single line of SWIFT messages exceeding 35 characters, then to avoid this problem, the above-mentioned line-by-line transcoding method cannot be used. Instead, serial transcoding can be used to convert M first element sets into N second telegraph code sets.
[0107] According to embodiments of this disclosure, specifically, converting the M first element sets into N second telegraph code sets includes the following operations:
[0108] First, based on the set index and element index, the first elements of the M first element sets are concatenated sequentially to obtain a basic element set. That is, the content corresponding to all lines in the original message before transcoding is strung into one line.
[0109] Then, after performing the first type of transcoding on each basic element in the basic element set, a basic telegraph code set is obtained; for example, the transcoding can be performed element by element, converting Chinese characters into four-corner codes, and retaining delimiters such as numbers and spaces to obtain a string of characters.
[0110] Next, the basic telegraph code set is divided according to a preset limit on the number of characters per line, resulting in N second telegraph code sets. For example, the resulting string is re-split into lines according to the SWIFT specification's 4*35 format, with each line retaining a maximum of 35 characters. Due to the serialization and re-splitting process, there may be instances of serialization. Therefore, the N second telegraph code sets obtained after transcoding do not correspond one-to-one with the M first element sets, and the contents of the corresponding telegraph code sets do not correspond to those of the corresponding first element sets. For example, in the original message format before transcoding, the first line contains the recipient's name in Chinese characters, and lines 2-4 contain the address. After transcoding, some addresses may have moved to the first line.
[0111] According to embodiments of this disclosure, in cases where the number of characters in one or more lines of Chinese text exceeds the limit after transcoding, the above-described serial transcoding method is used to serialize the text and then re-split the lines according to the single-line character limit. This ensures that the number of characters in each line after transcoding will not exceed the limit. Although serial transcoding may occur, this embodiment serves as a fallback method to ensure the compliance of the transcoded message and guarantee the smooth transmission of the message.
[0112] The transcoding method of this disclosure determines in advance whether the number of transcoded characters corresponding to each first element set exceeds the limit before transcoding, and reasonably selects whether to use line-by-line transcoding or serial transcoding. Under the premise of ensuring that the basic message format requirements are met (the number of characters in a single line message does not exceed the limit), the transcoded content is reduced to a certain extent.
[0113] According to embodiments of this disclosure, when the sender initiates a message, Chinese characters are entered and converted into telegraphic code before being sent to the SWIFT network; when the receiver receives the message, the reverse processing is required, converting the telegraphic code back into Chinese characters. The message data processing method of this disclosure can be executed by a financial institution's message transcoding processing system. In addition to the operation method applied in the aforementioned embodiments for the sender's conversion of Chinese messages into telegraphic code, it also includes an operation method applicable to the receiver's conversion of telegraphic code back into Chinese characters, which will be described in detail below.
[0114] Figure 3 A flowchart illustrating a message data processing method according to another embodiment of the present disclosure is shown schematically.
[0115] like Figure 3 As shown, in this embodiment, in addition to including the above references Figure 2 In addition to operations S210 to S240, operations S310 to S330 are also included. For the sake of brevity, the description of operations S210 to S240 is omitted here, wherein:
[0116] In operation S310, a second type of message data to be transcoded is received. The second type of message data to be transcoded includes S third telegraph code sets. Each third telegraph code set is marked with a set number. Each third telegraph code set includes at least a number of four-corner code characters. S is a positive integer.
[0117] According to embodiments of this disclosure, the received second type of message data to be transcoded can be data obtained after character recognition and format extraction of the telegraph code message to be transcoded. The telegraph code message to be transcoded may include multiple lines of message, each line of message may include four-corner characters, Arabic numerals, and separators (e.g., spaces). The obtained second type of message data to be transcoded retains the character content and format information (line information, line order information, character order information, etc.) of the original telegraph code message. Specifically, the second type of message data to be transcoded includes S third telegraph code sets, each third telegraph code set including multiple four-corner characters, reflecting the specific message content. It should be noted that before performing the above operation S310, obtaining the message to be transcoded requires user consent or authorization. For example, a request to obtain user information can be sent to the user. If the user agrees or authorizes the acquisition of user information, the above operation S310 is performed.
[0118] Each of the S third telegraph code sets corresponds one-to-one with one of the S lines of the telegraph message to be transcoded. Each third telegraph code set is marked with a set number, which can be the corresponding line number. Each four-corner code character in the third telegraph code set can also be marked with a character number, which can be the order in which the four-corner code characters are arranged in each line of the message. In this way, the character content and format information of the message to be transcoded can be preserved.
[0119] In operation S320, based on the set sequence number and the preset telegraph code combination rules, the second type of transcoding is performed on the S third telegraph code sets in sequence to obtain S second element sets. The type of the second element in each second element set includes at least Chinese character type and number type.
[0120] According to embodiments of this disclosure, the second type of transcoding process is a transcoding process that converts telegraph codes into Chinese characters. Converting telegraph codes into Chinese characters can be achieved by calling a Chinese character-four-corner code mapping table and converting each four-corner code into its corresponding Chinese character according to the mapping relationship in the table.
[0121] During the transcoding process, the four-corner code characters in each third telegraph code set are transcoded one by one according to the set sequence number (corresponding row sequence number). Furthermore, for multiple four-corner code characters within each third telegraph code set, transcoding is performed individually according to the character sequence number of each four-corner code character. Therefore, the resulting S sets of second elements correspond one-to-one with the S sets of third telegraph codes, and the contents of the corresponding telegraph code sets also correspond to the contents of the corresponding element sets.
[0122] The preset telegraph code combination rules can define the combination rules for standard four-corner codes. Since the four-corner codes are composed of Arabic numerals, they are easily confused with content in the original message that is already composed of Arabic numerals (such as road numbers, house numbers, etc.). However, the combination of Arabic numerals in the original message generally does not meet the preset telegraph code combination rules. Therefore, during the transcoding process, it is also necessary to combine the preset telegraph code combination rules to exclude this part of the original message that is already composed of Arabic numerals and not transcode it.
[0123] After parsing S sets of second elements using operation S330, S lines of target Chinese messages are output. Alternatively, multiple lines of Chinese messages can be output in the order of the rows, based on the sequence numbers of the S sets of second elements (corresponding row numbers).
[0124] According to embodiments of this disclosure, the above-described method performs data reception, transcoding, parsing, and output operations, achieving automatic conversion between Chinese characters and telegraphic codes in two directions (converting Chinese characters to telegraphic codes during remittance and converting telegraphic codes to Chinese characters during receipt). This frees up manpower, improves work efficiency, and avoids human error. Furthermore, by combining set sequence numbers for sequential transcoding, a one-to-one correspondence between the transcoded content and the original content is ensured, improving transcoding accuracy. Moreover, by combining preset telegraphic code combination rules for sequential transcoding, content that is already Arabic numerals in the original message is excluded from transcoding, further ensuring transcoding accuracy.
[0125] Figure 4 A flowchart illustrating a method for performing a second type of transcoding on a third telegraph code set according to an embodiment of the present disclosure is shown.
[0126] According to embodiments of this disclosure, such as Figure 4 As shown, specifically, the process of performing second-type transcoding on S sets of third telegraph codes in sequence based on preset telegraph code combination rules to obtain S sets of second elements may include operations S410 to S430.
[0127] In operation S410, based on a preset telegraph code combination format, multiple four-corner code characters in the third telegraph code set are divided into multiple character unit groups. The preset telegraph code combination format can be that each four-corner code includes 4 characters, and every two four-corner codes are separated by a separator (such as a space). In this way, multiple four-corner codes can be extracted to obtain multiple character unit groups by recognizing the space separator in the text.
[0128] Divide multiple four-corner code characters in the third telegraph code set into multiple character unit groups. For example, multiple four-corner code characters can be divided into multiple character unit groups in the form of groups of 4 characters.
[0129] In operation S420, multiple character unit groups are divided into a first type of character unit group and a second type of character unit group. The four-corner code characters in the first type of character unit group meet the preset telegraph code combination rules, while the four-corner code characters in the second type of character unit group do not meet the preset telegraph code combination rules.
[0130] In operation S430, based on the first type of character unit group and the second type of character unit group, multiple character unit groups in the S third telegraph code set are subjected to second type transcoding processing to obtain S second element sets.
[0131] Specifically, the transcoding method in operation S430 can be to convert only the four-corner codes corresponding to the first type of character unit group into the corresponding Chinese characters. Since the combination of Arabic numerals in the original message generally does not meet the preset telegraphic code combination rules, character unit groups that do not meet the preset telegraphic code combination rules are likely combinations containing Arabic numerals from the original message (e.g., a house number composed of four digits). By transcoding only the first type of character unit group that meets the preset telegraphic code combination rules, the possibility of mis-transcoding is avoided to a certain extent, improving the accuracy of transcoding and the compliance of the message. This can solve the current pain points such as the mis-conversion of message information numeric strings into Chinese characters, reduce the probability of being returned or queried, improve the accuracy of message conversion, and reduce business operation costs.
[0132] Specifically, the transcoding method in operation S430 can also be: traversing multiple character unit groups in the third telegraph code set, and when two or more consecutive character unit groups are first-type character unit groups, performing second-type transcoding on the two or more consecutive first-type character unit groups to obtain the second element set, that is, only converting the four-corner codes corresponding to two or more consecutive first-type character unit groups into the corresponding Chinese characters.
[0133] According to the embodiments of this disclosure, although the four-corner code that satisfies the preset telegraph code combination rules is unlikely to be a combination of Arabic numerals in the original message, it cannot be ruled out that a small number of Arabic numeral combinations in the original message may satisfy the preset telegraph code combination rules. In this case, if this part of the character unit group is transcoded, a mis-transmission will occur, that is, the original numerical string with a specific meaning will be converted into Chinese characters (such as a four-digit house number, road number, etc.), thereby interfering with business processing.
[0134] Considering that in normal scenarios, four-digit numbers such as house numbers and road numbers usually exist alone, and it is extremely rare for two consecutive sets of four-digit numbers to be house numbers or road numbers, based on the situation of most application scenarios, only two or more consecutive character units that conform to the preset telegraphic code combination rules are transcoded, and otherwise no transcoding is performed. This greatly reduces the possibility of mis-transcoding, thereby further improving the accuracy of transcoding and avoiding the impact on business processing due to mis-transcoded Chinese characters.
[0135] Based on the above message data processing method, this disclosure also provides a message data processing apparatus. The following will be combined with... Figure 5 The device is described in detail.
[0136] Figure 5 A schematic block diagram of a message data processing apparatus according to an embodiment of the present disclosure is shown.
[0137] like Figure 5 As shown, the message data processing device 500 in this embodiment includes a first receiving module 510, a calculation module 520, a first transcoding module 530, and a first parsing module 540.
[0138] The first receiving module 510 is used to receive a first type of message data to be transcoded, wherein the first type of message data to be transcoded includes M first element sets, each first element set is marked with a set number, each first element in the first element set is marked with an element number, and the type of each first element includes at least Chinese characters, where M is a positive integer.
[0139] Calculation module 520 is used to calculate the number of transcoded characters corresponding to each first element set;
[0140] The first transcoding module 530 is used to perform a first type of transcoding on each of the M first element sets based on the set index and element index to obtain M first telegraph code sets when the number of transcoded characters corresponding to each of the M first element sets is less than or equal to the preset number of characters. The Chinese meaning represented by the Lth first telegraph code set is the same as the Chinese meaning represented by the Lth first element set. Each first telegraph code set includes at least a number of four-corner code characters, where L is a positive integer and L is less than or equal to M.
[0141] The first parsing module 540 is used to parse M sets of first telegraph codes and output M lines of first target telegraph code messages.
[0142] According to embodiments of this disclosure, the first receiving module 510, calculation module 520, first transcoding module 530, and first parsing module 540 perform data receiving, character count calculation, transcoding, parsing, and output operations. During data processing, the text, character content, and format information of the Chinese message to be transcoded are preserved, enabling automated transcoding by a computer, freeing up manpower, improving work efficiency, and avoiding human error. Furthermore, given the specific length and format requirements of SWIFT messages, before transcoding, the calculation module 520 calculates the transcoding character count corresponding to each first element set. Further, the first transcoding module 530 performs transcoding line by line only if the transcoding character count for each of the multiple first element sets is less than or equal to a preset character count; otherwise, transcoding is not performed according to this method. This ensures that the transcoded message does not have individual lines with excessively long characters. Furthermore, the one-to-one transcoding according to the set number and element number ensures that the transcoded content will not be serialized, thus preventing inconsistencies between the converted format and the teller's input (for example, if the first line is the Chinese name and the second to fourth lines are the address, some addresses will be moved to the first line after conversion). This improves the automated conversion capability between Chinese characters and telegraphic codes, increases the accuracy of mutual conversion, reduces the qualification requirements for practitioners, improves message processing efficiency, and reduces operating costs.
[0143] According to embodiments of this disclosure, the type of each first element further includes a numeric type and a separator type. The first transcoding module includes a first transcoding unit, which is used to convert the first elements belonging to the Chinese character type in the M first element sets into four-corner codes based on the arrangement order represented by the set index and the element index, and to obtain M first telegraph code sets after retaining the first elements belonging to the numeric type and the separator type in the first element sets.
[0144] According to embodiments of this disclosure, the calculation module includes a determining unit, a first calculation unit, and a second calculation unit.
[0145] The unit is configured to determine the number of Chinese characters, numbers, and separators in the first element set; the first calculation unit is configured to calculate the number of target characters corresponding to the number of Chinese characters based on the number of Chinese characters in the first element set and a preset telegraph code combination format; and the second calculation unit is configured to calculate the sum of the number of target characters, numbers, and separators to obtain the number of transcoded characters corresponding to the first element set.
[0146] According to embodiments of this disclosure, the above-described apparatus further includes a second transcoding module and a second parsing module.
[0147] The second transcoding module is used to convert M first element sets into N second telegraph code sets when the number of transcoded characters corresponding to any first element set is greater than the preset number of characters. The Chinese meaning represented by the Kth second telegraph code set is different from the Chinese meaning represented by the Kth first element set. K is a positive integer, K is less than or equal to M, and K is less than or equal to N. The second parsing module is used to parse the N second telegraph code sets and output N lines of second target telegraph code messages.
[0148] According to embodiments of this disclosure, the second transcoding module includes a splicing unit, a second transcoding unit, and a segmentation unit.
[0149] The concatenation unit is used to concatenate the first elements of M first element sets sequentially based on the set index and element index to obtain a basic element set; the second transcoding unit is used to perform first-type transcoding processing on each basic element in the basic element set to obtain a basic telegraph code set; and the segmentation unit is used to segment the basic telegraph code set according to a preset single-line character limit to obtain N second telegraph code sets.
[0150] According to embodiments of this disclosure, the above-described apparatus further includes a second receiving module, a third transcoding module, and a third parsing module.
[0151] The second receiving module is used to receive a second type of message data to be transcoded, which includes S third telegraph code sets, each of which is marked with a set number and includes at least a number of four-corner code characters, where S is a positive integer. The third transcoding module is used to perform second-type transcoding processing on the S third telegraph code sets sequentially based on the set number and a preset telegraph code combination rule to obtain S second element sets, where the type of the second element in each second element set includes at least Chinese characters and numbers. The third parsing module is used to parse the S second element sets and output S lines of target Chinese message.
[0152] According to embodiments of this disclosure, the third transcoding module includes a partitioning unit, a classification unit, and a third transcoding unit.
[0153] The system includes: a partitioning unit, used to divide multiple four-corner code characters in the third telegraph code set into multiple character unit groups based on a preset telegraph code combination format; a classification unit, used to divide the multiple character unit groups into a first type of character unit group and a second type of character unit group, wherein the four-corner code characters in the first type of character unit group satisfy the preset telegraph code combination rules, and the four-corner code characters in the second type of character unit group do not satisfy the preset telegraph code combination rules; and a third transcoding unit, used to perform second-type transcoding processing on the multiple character unit groups in the S third telegraph code set based on the first type of character unit group and the second type of character unit group to obtain S second element sets.
[0154] According to an embodiment of this disclosure, the third transcoding unit includes a transcoding subunit, which is used to traverse multiple character unit groups in the third telegraph code set. When two or more consecutive character unit groups are first type character unit groups, the two or more consecutive first type character unit groups are subjected to second type transcoding processing to obtain a second element set.
[0155] According to embodiments of this disclosure, any plurality of modules among the first receiving module 510, the calculation module 520, the first transcoding module 530, and the first parsing module 540 can be combined into one module, or any one of these modules can be split into multiple modules. Alternatively, at least part of the functionality of one or more of these modules can be combined with at least part of the functionality of other modules and implemented in one module. According to embodiments of this disclosure, at least one of the first receiving module 510, the calculation module 520, the first transcoding module 530, and the first parsing module 540 can be at least partially implemented as hardware circuitry, such as a field-programmable gate array (FPGA), a programmable logic array (PLA), a system-on-a-chip, a system-on-a-substrate, a system-on-package, an application-specific integrated circuit (ASIC), or implemented in hardware or firmware by any other reasonable means of integrating or packaging the circuitry, or implemented in any one of the three implementation methods of software, hardware, and firmware, or in a suitable combination of any of these. Alternatively, at least one of the first receiving module 510, the calculation module 520, the first transcoding module 530, and the first parsing module 540 may be implemented at least partially as a computer program module, which can perform corresponding functions when the computer program module is run.
[0156] Figure 6 A block diagram schematically illustrates an electronic device suitable for implementing a message data processing method according to an embodiment of the present disclosure.
[0157] like Figure 6 As shown, an electronic device 600 according to an embodiment of this disclosure includes a processor 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage portion 608 into a random access memory (RAM) 603. The processor 601 may include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or an associated chipset and / or a special-purpose microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 601 may also include onboard memory for caching purposes. The processor 601 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of this disclosure.
[0158] RAM 603 stores various programs and data required for the operation of electronic device 600. Processor 601, ROM 602, and RAM 603 are interconnected via bus 604. Processor 601 performs various operations of the method flow according to embodiments of the present disclosure by executing programs in ROM 602 and / or RAM 603. It should be noted that the programs may also be stored in one or more memories other than ROM 602 and RAM 603. Processor 601 may also perform various operations of the method flow according to embodiments of the present disclosure by executing programs stored in said one or more memories.
[0159] According to embodiments of this disclosure, the electronic device 600 may further include an input / output (I / O) interface 605, which is also connected to a bus 604. The electronic device 600 may also include one or more of the following components connected to the I / O interface 605: an input section 606 including a keyboard, mouse, etc.; an output section 607 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 608 including a hard disk, etc.; and a communication section 609 including a network interface card such as a LAN card, modem, etc. The communication section 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to the I / O interface 605 as needed. A removable medium 611, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on the drive 610 as needed so that computer programs read from it can be installed into the storage section 608 as needed.
[0160] This disclosure also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or it may exist independently and not assembled into the device / apparatus / system. The computer-readable storage medium carries one or more programs that, when executed, implement the method according to the embodiments of this disclosure.
[0161] According to embodiments of this disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium, such as including, but not limited to: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this disclosure, the computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. For example, according to embodiments of this disclosure, the computer-readable storage medium may include ROM 602 and / or RAM 603 and / or one or more memories other than ROM 602 and RAM 603 described above.
[0162] Embodiments of this disclosure also include a computer program product comprising a computer program containing program code for performing the methods shown in the flowchart. When the computer program product is run on a computer system, the program code enables the computer system to implement the message data processing method provided in the embodiments of this disclosure.
[0163] When the computer program is executed by the processor 601, it performs the functions defined in the system / apparatus of this disclosure embodiments. According to embodiments of this disclosure, the systems, apparatuses, modules, units, etc., described above can be implemented by computer program modules.
[0164] In one embodiment, the computer program may rely on a tangible storage medium such as an optical storage device or a magnetic storage device. In another embodiment, the computer program may also be transmitted and distributed in the form of signals over a network medium, and downloaded and installed via the communication section 609, and / or installed from the removable medium 611. The program code contained in the computer program can be transmitted using any suitable network medium, including but not limited to: wireless, wired, etc., or any suitable combination thereof.
[0165] In such an embodiment, the computer program can be downloaded and installed from a network via the communication section 609, and / or installed from the removable medium 611. When the computer program is executed by the processor 601, it performs the functions defined in the system of this disclosure embodiment. According to embodiments of this disclosure, the systems, devices, apparatuses, modules, units, etc., described above can be implemented by computer program modules.
[0166] According to embodiments of this disclosure, program code for executing the computer programs provided in embodiments of this disclosure can be written in any combination of one or more programming languages. Specifically, these computational programs can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages include, but are not limited to, languages such as Java, C++, Python, "C", or similar programming languages. The program code can execute entirely on the user's computing device, partially on the user's device, partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).
[0167] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0168] Those skilled in the art will understand that the features described in the various embodiments and / or claims of this disclosure can be combined or combined in various ways, even if such combinations or combinations are not explicitly described in this disclosure. In particular, the features described in the various embodiments and / or claims of this disclosure can be combined or combined in various ways without departing from the spirit and teachings of this disclosure. All such combinations and / or combinations fall within the scope of this disclosure.
[0169] The embodiments of this disclosure have been described above. However, these embodiments are for illustrative purposes only and are not intended to limit the scope of this disclosure. Although various embodiments have been described above, this does not mean that the measures in the various embodiments cannot be used advantageously in combination. The scope of this disclosure is defined by the appended claims and their equivalents. Various substitutions and modifications can be made by those skilled in the art without departing from the scope of this disclosure, and all such substitutions and modifications should fall within the scope of this disclosure.
Claims
1. A message data processing method, comprising: Receive a first type of message data to be transcoded, wherein the first type of message data to be transcoded includes M sets of first elements, each set of first elements is marked with a set number, each first element in the set of first elements is marked with an element number, and the type of each first element includes at least Chinese characters, where M is a positive integer. Calculate the number of transcoded characters corresponding to each of the first element sets; When the number of transcoded characters corresponding to each of the M first element sets is less than or equal to the preset number of characters, based on the set index and the element index, the first type of transcoding processing is performed on each of the M first element sets to obtain M first telegraph code sets. The Chinese meaning represented by the Lth first telegraph code set is the same as the Chinese meaning represented by the Lth first element set. Each first telegraph code set includes at least a plurality of four-corner code characters. L is a positive integer and L is less than or equal to M. After parsing the M first telegraph code sets, output M lines of first target telegraph code messages; Receive the second type of message data to be transcoded, wherein the second type of message data to be transcoded includes S third telegraph code sets, each third telegraph code set is marked with a set number, and each third telegraph code set includes at least a number of four-corner code characters, where S is a positive integer; Based on the set index and the preset telegraph code combination rules, S sets of third telegraph codes are sequentially subjected to the second type of transcoding processing to obtain S sets of second elements. The types of the second elements in each set of second elements include at least Chinese characters and numbers. The second type of transcoding processing on the S sets of third telegraph codes includes: dividing multiple four-corner code characters in the third telegraph code sets into multiple character unit groups based on the preset telegraph code combination format; dividing the multiple character unit groups into first-type character unit groups and second-type character unit groups, wherein the four-corner code characters in the first-type character unit groups satisfy the preset telegraph code combination rules, while the four-corner code characters in the second-type character unit groups do not satisfy the preset telegraph code combination rules; and performing the second type of transcoding processing on the multiple character unit groups in the S sets of third telegraph codes based on the first-type and second-type character unit groups to obtain S sets of second elements. After parsing the S sets of second elements, output S lines of target Chinese messages.
2. The method according to claim 1, wherein, The types of each of the first elements also include number type and separator type. After performing the first type of transcoding processing on each of the M first element sets, the resulting M first telegraph code sets include: Based on the arrangement order represented by the set index and the element index, the first elements belonging to the Chinese character type in the M first element sets are converted into four-corner codes, and the first elements belonging to the number type and the separator type in the first element sets are retained to obtain the M first telegraph code sets.
3. The method according to claim 2, wherein calculating the number of transcoded characters corresponding to each of the first element sets includes: Determine the number of Chinese characters, numbers, and separators in the first element set; The number of target characters corresponding to the number of Chinese characters is calculated based on the number of Chinese characters in the first element set and the preset telegraph code combination format; The sum of the number of target characters, the number of numbers, and the number of separators is calculated to obtain the number of transcoded characters corresponding to the first element set.
4. The method according to claim 1, further comprising: If the number of transcoded characters corresponding to any of the first element sets is greater than the preset number of characters, the M first element sets are converted into N second telegraph code sets, wherein the Chinese meaning represented by the Kth second telegraph code set is different from the Chinese meaning represented by the Kth first element set, where K is a positive integer, K is less than or equal to M, and K is less than or equal to N. After parsing the N sets of second telegraph codes, output N lines of second target telegraph code messages.
5. The method according to claim 4, wherein, Converting the M sets of first elements into N sets of second telegraph codes includes: Based on the set index and the element index, the first elements of the M first element sets are sequentially concatenated to obtain a basic element set; After performing the first type of transcoding process on each basic element in the basic element set in sequence, a basic telegraph code set is obtained. The basic telegraph code set is divided into N second telegraph code sets according to the preset single-line character limit.
6. The method according to claim 1, wherein, Based on the first type of character unit group and the second type of character unit group, after performing the second type of transcoding processing on the multiple character unit groups in the S third telegraph code sets, S sets of the second elements are obtained, including: By traversing the plurality of character unit groups in the third telegraph code set, and when two or more consecutive character unit groups are of the first type of character unit groups, the second type of transcoding is performed on the two or more consecutive first type of character unit groups to obtain the second element set.
7. A message data processing apparatus, comprising: The first receiving module is used to receive a first type of message data to be transcoded, wherein the first type of message data to be transcoded includes M first element sets, each first element set is marked with a set number, each first element in the first element set is marked with an element number, and the type of each first element includes at least Chinese character type, wherein M is a positive integer. The calculation module is used to calculate the number of transcoded characters corresponding to each of the first element sets; The first transcoding module is used to perform a first type of transcoding processing on each of the M first element sets based on the set index and the element index to obtain M first telegraph code sets when the number of transcoded characters corresponding to each of the M first element sets is less than or equal to a preset number of characters. The Chinese meaning represented by the Lth first telegraph code set is the same as the Chinese meaning represented by the Lth first element set. Each first telegraph code set includes at least a plurality of four-corner code characters, where L is a positive integer and L is less than or equal to M. The first parsing module is used to parse the M first telegraph code sets and output M lines of first target telegraph code messages; The second receiving module is used to receive the second type of message data to be transcoded, wherein the second type of message data to be transcoded includes S third telegraph code sets, each third telegraph code set is marked with a set number, and each third telegraph code set includes at least a number of four-corner code characters, where S is a positive integer; The third transcoding module is used to sequentially perform second-type transcoding processing on S third telegraph code sets based on the set sequence number and preset telegraph code combination rules to obtain S second element sets. The types of the second elements in each second element set include at least Chinese character types and numeric types. The third transcoding module includes a partitioning unit, a classification unit, and a third transcoding unit. The partitioning unit is used to divide multiple four-corner code characters in the third telegraph code sets into multiple character unit groups based on the preset telegraph code combination format. The classification unit is used to divide the multiple character unit groups into first-type character unit groups and second-type character unit groups, wherein the four-corner code characters in the first-type character unit groups satisfy the preset telegraph code combination rules, while the four-corner code characters in the second-type character unit groups do not satisfy the preset telegraph code combination rules. The third transcoding unit is used to perform the second-type transcoding processing on the multiple character unit groups in the S third telegraph code sets based on the first-type character unit groups and the second-type character unit groups to obtain S second element sets. The third parsing module is used to parse the S sets of second elements and output S lines of target Chinese messages.
8. An electronic device, comprising: One or more processors; Storage device for storing one or more programs. Wherein, when the one or more programs are executed by the one or more processors, the one or more processors perform the method according to any one of claims 1 to 6.
9. A computer-readable storage medium having stored thereon executable instructions that, when executed by a processor, cause the processor to perform the method according to any one of claims 1 to 6.
10. A computer program product comprising a computer program that, when executed by a processor, implements the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Data processing method and device, electronic equipment and storage medium
CN111224967A
Message forwarding method and device, vehicle-mounted network system and readable storage medium
CN114827290A