Cryptographic machine instruction message compatible extension processing method and system, and storage medium
By constructing a preset instruction message format and using preset byte length parameters and identifiers to encapsulate and decompose large data instruction messages, the problem of low encryption and decryption efficiency in existing technologies is solved, and compatible processing of large data instruction messages for cryptographic machines is achieved, thereby improving processing efficiency.
Patent Information
- Application Number
- CN202310618791.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-29
- Publication Date
- 2026-02-03
- Estimated Expiration
- 2043-05-29
AI Technical Summary
Existing cryptographic machine instruction message formats are ineffective at processing large data instruction messages, resulting in low encryption and decryption efficiency. Furthermore, the data splitting and processing method increases the complexity of application system development.
A preset instruction message format is constructed, including preset byte length parameters and preset identifiers. These parameters are used to encapsulate, identify, and decompose big data instruction messages, and extract the message body to achieve compatible processing.
It improves the efficiency of encryption and decryption services for big data command messages, avoids the complexity of data splitting and processing, and supports efficient data processing for emerging businesses.
Smart Images

Figure CN116760909B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of communication technology, and in particular to a method, system, and storage medium for compatible extended processing of cryptographic machine instruction messages. Background Technology
[0002] A cryptographic machine is a cryptographic device used to ensure data security and provide corresponding cryptographic services. It provides the host with various cryptographic security service command message interfaces that meet the data security requirements of financial transactions such as magnetic stripe cards, IC cards, and online banking password keys. Most financial transactions using magnetic stripe cards, IC cards, and online banking password keys use relatively short command message data, with the longest command typically not exceeding 10KB. With the rapid development of information security, emerging businesses such as facial recognition payments and digital currencies have created demands for large-scale data encryption and decryption. Current technologies for processing large-scale command messages using existing message formats have limitations. For example, for large-scale command messages exceeding the length limit, the host application must split them into multiple packets and perform multiple TCP communications to complete the final cryptographic service. Furthermore, using the original message format for large-scale encryption and decryption services for new businesses makes it difficult to maximize the performance of the cryptographic machine, resulting in low efficiency. Additionally, the data splitting method also brings inconvenience to application system development. Summary of the Invention
[0003] To address at least one of the aforementioned technical problems, this invention proposes a method, system, and storage medium for compatible extended processing of cryptographic machine instruction messages, which enables compatibility with large data instruction messages from cryptographic machines and improves the efficiency of encryption and decryption services for large data instruction messages.
[0004] On one hand, embodiments of the present invention provide a method for compatibility and extension processing of cryptographic machine instruction messages, including the following steps:
[0005] Construct a preset instruction message format; wherein, big data instruction messages are encapsulated through the preset instruction message format, the preset instruction message format including a preset byte length parameter, a preset identifier and a message body;
[0006] Obtain message data;
[0007] The message data is determined to be the big data instruction message according to the preset instruction message format, and the preset byte length parameter and the preset identifier are obtained from the message data; wherein, the big data instruction message corresponds to the preset instruction message format;
[0008] Extract the message body from the message data according to the preset byte length parameter and the preset identifier;
[0009] The message body is decomposed to obtain service instruction data.
[0010] According to some embodiments of the present invention, the construction of the preset instruction message format includes:
[0011] Set the decimal message length parameter of the first byte length to obtain the preset byte length parameter; wherein, the preset byte length parameter corresponds to the length of the message body;
[0012] Set a string of length two bytes to obtain the preset identifier;
[0013] The message body is set according to the preset byte length parameter; wherein message data is stored in the message body.
[0014] According to some embodiments of the present invention, extracting the message body from the message data based on the preset byte length parameter and the preset identifier includes:
[0015] The message body length is calculated based on the preset byte length parameter and the preset identifier;
[0016] Extract the message body from the message data based on the message body length.
[0017] According to some embodiments of the present invention, calculating the message body length based on the preset byte length parameter and the preset identifier includes:
[0018] The first data length of the message body is obtained by analyzing the preset byte length parameter;
[0019] The message body length is obtained by subtracting the second byte length of the preset identifier from the first data length.
[0020] According to some embodiments of the present invention, the step of decomposing the message body to obtain service instruction data includes:
[0021] The message body is parsed to obtain the message header and message body;
[0022] Once the message header verification is confirmed to be successful, the message body is decomposed to obtain the business instruction data; wherein, the business instruction data includes an instruction header and an instruction body.
[0023] According to some embodiments of the present invention, determining that the message data is the big data instruction message based on the preset instruction message format, and separating the preset byte length parameter and the preset identifier from the message data, includes:
[0024] Based on the preset instruction message format, the message data is determined to contain the preset byte length parameter and the preset identifier. The big data instruction message is then separated using the preset instruction message format to obtain the preset byte length parameter and the preset identifier.
[0025] According to some embodiments of the present invention, in the process of performing the step of determining that the message data is the big data instruction message according to the preset instruction message format, and separating the preset byte length parameter and the preset identifier from the message data, the method further includes:
[0026] Based on the preset instruction message format, it is determined that the message data does not contain the preset byte length parameter and the preset identifier. The third byte of the binary message length parameter is separated from the message data to obtain the message body length data.
[0027] On the other hand, embodiments of the present invention also provide a cryptographic machine instruction message compatible extended processing system, including:
[0028] A construction module is used to construct a preset instruction message format; wherein, a big data instruction message is encapsulated through the preset instruction message format, the preset instruction message format including a preset byte length parameter, a preset identifier and a message body;
[0029] The acquisition module is used to acquire message data;
[0030] The identification module is used to determine that the message data is the big data instruction message according to the preset instruction message format, and to separate the preset byte length parameter and the preset identifier from the message data; wherein the big data instruction message corresponds to the preset instruction message format;
[0031] The extraction module is used to extract the message body from the message data according to the preset byte length parameter and the preset identifier;
[0032] The decomposition module is used to decompose the message body to obtain service instruction data.
[0033] On the other hand, embodiments of the present invention also provide a cryptographic machine instruction message compatible extended processing system, including:
[0034] At least one processor;
[0035] At least one memory for storing at least one program;
[0036] When the at least one program is executed by the at least one processor, the at least one processor implements the cryptographic machine instruction message compatibility extension processing method as described in the above embodiments.
[0037] On the other hand, embodiments of the present invention also provide a computer storage medium storing a processor-executable program, which, when executed by the processor, is used to implement the cryptographic machine instruction message compatibility extension processing method as described in the above embodiments.
[0038] A cryptographic machine instruction message compatibility extension processing method according to an embodiment of the present invention has at least the following beneficial effects: First, the embodiment of the present invention constructs a preset instruction message format, including a preset byte length parameter, a preset identifier, and a message body. In this embodiment, the preset instruction message format corresponds to a big data instruction message, so as to construct a big data instruction message data packet through the preset instruction message format, that is, to encapsulate the big data instruction message through the preset instruction message format. Next, the embodiment of the present invention obtains message data and identifies the message data according to the preset instruction message format. When the message data is determined to be a big data instruction message, the embodiment of the present invention separates the message data to obtain the preset byte length parameter and the preset identifier. Next, the embodiment of the present invention extracts the corresponding message body from the message data according to the preset byte length parameter and the preset identifier, and decomposes the message body to obtain relevant business data. Thus, by identifying the big data instruction message through the preset instruction message format and extracting the message body through the preset byte length parameter and the preset identifier, compatibility with cryptographic machine big data instruction messages is achieved, and the efficiency of big data instruction message encryption and decryption services is effectively improved. Attached Figure Description
[0039] Figure 1 This is a flowchart of the cryptographic machine instruction message compatibility extension processing method provided in the embodiments of the present invention;
[0040] Figure 2 This is a schematic diagram of the structure of the preset instruction message format provided in the embodiments of the present invention;
[0041] Figure 3 This is a block diagram of the cryptographic machine instruction message compatibility and extension processing system provided in the embodiments of the present invention. Detailed Implementation
[0042] The embodiments described in this application should not be considered as limitations on this application. All other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0043] In the following description, references are made to “some embodiments,” which describe a subset of all possible embodiments. However, it is understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.
[0044] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application.
[0045] Before describing the embodiments of this application, the relevant terms involved in this application will be explained.
[0046] Cryptographic machine: A cryptographic device used to ensure data security and provide related cryptographic services, such as PIN encryption, PIN to encryption, MAC generation and verification, data encryption and decryption, signature, signature verification and other cryptographic services.
[0047] Binary representation: The length of the cipher machine instruction message is represented by binary. For example, the 2-byte binary number "00000000 01001000" represents an instruction message length of 72.
[0048] Decimal representation: The length of the cipher machine instruction message is represented by decimal notation. For example, the 8-byte decimal string "00000100" represents an instruction message length of 100.
[0049] A cryptographic machine is a cryptographic device used to ensure data security and provide corresponding cryptographic services. It provides the host with various cryptographic security service command message interfaces that meet the data security requirements of financial transactions such as magnetic stripe cards, IC cards, and online banking password keys. Most financial transactions using magnetic stripe cards, IC cards, and online banking password keys use relatively short command message data, and the longest data in a command is generally not very large, typically not exceeding 10KB. With the rapid development of information security, emerging businesses such as facial recognition payment and digital currency have created demands for encrypting and decrypting large data messages. Current technologies for processing large data command messages using existing message formats have certain limitations. For large data command messages exceeding the length limit (e.g., the maximum length for a two-byte binary number is 65535 bytes), the host application must split these messages into multiple packets and perform multiple TCP communications to complete the final cryptographic service. Furthermore, with the adoption of 10 Gigabit optical cards in cryptographic machines, network bandwidth has been further enhanced. A single 10M TCP communication message is no longer a bottleneck. However, the existing message format is still used for big data encryption and decryption services for new businesses, making it difficult to maximize the performance of the cryptographic machine and resulting in low efficiency. Additionally, the data splitting processing method has also brought inconvenience to application system development.
[0050] One embodiment of the present invention provides a method, system, and storage medium for compatibility and extension processing of cryptographic machine instruction messages, which can achieve compatibility with large data instruction messages of cryptographic machines and improve the efficiency of encryption and decryption services for large data instruction messages. (Refer to...) Figure 1 The method in this embodiment of the invention includes, but is not limited to, steps S110, S120, S130, S140 and S150.
[0051] Specifically, the application process of the method in this embodiment of the invention includes, but is not limited to, the following steps:
[0052] S110: Construct a preset instruction message format. This involves encapsulating big data instruction messages using a preset instruction message format, which includes a preset byte length parameter, a preset identifier, and a message body.
[0053] S120: Obtain message data.
[0054] S130: Based on the preset instruction message format, the message data is determined to be a big data instruction message. The preset byte length parameter and preset identifier are extracted from the message data. The big data instruction message corresponds to the preset instruction message format.
[0055] S140: Extract the message body from the message data according to the preset byte length parameter and preset identifier.
[0056] S150: Decompose the message body to obtain business data.
[0057] In the operation of this specific embodiment, the present invention first constructs a preset instruction message format. Specifically, the preset instruction message format constructed in this embodiment includes a preset byte length parameter, a preset identifier, and a message body. It is easy to understand that the present invention encapsulates the large data message data to be sent, such as instruction messages larger than 10MB, using the preset instruction message format to obtain the corresponding message data. In this embodiment, the preset byte length parameter represents the message length LEN, and the preset identifier is a megabyte length identifier MC, indicating that the message data is a large data instruction message. Next, the present invention obtains the message data. Specifically, the message data received in this embodiment may contain messages with different message formats. For example, the message data in this embodiment includes the original instruction message format and large data instruction messages. The original instruction message format in this embodiment is the traditional cryptographic machine instruction message format, generally consisting of a two-byte length item plus a message content item, where the length item is represented by a binary number representing the length of the message content item. Accordingly, in this embodiment of the invention, the big data instruction message is a message format where a single instruction message is longer than a preset length, such as a single instruction message length greater than 65535 bytes, or a big data (over 10M) instruction message. Next, this embodiment of the invention uses a preset instruction message format to determine that the message data is a big data instruction message, and separates the preset byte length parameter and preset identifier from the message data. Specifically, in this embodiment of the invention, the big data instruction message corresponds to the preset instruction message format, that is, the preset instruction message format encapsulates the big data instruction message. This embodiment of the invention identifies the obtained message data using the preset instruction message format to determine whether the message data is a big data instruction message. When the message data is determined to be a big data instruction message, this embodiment of the invention separates the preset byte length parameter and preset identifier from the message data using the preset instruction message format, thereby obtaining the corresponding preset byte length parameter and preset identifier. Further, this embodiment of the invention extracts the message body from the message data based on the preset byte length parameter and preset identifier. In this embodiment of the invention, the message data is parsed based on the separated preset byte length parameter and preset identifier, such as parsing the length of the message data and the length of the preset identifier, thereby enabling the extraction of the corresponding message body from the message data. Next, this embodiment of the invention decomposes the message body to obtain service data. After extracting the message body from the message data, this embodiment of the invention decomposes the message body to obtain the corresponding service data, thereby executing the corresponding service processing.It is readily understood that in this embodiment of the invention, big data command messages are encapsulated using a pre-defined command message format, and the relevant big data command messages are identified by judging whether the message data is a big data command message using the pre-defined command message format. Furthermore, when this embodiment of the invention determines that the obtained message data is a big data command message, the message body of the message data is extracted by separating the pre-defined byte length parameter and the pre-defined identifier. The message body is then decomposed to obtain the corresponding business data, achieving compatibility with cryptographic machine big data command messages without requiring data splitting, effectively improving the efficiency of big data command message encryption and decryption services.
[0058] In some embodiments of the present invention, a preset instruction message format is constructed, including but not limited to:
[0059] Set the decimal message length parameter of the first byte length to obtain the preset byte length parameter. The preset byte length parameter corresponds to the length of the message body.
[0060] Set the string with the second byte length to obtain the preset identifier.
[0061] The message body is set according to the preset byte length parameter. The message data is stored in the message body.
[0062] In this specific embodiment, the preset instruction message format constructed by this invention includes a preset byte length parameter, a preset identifier, and a message body. Specifically, this invention first sets a decimal message length parameter of the first byte length to obtain the preset byte length parameter. In this invention, the preset byte length parameter corresponds to the length of the message body, that is, the data stored in the preset byte length parameter corresponds to the length of the message body. The first byte length in this invention is the length of the preset byte length parameter, which can be customized according to actual needs. For example, in this invention, the preset byte length is set to an 8-byte decimal message length parameter. By storing the length of the message body using an 8-byte decimal message length parameter, the problem of needing to split and perform multiple TCP communications to complete the cryptographic service for large data messages exceeding the limit length is effectively alleviated. Furthermore, it can meet the encryption and decryption service requirements of large data instructions, such as data exceeding 10M, achieving compatibility with large data instruction messages. Next, this invention sets a string of the second byte length to obtain the preset identifier. In this embodiment of the invention, the preset identifier is a string with a length of two bytes. For example, in this embodiment, a 2-byte string is used as the megabyte length identifier (MC identifier) supporting big data instruction messages, i.e., the preset identifier. This embodiment of the invention, through the set preset byte length parameter and the preset identifier, can identify whether the acquired message data is a big data instruction message. Further, this embodiment of the invention sets the message body according to the preset byte length parameter. In this embodiment of the invention, the message body stores the message content to be sent, i.e., the corresponding message data. Since the preset byte length parameter corresponds to the length of the message body, this embodiment of the invention constructs a message body of the corresponding length according to the preset byte length parameter to store the corresponding information data.
[0063] In some embodiments of the present invention, the message body is extracted from the message data according to a preset byte length parameter and a preset identifier, including but not limited to:
[0064] The message body length is calculated based on the preset byte length parameter and the preset identifier.
[0065] Extract the message body from the message data based on the message body length.
[0066] In this specific embodiment, the present invention first calculates the message body length using a preset byte length parameter and a preset identifier, and then extracts the message body from the message data based on the message body length. Specifically, the present invention can analyze and obtain the length of the message body in the message data based on the preset byte length parameter. The length data stored in the preset byte length parameter in the present invention is the total length of the message body and the preset identifier. The present invention calculates the message body length in the message data based on the length of the preset byte length parameter and the preset identifier, and extracts data of the corresponding byte length from the message data using the calculated message body length to obtain the message body. For example, when the calculated message body length is 'a' bytes, the present invention extracts 'a' bytes of data from the corresponding data position in the message data according to the preset instruction message format, thereby obtaining the corresponding message body. It should be noted that in some embodiments of the present invention, the length data stored in the preset byte length parameter may only be the message body length. In this case, the present invention directly reads the preset byte length parameter, and then extracts data of the corresponding byte length from the corresponding data position in the message data based on the read message body length to obtain the message body.
[0067] In some embodiments of the present invention, the message body length is calculated based on a preset byte length parameter and a preset identifier, including but not limited to:
[0068] The first data length of the message body is obtained by analyzing the preset byte length parameter.
[0069] Subtract the second byte length of the preset identifier from the first data length to obtain the message body length.
[0070] In this specific embodiment, the present invention analyzes the first data length of the message body through a preset byte length parameter to obtain the first data length and subtracts the second byte length of the preset identifier to obtain the message body length. Specifically, the preset byte length parameter in the present invention stores the total byte length of the message body, including the preset identifier following the preset byte length parameter of the message data. That is, the length data stored in the preset byte length parameter is the sum of the second byte length of the preset identifier and the length of the message body. Therefore, the present invention can calculate the corresponding message body length using the length data of the preset byte length parameter, i.e., the first data length, and the second byte length of the preset identifier. For example, the present invention subtracts the length of the preset identifier from the length data in the preset byte length parameter. For instance, if the length data in the preset byte length parameter, i.e., the first data length, is len, and the second byte length of the preset identifier is 2 bytes, then the message body length is len-2 bytes. Then, the present invention extracts the corresponding message data from the message data according to the calculated message body length. For example, when the calculated message body length is len-2 bytes, the present invention extracts len-2 bytes of data after the preset identifier to obtain the message body of the message data.
[0071] In some embodiments of the present invention, the message body is decomposed to obtain service instruction data, including but not limited to:
[0072] The message body is parsed to obtain the message header and message body.
[0073] Once the message header verification is successful, the message body is decomposed to obtain the business instruction data. The business instruction data includes an instruction header and an instruction body.
[0074] In this specific embodiment, the present invention first parses the message body to obtain the message header and the message body. Next, the present invention verifies the message header. Once the message header verification is successful, the present invention decomposes the message body to obtain the corresponding business instruction data, thereby enabling corresponding business processing based on the business instruction data. Specifically, refer to... Figure 2 In this embodiment of the invention, the message body includes a message header and a message body. Accordingly, this embodiment performs data verification using the message header, and the message body includes an instruction header and an instruction body. This embodiment first parses the message body according to a preset message protocol, thereby separating the message header and message body. Next, this embodiment performs data verification using the message header. When the message header verification is successful, this embodiment further parses the message body to obtain the instruction header and instruction body, thus obtaining the corresponding business instruction data. This embodiment executes the corresponding business instruction based on the parsed instruction header and instruction body, thereby achieving processing and compatibility with large data instruction messages.
[0075] For example, in this embodiment of the invention, each cryptographic service message body has a fixed-length message header and different command codes (2 bytes), such as "NC" indicating the version number to be obtained, "KE" indicating SM2 national cryptographic algorithm encryption, etc., and each command code is followed by a command content in a custom format. The cryptographic machine decomposes the message body according to different command codes. For example, the "KE" cryptographic service message body (12345678KE0100041234) is decomposed into a verification message header 12345678, the SM2 national cryptographic encryption command code "KE", the public key index 01 used, the length of the encrypted data 0004, the encrypted data 1234, etc. Accordingly, this embodiment of the invention performs business processing based on the command codes obtained from the decomposed message. For example, in the SM2 national cryptographic encryption business described above, this embodiment of the invention obtains the public key plaintext from the public key index 01, performs public key encryption operation on the data plaintext 1234, and obtains the encryption result.
[0076] In some embodiments of the present invention, the message data is determined to be a large data instruction message according to a preset instruction message format, and a preset byte length parameter and a preset identifier are obtained from the message data, including but not limited to:
[0077] Based on the preset instruction message format, the message data contains a preset byte length parameter and a preset identifier. The big data instruction message is separated using the preset instruction message format to obtain the preset byte length parameter and the preset identifier.
[0078] In this specific embodiment, the present invention first identifies and analyzes the message data to determine whether it contains a preset byte length parameter and a preset identifier. If the message data contains both the preset byte length parameter and the preset identifier, the acquired message data is determined to be a large data instruction message. Next, the present invention separates the large data instruction message (i.e., the acquired message data) using a preset instruction message format to obtain the corresponding preset byte length parameter and preset identifier. Specifically, the present invention first parses the message data using the preset instruction message format to determine whether the message data satisfies the preset byte length parameter (first byte length) and whether a preset identifier (second byte length) is set. When the message data is identified to contain a preset byte length parameter of the first byte length and a preset identifier of the second byte length, such as determining that the message data contains a decimal message length parameter of 8 bytes and a preset identifier of 2 bytes, it can be determined that the received message data is a big data instruction message. According to the encapsulation format of the big data instruction message, i.e. the preset instruction message format, the message data is decomposed. For example, the present invention first extracts the identified 2-byte preset identifier, and then extracts the 8-byte data before the preset identifier to obtain the preset byte length parameter of 8 bytes.
[0079] In some embodiments of the present invention, during the step of determining that the message data is a large data instruction message according to the preset instruction message format, and separating the preset byte length parameter and preset identifier from the message data, the cryptographic machine instruction message compatibility extension processing method provided in the embodiments of the present invention further includes, but is not limited to:
[0080] Based on the preset instruction message format, it is determined that the message data does not contain the preset byte length parameter and the preset identifier. The third byte of the binary message length parameter is separated from the message data to obtain the message body length data.
[0081] In this specific embodiment, the message data obtained by this invention may not contain a preset byte length parameter and a preset identifier. That is, the received message data may not be a large data instruction message, but rather message data encapsulated in the original instruction message format, such as the length of the third byte (i.e., the binary message length parameter) plus the message content item, where the length item represents the length of the message content item using binary numbers. Therefore, when this invention analyzes the message data using a preset message format and determines that the message data does not contain a preset byte length parameter and a preset identifier, it determines that the message data is not a large data instruction message. This invention then separates the corresponding binary message length parameter from the message data according to the ordinary instruction message format, such as directly taking the third byte of data sequentially from the message data to obtain the binary message length parameter. Accordingly, the obtained binary message length parameter is parsed to obtain the corresponding message body length data, thereby enabling the extraction of the corresponding message body based on the message body length data. It is easy to understand that the embodiments of the present invention determine whether the acquired message data is a big data instruction message by judging the message data, and perform different processing on big data instruction messages and non-big data instruction messages respectively. In this way, while supporting the original instruction message format, it realizes the compatible and extended processing of big data instructions, and the original application system does not need to be reconfigured or changed, effectively reducing deployment and maintenance costs.
[0082] It should be noted that, in some embodiments of the present invention, the present invention first receives message data and determines whether the message data is a big data instruction message, that is, whether the message data meets the preset instruction message format. When it is determined that the message data meets the preset instruction message format, the obtained message data is determined to be a big data instruction message. The present invention separates the preset byte length parameter and the preset identifier from the message data according to the preset instruction message format. Then, the present invention subtracts the second byte length of the preset identifier from the length data of the preset byte length parameter to obtain the corresponding message body length. Correspondingly, when it is determined that the message data does not meet the preset instruction message format, the obtained message data is determined to be a normal instruction message. The present invention obtains the binary message length parameter by obtaining the data of the first third byte length in the message data, and obtains the corresponding message body length according to the binary message length parameter. Further, the present invention extracts the message body from the message data according to the message body length, and decomposes the extracted message body to obtain the corresponding message header and message body. Once the message header verification is successful, this embodiment of the invention decomposes the message body to obtain the corresponding instruction header and instruction body for relevant business processing. This enables support for existing message formats and compatibility extensions for big data instruction messages. Furthermore, when processing new business using big data instruction messages, this embodiment of the invention eliminates the need to split data into multiple data packets, allowing for direct data encryption and decryption services to be completed in one step, effectively improving data processing efficiency.
[0083] An embodiment of the present invention also provides a cryptographic machine instruction message compatible extended processing system, comprising:
[0084] The construction module is used to build a preset command message format. Specifically, it encapsulates big data command messages using this preset command message format, which includes a preset byte length parameter, a preset identifier, and a message body.
[0085] The acquisition module is used to acquire message data.
[0086] The identification module is used to determine whether the message data is a big data instruction message based on a preset instruction message format, and to extract a preset byte length parameter and a preset identifier from the message data. The big data instruction message corresponds to the preset instruction message format.
[0087] The extraction module is used to extract the message body from the message data according to the preset byte length parameter and the preset identifier.
[0088] The decomposition module is used to decompose the message body to obtain business instruction data.
[0089] Reference Figure 3An embodiment of the present invention also provides a cryptographic machine instruction message compatible extended processing system, comprising:
[0090] At least one processor 210.
[0091] At least one memory 220 is used to store at least one program.
[0092] When at least one program is executed by at least one processor 210, the at least one processor 210 implements the cryptographic machine instruction message compatibility extension processing method as described in the above embodiments.
[0093] An embodiment of the present invention also provides a computer-readable storage medium storing computer-executable instructions that are executed by one or more control processors, for example, performing the steps described in the above embodiments.
[0094] It will be understood by those skilled in the art that all or some of the steps and systems in the methods disclosed above can be implemented as software, firmware, hardware, and suitable combinations thereof. Some or all of the physical components can be implemented as software executed by a processor, such as a central processing unit, digital signal processor, or microprocessor, or as hardware, or as an integrated circuit, such as an application-specific integrated circuit. Such software can be distributed on a computer-readable medium, which can include computer storage media (or non-transitory media) and communication media (or transient media). As is known to those skilled in the art, the term computer storage media includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technologies, CD-ROM, digital versatile disc (DVD) or other optical disc storage, magnetic cartridges, magnetic tape, disk storage or other magnetic storage devices, or any other medium that can be used to store desired information and is accessible to a computer. Furthermore, as is known to those skilled in the art, communication media typically contain computer-readable instructions, data structures, program modules, or other data in modulated data signals such as carrier waves or other transmission mechanisms, and may include any information delivery medium.
[0095] The above is a detailed description of the preferred embodiments of the present invention. However, the present invention is not limited to the above embodiments. Those skilled in the art can make various equivalent modifications or substitutions without departing from the spirit of the present invention. All such equivalent modifications or substitutions are included within the scope defined by the claims of the present invention.
Claims
1. A method for compatible extension processing of cryptographic machine instruction messages, characterized in that, Includes the following steps: Construct a preset instruction message format; wherein, big data instruction messages are encapsulated through the preset instruction message format, the preset instruction message format including a preset byte length parameter, a preset identifier and a message body; Obtain message data; The message data is determined to be the big data instruction message according to the preset instruction message format, and the preset byte length parameter and the preset identifier are obtained from the message data; wherein, the big data instruction message corresponds to the preset instruction message format; The message body is extracted from the message data based on the preset byte length parameter and the byte length of the preset identifier; wherein, the preset identifier is a megabyte length identifier; The message body is decomposed to obtain service instruction data.
2. The cryptographic machine instruction message compatibility extension processing method according to claim 1, characterized in that, The construction of the preset instruction message format includes: Set the decimal message length parameter of the first byte length to obtain the preset byte length parameter; wherein, the preset byte length parameter corresponds to the length of the message body; Set a string of length two bytes to obtain the preset identifier; The message body is set according to the preset byte length parameter; wherein message data is stored in the message body.
3. The cryptographic machine instruction message compatibility extension processing method according to claim 2, characterized in that, The step of extracting the message body from the message data according to the preset byte length parameter and the preset identifier byte length includes: The message body length is calculated based on the preset byte length parameter and the preset identifier; Extract the message body from the message data based on the message body length.
4. The cryptographic machine instruction message compatibility extension processing method according to claim 3, characterized in that, The step of calculating the message body length based on the preset byte length parameter and the preset identifier includes: The first data length of the message body is obtained by analyzing the preset byte length parameter; The message body length is obtained by subtracting the second byte length of the preset identifier from the first data length.
5. The cryptographic machine instruction message compatibility extension processing method according to claim 3, characterized in that, The process of decomposing the message body to obtain service instruction data includes: The message body is parsed to obtain the message header and message body; Once the message header verification is confirmed to be successful, the message body is decomposed to obtain the business instruction data; wherein, the business instruction data includes an instruction header and an instruction body.
6. The cryptographic machine instruction message compatibility extension processing method according to claim 2, characterized in that, The step of determining the message data as the big data instruction message according to the preset instruction message format, and separating the preset byte length parameter and the preset identifier from the message data, includes: Based on the preset instruction message format, the message data is determined to contain the preset byte length parameter and the preset identifier. The big data instruction message is then separated using the preset instruction message format to obtain the preset byte length parameter and the preset identifier.
7. The cryptographic machine instruction message compatibility extension processing method according to claim 2, characterized in that, In the process of determining that the message data is the big data instruction message according to the preset instruction message format, and separating the preset byte length parameter and the preset identifier from the message data, the method further includes: Based on the preset instruction message format, it is determined that the message data does not contain the preset byte length parameter and the preset identifier. The third byte of the binary message length parameter is separated from the message data to obtain the message body length data.
8. A cryptographic machine instruction message compatible extended processing system, characterized in that, include: A construction module is used to construct a preset instruction message format; wherein, a big data instruction message is encapsulated through the preset instruction message format, the preset instruction message format including a preset byte length parameter, a preset identifier and a message body; The acquisition module is used to acquire message data; The identification module is used to determine that the message data is the big data instruction message according to the preset instruction message format, and to separate the preset byte length parameter and the preset identifier from the message data; wherein the big data instruction message corresponds to the preset instruction message format; An extraction module is used to extract the message body from the message data according to the preset byte length parameter and the byte length of the preset identifier; wherein, the preset identifier is a megabyte length identifier; The decomposition module is used to decompose the message body to obtain service instruction data.
9. A cryptographic machine instruction message compatible extended processing system, characterized in that, include: At least one processor; At least one memory for storing at least one program; When the at least one program is executed by the at least one processor, the at least one processor implements the cryptographic machine instruction message compatibility extension processing method as described in any one of claims 1 to 7.
10. A computer storage medium storing a processor-executable program, characterized in that, The processor-executable program, when executed by the processor, is used to implement the cryptographic machine instruction message compatibility extension processing method as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Data message sending method, data message processing method, data message sending device, data message processing device, data message sending equipment and data message
CN114125940A
Message processing method, system and device and medium
CN114390004A