Data processing method, device, electronic device and storage medium
By using the mapping information of the second electronic device to convert character encoding in the first electronic device, the communication failure problem caused by inconsistency in the character set is solved, and successful communication between the electronic devices is achieved.
Patent Information
- Application Number
- CN202210060645.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-19
- Publication Date
- 2025-08-29
- Estimated Expiration
- 2042-01-19
AI Technical Summary
When communicating between electronic devices, the encoding methods are inconsistent due to the use of different character sets, resulting in different encoding information of the same characters under different encoding methods, resulting in communication failure.
By storing the mapping information of the second electronic device in the first electronic device, determining the character encoding in the first transmission data and converting it into encoding information that the second electronic device can decode, the mapping relationship conversion of the character and character encoding is realized.
This enables the second electronic device to successfully decode the communication content, achieve successful communication, and improves the integrity and reliability of communication.
Smart Images

Figure CN114417786B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a data processing method, device, electronic device, and storage medium. Background Art
[0002] During the communication process between two electronic devices, if the two devices use different character sets, due to the different encoding methods of different character sets, the encoding information obtained by the same character under different encoding methods is different. Therefore, the electronic devices often cannot read the complete communication content because some characters cannot be correctly decoded, which leads to communication failure. Summary of the Invention
[0003] The embodiments of the present application provide a data processing method, device, electronic device and storage medium, which can enable an electronic device serving as a recipient to successfully decode the received encoded information, thereby obtaining the complete communication content, which is conducive to achieving successful communication.
[0004] In one aspect, an embodiment of the present application provides a data processing method, which is applied to a first electronic device and includes:
[0005] Acquire first encoding information of first transmission data to be transmitted to a second electronic device;
[0006] Determining, based on first mapping information of the first electronic device, first characters corresponding to respective first character codes in the first coding information, where the first characters match characters in the first transmission data, the first mapping information being used to indicate a mapping relationship between characters and character codes;
[0007] Determining, based on second mapping information of the second electronic device, a second character code corresponding to each of the first characters to obtain second encoding information of the first transmission data, the second encoding information including each of the second character codes, the second mapping information being used to indicate a mapping relationship between characters and character codes;
[0008] The second coded information is sent to the second electronic device.
[0009] In one embodiment, it also includes: obtaining third mapping information, where the third mapping information is used to indicate a mapping relationship between a first character and a second character; determining a second character corresponding to each of the first characters based on the third mapping information; determining a second character code corresponding to each of the first characters based on the second mapping information of the second electronic device, including: determining a second character code corresponding to each of the second characters based on the second mapping information.
[0010] In one embodiment, the method further includes: receiving third coding information sent by the second electronic device, wherein each third character code in the third coding information is a character code corresponding to each character in the second transmission data determined by the second electronic device based on the second mapping information, and the second transmission data is generated by the second electronic device in response to the second coding information; based on the second mapping information, determining the characters corresponding to each third character code to obtain the second transmission data, and the second transmission data includes the characters corresponding to each third character code.
[0011] In one embodiment, before determining the second character encoding corresponding to each first character based on the second mapping information of the second electronic device, the method further includes: receiving fourth encoding information sent by the second electronic device; traversing each mapping information stored in the first electronic device, and decoding the fourth encoding information based on the traversed mapping information; if the decoding is successful, determining the traversed mapping information as the second mapping information of the second electronic device.
[0012] In one embodiment, before determining the second character encoding corresponding to each first character based on the second mapping information of the second electronic device, the method further includes: receiving fourth encoding information sent by the second electronic device; obtaining mapping identification information of the second mapping information from the second electronic device; and determining the mapping information corresponding to the mapping identification information as the second mapping information of the second electronic device.
[0013] In one embodiment, it also includes: if the mapping information corresponding to the mapping identification information exists in the first electronic device, the mapping information corresponding to the mapping identification information stored in the first electronic device is determined as the second mapping information of the second electronic device; if the mapping information corresponding to the mapping identification information does not exist in the first electronic device, the mapping information corresponding to the mapping identification information is downloaded; and the downloaded mapping information is determined as the second mapping information of the second electronic device.
[0014] In one embodiment, it also includes: sending the first transmission data and the device identification information of the second electronic device to a server, wherein the server stores a plurality of mapping information, each mapping information being used to indicate a mapping relationship between a character and a character encoding, so that the server searches for the second mapping information of the second electronic device corresponding to the device identification information in the plurality of mapping information, and the server determines the second character encoding corresponding to each first character in the first transmission data based on the second mapping information to obtain the second encoding information of the first transmission data, and the server sends the second encoding information to the second electronic device.
[0015] On the other hand, an embodiment of the present application provides a data processing device, the data processing device comprising:
[0016] An acquiring unit, configured to obtain first coding information of first transmission data to be transmitted to a second electronic device;
[0017] a processing unit, configured to determine, based on first mapping information of the first electronic device, first characters corresponding to respective first character codes in the first coding information, where the first characters match characters in the first transmission data, the first mapping information being used to indicate a mapping relationship between characters and character codes;
[0018] The processing unit is further configured to determine, based on second mapping information of the second electronic device, a second character code corresponding to each of the first characters, to obtain second encoding information of the first transmission data, where the second encoding information includes each of the second character codes, and the second mapping information is used to indicate a mapping relationship between characters and character codes;
[0019] A sending unit is used to send the second coded information to the second electronic device.
[0020] On the other hand, an embodiment of the present application provides an electronic device, including a processor, a storage device and a communication interface, wherein the processor, the storage device and the communication interface are interconnected, wherein the storage device is used to store a computer program that supports a terminal to execute the above method, the computer program includes program instructions, and the processor is configured to call the program instructions to perform the following steps: obtaining first encoding information of first transmission data to be transmitted to a second electronic device; based on the first mapping information of the first electronic device, determining the first character corresponding to each first character encoding in the first encoding information, the first character matches the character in the first transmission data, and the first mapping information is used to indicate the mapping relationship between the character and the character encoding; based on the second mapping information of the second electronic device, determining the second character encoding corresponding to each first character to obtain the second encoding information of the first transmission data, the second encoding information includes each second character encoding, the second mapping information is used to indicate the mapping relationship between the character and the character encoding, and sending the second encoding information to the second electronic device.
[0021] On the other hand, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. The computer program includes program instructions, and when the program instructions are executed by a processor, the processor executes the above-mentioned data processing method.
[0022] In an embodiment of the present application, first obtain the first encoding information of the first transmission data to be transmitted to the second electronic device; based on the first mapping information of the first electronic device, determine the first character corresponding to each first character encoding in the first encoding information, the first character matches the character in the first transmission data, and the first mapping information is used to indicate the mapping relationship between the character and the character encoding; based on the second mapping information of the second electronic device, determine the second character encoding corresponding to each first character to obtain the second encoding information of the first transmission data, the second encoding information includes each second character encoding, the second mapping information is used to indicate the mapping relationship between the character and the character encoding, and the second encoding information is sent to the second electronic device. In an embodiment of the present application, through the second mapping information of the second electronic device stored in the first electronic device, each character in the first transmission data to be transmitted to the second electronic device can be encoded into the second encoding information that the second electronic device can directly decode successfully, so that the second electronic device can successfully decode the second encoding information, thereby obtaining the complete communication content, which is conducive to achieving successful communication. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0024] Figure 1 This is a structural diagram of a data processing system provided in an embodiment of the present application;
[0025] Figure 2 This is a flow chart of a data processing method provided in an embodiment of the present application;
[0026] Figure 3 This is a schematic diagram of a process for determining a first character provided by an embodiment of the present application;
[0027] Figure 4 This is a schematic diagram of a process for determining a second character code provided by an embodiment of the present application;
[0028] Figure 5 This is a flow chart of another data processing method provided in an embodiment of the present application;
[0029] Figure 6 is a schematic diagram of a decoding process provided in an embodiment of the present application;
[0030] Figure 7is a structural diagram of another data processing system provided in an embodiment of the present application;
[0031] Figure 8 This is a flow chart of another data processing method provided in an embodiment of the present application;
[0032] Figure 9 is a structural diagram of a data processing device provided in an embodiment of the present application;
[0033] Figure 10 This is a structural diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0034] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0035] The embodiment of the present application provides a data processing system. Figure 1 , is a structural diagram of a data processing system provided in an embodiment of the present application. Figure 1 The data processing system shown may include a first electronic device 101 and a second electronic device 102. The first electronic device 101 or the second electronic device 102 may include any one or more of a smartphone, a tablet computer, a laptop computer, and a desktop computer. The first electronic device 101 or the second electronic device 102 may also be a server, such as an independent physical server or a server cluster or distributed system composed of multiple physical servers. The first electronic device 101 and the second electronic device 102 may be directly or indirectly connected to each other via wired or wireless communication, which is not limited in this application.
[0036] Based on the above-mentioned data processing system, an embodiment of the present application also provides a data processing method. This data processing method can encode each character in the first transmission data to be transmitted to the second electronic device into second encoding information that can be directly decoded successfully by the second electronic device through the second mapping information of the second electronic device stored in the first electronic device, so that the second electronic device can successfully decode the second encoding information, thereby obtaining the complete communication content, which is conducive to achieving successful communication.
[0037] It should be noted that the embodiments of this application introduce the data processing solutions mentioned in the embodiments of this application by taking relevant scenarios where the transmitted data is characters as an example, which does not limit the embodiments of this application. The data processing solutions mentioned in the embodiments of this application can also be applied to other scenarios that require data transmission, and the embodiments of this application do not limit this.
[0038] Please refer to Figure 2 , Figure 2 which is a schematic flowchart of a data processing method provided by an embodiment of this application; as Figure 2 shown, the data processing solution can be executed by the first electronic device shown in Figure 1 and can be applied to the data processing system shown in Figure 1 . This solution includes but is not limited to steps S201 to S204, where:
[0039] S201, obtain the first encoding information of the first transmission data to be transmitted to the second electronic device.
[0040] In the embodiments of this application, the first transmission data can be a text document such as an email or a file message, or other data containing characters, which is not limited here. The method of obtaining the first encoding information of the first transmission data to be transmitted to the second electronic device can be to obtain the character encoding reflected by the characters input or displayed by the user on the electronic device in the electronic device, so as to obtain the first encoded data.
[0041] In the embodiments of this application, the first encoding information refers to information composed of at least one character encoding, where the characters corresponding to the character encodings in the first encoding information are the same as the characters in the first transmission data. For example, if the character set supported by the first electronic device is utf-8, then the encoding method of the first electronic device is the encoding method corresponding to the character set utf-8. If the first transmission data is "The weather is not bad today!", then the first encoding information includes "0x4ECA0x5929 0x5929 0x6C14 0x8FD8 0x4E0D 0x9519 0xFF01". Among them, the character "今" corresponds to the character encoding "0x4ECA"; the character "天" corresponds to the character encoding "0x5929"; the character "气" corresponds to the character encoding "0x6C14"; the character "还" corresponds to the character encoding "0x8FD8"; the character "不" corresponds to the character encoding "0x4E0D"; the character "错" corresponds to the character encoding "0x9519"; the character "!" corresponds to the character encoding "0xFF01".
[0042] S202. Based on the first mapping information of the first electronic device, determine the first characters corresponding to each first character code in the first coding information, where the first characters match the characters in the first transmission data, and the first mapping information is used to indicate the mapping relationship between characters and character codes.
[0043] In the embodiments of the present application, the first mapping information refers to the mapping relationship between each character and each character code in the first electronic device. Specifically, a character code is a number that converts a symbol into a digital system that a computer can accept, and can also be called a digital code. Through the mapping relationship between characters and character codes, it is convenient for an electronic device to store characters and also convenient for communication between electronic devices through characters.
[0044] In the embodiments of the present application, the method for determining the first characters corresponding to each first character code in the first coding information may be: determine the target character code in the first mapping information that is the same as the character code in the first coding information, and then determine the target character corresponding to the target character code in the first mapping information. Then this target character is the first character corresponding to the character code in the first coding information.
[0045] Exemplarily, please refer to the appendix Figure 3 which shows a schematic diagram of a process for determining the first characters. The coding method of the first electronic device is the coding method corresponding to the character set utf-8, the first mapping information is the mapping relationship between characters and character codes in the character set utf-8, and the first coding information is "0x8DF3 0x8FDC". Then, determine the character codes in the first mapping information that are the same as "0x8DF3" and "0x8FDC". Since the character corresponding to "0x8DF3" in the first mapping information is "跳" (jump in Chinese), and the character corresponding to "0x8FDC" is "远" (far in Chinese), it can be determined that the first characters corresponding to the character codes "0x8DF3" and "0x8FDC" in the first coding information are "跳" and "远" respectively.
[0046] S203. Based on the second mapping information of the second electronic device, determine the second character codes corresponding to each first character to obtain the second coding information of the first transmission data, where the second coding information includes each second character code, and the second mapping information is used to indicate the mapping relationship between characters and character codes.
[0047] S204. Send the second coding information to the second electronic device.
[0048] In an embodiment of the present application, the method for determining the second character encoding corresponding to each of the first characters may be: based on finding a target character identical to the first character in the second mapping information, then determining the character encoding corresponding to the target character, and finally using the character encoding corresponding to the target character as the second character encoding corresponding to the first character. Exemplarily, there are three first characters, namely the first character "吃", the first character "饭", and the first character "。"; then, through character verification, character similarity comparison, and other methods, the first target character identical to the first character "吃", the second target character identical to the first character "饭", and the third target character identical to the first character "。" are determined among all the characters in the second mapping information. Finally, based on the second mapping information, the character encodings corresponding to the first target character, the second target character, and the third target character are determined, using the character encoding corresponding to the first target character as the second character encoding corresponding to the first character "吃", the character encoding corresponding to the second target character as the second character encoding corresponding to the second character "饭", and the character encoding corresponding to the third target character as the second character encoding corresponding to the third character "。".
[0049] In a possible implementation manner, it may also be to obtain a third mapping information, which is used to indicate the mapping relationship between the first character and the second character; based on the third mapping information, determine the second character corresponding to each first character; based on the second mapping information of the second electronic device, determine the second character encoding corresponding to each first character, including: based on the second mapping information, determine the second character encoding corresponding to each second character.
[0050] Specifically, directly establishing the mapping relationship between the characters in the first mapping information and each character in the second mapping information can eliminate the need to determine the target character corresponding to the first character through methods such as character verification and character similarity comparison. In addition, if there is a rare character M and its corresponding character encoding in the mapping information a of electronic device A, but the rare character M does not exist in the mapping information b of electronic device B, and there is no character encoding corresponding to the rare character M; then, at this time, it is impossible to determine the character corresponding to the rare character M in the mapping information of electronic device B through character verification or character similarity comparison. However, the rare character M can point to another similar or synonymous character N in the mapping information b. Therefore, by presetting the mapping relationship between each character in the mapping information a and each character in the mapping information b, it is not only beneficial to improve the conversion speed of converting the first encoding information into the second encoding information, but also can improve the accuracy of character conversion.
[0051] For example, please refer to the appendix Figure 4 , which shows a schematic diagram of a process for determining the second character encoding. The first characters in the first transmission data obtained by the first electronic device A and to be transmitted to the second electronic device B include Then, the first character can be determined according to the third mapping information The corresponding second character of the first character is "喃", the second character corresponding to the first character "自" is "自", and the second character corresponding to the first character "语" is "語". Finally, according to the relationship between characters and character encodings in the second mapping information of the second electronic device B, the second character encoding of the first character is "XXX", the second character encoding of the first character "自" is "XX", and the second character encoding of the first character "语" is "XXXX". The finally obtained second encoding information is "XXX XXX XX XXXX".
[0052] In a possible implementation manner, it is also possible to implement the conversion of the first character to the second character based on the mapping relationship between characters of the first electronic device and the second electronic device in the third mapping information, so as to determine the second character corresponding to the first character. Exemplarily, the character set used by the first electronic device (i.e., the sending device) is the utf-8 character set, and the character set used by the second electronic device (i.e., the receiving device) is the gbl3000 character set; the font library of the character set used by the second electronic device is also installed in the first electronic device. The first electronic device can establish the mapping relationship between each character in the font library of the utf-8 character set and each character in the font library of the gbl3000 character set, that is, the mapping information Z. After the first electronic device determines the first character in the first transmission data to be transmitted to the second electronic device, the first character is then converted into the second character through the character conversion program and the mapping information Z. Preferably, the first electronic device can encode all the second characters in the encoding manner of the gbl3000 character set to obtain the second encoding information, and send the second encoding information to the second electronic device. The code example of the character conversion program is as follows:
[0053]
[0054] In an embodiment of the present application, first obtain the first encoding information of the first transmission data to be transmitted to the second electronic device; based on the first mapping information of the first electronic device, determine the first character corresponding to each first character encoding in the first encoding information, the first character matches the character in the first transmission data, and the first mapping information is used to indicate the mapping relationship between the character and the character encoding; based on the second mapping information of the second electronic device, determine the second character encoding corresponding to each first character to obtain the second encoding information of the first transmission data, the second encoding information includes each second character encoding, the second mapping information is used to indicate the mapping relationship between the character and the character encoding, and send the second encoding information to the second electronic device. In an embodiment of the present application, through the second mapping information of the second electronic device stored in the first electronic device, each character in the first transmission data to be transmitted to the second electronic device can be encoded into the second encoding information that the second electronic device can directly decode successfully, so that the second electronic device can successfully decode the second encoding information, thereby obtaining the complete communication content, which is conducive to achieving successful communication.
[0055] See Figure 5 , Figure 5 is a flow chart of another data processing method provided in an embodiment of the present application; Figure 5 The data processing scheme shown can be Figure 1 The first electronic device and the second electronic device shown in the figure can be used to perform Figure 1 The data processing system shown in FIG. 5 may include, but is not limited to, steps S501 to S507, wherein:
[0056] S501: A first electronic device obtains first coding information of first transmission data to be transmitted to a second electronic device.
[0057] S502: The first electronic device determines, based on first mapping information, first characters corresponding to respective first character codes in the first coding information, where the first characters match characters in the first transmission data. The first mapping information is used to indicate a mapping relationship between characters and character codes.
[0058] It should be noted that the specific implementation process of step S501-step S502 can be found in Figure 2 The relevant description of the specific implementation process shown in steps S201 and S202 in the illustrated embodiment is not repeated here.
[0059] S503, the first electronic device determines the second character code corresponding to each first character based on the second mapping information of the second electronic device to obtain second coding information of the first transmission data, wherein the second coding information includes each second character code, and the second mapping information is used to indicate the mapping relationship between the character and the character code.
[0060] In an embodiment of the present application, before determining the second character encoding corresponding to each first character based on the second mapping information of the second electronic device, fourth encoding information sent by the second electronic device may be received first; then, each mapping information stored in the first electronic device is traversed, and the fourth encoding information is decoded based on the traversed mapping information; if the decoding is successful, the traversed mapping information is determined as the second mapping information of the second electronic device.
[0061] Specifically, if the first electronic device has not communicated with the second electronic device before, and this is the first time to receive the coded information sent by the second electronic device, then the mapping information stored in the first electronic device can be used to decode the fourth coded information sent by the second electronic device one by one, that is, the character codes in the fourth coded information are converted into characters. If there is mapping information that makes each character code in the fourth coded information successfully converted into characters without garbled characters, it means that the decoding is successful. Therefore, it can be determined that the mapping information is the mapping information used by the second electronic device, that is, the second mapping information.
[0062] In one possible implementation, before determining the second character encoding corresponding to each first character based on the second mapping information of the second electronic device, the fourth encoding information sent by the second electronic device may be received first; then the mapping identification information of the second mapping information is obtained from the second electronic device; and the mapping information corresponding to the mapping identification information is determined as the second mapping information of the second electronic device.
[0063] Specifically, the method of obtaining the mapping identification information of the second mapping information from the second electronic device may be to send a mapping information confirmation request to the second electronic device, and then the second electronic device sends the mapping identification information of the second mapping information to the first electronic device based on the mapping information confirmation request. The method of obtaining the mapping identification information of the second mapping information from the second electronic device may also be that the second electronic device sends the mapping identification information of the second mapping information to the first electronic device when sending the fourth coded information. Preferably, the mapping identification information of the second mapping information can also be obtained from the second electronic device in other ways, which are not limited here.
[0064] In one possible implementation, if mapping information corresponding to the mapping identification information exists in the first electronic device, the mapping information corresponding to the mapping identification information stored in the first electronic device is determined as the second mapping information of the second electronic device; if the mapping information corresponding to the mapping identification information does not exist in the first electronic device, the mapping information corresponding to the mapping identification information is downloaded; and the downloaded mapping information is determined as the second mapping information of the second electronic device.
[0065] In one possible implementation, it is also possible to traverse the various mapping information stored in the first electronic device, and decode the fourth coded information based on the mapping information obtained through the traversal. If the decoding fails, the mapping identification information of the second mapping information is obtained from the second electronic device, and then the mapping information corresponding to the mapping identification information is downloaded; finally, the downloaded mapping information is determined as the second mapping information of the second electronic device.
[0066] For example, see the attached Figure 6 , shows a schematic diagram of a decoding process. Electronic devices 601 and 602 have not communicated with each other before. Electronic device 601 is used by user A, and electronic device 602 is used by user B. When electronic device 602 sends encoded information Z1 to electronic device 601, electronic device 601 first traverses pre-stored mapping information 1 to mapping information N, using each mapping information to decode encoded information Z1 one by one. However, each mapping information decodes encoded information Z1 and produces garbled characters. Therefore, it is determined that electronic device 601 has failed to decode. Electronic device 601 then sends a mapping information confirmation request to electronic device 602, and electronic device 602 returns mapping identification information Z2 to electronic device 601. Electronic device 601 then downloads mapping information Z3 corresponding to mapping identification information Z2 and decodes encoded information Z1 using mapping information Z3 to obtain transmission data Z4. Finally, electronic device 601 displays each character in transmission data Z4 for user A to view.
[0067] S504: The first electronic device sends the second coded information to the second electronic device.
[0068] S505: The second electronic device generates third coding information in response to the second coding information, wherein each third character code in the third coding information is a character code corresponding to each character in the second transmission data determined by the second electronic device based on the second mapping information.
[0069] In an embodiment of the present application, the second electronic device generates the third coded information in response to the second coded information. After receiving the second coded information, the second electronic device decodes the second coded information through the second mapping information used by the second electronic device to obtain the first transmission data. After viewing the first transmission data, the user object of the second electronic device or the information processing system running in the second electronic device inputs the second transmission data, and then encodes the second transmission data through the second mapping information used by the second electronic device to obtain the second coded information.
[0070] Exemplarily, after the second electronic device receives the second coded information, it decodes the second coded information through the second mapping information used by the second electronic device, and the obtained first transmission data is "Let's meet at the company at 12 noon tomorrow!" After the user of the second electronic device views the first transmission data, he enters the second transmission data "Okay, I will be there on time", and finally the second electronic device encodes the second transmission data through the second mapping information to obtain the second coded information.
[0071] S506: The second electronic device sends the third coded information to the first electronic device.
[0072] S507: The first electronic device determines, based on the second mapping information, characters corresponding to the third character codes to obtain second transmission data, where the second transmission data includes characters corresponding to the third character codes.
[0073] In the embodiment of the present application, the specific implementation process of step S507 can be found in Figure 2 The relevant description of the specific implementation process shown in step S202 in the illustrated embodiment is not repeated here.
[0074] In an embodiment of the present application, a first electronic device first obtains first encoding information of first transmission data to be transmitted to a second electronic device; then, based on the first mapping information of the first electronic device, determines the first character corresponding to each first character encoding in the first encoding information, and based on the second mapping information of the second electronic device, determines the second character encoding corresponding to each first character, so as to obtain second encoding information of the first transmission data, and then sends the second encoding information to the second electronic device; after the second electronic device receives the second encoding information, it generates third encoding information in response to the second encoding information, and sends the third encoding information to the first electronic device, and the first electronic device decodes the third encoding information based on the second mapping information, thereby obtaining the second transmission information. In an embodiment of the present application, the third encoding information is decoded by the second mapping information stored in the first electronic device, thereby avoiding the need for the first electronic device and the second electronic device to maintain the mapping information of both parties, and reducing the data processing capacity of the second electronic device; in addition, when the decoding of the received encoding information of the second electronic device fails, the mapping information of the second electronic device is downloaded by the obtained mapping identification information, so that the encoding information sent by the second electronic device can be quickly decoded, thereby quickly expanding the decoding and encoding capabilities of the first electronic device.
[0075] See also Figure 7 , is a structural diagram of another data processing system provided in an embodiment of the present application. Figure 7The data processing system shown may include a first electronic device 701, a second electronic device 702 and a server 703. The first electronic device 701 or the second electronic device 702 may include any one or more of a smart phone, a tablet computer, a laptop computer, and a desktop computer; the first electronic device 701 or the second electronic device 702 may also be a server, for example, an independent physical server, or a server cluster or distributed system composed of multiple physical servers. The server 703 may be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms. The first electronic device 701, the second electronic device 702 and the server 703 may be directly or indirectly connected to each other via wired or wireless communication, and this application does not limit this.
[0076] See Figure 8 , Figure 8 is a flow chart of another data processing method provided in an embodiment of the present application; Figure 8 The data processing scheme shown can be Figure 7 The first electronic device, the second electronic device and the server shown are used to perform the operation, which can be applied to Figure 7 In the data processing system shown, the solution may include but is not limited to steps S801 to S804, wherein:
[0077] S801, the first electronic device sends first transmission data and device identification information of the second electronic device to a server, wherein the server stores a plurality of mapping information, each mapping information being used to indicate a mapping relationship between a character and a character code.
[0078] S802: The server searches for second mapping information of the second electronic device corresponding to the device identification information in the plurality of mapping information.
[0079] S803: The server determines, based on the second mapping information, a second character code corresponding to each first character in the first transmission data to obtain second coding information of the first transmission data.
[0080] S804: The server sends the second coded information to the second electronic device.
[0081] It should be noted that the specific implementation process of steps S801 to S804 can be found in Figure 2The relevant description of the specific implementation process shown in steps S201 to S204 in the illustrated embodiment is not repeated here.
[0082] In one possible implementation, after the server sends the second coding information to the second electronic device, it can also be: the second electronic device generates third coding information based on the second coding information, and sends the third coding information to the first electronic device; the first electronic device sends the third coding information to the server, and the server determines the characters corresponding to each third character encoding in the third coding information based on the second mapping information to obtain second transmission data, and finally returns the second transmission data to the first electronic device.
[0083] In one possible implementation, the second electronic device is also allowed to use the server. Then, after the server sends the second coding information to the second electronic device, the second electronic device can also generate or obtain second transmission data based on the second coding information, and then the second electronic device sends the second transmission data to the server. The server encodes each character in the second transmission data based on the first mapping information to obtain fifth coding information, and sends the fifth coding information to the first electronic device. The first electronic device decodes the fifth coding information based on the first mapping information to obtain the second transmission data.
[0084] In an embodiment of the present application, the first electronic device first sends the first transmission data and the device identification information of the second electronic device to the server; then the server searches for the second mapping information of the second electronic device corresponding to the device identification information in multiple mapping information, and based on the second mapping information, determines the second character encoding corresponding to each first character in the first transmission data to obtain the second encoding information of the first transmission data; finally, the server sends the second encoding information to the second electronic device. The server of the embodiment of the present application stores multiple mapping information, and then the server obtains the second encoding information of the first transmission data based on the found second mapping information. Through the server, multiple electronic devices can share and use multiple mapping information, and encode different transmission data accordingly, making the communication process within the team, within the company, etc. more efficient, thereby saving development resources and improving development speed.
[0085] An embodiment of the present application further provides a computer storage medium, in which program instructions are stored. When the program instructions are executed, they are used to implement the corresponding methods described in the above embodiments.
[0086] See also Figure 9 , Figure 9 It is a structural diagram of a data processing device provided in an embodiment of the present application.
[0087] In one implementation of the device of the embodiment of the present application, the device includes the following structure.
[0088] An acquiring unit 901 is configured to acquire first coding information of first transmission data to be transmitted to a second electronic device;
[0089] A processing unit 902 is configured to determine, based on first mapping information of the first electronic device, a first character corresponding to each first character code in the first coding information, where the first character matches a character in the first transmission data, the first mapping information being used to indicate a mapping relationship between the character and the character code;
[0090] The processing unit 902 is further configured to determine, based on second mapping information of the second electronic device, a second character code corresponding to each first character, to obtain second encoding information of the first transmission data, where the second encoding information includes each second character code, and the second mapping information is used to indicate a mapping relationship between characters and character codes;
[0091] The sending unit 903 is configured to send the second coded information to the second electronic device.
[0092] In one embodiment, the processing unit 902 is further configured to: obtain third mapping information, where the third mapping information is used to indicate a mapping relationship between the first character and the second character;
[0093] Determining, based on the third mapping information, a second character corresponding to each first character;
[0094] Determining, based on the second mapping information of the second electronic device, a second character code corresponding to each first character includes:
[0095] Based on the second mapping information, a second character code corresponding to each second character is determined.
[0096] In one embodiment, the processing unit 902 is further configured to: receive third encoding information sent by the second electronic device, where each third character code in the third encoding information is a character code corresponding to each character in the second transmission data determined by the second electronic device based on the second mapping information, and the second transmission data is generated by the second electronic device in response to the second encoding information;
[0097] Based on the second mapping information, characters corresponding to the respective third character codes are determined to obtain second transmission data, where the second transmission data includes the characters corresponding to the respective third character codes.
[0098] In one embodiment, before determining the second character code corresponding to each first character based on the second mapping information of the second electronic device, the processing unit 902 is further configured to: receive fourth code information sent by the second electronic device;
[0099] Traversing each mapping information stored in the first electronic device, and decoding the fourth coded information based on the traversed mapping information;
[0100] If the decoding is successful, the traversed mapping information is determined as the second mapping information of the second electronic device.
[0101] In one embodiment, before determining the second character code corresponding to each first character based on the second mapping information of the second electronic device, the processing unit 902 is further configured to: receive fourth code information sent by the second electronic device;
[0102] Acquire mapping identification information of the second mapping information from the second electronic device;
[0103] The mapping information corresponding to the mapping identification information is determined as the second mapping information of the second electronic device.
[0104] In one embodiment, the processing unit 902 is further configured to: if mapping information corresponding to the mapping identification information exists in the first electronic device, determine the mapping information corresponding to the mapping identification information stored in the first electronic device as the second mapping information of the second electronic device;
[0105] If the mapping information corresponding to the mapping identification information does not exist in the first electronic device, downloading the mapping information corresponding to the mapping identification information;
[0106] The downloaded mapping information is determined as the second mapping information of the second electronic device.
[0107] In one embodiment, the processing unit 902 is further used to: send the first transmission data and the device identification information of the second electronic device to the server, wherein a plurality of mapping information is stored in the server, and each mapping information is used to indicate the mapping relationship between characters and character codes, so that the server can search for the second mapping information of the second electronic device corresponding to the device identification information in the plurality of mapping information, and the server determines the second character code corresponding to each first character in the first transmission data based on the second mapping information to obtain the second coding information of the first transmission data, and the server sends the second coding information to the second electronic device.
[0108] In an embodiment of the present application, first obtain the first encoding information of the first transmission data to be transmitted to the second electronic device; based on the first mapping information of the first electronic device, determine the first character corresponding to each first character encoding in the first encoding information, the first character matches the character in the first transmission data, and the first mapping information is used to indicate the mapping relationship between the character and the character encoding; based on the second mapping information of the second electronic device, determine the second character encoding corresponding to each first character to obtain the second encoding information of the first transmission data, the second encoding information includes each second character encoding, the second mapping information is used to indicate the mapping relationship between the character and the character encoding, and send the second encoding information to the second electronic device. In an embodiment of the present application, through the second mapping information of the second electronic device stored in the first electronic device, each character in the first transmission data to be transmitted to the second electronic device can be encoded into the second encoding information that the second electronic device can directly decode successfully, so that the second electronic device can successfully decode the second encoding information, thereby obtaining the complete communication content, which is conducive to achieving successful communication.
[0109] See also Figure 10 , Figure 10 100 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. The electronic device in this embodiment of the present application includes a power supply module and other structures, and includes a processor 1001, a storage device 1002, and a communication interface 1003. The processor 1001, the storage device 1002, and the communication interface 1003 can exchange data, and the processor 1001 implements the corresponding data processing solution.
[0110] The storage device 1002 may include a volatile memory, such as a random-access memory (RAM); the storage device 1002 may also include a non-volatile memory, such as a flash memory, a solid-state drive (SSD), etc.; the storage device 1002 may also include a combination of the above types of memory.
[0111] Processor 1001 may be a central processing unit (CPU). Processor 1001 may also be a combination of a CPU and a GPU. In an electronic device, multiple CPUs and GPUs may be included as needed to perform corresponding data processing. In one embodiment, storage device 1002 is used to store program instructions. Processor 1001 may call program instructions to implement the various methods described above in the embodiments of the present application.
[0112] In a first possible implementation, the processor 1001 of the electronic device calls the program instructions stored in the storage device 1002 to obtain first encoding information of first transmission data to be transmitted to the second electronic device; based on the first mapping information of the first electronic device, determines the first character corresponding to each first character encoding in the first encoding information, the first character matches the character in the first transmission data, and the first mapping information is used to indicate the mapping relationship between the character and the character encoding; based on the second mapping information of the second electronic device, determines the second character encoding corresponding to each first character to obtain second encoding information of the first transmission data, the second encoding information includes each second character encoding, and the second mapping information is used to indicate the mapping relationship between the character and the character encoding; and sends the second encoding information to the second electronic device.
[0113] In one embodiment, the processor 1001 is further configured to: obtain third mapping information, where the third mapping information is used to indicate a mapping relationship between the first character and the second character;
[0114] Determining, based on the third mapping information, a second character corresponding to each of the first characters;
[0115] The processor 1001 is further configured to:
[0116] Based on the second mapping information, a second character code corresponding to each second character is determined.
[0117] In one embodiment, the processor 1001 is further configured to: receive third coding information sent by the second electronic device, where each third character code in the third coding information is a character code corresponding to each character in the second transmission data determined by the second electronic device based on the second mapping information, and the second transmission data is generated by the second electronic device in response to the second coding information;
[0118] Based on the second mapping information, characters corresponding to the respective third character codes are determined to obtain the second transmission data, where the second transmission data includes the characters corresponding to the respective third character codes.
[0119] In one embodiment, before determining the second character code corresponding to each first character based on the second mapping information of the second electronic device, the processor 1001 is further configured to: receive fourth coding information sent by the second electronic device;
[0120] traversing each mapping information stored in the first electronic device, and decoding the fourth coded information based on the traversed mapping information;
[0121] If the decoding is successful, the mapping information obtained through the traversal is determined as the second mapping information of the second electronic device.
[0122] In one embodiment, before determining the second character code corresponding to each first character based on the second mapping information of the second electronic device, the processor 1001 is further configured to: receive fourth coding information sent by the second electronic device;
[0123] Acquire mapping identification information of the second mapping information from the second electronic device;
[0124] The mapping information corresponding to the mapping identification information is determined as the second mapping information of the second electronic device.
[0125] In one embodiment, the processor 1001 is further configured to: if mapping information corresponding to the mapping identification information exists in the first electronic device, determine the mapping information corresponding to the mapping identification information stored in the first electronic device as the second mapping information of the second electronic device;
[0126] If the mapping information corresponding to the mapping identification information does not exist in the first electronic device, downloading the mapping information corresponding to the mapping identification information;
[0127] The downloaded mapping information is determined as the second mapping information of the second electronic device.
[0128] In one embodiment, the processor 1001 is also used to: send the first transmission data and the device identification information of the second electronic device to a server, wherein the server stores multiple mapping information, each mapping information is used to indicate the mapping relationship between characters and character codes, so that the server can search the multiple mapping information for the second mapping information of the second electronic device corresponding to the device identification information, and the server determines the second character code corresponding to each first character in the first transmission data based on the second mapping information to obtain the second coding information of the first transmission data, and the server sends the second coding information to the second electronic device.
[0129] In an embodiment of the present application, first obtain the first encoding information of the first transmission data to be transmitted to the second electronic device; based on the first mapping information of the first electronic device, determine the first character corresponding to each first character encoding in the first encoding information, the first character matches the character in the first transmission data, and the first mapping information is used to indicate the mapping relationship between the character and the character encoding; based on the second mapping information of the second electronic device, determine the second character encoding corresponding to each first character to obtain the second encoding information of the first transmission data, the second encoding information includes each second character encoding, the second mapping information is used to indicate the mapping relationship between the character and the character encoding, and send the second encoding information to the second electronic device. In an embodiment of the present application, through the second mapping information of the second electronic device stored in the first electronic device, each character in the first transmission data to be transmitted to the second electronic device can be encoded into the second encoding information that the second electronic device can directly decode successfully, so that the second electronic device can successfully decode the second encoding information, thereby obtaining the complete communication content, which is conducive to achieving successful communication.
[0130] Those skilled in the art will appreciate that all or part of the processes in the above-described method embodiments can be implemented by instructing the relevant hardware through a computer program. The program can be stored in a computer-readable storage medium. When executed, the program can include the processes of the above-described method embodiments. The storage medium can be a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM). The computer-readable storage medium can primarily include a program storage area and a data storage area. The program storage area can store an operating system, at least one application required for a function, and the like; the data storage area can store data created based on the use of the blockchain node.
[0131] The above disclosure is only part of the embodiments of the present application, and it is certainly not intended to limit the scope of the rights of the present application. A person skilled in the art can understand that all or part of the processes of the above embodiments and equivalent changes made in accordance with the claims of the present application are still within the scope of the invention.
Claims
1. A data processing method, characterized in that: The method is applied to a first electronic device, and includes: Acquire first encoding information of first transmission data to be transmitted to a second electronic device; Determining, based on first mapping information of the first electronic device, first characters corresponding to respective first character codes in the first coding information, where the first characters match characters in the first transmission data, the first mapping information being used to indicate a mapping relationship between characters and character codes; Determining, based on second mapping information of the second electronic device, a second character code corresponding to each of the first characters to obtain second encoding information of the first transmission data, the second encoding information including each of the second character codes, the second mapping information being used to indicate a mapping relationship between characters and character codes; The second coded information is sent to the second electronic device.
2. The method according to claim 1, characterized in that The method further comprises: Acquire third mapping information, where the third mapping information is used to indicate a mapping relationship between the first character and the second character; Determining, based on the third mapping information, a second character corresponding to each of the first characters; The determining, based on the second mapping information of the second electronic device, the second character code corresponding to each of the first characters includes: Based on the second mapping information, a second character code corresponding to each second character is determined.
3. The method according to claim 1, characterized in that The method further comprises: receiving third coding information sent by the second electronic device, where each third character code in the third coding information is a character code corresponding to each character in the second transmission data determined by the second electronic device based on the second mapping information, and the second transmission data is generated by the second electronic device in response to the second coding information; Based on the second mapping information, characters corresponding to the respective third character codes are determined to obtain the second transmission data, where the second transmission data includes the characters corresponding to the respective third character codes.
4. The method according to claim 1, wherein Before determining the second character code corresponding to each first character based on the second mapping information of the second electronic device, the method further includes: receiving fourth coded information sent by the second electronic device; traversing each mapping information stored in the first electronic device, and decoding the fourth coded information based on the traversed mapping information; If the decoding is successful, the mapping information obtained through the traversal is determined as the second mapping information of the second electronic device.
5. The method according to claim 1, wherein Before determining the second character code corresponding to each first character based on the second mapping information of the second electronic device, the method further includes: receiving fourth coded information sent by the second electronic device; Acquire mapping identification information of the second mapping information from the second electronic device; The mapping information corresponding to the mapping identification information is determined as the second mapping information of the second electronic device.
6. The method according to claim 5, characterized in that The method further comprises: If mapping information corresponding to the mapping identification information exists in the first electronic device, determining the mapping information corresponding to the mapping identification information stored in the first electronic device as the second mapping information of the second electronic device; If the mapping information corresponding to the mapping identification information does not exist in the first electronic device, downloading the mapping information corresponding to the mapping identification information; The downloaded mapping information is determined as the second mapping information of the second electronic device.
7. The method according to claim 1, characterized in that The method further comprises: The first transmission data and the device identification information of the second electronic device are sent to a server, where a plurality of mapping information are stored, each mapping information being used to indicate a mapping relationship between a character and a character encoding, so that the server searches for the second mapping information of the second electronic device corresponding to the device identification information in the plurality of mapping information. The server determines the second character encoding corresponding to each first character in the first transmission data based on the second mapping information to obtain the second encoding information of the first transmission data, and the server sends the second encoding information to the second electronic device.
8. A data processing device, characterized in that: The device comprises: an acquiring unit, configured to acquire first coding information of first transmission data to be transmitted to a second electronic device; a processing unit, configured to determine, based on first mapping information of the first electronic device, first characters corresponding to respective first character codes in the first coding information, where the first characters match characters in the first transmission data, the first mapping information being used to indicate a mapping relationship between characters and character codes; The processing unit is further configured to determine, based on second mapping information of the second electronic device, a second character code corresponding to each of the first characters, to obtain second encoding information of the first transmission data, where the second encoding information includes each of the second character codes, and the second mapping information is used to indicate a mapping relationship between characters and character codes; A sending unit is used to send the second coded information to the second electronic device.
9. An electronic device, characterized in that: The method comprises a processor, a storage device and a communication interface, wherein the processor, the storage device and the communication interface are connected to each other, wherein the storage device is used to store computer program instructions, and the processor is configured to execute the program instructions to implement the data processing method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer program instructions, which, when executed by a processor, are used to execute the data processing method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Character recognition method, model training method, related device and electronic equipment
CN113011420A
Data transmission method and device
CN113938530A