Data processing method and related apparatus
By introducing a preset delimiter into the QR code and parsing the payload data according to the device type, the problem of insufficient payload data capacity in QR codes is solved, and accurate acquisition and efficient encoding of payload data are achieved.
Patent Information
- Application Number
- CN202110488075.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-04-30
- Publication Date
- 2026-02-27
- Estimated Expiration
- 2041-04-30
AI Technical Summary
The limited payload capacity of QR codes means that the payload data cannot be fully carried, and scanning devices cannot accurately obtain the relevant data.
By introducing a preset delimiter into the QR code, the payload data is parsed according to the device type of the terminal device, and the first and second payload data are processed using different encoding methods, thereby improving the accuracy and capacity of payload data acquisition.
This improves the accuracy of payload data acquisition and the encoding efficiency of QR codes, ensuring that scanning devices can correctly parse and perform corresponding operations.
Smart Images

Figure CN115271014B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of data processing, and in particular, to a data processing method and related apparatus. BACKGROUND
[0002] The capacity of the payload data in a two-dimensional code is usually fixed, and the amount of data carried is limited. The payload data can be expressed as a URI (Uniform Resource Identifier) link and configuration parameters, and the URI link and configuration parameters can adopt a single encoding mode, for example, expressed as an ASCII code string as a whole. If the amount of data of the numbers in the configuration parameters is more, the wasted byte space is more, which will cause the two-dimensional code to be unable to carry the payload data that needs to be carried completely, so that the scanning device cannot accurately obtain the related data. SUMMARY
[0003] Embodiments of the present application provide a data processing method and related apparatus, and a terminal device can extract payload data according to position information of a preset delimiter and a device type, so that the payload data is associated with the device type, thereby improving the accuracy of payload data acquisition.
[0004] In a first aspect, embodiments of the present application provide a data processing method applied to a terminal device, and the method comprises:
[0005] Obtaining payload data in a two-dimensional code;
[0006] Analyzing the payload data to obtain first position information of a preset delimiter in the payload data;
[0007] Extracting target payload data from the payload data according to the first position information and a device type of the terminal device;
[0008] Performing an operation corresponding to the target payload data.
[0009] In this example, the first position information of the preset delimiter in the payload data is obtained by analyzing the payload data, the target payload data is extracted from the payload data according to the first position information and the device type of the terminal device, and the payload data is associated with the device type, so that the corresponding payload data can be set for the device type, thereby improving the accuracy of target payload data acquisition.
[0010] In combination with the first aspect, in one possible implementation manner, a first payload data before a position indicated by the first position information is different from a second payload data after the position indicated by the first position information in encoding mode.
[0011] In the example, the encoding manner of the first load data is different from the encoding manner of the second load data, and the same encoding manner is used for the first load data and the second load data, so that the utilization of the encoding space of each byte in the two-dimensional code is improved, and the capacity of the load data is improved.
[0012] With reference to the first aspect, in a possible implementation, the encoding manner of the first load data includes ASCII character encoding, and the encoding manner of the second load data includes raw hexadecimal encoding.
[0013] In the example, the encoding manner of the second load data includes raw hexadecimal encoding, so that the utilization of the byte corresponding to the second load data is improved, and the waste of the number of bytes is reduced.
[0014] With reference to the first aspect, in a possible implementation, the encoding manner of the preset delimiter is the same as the encoding manner of the first load data.
[0015] With reference to the first aspect, in a possible implementation, the parsing the load data to obtain the first position information of the preset delimiter in the load data includes:
[0016] determining the preset delimiter;
[0017] obtaining the first position information of the preset delimiter.
[0018] With reference to the first aspect, in a possible implementation, the load data includes at least one preset string, and the determining the preset delimiter includes:
[0019] determining, as the preset delimiter, a preset string with the largest interval between the preset string and the first character of the load data.
[0020] In the example, the preset string with the largest interval between the preset string and the first character of the load data is determined as the preset delimiter, so that, since there can be multiple preset strings in the load data, the string with the largest interval is determined as the preset delimiter, the integrity of the first data is ensured, and the accuracy of determining the preset delimiter is improved.
[0021] With reference to the first aspect, in a possible implementation, the extracting the target load data from the load data according to the position information and the device type of the terminal device includes:
[0022] if the device type is a first device type, determining the first load data before the position indicated by the position information as the target load data.
[0023] extract the first load data from the load data to obtain the target load data.
[0024] With reference to the first aspect, in a possible implementation manner, the operation corresponding to the target load data comprises:
[0025] determining whether the application software corresponding to the target load data is installed in the terminal device;
[0026] if the application software corresponding to the target load data is not installed in the terminal device, displaying installation prompt information;
[0027] if an installation instruction is received, obtaining an installation package of the application software according to the target load data.
[0028] With reference to the first aspect, in a possible implementation manner, the method further comprises:
[0029] if the device type is the second device type, determining second load data after a position indicated by the position information as the target load data;
[0030] extracting the second load data from the load data to obtain the target load data.
[0031] In a second aspect, an embodiment of the present application provides a data processing apparatus applied to a terminal device, and the apparatus comprises:
[0032] an obtaining unit, configured to obtain load data in a two-dimensional code;
[0033] a parsing unit, configured to parse the load data to obtain first position information of a preset delimiter in the load data;
[0034] an extracting unit, configured to extract target load data from the load data according to the first position information and a device type of the terminal device;
[0035] an executing unit, configured to execute an operation corresponding to the target load data.
[0036] With reference to the second aspect, in a possible implementation manner, a first load data before a position indicated by the first position information and second load data after the position indicated by the first position information are encoded in different manners.
[0037] With reference to the second aspect, in a possible implementation manner, the first load data is encoded in an ASCII character encoding manner, and the second load data is encoded in a raw hexadecimal encoding manner.
[0038] With reference to the second aspect, in a possible implementation manner, the preset delimiter is encoded in the same manner as the first payload data.
[0039] With reference to the second aspect, in a possible implementation manner, the parsing unit is configured to:
[0040] determine the preset delimiter;
[0041] obtain first position information of the preset delimiter.
[0042] With reference to the second aspect, in a possible implementation manner, the payload data comprises at least one preset string, and in the determination of the preset delimiter, the parsing unit is configured to:
[0043] determine, as the preset delimiter, a preset string with a maximum interval between the at least one preset string and a first character of the payload data.
[0044] With reference to the second aspect, in a possible implementation manner, the extracting unit is configured to:
[0045] if the device type is a first device type, determine, as target payload data, first payload data before a position indicated by the position information;
[0046] extract the first payload data from the payload data to obtain the target payload data.
[0047] With reference to the second aspect, in a possible implementation manner, the executing unit is configured to:
[0048] determine whether application software corresponding to the target payload data has been installed in the terminal device;
[0049] if the application software corresponding to the target payload data has not been installed in the terminal device, display installation prompt information;
[0050] if installation indication is received, obtain an installation package of the application software according to the target payload data.
[0051] With reference to the second aspect, in a possible implementation manner, the apparatus is further configured to:
[0052] if the device type is a second device type, determine, as target payload data, second payload data after a position indicated by the position information;
[0053] extract the second payload data from the payload data to obtain the target payload data.
[0054] With reference to the third aspect, in a possible implementation manner, the terminal device comprises:
[0055] Memory, used to store instructions; and
[0056] At least one processor is coupled to the memory;
[0057] Wherein, when the at least one processor executes the instruction, the instruction causes the processor to perform all or part of the methods as described in the first aspect.
[0058] Fourthly, embodiments of the present invention provide a computer-readable storage medium storing a computer program, the computer program including program instructions that, when executed by a processor, cause the processor to perform all or part of the methods described in the first aspect.
[0059] These or other aspects of the invention will become more apparent from the following description of the embodiments. Attached Figure Description
[0060] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0061] Figure 1 This application provides a schematic diagram of an application scenario.
[0062] Figure 2 This application provides a flowchart illustrating a data processing method.
[0063] Figure 3 This application provides a schematic diagram of the structure of a data processing device.
[0064] Figure 4 This application provides a schematic diagram of the structure of a terminal device. Detailed Implementation
[0065] The embodiments of this application will now be described with reference to the accompanying drawings.
[0066] To better understand the data processing method provided in the embodiments of this application, the application scenarios of the data processing method will be briefly introduced below. For example... Figure 1As shown, the terminal device to which the data processing method is applied includes a first role device and a second role device. The first role device is a device providing a two-dimensional code, and the second role device is a device scanning the two-dimensional code. The second role device and the first role device can be the same device type or different device types. For example, it is assumed that the first role device includes terminal device B, and the second role device includes terminal device A and terminal device C and terminal device D. Terminal device B and terminal device A are the same device type, and terminal device C, terminal device D, and terminal device B are different device types. Here, only four devices are taken as an example for description, and there can be more than four devices, and there can be more than two device types, which are not limited here.
[0067] Terminal device B provides a two-dimensional code, which can be a two-dimensional code pasted on the body of terminal device B or a two-dimensional code displayed on the screen of terminal device B, etc. Terminal device A and terminal device C are used to scan the two-dimensional code on terminal device B to perform corresponding operations according to the payload data in the two-dimensional code.
[0068] The payload data of the two-dimensional code includes first payload data, a preset delimiter, and second payload data, and the first payload data and the second payload data are encoded in different ways. In one possible example, the first payload data can be a URI link or a URL (Uniform Resource Locator) link, which can be a link for downloading application software, and the second payload data can be a configuration parameter. The preset delimiter is used to isolate the first payload data and the second payload data, so that the scanning device can accurately obtain the first payload data and / or the second payload data.
[0069] The URI link is, for example, https: / / companyZZZ.com / dev=xxxx……, which can carry the use parameter of the application software indicated by the URI link, and the URL link can carry the use parameter of the application software indicated by the URL link.
[0070] The configuration parameter includes a device identifier, security information, application information, and a parameter used by the application software. In subsequent embodiments, the URI link is taken as an example for description, and the URI link can be replaced by the URL link, which is not limited here.
[0071] The configuration parameter is expressed by a TLV (Type / Length / Value) table: the original meanings of T and L are numbers; the original meanings of the values of most commonly used types are also numbers; for individual types (for example, the type representing the WiFi SSID), although the original meaning of the value is a string, each ASCII character of the value can still be expressed by a hexadecimal number;
[0072] Each byte in the two-dimensional code can store two 4-bit hexadecimal numbers, so the original information of the entire TLV parameter set is expressed in the form of a "hexadecimal byte array", which is more efficient;
[0073] If each hexadecimal number (0-9, A-F (case-insensitive)) of the TLV data segment is expressed in the form of a character, when 1 byte of 4-bit hexadecimal numbers is expressed by 1 byte of ASCII characters, 50% of the coding space will be wasted.
[0074] The operations performed on the terminal device C and the terminal device D include, for example, the terminal device C and the terminal device D scanning the two-dimensional code on the terminal device B, which can trigger the downloading or pulling of the application software provided by the terminal device B manufacturer and executed on the scanning device, for managing and controlling the terminal device B, and the like; for example, the software App-XX on the terminal device C is of a first version type, and the software APP-KK on the terminal device is of a second version type.
[0075] The URI link points to the website of the terminal device B manufacturer, and the website provides a download link of the application software of the corresponding version type according to the requested device type, for example:
[0076] For the terminal device C, a download link of the first version type of software App-XX for managing and controlling the terminal device B is provided;
[0077] For the terminal device D, a download link of the second version type of software App-KK for managing and controlling the terminal device B is provided;
[0078] When the terminal device C and the terminal device D do not have the application software corresponding to the URI link installed, the URI link can be used by the user to download the application software of the device;
[0079] When the terminal device C and the terminal device D have the application software installed, the scanning can trigger the terminal device C and the terminal device D to pull the corresponding application software.
[0080] The operations performed on the terminal device A include that the terminal device A scans the two-dimensional code on the terminal device B, and pulls the application software FA-X on the terminal device A for controlling the terminal device B:
[0081] The FA-X on the terminal device A needs to complete the device binding security authentication between the terminal device A and the terminal device B about the service FA-X based on the configuration parameters before being pulled up;
[0082] The application software FA-X is put on the application market of the terminal device A, and the detailed information thereof does not need to be embodied in the foregoing URI link. If the application software FA-X is not installed on the terminal device, installation prompt information can be displayed, and the installation indication input by the user is received to acquire and install the application software FA-X from the application market according to the application information in the configuration information. Of course, if the terminal device does not install the application software FA-X, the terminal device can also not display the prompt information to acquire and install the application software FA-X from the application market according to the application information in the configuration information. Of course, other manners can also be used, which are only used for illustration and are not limited in a specific manner.
[0083] In the existing two-dimensional code, the URI and the distributed parameter are loaded, the encoding manner of the URI and the distributed parameter is the same, and the encoding manner of the string is used for encoding. The above manner can easily cause that all data in the two-dimensional code cannot be loaded when the data amount of the distributed parameter is large, thereby reducing the reliability of the two-dimensional code in use. To solve the above problem, in the present application, the URI and the configuration parameter are isolated by a preset delimiter, different encoding manners are used for the URI and the distributed parameter, the encoding efficiency is improved, and the reliability of the two-dimensional code is improved. When the two-dimensional code is used, the load data corresponding to the terminal device can be extracted according to the preset delimiter and the type of the terminal device.
[0084] Please refer to Figure 2 , Figure 2 A flowchart of a data processing method is provided for the embodiments of the present application. As shown in Figure 2 , the data processing method is applied to a terminal device, which can be the terminal device in the second role device in the foregoing embodiments. The data processing method comprises the following steps.
[0085] S201, load data in a two-dimensional code.
[0086] The terminal device can acquire the load data in the two-dimensional code by scanning the two-dimensional code. For example, the user scans the two-dimensional code by the code scanning device of the terminal device to acquire the load data.
[0087] The load data in the two-dimensional code comprises first load data and second load data. The first load data is data before a position indicated by first position information, and the second load data is data after a position indicated by second position information. The first position information is position information of a preset delimiter in the load data.
[0088] The first load data can be a URI link, and the second load data can be configuration parameters.
[0089] The first load data and the second load data are encoded in different manners. The first load data is encoded in ASCII character encoding, and the second load data is encoded in raw hexadecimal encoding.
[0090] The preset delimiter can be indicated by a preset string case-sensitive, such as “?hmt=”, “?hmT=”, “?t=”, or “?T=”, and the like. The preset delimiter is encoded in the same manner as the first load data.
[0091] The two-dimensional code can be a circular dot matrix two-dimensional code, a rectangular dot matrix two-dimensional code, or other dot matrix types.
[0092] S202, parsing the load data to obtain first position information of the preset delimiter in the load data.
[0093] The method of parsing the load data can be to parse the load data by using a general decoding method to obtain parsed load data. The first position of the preset delimiter in the load data can be obtained from the parsed load data. The method of parsing the load data can be a parsing method corresponding to the encoding manner of the load data before the position indicated by the first position information. For example, the encoding manner of the first load data is ASCII character encoding, and the decoding manner of the load data is the decoding manner corresponding to the ASCII character encoding.
[0094] S203, extracting target load data from the load data according to the first position information and the device type of the terminal device.
[0095] The load data before the position indicated by the first position information or the load data after the position indicated by the first position information can be determined as the target load data according to the device type, and the target load data can be extracted.
[0096] S204, performing an operation corresponding to the target load data.
[0097] The target load data indicates a corresponding operation, and the corresponding operation is performed after the target load data is extracted. The corresponding operation can refer to the operation performed by the second role device in the foregoing embodiments. For example, the target load data is configuration parameters, and the security authentication between the device providing the two-dimensional code and the device is completed according to the configuration parameters. After the authentication is successful, the corresponding application software is pulled up to manage and control the device providing the two-dimensional code.
[0098] In this example, the first position information of the preset delimiter in the load data is obtained by analyzing the load data, and the target load data is extracted from the load data according to the first position information and the device type of the terminal device. In this way, the corresponding load data can be set for the device type in a manner that the load data is associated with the device type, thereby improving the accuracy of the target load data acquisition.
[0099] In one possible implementation, a possible method for analyzing the load data to obtain the first position information of the preset delimiter in the load data includes:
[0100] A1, determining the preset delimiter;
[0101] A2, obtaining the first position information of the preset delimiter.
[0102] The preset delimiter can be one of the preset strings, and the preset string can be the string shown in the foregoing embodiments. Since there can be multiple preset strings, the preset delimiter needs to be determined from the multiple strings. For example, the last preset string in the load data can be determined as the preset delimiter.
[0103] After the preset delimiter is determined, the corresponding first position information can be extracted.
[0104] In one possible implementation, a possible method for determining the preset delimiter includes:
[0105] The preset string with the largest interval between the first character of the load data and the preset string is determined as the preset delimiter.
[0106] By determining the preset string with the largest interval between the first character of the load data and the preset string as the preset delimiter, the accuracy of the preset delimiter determination is improved.
[0107] In one possible implementation, a possible method for extracting the target load data from the load data according to the position information and the device type of the terminal device includes:
[0108] B1, if the device type is a first device type, determining the first load data before the position indicated by the position information as the target load data;
[0109] B2, extracting the first load data from the load data to obtain the target load data.
[0110] The device of the first device type can be a device of a device type different from the device type of the device in the first role device in the foregoing embodiments, such as the device type corresponding to the terminal device C and the terminal device D.
[0111] The two-dimensional code decoder in the terminal device can determine the device type of the terminal device in which the two-dimensional code decoder is located. If the terminal device is of the first device type, the terminal device can only parse the target payload data, that is, the first payload data, and cannot obtain the information in the second payload data. The terminal device discards the second payload data and the preset delimiter.
[0112] In one possible implementation, when the device type is the first device type, the method of performing an operation corresponding to the target payload data includes the following steps.
[0113] C1, determining whether the application software corresponding to the target payload data has been installed in the terminal device;
[0114] C2, if the application software corresponding to the target payload data has not been installed in the terminal device, displaying installation prompt information;
[0115] C3, receiving an installation instruction, and then obtaining an installation package of the application software according to the target payload data.
[0116] The target payload data includes a URI link, and the terminal device can obtain the installation package of the application software according to the URI link. Specifically, an http request can be sent to a website corresponding to the URI link. After receiving the request, the website parses the request. If the RUI includes a preset string (the preset delimiter) and the preset delimiter also includes a parameter, the parameter has illegal characters and cannot be parsed by the website, the parameter after the preset delimiter is processed only for the content before the preset delimiter.
[0117] The method of displaying the installation prompt information can be displaying the installation prompt information on the display screen of the terminal device. The installation prompt information is prompt information for prompting the user whether to install the application software, for example, "whether to install the application software", and the like. Here, examples are used for illustration, and are not limited in specific.
[0118] Of course, if the terminal device has installed the application software corresponding to the target payload data, the terminal device can be triggered to pull up the application software.
[0119] In one possible implementation, another possible method of extracting the target payload data from the payload data according to the position information and the device type of the terminal device includes the following steps.
[0120] D1, if the device type is a second device type, determining second payload data after a position indicated by the position information as target payload data;
[0121] D2, extracting the second payload data from the payload data to obtain the target payload data.
[0122] The second device type can be the same device type as that of the terminal device in the first role device in the foregoing embodiments. When the terminal device parses the target payload data, the first payload data can also be parsed, that is, the device type of the terminal device is the second device type, and when the payload data is parsed, all the payload data can be obtained, for example, the first payload data before the preset delimiter and the second payload data after the preset delimiter.
[0123] Of course, if the first payload data is not processed, the first payload data can be discarded to reduce storage overhead, and the preset delimiter can also be discarded, which can further reduce storage overhead.
[0124] Since the encoding mode of the second payload data is the original hexadecimal encoding mode, when the second payload data is stored, the second payload data in the original hexadecimal encoding mode can be directly stored, without the need to adjust the encoding mode.
[0125] After the target payload data is obtained, the terminal device A can perform the actions in the foregoing embodiments, which are not described herein again.
[0126] Please refer to Figure 3 , Figure 3 A structural schematic diagram of a data processing apparatus is provided in the embodiments of the present application. As shown in the figure, the data processing apparatus is applied to a terminal device, and the apparatus includes: Figure 3
[0127] The obtaining unit 301 is configured to obtain payload data in a two-dimensional code.
[0128] The parsing unit 302 is configured to parse the payload data to obtain first position information of a preset delimiter in the payload data.
[0129] The extracting unit 303 is configured to extract target payload data from the payload data according to the first position information and a device type of the terminal device.
[0130] The executing unit 304 is configured to perform an operation corresponding to the target payload data.
[0131] In a possible implementation, the first payload data before the position indicated by the first position information and the second payload data after the position indicated by the first position information are in different encoding modes.
[0132] In a possible implementation, the encoding mode of the first payload data comprises ASCII character encoding, and the encoding mode of the second payload data comprises raw hexadecimal encoding.
[0133] In a possible implementation, the encoding mode of the preset delimiter is the same as the encoding mode of the first payload data.
[0134] In a possible implementation, the parsing unit 302 is configured to:
[0135] determine the preset delimiter;
[0136] obtain first position information of the preset delimiter.
[0137] In a possible implementation, the payload data comprises at least one preset character string, and in the determination of the preset delimiter, the parsing unit 302 is configured to:
[0138] determine, as the preset delimiter, a preset character string with the largest interval between the preset character string and the first character of the payload data.
[0139] In a possible implementation, the extracting unit 303 is configured to:
[0140] if the device type is a first device type, determine the first payload data before the position indicated by the position information as target payload data;
[0141] extract the first payload data from the payload data to obtain the target payload data.
[0142] In a possible implementation, the executing unit 304 is configured to:
[0143] determine whether an application corresponding to the target payload data has been installed in the terminal device;
[0144] if the application corresponding to the target payload data has not been installed in the terminal device, display installation prompt information;
[0145] if installation indication is received, obtain an installation package of the application according to the target payload data.
[0146] In a possible implementation, the apparatus is further configured to:
[0147] if the device type is a second device type, determine the second payload data after the position indicated by the position information as target payload data;
[0148] The second load data is extracted from the load data to obtain the target load data.
[0149] In the present embodiment, the data processing apparatus 30 is presented in the form of a unit. The "unit" here can refer to an application-specific integrated circuit (ASIC), a processor and a memory executing one or more software or firmware programs, an integrated logic circuit, and / or other devices that can provide the above functions. In addition, the above analysis unit 302, extraction unit 303 can be implemented by Figure 4 the processor 401 of the terminal device shown.
[0150] As Figure 4 The terminal device 40 shown can be implemented in the structure in Figure 3 , the terminal device 40 comprising at least one processor 401, at least one memory 402 and at least one communication interface 403. The processor 401, the memory 402 and the communication interface 403 are connected through the communication bus and complete the communication among each other.
[0151] The processor 401 can be a general central processing unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits for controlling the execution of the above scheme programs.
[0152] The communication interface 403 is used for communication with other devices or communication networks, such as Ethernet, Radio Access Network (RAN), Wireless Local Area Networks (WLAN), etc.
[0153] The memory 402 can be a read-only memory (ROM) or other type of static storage device that can store static information and instructions, a random access memory (RAM) or other type of dynamic storage device that can store information and instructions, an Electrically Erasable Programmable Read-Only Memory (EEPROM), a Compact Disc Read-Only Memory (CD-ROM) or other optical disk storage, a magnetic disk storage or other magnetic storage devices, or any other medium capable of storing desired program code in the form of instructions or data structures and that can be accessed by a computer, but is not limited to this. The memory can exist independently and be connected to the processor through a bus. The memory can also be integrated with the processor.
[0154] The memory 402 is configured to store application software code for implementing the above solutions, and the processor 401 is configured to control the execution of the application software code.
[0155] The code stored in the memory 402 can execute the data processing method provided above to obtain the payload data in the two-dimensional code, parse the payload data to obtain the first position information of the preset delimiter in the payload data, extract the target payload data from the payload data according to the first position information and the device type of the terminal device, and perform an operation corresponding to the target payload data.
[0156] The embodiment of the present application also provides a computer readable storage medium, wherein the computer readable storage medium can store a program, and the program includes part or all steps of any one of the data processing methods described in the above method embodiments when executed.
[0157] It should be noted that, for the above-mentioned method embodiments, in order to simply describe, they are all expressed as a series of action combinations, but those skilled in the art should know that the present application is not limited to the action sequence described, because according to the present application, some steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should know that the embodiments described in the specification all belong to preferred embodiments, and the actions and modules involved are not necessarily necessary for the present application.
[0158] In the above embodiments, the description of each embodiment focuses on different aspects, and the parts not described in detail in a certain embodiment can be referred to the relevant description of other embodiments.
[0159] In several embodiments provided in the present application, it should be understood that the disclosed apparatus can be implemented in other manners. For example, the described apparatus embodiments are merely schematic. Taking the division of the units as an example, the division can be changed in actual implementation, for example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the displayed or discussed mutual couplings or direct couplings or communication connections can be indirect couplings or communication connections through some interfaces, devices or units, and can be in electrical, mechanical or other forms.
[0160] The units described as separate components can or can not be physically separate, and the components displayed as units can or can not be physical units, i.e., can be located in one place, or can be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the embodiments.
[0161] In addition, each functional unit in the various embodiments of the present application can be integrated in one processing unit, or each unit can be physically present separately, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of a software functional unit.
[0162] When the integrated unit is realized in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer readable storage medium. Based on this understanding, the technical solutions of the present application essentially or the part that contributes to the prior art or the whole or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium, and includes a number of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage medium includes: a U disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a mobile hard disk, a magnetic disk or an optical disk, and various media that can store program codes.
[0163] Those skilled in the art can understand that all or part of the steps of various methods in the above embodiments can be completed by instructing the relevant hardware through a program, and the program can be stored in a computer readable memory, which can include a flash disk, a read-only memory (English: Read-Only Memory, for short: ROM), a random access memory (English: Random Access Memory, for short: RAM), a magnetic disk or an optical disk, etc.
[0164] The above has carried on the detailed introduction to the embodiment of the application, the principle and the implementation mode of the application have been set forth in this paper by applying specific examples, the above embodiment is only used for helping understanding the method of the application and its core idea; at the same time, for the general technical personnel in the art, according to the idea of the application, the specific implementation mode and the application range will have the change, according to the above, the content of the specification should not be understood as the limitation of the application.
Claims
1. A data processing method, characterized by, The method is applied to a terminal device, and comprises the following steps: acquiring payload data in a two-dimensional code; parsing the payload data to obtain first position information of a preset delimiter in the payload data; extracting target payload data from the payload data according to the first position information and a device type of the terminal device, wherein if the device type of the terminal device is different from a device type of a device providing the two-dimensional code, the target payload data is first payload data before a position indicated by the first position information, if the device type of the terminal device is the same as the device type of the device providing the two-dimensional code, the target payload data is second payload data after the position indicated by the first position information, the first payload data comprises a uniform resource identifier (URI) link or a uniform resource locator (URL) link, the URI link or the URL link is used to download or call a first application software, the first application software is provided by a manufacturer of the device providing the two-dimensional code, the URI link or the URL link indicates a website of the manufacturer of the device providing the two-dimensional code, the second payload data comprises configuration parameters, the configuration parameters are used to call or install a second application software, the second application software is listed on an application market of the terminal device, and the second application software is installed from the application market of the terminal device; an encoding mode of the first payload data comprises ASCII character encoding, and an encoding mode of the second payload data comprises original hexadecimal encoding; the first application software and the second application software are used to control the device providing the two-dimensional code; performing an operation corresponding to the target payload data.
2. The method of claim 1, wherein, An encoding mode of the preset delimiter is the same as an encoding mode of the first payload data.
3. The method of claim 1, wherein, The parsing of the payload data to obtain the first position information of the preset delimiter in the payload data comprises the following steps: determining the preset delimiter; acquiring first position information of the preset delimiter.
4. The method of claim 3, wherein, The payload data comprises at least one preset string, and the determination of the preset delimiter comprises the following steps: determining a preset string with a maximum interval between the at least one preset string and a first character of the payload data as the preset delimiter.
5. The method according to any one of claims 1 to 4, characterized in that, The extraction of the target payload data from the payload data according to the first position information and the device type of the terminal device comprises the following steps: if the device type is a first device type, determining the first payload data before the position indicated by the first position information as the target payload data; extracting the first payload data from the payload data to obtain the target payload data.
6. The method of claim 5, wherein, The performance of the operation corresponding to the target payload data comprises the following steps: determining whether application software corresponding to the target payload data has been installed in the terminal device; if the application software corresponding to the target payload data has not been installed in the terminal device, displaying installation prompt information; if installation instruction is received, acquiring an installation package of the application software according to the target payload data.
7. The method according to any one of claims 1 to 4, characterized in that, The method further comprises the following steps: if the device type is a second device type, determining second payload data after a position indicated by the position information as the target payload data; extracting the second payload data from the payload data to obtain the target payload data.
8. A data processing apparatus, characterized by, The application is applied to a terminal device, and the apparatus comprises: an acquisition unit configured to acquire payload data in a two-dimensional code; an analysis unit configured to analyze the payload data to obtain first position information of a preset delimiter in the payload data; an extraction unit configured to extract target payload data from the payload data according to the first position information and a device type of the terminal device, wherein if the device type of the terminal device is different from a device type of a device providing the two-dimensional code, the target payload data is first payload data before a position indicated by the first position information, if the device type of the terminal device is the same as the device type of the device providing the two-dimensional code, the target payload data is second payload data after the position indicated by the first position information, the first payload data comprises a uniform resource identifier (URI) link or a uniform resource locator (URL) link, the URI link or the URL link is used to download or invoke a first application software, the first application software is provided by a manufacturer of the device providing the two-dimensional code, the URI link or the URL link indicates a website of the manufacturer of the device providing the two-dimensional code, the second payload data comprises configuration parameters, the configuration parameters are used to invoke or install a second application software, the second application software is listed on an application market of the terminal device, and the second application software is installed from the application market of the terminal device; an encoding mode of the first payload data comprises ASCII character encoding, and an encoding mode of the second payload data comprises original hexadecimal encoding; the first application software and the second application software are used to control the device providing the two-dimensional code; an execution unit configured to perform an operation corresponding to the target payload data.
9. The apparatus of claim 8, wherein, An encoding mode of the preset delimiter is the same as an encoding mode of the first payload data.
10. The apparatus of claim 8, wherein, The analysis unit is configured to: determine the preset delimiter; and acquire first position information of the preset delimiter.
11. The apparatus of claim 10, wherein, The payload data comprises at least one preset character string, and in the determination of the preset delimiter, the analysis unit is configured to: determine a preset character string with a maximum interval between the at least one preset character string and a first character of the payload data as the preset delimiter.
12. The device of any one of claims 8-11, wherein, The extraction unit is configured to: if the device type is a first device type, determine first payload data before a position indicated by the position information as the target payload data; extract the first payload data from the payload data to obtain the target payload data.
13. The apparatus of claim 12, wherein, The execution unit is configured to: determine whether an application software corresponding to the target payload data has been installed in the terminal device; if the application software corresponding to the target payload data has not been installed in the terminal device, display installation prompt information; if an installation instruction is received, acquire an installation package of the application software according to the target payload data.
14. The apparatus of any one of claims 8-11, wherein, The apparatus is further configured to: if the device type is a second device type, determining a second payload data after a position indicated by the position information as the target payload data; extracting the second payload data from the payload data to obtain the target payload data.
15. A terminal device, comprising: comprising: a memory for storing instructions; and at least one processor coupled to the memory; wherein when the at least one processor executes the instructions, the instructions cause the processor to perform the method of any one of claims 1-7.
16. A computer readable storage medium characterized by: The computer readable storage medium stores a computer program, and the computer program comprises program instructions. The program instructions, when executed by a processor, cause the processor to perform the method of any one of claims 1-7.
Citation Information
Patent Citations
Two-dimensional code application method and device
CN104281866A
Two-dimension code and generation method and identification method thereof
CN104616046A