A decoding method, apparatus, and computer-readable storage medium

By determining the delimiter information in the target encoded data to establish decoding rules, the problem of low decoding efficiency in existing technologies is solved, enabling efficient decoding of mixed encoding of multiple encoding formats and improving decoding speed.

CN115906765BActive Publication Date: 2025-12-02ICLOUDSHIELD SECURITY TECHNOLOGY CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202211338330.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-10-28
Publication Date
2025-12-02
Estimated Expiration
2042-10-28

AI Technical Summary

Technical Problem

Existing technologies have low decoding efficiency and long processing time, and cannot efficiently process target encoded data with mixed encoding formats.

Method used

By determining the delimiter information in the target encoded data, the decoding rule corresponding to the encoded text information is determined based on the delimiter information, and the decoding is performed using the rule, thus achieving simultaneous scanning and decoding, and supporting the decoding of mixed encoding formats.

Benefits of technology

It improves decoding efficiency, reduces the number of scans, and increases decoding speed from O(M*N) to O(N), allowing decoding to be completed without pre-scanning.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115906765B_ABST
    Figure CN115906765B_ABST
Patent Text Reader

Abstract

This application relates to a decoding method, apparatus, and computer-readable storage medium, comprising: determining first delimiter information based on target encoded data; then determining decoding rules corresponding to first encoded text information based on the first delimiter information; wherein, in the text identified by the target encoded data, the delimiter text identified by the first delimiter information and the encoded text identified by the first encoded text information are arranged adjacently, and the delimiter text identified by the first delimiter information precedes the encoded text identified by the first encoded text information; and then, using the decoding rules corresponding to the first encoded text information, the first encoded text information is decoded to obtain first decoded text information. This application can support the decoding of target encoded data generated by mixed encoding of multiple encoding formats, and does not require pre-scanning of the target encoded data, enabling simultaneous scanning and decoding, which greatly improves decoding efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of network security technology, specifically to a decoding method, apparatus, and computer-readable storage medium. Background Technology

[0002] During network transmission, data is often encoded into a predetermined target encoding format to evade detection and prevent incorrect escaping by browsers or web servers before being sent. The receiver then decodes the received target encoding data to obtain the original information. The encoding format used is agreed upon by the sender and receiver.

[0003] When a third-party authorized module detects target encoded data, it may not know the encoding format used in advance, thus requiring a specific algorithm for decoding. In existing technologies, such as the scheme disclosed in patent application CN114745206A, the encoded string identifying the target encoded data needs to be pre-scanned before decoding; in the scheme disclosed in patent application CN114584362A, the target encoded data is scanned multiple times according to a decoding template, attempting decoding with different format decoders; and in the scheme disclosed in patent application CN115086044A, the encoding format needs to be assumed, and multiple decoding operations are required. Therefore, existing technologies suffer from low decoding efficiency and long decoding time. Summary of the Invention

[0004] In view of this, one of the technical problems solved by the embodiments of the present invention is to provide a decoding method, apparatus and computer-readable storage medium to overcome the problems of low decoding efficiency and long decoding time in the prior art.

[0005] The first aspect of this application discloses a decoding method, including: determining first delimiter information based on target encoded data.

[0006] Based on the first delimiter information, the decoding rule corresponding to the first encoded text information is determined; wherein, in the text identified by the target encoded data, the delimiter text identified by the first delimiter information and the encoded text identified by the first encoded text information are arranged adjacently, and the delimiter text identified by the first delimiter information is located before the encoded text identified by the first encoded text information.

[0007] Using the decoding rules corresponding to the first encoded text information, the first encoded text information is decoded to obtain the first decoded text information.

[0008] The second aspect of this application discloses a decoding apparatus, comprising:

[0009] The information extraction module is used to determine the first delimiter information based on the target encoded data.

[0010] The rule matching module is used to determine the decoding rule corresponding to the first encoded text information based on the first delimiter information; wherein, in the text identified by the target encoded data, the delimiter text identified by the first delimiter information and the encoded text identified by the first encoded text information are arranged adjacently, and the delimiter text identified by the first delimiter information is located before the encoded text identified by the first encoded text information.

[0011] The information decoding module is used to decode the first encoded text information using the decoding rules corresponding to the first encoded text information to obtain the first decoded text information.

[0012] A third aspect of this application discloses a computer-readable storage medium storing a computer program, the computer program including some or all of the steps for performing the aforementioned decoding method.

[0013] Compared with existing technologies, the embodiments of this application first determine the first delimiter information based on the target encoded data. Then, based on the first delimiter information, the decoding rules corresponding to the first encoded text information are determined. The delimiter text identified by the first delimiter information and the encoded text identified by the first encoded text information are arranged adjacently in the text identified by the target encoded data, and the delimiter text identified by the first delimiter information precedes the encoded text identified by the first encoded text information. Then, the decoding rules corresponding to the first encoded text information are used to decode the first encoded text information to obtain the first decoded text information. In this embodiment of the invention, after determining the first delimiter information used to identify only one delimiter text from the target encoded data, the decoding rules corresponding to the first encoded text information are further determined based on the first delimiter information. This method supports decoding target encoded data generated by mixing multiple encoding formats and does not require pre-scanning of the target encoded data, enabling simultaneous scanning and decoding, greatly improving decoding efficiency. Attached Figure Description

[0014] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0015] Figure 1 This is a flowchart illustrating a decoding method disclosed in Embodiment 1 of this application;

[0016] Figure 2 This is a flowchart illustrating a decoding method disclosed in Embodiment 2 of this application;

[0017] Figure 3 This is a schematic block diagram of a decoding device disclosed in Embodiment 3 of this application. Detailed Implementation

[0018] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0019] It should be noted that the terms "first," "second," "third," and "fourth," etc., used in the specification and claims of this application are used to distinguish different objects, not to describe a specific order. The terms "comprising" and "having," and any variations thereof, in the embodiments of this application are intended to cover non-exclusive inclusion. For example, a process, method, apparatus, product, or device that includes a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to these processes, methods, products, or devices.

[0020] Example 1

[0021] like Figure 1 As shown, Figure 1 This is a schematic flowchart illustrating a decoding method disclosed in Embodiment 1 of this application. The decoding method includes:

[0022] Step S101: Determine the first delimiter information based on the target encoded data.

[0023] In this embodiment, the entity executing the decoding method is not limited. It can be the encoder that generates the target encoded data, the receiver that receives the target encoded data sent by the encoder, or a third party authorized to decode and detect the target encoded data.

[0024] In this example, the text identified by the target encoded data consists of alternating delimiter text and encoded text. The number of delimiter text and encoded text included in the text identified by the target encoded data is greater than or equal to one, and each delimiter text consists of at least one character or one space.

[0025] The development language, text format, and encoding format used to generate the target encoded data are not limited. It can be generated using only one development language, text format, and encoding format, or it can be generated using multiple encoding formats, development languages, or text formats. For example, the encoding format can be at least one of UTF32, UTF16, and UTF8, and the corresponding development language or text format can include HTML / XML, CSS, Hex NCRs, JS / Java / C / Rust / Ruby, CSS, U+hex, percent encoding, and so on.

[0026] In this embodiment, in the text identified by the target encoded data, the delimiter text identified by the first delimiter information and the encoded text identified by the first encoded text information are arranged adjacent to each other, and the delimiter text identified by the first delimiter information is located before the encoded text identified by the first encoded text information. That is, the first delimiter information and the first encoded text information are respectively used to identify an adjacent delimiter text and an encoded text in the text identified by the target encoded data.

[0027] The delimiter text and the encoded text identified by the first delimiter information and the first encoded text information can be located at the front, middle, or end of the text identified by the target encoded data, and this embodiment does not limit this here.

[0028] [[ID=I]]However, it should be noted that when decoding the target encoded data in this embodiment, it starts from the first delimiter text in the text identified by the target encoded data. That is, when the decoding method of this embodiment is executed for the Nth time, the first delimiter information is used to identify the Nth delimiter text in the text identified by the target encoded data, and the first encoded text information is used to identify the Nth or N+1th encoded text in the text identified by the target encoded data.

[0029] For example, when encoding "<Cloud Shield Smart icloudshield.com>" using a development language with UTF16, the text identified by the obtained target encoded data is "003C 4E91 76FE 667A 6i67 0069 0063 006C006F 0075 0064 0073 0068 0069 0065 006C 006D 003E". Among them, all the delimiter texts in this encoding format are spaces. When the first delimiter information is used to identify the 1st space, the first encoded text information is used to identify the second encoded text, that is, "4E91"; when the first delimiter information is used to identify the 3rd space, the first encoded text information is used to identify the 4th encoded text, that is, "667A".

[0030] For another example, when encoding "<Cloud Shield Smart icloudshield.com>" using a text format in UTF8, the text identified by the target encoded data is "%3C%E4%BA%91%E7%9B%BE%E6%99%BA%E6%85%A7icloudshield.com%3E". Among them, all delimiter texts of this encoding format are percentage symbols "%". When the first delimiter information is used to identify the 1st "%", the first encoded text information is used to identify the 1st encoded text, that is, "3C"; when the first delimiter information is used to identify the 3rd "%", the first encoded text information is used to identify the 3rd encoded text, that is, "BA".

[0031] Step S102: Determine the decoding rule corresponding to the first encoded text information according to the first delimiter information.

[0032] In this embodiment, since the delimiter texts and / or encoded texts used in different types of encoding formats are different, before step S101, a delimiter text matching rule can be preset in advance, so that after obtaining the first delimiter information, the decoding rule corresponding to the first encoded text information can be determined according to the delimiter text matching rule.

[0033] For example, if it is preset in the delimiter text matching rule that: "0x" corresponds to the A text format of UTF16, and "\x" corresponds to the B text format of UTF16. When the determined first delimiter information is used to identify "0x", the decoding rule corresponding to the first encoded text information can be determined according to the delimiter text matching rule as the decoding rule of UTF16; when the determined first delimiter information is used to identify "\x", the decoding rule corresponding to the first encoded text information can also be determined according to the delimiter text matching rule as the decoding rule of UTF16.

[0034] Optionally, considering that the Unicode encoding format is widely used, the delimiter text matching rule can be preset according to the programming language and / or text format corresponding to the Unicode encoding format, so that in step S102, according to the first delimiter information, using the delimiter text matching rule, the decoding rule corresponding to the first encoded text information can be determined, that is, the decoding rule corresponding to the specific encoding format in Unicode encoding can be determined.

[0035] Unicode, also known as Universal Character Set, is a character encoding used on computers. It assigns a unique binary code to each character in every language to meet the requirements of cross-language and cross-platform text conversion and processing. Development began in 1990, and it was officially released in 1994. With the increasing capabilities of computers, Unicode has become widely adopted in the decade since its release.

[0036] Furthermore, since Unicode encoding formats include multiple types such as UTF32, UTF16, and UTF8, and considering that UTF16 and UTF8 encoding formats are more common, in order to simplify the amount of data processing, it is preferable to preset delimiter text matching rules based on the programming languages ​​and / or text formats commonly used in UTF16 and UTF8 encoding formats.

[0037] The UTF-16 encoding format maps the abstract code points of the Unicode character set to a sequence of 16-bit integers (i.e., code elements) for data storage or transmission. A Unicode character code point requires one or two 16-bit code elements to represent it; therefore, it is a variable-length representation.

[0038] UTF-8 encoding is a variable-length character encoding for Unicode. It can represent any character in the Unicode standard, and its first byte remains compatible with ASCII, allowing software that originally processed ASCII characters to continue using it with little or no modification. Therefore, UTF-8 encoding has gradually become the preferred encoding for email, web pages, and other applications that store or transmit text.

[0039] Optionally, in order to achieve scanning and decoding more efficiently and reduce the amount of data processing, an algorithm similar to a state machine can be used to match all the characters included in the delimiter text identified by the first delimiter information in turn. When all characters match, the first delimiter information is deemed valid, and the decoding rule corresponding to the first encoded text information can be determined. When one character does not match, the first delimiter information is deemed invalid.

[0040] Specifically, when the delimiter text identified by the first delimiter information is a delimiter string containing multiple characters, step S102 may include: using a preset delimiter matching rule to sequentially match the characters included in the delimiter string in order to determine the decoding rule corresponding to the first encoded text information.

[0041] For example, for a text format in UTF16, the delimiter used is "&#x". When setting the delimiter matching rules, it can be set that the first delimiter information is valid only when the characters included in the delimiter string match "&#x", and the encoding format used by the encoded text is determined to be UTF16 encoding format. That is, the decoding rule used for the encoded text is the UTF16 decoding rule.

[0042] When the text jointly identified by the first delimiter information and the first encoded text information is "shield", the delimiter text identified by the first delimiter information is "&#x". Using the preset delimiter matching rules, it can be matched in the order of "&", "#", and "x". All three characters can be matched successfully. Therefore, the first delimiter information is determined to be valid, and the decoding rule corresponding to the first encoded text information is determined to be the UTF16 decoding rule.

[0043] When the string jointly identified by the first delimiter information and the first encoded text information is “&%x76FE”, the preset delimiter matching rules can be used to match in the order of “&”, “%”, and “x”. Since the second character “%” cannot match “#”, the second character fails to match, so the first delimiter information is deemed invalid and the decoding rule corresponding to the first encoded text information cannot be determined.

[0044] Furthermore, considering that some encoding formats may use the same delimiter, but the encoded text encoding the same content may differ. For example, a text format in UTF16 and a text format in UTF8 both use spaces as delimiters. Therefore, to improve the accuracy of determining the decoding rule corresponding to the first encoded text information while ensuring decoding efficiency, the decoding rule corresponding to the first encoded text information can be determined jointly based on the first delimiter information and the first encoded text information. That is, step S102 may further include: when the first delimiter information is determined to be valid, determining the decoding rule corresponding to the first encoded text information based on the first encoded text information.

[0045] For example, when the delimiter text identified by the first delimiter information is a space, the encoded text identified by the first encoded text information is "BA". Based on the first delimiter information, it can be determined whether the decoding rule corresponding to the first encoded text information is the UTF16 decoding rule or the UTF8 decoding rule. Then, based on "BA", it can be further determined that the decoding rule corresponding to the first encoded text information is the UTF8 decoding rule.

[0046] In addition, similar to the aforementioned preset delimiter text matching rules, correspondingly, before step S101, an encoded text matching rule can also be preset, so that when the first delimiter information is determined to be valid, the validity of the first encoded text information can be determined according to the encoded text matching rule. When the first encoded text information is valid, the decoding rule of the encoded language corresponding to the first encoded text information can be determined.

[0047] Step S103: Decode the first encoded text information using the decoding rules corresponding to the first encoded text information to obtain the first decoded text information.

[0048] In this embodiment, after determining the decoding rule corresponding to the first encoded text information, the first encoded text information can be decoded using the rule to obtain the first decoded text information used to identify the decoded text. The method of decoding the first encoded text information using the decoding rule is a common technique used by those skilled in the art, and will not be described in detail here.

[0049] Optionally, when it is determined that the first delimiter information is invalid or the first encoded text information is invalid, that is, when the encoding rule corresponding to the first encoded text information cannot be determined based on the first delimiter information or the first encoded text information, in order to avoid decoding errors or stop decoding, this embodiment may further include:

[0050] Step S104: Use the first delimiter information and the first encoded text information as the first decoded text information.

[0051] The phrase "using the first delimiter information and the first encoded text information as the first decoded text information" means that the delimiter text identified by the first delimiter information and the encoded text identified by the first encoded text information are not decoded in any way, but are directly used as decoded text to generate the first decoded text information.

[0052] For example, when the delimiter text identified by the first delimiter information and the encoded text identified by the first encoded text information are “&%x” and “76FE” respectively, the first delimiter information is determined to be invalid according to the delimiter matching rules. In this case, “&%x76FE” is used as the decoded text, and the first decoded text information is used to identify “&%x76FE”.

[0053] As can be seen from the above embodiments of the present invention, the embodiments of the present invention first determine the first delimiter information based on the target encoded data. Then, based on the first delimiter information, the decoding rules corresponding to the first encoded text information are determined, wherein the delimiter text identified by the first delimiter information and the encoded text identified by the first encoded text information are arranged adjacently in the text identified by the target encoded data, and the delimiter text identified by the first delimiter information is located before the encoded text identified by the first encoded text information. Then, the decoding rules corresponding to the first encoded text information are used to decode the first encoded text information to obtain the first decoded text information. In the embodiments of the present invention, after determining the first delimiter information used to identify only one delimiter text from the target encoded data, the decoding rules corresponding to the first encoded text information are further determined based on the first delimiter information, and the first encoded text is decoded. This method can support the decoding of target encoded data generated by mixed encoding of multiple encoding formats, and does not require pre-scanning of the target encoded data, enabling simultaneous scanning and decoding, which greatly improves the decoding efficiency.

[0054] Example 2

[0055] like Figure 2 As shown, Figure 2 This is a schematic flowchart of a decoding method disclosed in Embodiment 2 of this application. The decoding method includes:

[0056] Step S201: Determine the first delimiter information based on the target encoded data.

[0057] In this embodiment, step S201 is basically the same as or similar to step S101 in the aforementioned embodiment one, and will not be described again here.

[0058] Step S202: Determine the decoding rule corresponding to the first encoded text information based on the first delimiter information. Specifically, in the text identified by the target encoded data, the delimiter text identified by the first delimiter information and the encoded text identified by the first encoded text information are arranged adjacently, with the delimiter text identified by the first delimiter information preceding the encoded text identified by the first encoded text information.

[0059] In this embodiment, step S202 is basically the same as or similar to step S102 in the aforementioned embodiment one, and will not be described again here.

[0060] Step S203: Decode the first encoded text information using the decoding rules corresponding to the first encoded text information to obtain the first decoded text information.

[0061] In this embodiment, step S203 is basically the same as or similar to step S103 in the aforementioned embodiment one, and will not be described again here.

[0062] Step S204: Determine the second delimiter information based on the target encoded data.

[0063] In this embodiment, in the text identified by the target encoded data, the delimiter text identified by the second delimiter information is located after the encoded text identified by the first encoded text information. Furthermore, the encoded text identified by the second encoded text information is located after the delimiter text identified by the second delimiter information. The second delimiter information and the first delimiter information may be the same or different; the first encoded text information and the second encoded text information may also be the same or different.

[0064] For example, when the text identified by the target encoded data is “%3C%E4%BA\4E91\76FE”, if the first delimiter is “%” and the first encoded text is “3C”, then the second delimiter is “%” and the second encoded text is “E4”; if the first delimiter is “%” and the first encoded text is “BA”, then the second delimiter is “\” and the second encoded text is “4E91”; if the first delimiter is “\” and the first encoded text is “4E91”, then the second delimiter is “\” and the second encoded text is “76FE”.

[0065] Step S205: Determine the decoding rule corresponding to the second encoded text information based on the second delimiter information.

[0066] In this embodiment, the method for determining the decoding rule corresponding to the second encoded text information based on the second delimiter information in step S205 is basically the same as or similar to the method for determining the decoding rule corresponding to the first encoded text information based on the first delimiter information in step S202, and will not be described again in this embodiment.

[0067] Step S206: Decode the second encoded text information using the decoding rules corresponding to the second encoded text information to obtain the second decoded text information.

[0068] The method of decoding the second encoded text information using the decoding rules corresponding to the second encoded text information in step S206 to obtain the second decoded text information is basically the same as or similar to the method of decoding the first encoded text information using the decoding rules corresponding to the first encoded text information to obtain the first decoded text information in step S203. Therefore, it will not be described again in this embodiment.

[0069] Optionally, when the implementing entity of this embodiment is a third party authorized to decode and detect the target encoded data, this embodiment may further include the following to ensure network security:

[0070] Step S207: Detect the first decoded text information and / or the second decoded text information to determine whether the target encoded data includes attack features.

[0071] In this embodiment, the first decoded text information and the second decoded text information can be detected separately, or they can be detected together. The attack feature detection algorithm used is not limited and can be reasonably selected according to actual application requirements. If the detection of the first decoded text information and / or the second decoded text information determines that it includes attack features, then it can be determined that the target encoded data contains attack features.

[0072] Furthermore, to improve the accuracy of attack feature identification, as much decoded information as possible can be detected. Specifically, step S207 may include: detecting the target decoded data obtained after decoding the text identified by the target encoded data to determine whether the target encoded data contains attack features. That is, after sequentially decoding all or most of the encoded text identified by the target encoded data, target decoded data can be obtained. By detecting whether the target decoded data contains attack features, it can be further determined whether the target encoded data contains attack features.

[0073] As can be seen from the above embodiments of the present invention, by sequentially decoding multiple encoded texts identified by the target encoded data, the embodiments of the present invention can not only support the decoding of target encoded data generated by mixed encoding of multiple encoding formats, but also eliminate the need for pre-scanning of the target encoded data and multiple scans of the target encoded data. Thus, it can achieve simultaneous scanning and decoding, completing the decoding in one scan, and improving the running efficiency from O(M*N) to O(N), where M is the number of scans and N is the length of the text string used to identify the target encoded data.

[0074] Example 3

[0075] Embodiment 3 of this application provides a decoding device. Figure 3 This is a schematic diagram of a decoding device disclosed in Embodiment 3 of this application. The device includes:

[0076] The information extraction module 301 is used to determine the first delimiter information based on the target encoded data.

[0077] The rule matching module 302 is used to determine the decoding rule corresponding to the first encoded text information based on the first delimiter information; wherein, in the text identified by the target encoded data, the delimiter text identified by the first delimiter information and the encoded text identified by the first encoded text information are arranged adjacently, and the delimiter text identified by the first delimiter information is located before the encoded text identified by the first encoded text information.

[0078] The information decoding module 303 is used to decode the first encoded text information using the decoding rules corresponding to the first encoded text information to obtain the first decoded text information.

[0079] Optionally, after decoding the first encoded text information using the decoding rules corresponding to the first encoded text information to obtain the first decoded text information, the information extraction module 301 is further used to determine the second delimiter information based on the target encoded data. Specifically, in the text identified by the target encoded data, the delimiter text identified by the second delimiter information is located after the encoded text identified by the first encoded text information.

[0080] The rule matching module 302 is further configured to determine the decoding rule corresponding to the second encoded text information based on the second delimiter information. The encoded text identified by the second encoded text information is located after the delimiter text identified by the second delimiter information.

[0081] The information decoding module 303 is also used to decode the second encoded text information using the decoding rules corresponding to the second encoded text information to obtain the second decoded text information.

[0082] Optionally, the decoding device further includes an attack feature recognition module for detecting the first decoded text information and / or the second decoded text information to determine whether the target encoded data includes attack features.

[0083] Optionally, the decoding device further includes a rule setting module, used to preset delimiter text matching rules according to the programming language and / or text format corresponding to the Unicode encoding format; correspondingly, the rule matching module 302 is also used to determine the decoding rules corresponding to the first encoded text information based on the first delimiter information and using the delimiter text matching rules.

[0084] Optionally, when the delimiter text identified by the first delimiter information is a delimiter string containing multiple characters, the rule matching module 302 is further used to use a preset delimiter matching rule to sequentially match the characters included in the delimiter string in order to determine the decoding rule corresponding to the first encoded text information.

[0085] Optionally, the rule matching module 302 is further configured to determine the decoding rule corresponding to the first encoded text information based on the first encoded text information when it is determined that the first delimiter information is valid.

[0086] Optionally, when it is determined that the first delimiter information is invalid or the first encoded text information is invalid, the information decoding module is further configured to use the first delimiter information and the first encoded text information as the first decoded text information.

[0087] The decoding device of this embodiment can realize the corresponding decoding methods in the foregoing multiple method embodiments and has the beneficial effects of the corresponding method embodiments, which will not be repeated here.

[0088] Example 4

[0089] This invention also provides a computer-readable storage medium storing a computer program for performing the corresponding methods in the foregoing method embodiments. Specifically, the computer program includes:

[0090] Used to execute instructions that determine the first delimiter information based on the target encoded data.

[0091] This instruction is used to execute the decoding rule corresponding to the first encoded text information based on the first delimiter information. Specifically, in the text identified by the target encoded data, the delimiter text identified by the first delimiter information and the encoded text identified by the first encoded text information are arranged adjacently, with the delimiter text identified by the first delimiter information preceding the encoded text identified by the first encoded text information.

[0092] Instructions for executing the decoding rules corresponding to the first encoded text information to decode the first encoded text information and obtain the first decoded text information.

[0093] Optionally, after executing the decoding rule corresponding to the first encoded text information to decode the first encoded text information and obtain the first decoded text information, the method further includes an instruction to determine the second delimiter information based on the target encoded data; wherein, in the text identified by the target encoded data, the delimiter text identified by the second delimiter information is located after the encoded text identified by the first encoded text information.

[0094] This instruction is used to execute the command to determine the decoding rule corresponding to the second encoded text information based on the second delimiter information. The encoded text identified by the second encoded text information is located after the delimiter text identified by the second delimiter information.

[0095] Instructions are used to execute the decoding rules corresponding to the second encoded text information, decode the second encoded text information, and obtain the second decoded text information.

[0096] Optionally, it also includes instructions for performing detection on the first decoded text information and / or the second decoded text information to determine whether the target encoded data includes attack features.

[0097] Optionally, it also includes instructions for executing preset delimiter text matching rules according to the programming language and / or text format corresponding to the Unicode encoding format; and instructions for executing decoding rules corresponding to the first encoded text information based on the first delimiter information and using the delimiter text matching rules.

[0098] Optionally, when the delimiter text identified by the first delimiter information is a delimiter string containing multiple characters, it further includes an instruction for performing sequential matching of the characters included in the delimiter string using a preset delimiter matching rule to determine the decoding rule corresponding to the first encoded text information.

[0099] Optionally, it also includes instructions for performing the determination of the decoding rule corresponding to the first encoded text information based on the first encoded text information when the first delimiter information is determined to be valid.

[0100] Optionally, it also includes instructions for executing the first delimiter information and the first encoded text information as the first decoded text information.

[0101] The computer-readable storage medium of this embodiment can implement the corresponding decoding methods in the foregoing multiple method embodiments and has the beneficial effects of the corresponding method embodiments, which will not be repeated here.

[0102] Specific embodiments of this application have now been described. Other embodiments are within the scope of the appended claims. In some cases, the actions described in the claims can be performed in a different order and still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require a specific or sequential order to achieve the desired result. In some embodiments, multitasking and parallel processing can be advantageous.

[0103] This application is described with reference to flowchart illustrations and / or block diagrams of methods according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0104] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.

[0105] Those skilled in the art will understand that embodiments of this application can be provided as methods, apparatus, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-readable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0106] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the apparatus embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions of the method embodiments.

[0107] The above are merely embodiments of this application and are not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.

Claims

1. A decoding method, characterized in that, The method includes: Determine the first delimiter information based on the target encoded data; When the first delimiter information is determined to be valid, the decoding rule corresponding to the first encoded text information is determined according to the first encoded text information; wherein, in the text identified by the target encoded data, the delimiter text identified by the first delimiter information and the encoded text identified by the first encoded text information are arranged adjacently, and the delimiter text identified by the first delimiter information is located before the encoded text identified by the first encoded text information. Using the decoding rules corresponding to the first encoded text information, the first encoded text information is decoded to obtain the first decoded text information; when it is determined that the first delimiter information is invalid or the first encoded text information is invalid, the first delimiter information and the first encoded text information are used as the first decoded text information. Based on the target encoded data, second delimiter information is determined; wherein, in the text identified by the target encoded data, the delimiter text identified by the second delimiter information is located after the encoded text identified by the first encoded text information; Based on the second delimiter information, the decoding rule corresponding to the second encoded text information is determined; wherein, the encoded text identified by the second encoded text information is located after the delimiter text identified by the second delimiter information; Using the decoding rules corresponding to the second encoded text information, the second encoded text information is decoded to obtain the second decoded text information.

2. The method according to claim 1, characterized in that, The method further includes: The first decoded text information and / or the second decoded text information are detected to determine whether the target encoded data includes attack features.

3. The method according to claim 1, characterized in that, The method further includes: pre-setting delimiter text matching rules according to the programming language and / or text format corresponding to the Unicode encoding format; Correspondingly, determining the decoding rule corresponding to the first encoded text information based on the first delimiter information includes: Based on the first delimiter information, the decoding rule corresponding to the first encoded text information is determined using the delimiter text matching rule.

4. The method according to claim 1, characterized in that, When the delimiter text identified by the first delimiter information is a delimiter string containing multiple characters, the step of determining the decoding rule corresponding to the first encoded text information based on the first delimiter information includes: Using preset delimiter matching rules, the characters included in the delimiter string are matched sequentially to determine the decoding rules corresponding to the first encoded text information.

5. A decoding device, characterized in that, The decoding device includes: The information extraction module is configured to determine first delimiter information and first coded text information based on target coded data, wherein, in the text identified by the target coded data, the delimiter text identified by the first delimiter information and the coded text identified by the first coded text information are arranged adjacently, and the delimiter text identified by the first delimiter information is located before the coded text identified by the first coded text information; and is further configured to determine second delimiter information based on the target coded data, wherein, in the text identified by the target coded data, the delimiter text identified by the second delimiter information is located after the coded text identified by the first coded text information. The rule matching module is used to determine the decoding rule corresponding to the first encoded text information based on the first encoded text information when the first delimiter information is determined to be valid; it is also used to determine the decoding rule corresponding to the second encoded text information based on the second delimiter information; wherein the encoded text identified by the second encoded text information is located after the delimiter text identified by the second delimiter information; The information decoding module is used to decode the first encoded text information using the decoding rules corresponding to the first encoded text information to obtain first decoded text information; it is also used to take the first separator information and the first encoded text information as the first decoded text information when it is determined that the first separator information is invalid or the first encoded text information is invalid; it is also used to decode the second encoded text information using the decoding rules corresponding to the second encoded text information to obtain second decoded text information.

6. The apparatus according to claim 5, characterized in that, The information decoding module is further configured to, when it is determined that the first delimiter information is invalid or the first encoded text information is invalid, use the first delimiter information and the first encoded text information as the first decoded text information.

7. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program for performing the method according to any one of claims 1-4.

Citation Information

Patent Citations

  • Detection method and device for preventing unicode code from bypassing

    CN114584362A

  • Nested coding attack load detection method, system and device and storage medium

    CN114745206A

  • Attack feature processing method and device, electronic equipment and storage medium

    CN115086044A

  • Network message decoding method and device, network attack detection method and device and storage medium

    CN114615074A