Message exchange method and system
By configuring the message composition and encryption operations of the 8583 protocol, transaction messages are generated and MAC verification is performed. This solves the problems of insufficient understanding of the protocol by developers and deep binding between the system and hardware, and realizes efficient and stable 8583 format data exchange.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-02
- Publication Date
- 2026-04-10
AI Technical Summary
In existing technologies, developers lack sufficient understanding of the 8583 protocol specification, making it difficult to guarantee code quality in 8583 format data exchange scenarios. Furthermore, the deep integration of the message exchange system with the transaction information collection hardware increases system complexity and migration difficulty, making it impossible to operate independently and posing transaction risks and logical vulnerabilities.
By configuring the fields of the message components, including purpose and data field number, a basic packet format is generated, encryption is performed, a transaction message is generated, and MAC verification and decoding are performed at the receiving end. This decouples the system from the hardware and achieves standardized data format conversion and encapsulation.
It lowers the barrier for developers to understand the protocol, reduces code logic vulnerabilities and transaction risks, simplifies system integration, improves system stability and adaptability, and reduces development and maintenance costs.
Smart Images

Figure CN121262294B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of 8583 format data exchange, in particular to a message exchange method and system. BACKGROUND
[0002] As the core specification of message exchange between banks, card organizations, terminals and systems, the 8583 standard exposes corresponding technical problems when industry institutions access related transaction systems. On the one hand, developers generally do not have a deep understanding of the 8583 protocol specification and lack relevant development experience, which leads to difficulty in guaranteeing code quality in the 8583 format data exchange scenario, and hidden dangers for transaction security.
[0003] On the other hand, the message exchange system is deeply bound and integrated with transaction information collection hardware devices, which not only greatly increases the system structure complexity, but also greatly increases the system migration difficulty. At the same time, the dependence on hardware leads to the inability to reuse the code, and repeated development not only increases the labor cost, but also increases the probability of logical loopholes, transaction interruption and other risks.
[0004] Existing technical solutions fail to solve the above problems: neither do they fully consider the understanding differences of developers on the data format of each field of the message, nor do they avoid transaction risks caused thereby through technical means; and because the system needs to deeply participate in the control of the transaction terminal hardware in the traditional solution, it is difficult to run independently, further exacerbating the pain point of high system complexity. SUMMARY
[0005] Therefore, the present application provides a message exchange method, which includes the following steps:
[0006] Based on the format of the 8583 protocol, the message composition content is configured, wherein the fields of the message composition content include a universal basic package format composed of purpose, data field number, maximum length of data field, length type of data field, data format, padding type, padding position, padding content, existence identifier, original data, and formatted package data;
[0007] Based on the transaction data dynamically generated in the transaction process, the configured message composition content is encrypted to generate a data set;
[0008] The format of the data set is converted into the required format of the transaction message to generate message format data;
[0009] The message format data is added with a message header and MAC to complete the message, and the completed message is uploaded to the transaction system of the transaction processing party.
[0010] In one possible implementation, the method further includes:
[0011] The processing party receives the response message and verifies the message header of the response message according to the 8583 protocol.
[0012] The extracted message is compared with the local MAC value for verification;
[0013] The decoded message bitmap determines the data field list, and the recovered message original data is restored;
[0014] According to the basic packet format of the message composition, the integrity of the mandatory field and the legality of the field value of the parsed data set are verified, and the data set that passes the verification is encapsulated as a structured result;
[0015] According to the environmental variable configuration, the structured result is encrypted and sent to the business system of the processing party.
[0016] In one possible implementation, based on the format of the 8583 protocol, the configuration of the message composition content includes the following steps:
[0017] Configure the operating system basic parameters and external device service interaction parameters;
[0018] Based on the core field of the message composition content, configure the corresponding conversion rules respectively;
[0019] Based on the 8583 protocol adaptation version and non-standard domain mapping rules;
[0020] Based on the main encryption algorithm configuration parameters and priority, define the encryption and verification rules of the track data, PIN, and MAC;
[0021] Based on the above rules, map the above parameters and rules to the fields to generate the message composition content.
[0022] In one possible implementation, based on the transaction data dynamically generated in the transaction process, the encryption operation is performed through the configured message composition content to generate a data set, including the following steps:
[0023] Receive transaction original data dynamically generated in the transaction process;
[0024] Verify the integrity of the mandatory fields of the transaction original data and store them in the specified directory;
[0025] Based on the configuration of the preset message composition basic packet format, perform format conversion and length compliance judgment on the original data;
[0026] Based on the configuration of the preset message composition basic packet format, the original data is split into normal data and sensitive encrypted data according to the preset 8583 protocol;
[0027] Based on the preset rules, the sensitive encrypted data is encrypted;
[0028] Combine the normal data and sensitive data ciphertext into an encrypted data set and mark the encryption state to generate a data set.
[0029] In a possible implementation, the format conversion of the data set into the required format of the transaction message, the generating of the message format data comprises the steps of:
[0030] Based on the mapping rule of the 8583 protocol adaptation configuration, the fields in the encrypted data set are associated with the 8583 protocol standard domain / customized domain;
[0031] Based on the basic package format of the message composition, the format conversion of the mapped fields, the padding of the fixed-length fields / overlength processing are performed;
[0032] Based on the bitmap generated by the transaction processing party according to the 8583 protocol rule, the 8583 protocol standard domain data and the customized domain data are spliced to generate a 8583 protocol data domain splicing body;
[0033] The message header containing the message length, the message type and the like information is added to the 8583 protocol data domain splicing body to generate an assembled message;
[0034] The length, the bitmap and the consistency of the variable-length domain of the assembled message are checked to generate the message format data.
[0035] In a possible implementation, the configuration of the operating system basic parameters and the external device service interaction parameters comprises:
[0036] The operating system underlying path and the compilation environment adaptation parameter are configured, and the compilation environment adaptation parameter selects the compilation dependency supported by the operating system natively;
[0037] The communication protocol of the access institution device, the device identification coding rule, and the communication address of the encryption machine, the connection timeout time and the data transmission protocol are configured.
[0038] In a possible implementation, the encryption of the sensitive encrypted data based on the preset rule comprises:
[0039] The encryption parameters are loaded from the preset configuration, and the encryption parameters comprise the main encryption algorithm, the algorithm parameter, the algorithm priority and the encryption machine communication parameter;
[0040] The communication connection with the encryption machine is established based on the encryption machine communication parameter;
[0041] The track 1 / track 2 data are encrypted based on the track data encryption range to generate the track ciphertext;
[0042] The PIN and the part of the primary account number fields are combined and encrypted based on the PIN Block format to generate the PIN ciphertext.
[0043] The application further comprises a message exchange system for implementing the above method, and the system comprises:
[0044] The transaction data collection module receives transaction dynamic data, separates non-business necessary data and core business data, and provides a data transmission interface to the outside;
[0045] The message format loading module preconfigures a basic packet format adapted to the 8583 protocol data format, and adjusts and configures the 8583 protocol difference of different transaction processing parties;
[0046] The message generation and decryption module generates a transaction message based on the core business data and the basic packet format definition 8583 complete domain information, and is used for sensitive data encryption, key verification and MAC calculation.
[0047] The message data verification and analysis module receives a transaction processing party response message and performs MAC verification, and after verification, the message is parsed into original data based on the basic packet format, and an original data calling interface is provided.
[0048] In a possible implementation, the basic packet format includes 11 configuration dimensions, specifically, use, data field number, maximum length of data field, length type of data field, data format, padding type, padding position, padding content, existence identifier, original data, and formatted packet data.
[0049] In a possible implementation, the length type of the data field is configured as fixed length or variable length, the data format is configured as numeric type, character type or binary type, and the padding type is configured as space padding, zero padding or specific character padding.
[0050] The present application has the following advantages:
[0051] The method effectively solves the existing problems in the industry. The method first fully considers the data field standard difference of different transaction processing parties, and reduces the influence of personnel standard understanding deviation on the technical level by defining a unified field analysis rule and format verification mechanism, maximally avoids code logic loopholes, data analysis errors and other risks caused by cognitive differences, and guarantees the accuracy of transaction data exchange.
[0052] Secondly, the method focuses on stripping the deep association relationship between the message exchange system and the input device and the output device, decouples the hardware control and the data processing function. The original transaction data collected is standardized and converted and uniformly packaged to form a data format easy for developers to understand and call, which greatly reduces the system integration difficulty and helps the system to be quickly deployed and put into actual use.
[0053] In addition, the method does not depend on any external library or third-party package in the implementation process, and all core functions are developed by using native code, which fundamentally avoids the transplantation difficulty problem caused by the difference between system environments and compiler versions, and improves the compatibility and stability of the scheme.
[0054] Other features and aspects of the present application will become apparent from the following detailed description of exemplary embodiments, taken in conjunction with the accompanying drawings. BRIEF DESCRIPTION OF DRAWINGS
[0055] The accompanying drawings incorporated in and forming a part of the specification, illustrate exemplary embodiments, features and aspects of the present application and, together with the description, serve to explain the principles of the present application.
[0056] Figure 1 A flow chart of a message exchange method according to an embodiment of the present application is shown in FIG. 1;
[0057] Figure 2 A flow chart of a message exchange method according to an embodiment of the present application is shown in FIG. 1;
[0058] Figure 3 A flow chart of a message exchange method according to an embodiment of the present application is shown in FIG. 1;
[0059] Figure 4 A flow chart of a message exchange method according to an embodiment of the present application is shown in FIG. 1;
[0060] Figure 5 A flow chart of a message exchange method according to an embodiment of the present application is shown in FIG. 1;
[0061] Figure 6 A flow chart of a message exchange method according to an embodiment of the present application is shown in FIG. 1;
[0062] Figure 7A A flow chart of a message exchange method according to an embodiment of the present application is shown in FIG. 1;
[0063] Figure 7B A flow chart of a message exchange method according to an embodiment of the present application is shown in FIG. 1; DETAILED DESCRIPTION
[0064] Various exemplary embodiments, features and aspects of the present application will be described in detail below with reference to the accompanying drawings. Like reference numerals in the drawings denote elements having the same or similar functions or elements. Although various aspects of the embodiments are illustrated in the drawings, the drawings are not necessarily drawn to scale unless otherwise specified.
[0065] It should be understood that the terms "center", "longitudinal", "transverse", "length", "width", "upper", "lower", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", "clockwise", "counterclockwise", "axial", "radial", "circumferential" and the like indicate the orientation or positional relationship based on the orientation or positional relationship shown in the drawings, and are only for the convenience of describing the present application or simplifying the description, and therefore cannot be understood as indicating or implying that the devices or elements referred to must have a particular orientation, be constructed and operated in a particular orientation, and therefore cannot be understood as limiting the present application.
[0066] In addition, the terms "first", "second" are only for descriptive purposes and cannot be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Therefore, the features defined with "first", "second" can include one or more of the features explicitly or implicitly. In the description of the present application, the meaning of "multiple" is two or more, unless otherwise specifically limited.
[0067] The word "exemplary" here means "serving as an example, an implementation, or an illustration". Any implementation described as "exemplary" here is not necessarily to be construed as superior or better than other implementations.
[0068] In addition, in order to better illustrate the present application, a large number of specific details are given in the specific embodiments below. Those skilled in the art should understand that the present application can also be implemented without certain specific details. In some examples, methods, means, elements and circuits well known to those skilled in the art are not described in detail, in order to highlight the main idea of the present application.
[0069] The application of the present application is a message exchange method and system, which is applied in the field of 8583 format data exchange between bank, card organization terminal or system, and plays the role of unifying 8583 message group unpacking and encryption and decryption standard, reducing the understanding threshold of developers on the protocol, stripping the deep association between system and hardware to improve portability, reducing the risk of repeated code development, and realizing efficient and low-coupling message exchange between client and agency system.
[0070] Method
[0071] Specifically referring to Figure 1 which is a specific embodiment message exchange method of the present application, comprising the step S100 of configuring message composition content based on the format of 8583 protocol, wherein the fields of the message composition content include the basic package format with universality, which is composed of purpose, data field number, maximum length of data field, length type of data field, data format, padding type, padding position, padding content, existence identifier, original data and formatted package data.
[0072] Step S200, based on the transaction data dynamically generated in the transaction process, the encrypted operation is carried out through the configured message composition content, and the data set is generated. In the transaction process, the dynamically generated transaction data is acquired in real time, the message generation and decryption module is called, the encryption operation is performed on the data in combination with the message composition content configured in S100, the data security is ensured, and finally the encrypted data set is generated.
[0073] Step S300, the format of the data set is converted into the required format of the transaction message, and the message format data is generated. Based on the basic package format configured in S100, the encrypted data set generated in S200 is format-converted. The data structure is adjusted according to the length type, data format and other requirements of the data field, the data with insufficient length is processed by padding rules, the data set is converted into the required format of the transaction message conforming to the 8583 protocol, and the message format data is generated.
[0074] And step S400, the message header and MAC are added to the message format data to complete the message, and the completed message is uploaded to the transaction system of the transaction processing party. Based on the message format data generated in S300, the message header containing routing, identification and other information required by the transaction processing party is added, and the MAC (message authentication code) is calculated by the encryption machine and attached to the end of the data to form a complete transaction message. Then, according to the communication specification, the completed message is uploaded to the transaction system of the transaction processing party, and the data transmission is completed.
[0075] The scheme fully avoids the code risk caused by the understanding difference of personnel on the 8583 protocol through standardized configuration and modular processing; the system is decoupled from the hardware, and does not need to rely on third-party packages, realizing the transplantation of multiple systems; the data security is guaranteed by encryption and MAC verification, each step is efficient, the stability and adaptability of message exchange are improved, and the development and maintenance cost is reduced.
[0076] In a possible implementation, with specific reference to Figure 2 The method further includes:
[0077] Step S500, the processing party receives the response message and verifies the message header of the response message according to the 8583 protocol. After the processing party receives the response message returned from the transaction system, the response message header information is verified according to the specification requirements of the message header in the 8583 protocol. The key contents such as routing identification, message type identification and length field in the message header are checked, it is confirmed that the field values conform to the protocol agreement format and value range, and the subsequent parsing error caused by abnormal message header is excluded.
[0078] Step S600, the extracted completion message to be verified MAC and local MAC value comparison. From the received completion message to extract the MAC to be verified, while combining the local storage key and message body data according to the algorithm specified in the 8583 protocol, the local MAC value is recalculated. The extracted MAC to be verified is compared with the local MAC value for consistency, to determine whether the message has been tampered with or damaged in the transmission process.
[0079] Step S700, decoding completion message bitmap to determine the data field list, restore the original data of the completion message. Specifically, the decoding rule corresponding to the 8583 protocol is used to decode the bitmap field in the completion message, and the data field list actually contained in the message is determined according to the identification state of each bit of the bitmap. Then, according to the length, format and other configurations of the data field in the basic packet format, the contents of each data field are parsed in reverse, and the original data corresponding to the completion message is recovered, preparing for subsequent verification.
[0080] Step S800, according to the message composition basic packet format, verify the integrity of the mandatory fields of the parsed data set and the legality of the field values, and encapsulate the data set that passes the verification as a structured result. Specifically, refer to the mandatory attributes marked by the identification field in the message composition basic packet format, verify whether the mandatory fields of the parsed data set are complete, and check whether the field values meet the legal requirements according to the data format, maximum length and other configurations. The data set that passes the verification is encapsulated as a structured result according to the preset structure.
[0081] And step S900, according to the environment variable configuration, encrypt the structured result and send it to the business system of the processing party. Read the environment variable information configured in the early stage to determine the encryption algorithm and key parameters in the current scenario. Use the corresponding encryption algorithm to encrypt the encapsulated structured result to ensure data transmission security. After encryption, the encrypted structured result is sent to the business system of the processing party according to the preset communication link for subsequent business operation.
[0082] In one possible implementation, specifically referring to Figure 3 , based on the format of the 8583 protocol, the configuration of the message composition content includes the following steps:
[0083] Step S110, configure the operating system basic parameters and external device service interaction parameters. To unify the operating system and external device interaction parameters, eliminate device adaptation differences, lay a stable environment foundation for subsequent message processing, and reduce system complexity caused by hardware association.
[0084] Step S120, based on the core field of the message composition content, configure the corresponding conversion rule respectively. Configure the conversion rule for the core field, standardize the data processing standard, avoid personnel understanding deviation of the field format, and reduce the risk of transaction data format error.
[0085] In a specific embodiment, the conversion rules described above are configured respectively for the data field length type, data format, padding type, padding position, padding content, and existence identifier in the base package format. For the data field length type, if the field is defined as fixed length, the conversion rule is configured to directly cut or complete the data according to the preset fixed length; if the field is defined as variable length, the conversion rule is configured to first read the data field header length identifier, and then extract the corresponding data content according to the identifier length. For the padding type, if the field is defined as left padding and the padding content is 0, the conversion rule is configured to fill '0' to the left of the data to the preset maximum length when the data length is less than the preset maximum length; if the field is defined as right padding and the padding content is space, the conversion rule is configured to fill spaces to the right of the data to the preset length when the data length is insufficient. For the existence identifier, when the field is defined as 1 to indicate existence and 0 to indicate nonexistence, the conversion rule is configured to first check the identifier bit, and if it is 1, the corresponding data field content is read and format processing is performed; if it is 0, the data field is skipped.
[0086] In step S130, the 8583 protocol adaptation version and non-standard field mapping rule are based on. The 8583 protocol adaptation version and non-standard field mapping are adapted to break the protocol version limitation, compatible with different processing parties' non-standard requirements, and improve the generality of message exchange.
[0087] In a specific embodiment, the 8583 protocol adaptation version and non-standard field mapping rule based on are configured by a message format loading module, presetting two mainstream 8583 protocol adaptation version configuration items of V1993 and V2003, and establishing a non-standard field mapping table in the module. The mapping table clearly shows the association between the access institution A's self-defined merchant type extension code and the 8583 standard field, as well as the data length, data format, and padding rule of the non-standard field. When the access institution initiates a transaction, the message format loading module automatically matches the protocol adaptation version and non-standard field mapping rule corresponding to the institution after the transaction data module acquires the original data containing the merchant type extension code, and converts the non-standard field data into the 8583 standard field format according to the mapping relationship. Then, the message generation and encryption / decryption module completes the packet encryption, effectively solving the adaptation problem of the institution's non-standard field and the 8583 standard field, and avoiding transaction failure caused by format incompatibility.
[0088] In step S140, the encryption and verification rules of track data, PIN, and MAC are defined based on the main encryption algorithm configuration parameters and priority. The encryption algorithm parameters and verification rules are clearly defined to ensure the security of sensitive information such as track data and PIN, while supporting algorithm switching to meet diverse security needs.
[0089] And step S150, based on the above rules, the parameters and rules are mapped to the field to generate the message composition content. The parameters and rules are mapped to the field to generate the message content, realize the configuration standardization, do not need to repeat the development, improve the message assembly efficiency and system portability.
[0090] In one possible implementation, with specific reference to Figure 4 Based on the transaction data dynamically generated in the transaction process, the encrypted operation is performed through the configured message composition content to generate the data set, including the steps of:
[0091] Step S210, receiving the transaction original data based on the transaction data dynamically generated in the transaction process.
[0092] Step S220, checking the integrity of the mandatory field of the transaction original data and storing it in the specified directory.
[0093] Step S230, based on the configuration of the preset message composition basic package format, performing format conversion and length compliance judgment on the original data.
[0094] Step S240, based on the configuration of the preset message composition basic package format, the original data is split into normal data and sensitive encrypted data according to the preset 8583 protocol.
[0095] Step S250, based on the preset rule, the sensitive encrypted data is encrypted.
[0096] Step S260, combining the normal data and the sensitive data ciphertext into the encrypted data set and marking the encryption state to generate the data set.
[0097] First, check the integrity of the mandatory field of the transaction original data, then do format conversion and length compliance judgment according to the basic package format, split and encrypt the sensitive data, and combine to generate the data set marked with the encryption state. It not only guarantees data compliance and safety, but also reduces the complexity of personnel operation, adapts to the requirements of 8583 protocol, and improves the reliability of encryption processing.
[0098] In one possible implementation, with specific reference to Figure 5 The format of the data set is converted into the required format of the transaction message to generate the message format data, including the steps of:
[0099] Step S310, based on the mapping rule of the 8583 protocol adaptation configuration, the fields in the encrypted data set are associated with the 8583 protocol standard domain / custom domain.
[0100] Step S320, based on the message composition basic package format, performing format conversion, fixed length field padding / super length processing on the mapped field.
[0101] Step S330, based on the bitmap generated by the transaction processor according to the 8583 protocol rule, splicing the 8583 protocol standard domain data and the custom domain data to generate the 8583 protocol data domain splicing body.
[0102] Step S340, adding a message header containing message length, message type and other information to the 8583 protocol data domain splicing body to generate an assembled message.
[0103] And step S350, checking the length, bitmap and variable length domain consistency of the assembled message to generate message format data.
[0104] In a possible implementation, the configuration operation system basic parameters and external device service interaction parameters include:
[0105] Configuring the operating system underlying path and the compilation environment adaptation parameter, the compilation environment adaptation parameter selects the compilation dependency supported by the operating system natively; and configuring the communication protocol of the access agency device, the device identification coding rule, and the communication address, the connection timeout time, and the data transmission protocol of the encryption machine.
[0106] In a possible implementation, specifically referring to Figure 6 , the encryption of the sensitive encryption data based on the preset rule includes:
[0107] Step S251, loading the encryption parameter from the preset configuration, the encryption parameter including the main encryption algorithm, the algorithm parameter, the algorithm priority, and the encryption machine communication parameter.
[0108] Step S252, establishing a communication connection with the encryption machine based on the encryption machine communication parameter.
[0109] Step S253, encrypting the track 1 / track 2 data based on the track data encryption range to generate track ciphertext.
[0110] And step S254, encrypting the PIN and the part field of the primary account number after combination based on the PIN Block format to generate PIN ciphertext.
[0111] The system
[0112] The application further includes a message exchange system for implementing the above method, specifically referring to Figure 7A and Figure 7B , Figure 7A shows a message exchange system structure diagram of the embodiment of the application, Figure 7BA structure diagram of a message exchange system cooperating with an external system is shown. The system standardizes the 8583 group unpacking related functions and encryption and decryption processing, isolates the complex data format processing and business process, and a developer obtains the message assembly and analysis result by calling the standard function interface to complete the business process processing. The message exchange method is applied between the client and the institution system, including a transaction data acquisition module, a message format loading module, a message generation and encryption and decryption module, a message data verification and analysis module, realizing low coupling and high cohesion of code structure, and the interface is friendly to the developer, and the transaction process data transmission operation is simple. Considering the differences of different operating systems, the third-party package is not used in the code implementation, and the transplantation can be completed without modification on the mainstream operating systems of windows and linux. The system includes:
[0113] The transaction data acquisition module 701 receives transaction dynamic data, separates non-business necessary data and core business data, and provides a data transmission interface to the outside. Specifically, the transaction data acquisition module 701 provides the application with the data dynamically acquired in the current transaction process, the acquisition process uploads the raw data collected by each external device module to the module, and the calling end only needs to focus on the transmission of the actual transaction data. Other necessary data for generating the final message is separated out and processed by the message format standard module, reducing the requirement of the business layer on the system message understanding.
[0114] The message format loading module 702 preconfigures the basic package format adapted to the 8583 protocol data format, and adjusts and configures according to the 8583 protocol difference of different transaction processing parties. Specifically, the basic data format processing in the message format loading module 702 has been adapted to the data format that may appear in the 8583 protocol, and can be configured as a message format conforming to the 8583 standard; the basic package format divides the package into purpose, data field number, maximum length of data field, length type of data field, data format, padding type, padding position, padding content, existence identifier, raw data, and formatted package data.
[0115] The message generation and encryption and decryption module 703 generates a transaction message based on the core business data and the basic package format definition 8583 complete domain information, and is used for sensitive data encryption, key verification and MAC calculation. Specifically, the message generation and encryption and decryption module 703 formats the upper layer acquisition data and assembles the message according to the 8583 protocol format, the generation process defines the 8583 complete domain information one by one according to the basic package format defined by the message format loading module, forms the message generation format, and realizes the processing method for the purpose, the length type of the data field, the data format, the padding type, the padding position, the padding content and the existence identifier in the basic package format. The contents involving the cryptographic algorithm, such as track data encryption, PIN, working key verification and MAC calculation, are operated by the encryption machine, and the switching of the national cryptographic algorithm and the 3DES algorithm is supported.
[0116] The message data verification and analysis module 704 receives the transaction processing party response message and performs MAC verification. After verification, the message is parsed into raw data based on the basic package format, etc., and an interface is provided for calling the raw data. Specifically, the message data verification and analysis module 704 completes the verification and analysis of the agency return data. The analysis process is based on the basic package format, message format, and data field format defined in the aforementioned module. The received agency return data is restored to the raw data in the basic package format. An interface is provided for calling the restored raw data, so that the business system using the present scheme can complete the message exchange and obtain the necessary transaction results and transaction records.
[0117] In one possible implementation, the basic package format includes 11 configuration dimensions, specifically, purpose, data field number, maximum length of data field, length type of data field, data format, padding type, padding position, padding content, existence identifier, raw data, and formatted package data. The purpose specifies the business function of the data field in the 8583 message, such as identifying the transaction type and the amount of information. The data field number corresponds to the unique code of the data field specified in the 8583 protocol, ensuring field matching. The maximum length of the data field limits the maximum number of characters or bytes that the field can carry to avoid overflow. The length type of the data field defines the length representation method, such as fixed length or variable length. The data format specifies the data storage form, such as numbers, letters, and binary. The padding type determines the padding content when the length is insufficient, such as spaces. The padding position specifies the padding position, which is divided into left padding and right padding. The padding content specifies the specific characters or values of the padding. The existence identifier marks whether the data field is mandatory, controlling whether the field appears in the message. The raw data stores the initial collected data that has not been formatted. The formatted package data saves the final data that meets the 8583 standard after processing according to the above rules.
[0118] The basic package format fully specifies the 8583 message data field attributes through 11 dimensions, unifies the data processing standard, and significantly reduces the code risk caused by differences in understanding the protocol by developers. At the same time, standardized configuration allows the system to adapt to the field requirements of different transaction processing parties without repeated development. The system also decouples the deep association with hardware, improving system portability and reusability, and reducing the risk caused by repeated development.
[0119] In a possible implementation, the length type of the data field is configured as fixed length or variable length, the data format is configured as numeric type, character type or binary type, and the padding type is configured as space padding, zero padding or specific character padding. By configuring the length type of the data field as fixed length or variable length, the length mismatch of the message caused by different field length requirements of the 8583 protocol is avoided; the data format is set as three types of numeric type, covering the common storage form of transaction data and meeting diversified data processing scenarios; the padding type provides three options of space, which flexibly copes with the specification differences of field padding of different institutions. The overall configuration design reduces the risk of personnel understanding deviation, improves the message compatibility and system adaptation efficiency.
[0120] Embodiments of the application have been described above, the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and changes are obvious to those skilled in the art without departing from the scope and spirit of the described embodiments. The selection of terms used herein is intended to best explain the principles, practical application or improvement of technology in the market of the embodiments, or to enable other ordinary skilled in the art to understand the embodiments disclosed herein.
Claims
1. A message switching method characterized by, The method comprises the steps of: configuring message composition content based on the format of the 8583 protocol, wherein the fields of the message composition content include a universal basic package format composed of purpose, data field number, maximum length of data field, length type of data field, data format, padding type, padding position, padding content, existence identifier, original data, and formatted package data; configuring operating system basic parameters and external device service interaction parameters; configuring corresponding conversion rules based on the core fields of the message composition content, wherein the conversion rules are configured for the data field length type, data format, padding type, padding position, padding content, and existence identifier in the basic package format, for the data field length type, if the field is defined as fixed length, the conversion rule is configured as directly cutting or completing the data according to the preset fixed length, if the field is defined as variable length, the conversion rule is configured as first reading the data field header length identifier, and then extracting the corresponding data content according to the identifier length, for the padding type, if the field is defined as left padding and the padding content is 0, the conversion rule is configured as filling 0 to the maximum length on the left side of the data when the data length is less than the preset maximum length, if the field is defined as right padding and the padding content is space, the conversion rule is configured as filling space to the preset length on the right side of the data when the data length is insufficient, and for the existence identifier, when the field is defined as 1 indicating existence and 0 indicating nonexistence, the conversion rule is configured as first checking the identifier bit, if it is 1, the corresponding data field content is read and format processing is performed, if it is 0, the data field is skipped; configuring two mainstream 8583 protocol adaptation versions V1993 and V2003 through presetting, simultaneously establishing a non-standard domain mapping table, and mapping the association between the merchant type extension code defined by the access institution and the 8583 standard domain, as well as the data length, data format, and padding rule of the non-standard domain; defining the encryption and verification rules of track data, PIN, and MAC based on the main encryption algorithm configuration parameters and priority; mapping the above parameters and rules to the core fields of the message composition content based on the conversion rules and the encryption and verification rules of track data, PIN, and MAC, to generate message composition content; generating a data set through encryption operation based on the transaction data dynamically generated in the transaction process and the configured message composition content; converting the format of the data set into the required format of the transaction message to generate message format data; adding a message header and MAC to the message format data to complete the message, and uploading the completed message to the transaction system of the transaction processing party.
2. The method of claim 1, wherein, The method further comprises: the processing party receives a response message and checks the message header of the response message according to the 8583 protocol; comparing the MAC to be verified of the completed message with the local MAC value; decoding the bitmap of the completed message to determine the data field list and recover the original data of the completed message; checking the completeness of the optional fields and the legality of the field values of the data set according to the basic package format of the message composition, and encapsulating the data set that passes the check as a structured result; According to the environmental variable configuration, the structured result is encrypted and sent to the business system of the processing party.
3. The method of claim 1, wherein, The encryption operation is performed on the transaction data generated dynamically in the transaction process based on the configured message composition content to generate a data set, including the following steps: Receiving transaction raw data generated dynamically in the transaction process; Verifying the completeness of the mandatory fields of the transaction raw data and storing them in a specified directory; Performing format conversion and length compliance judgment on the raw data based on the configuration of the preset message composition basic packet format; Based on the configuration of the preset message composition basic packet format, the raw data is split into normal data and sensitive encrypted data according to the preset 8583 protocol; Encrypting the sensitive encrypted data based on the preset rules; Combining the normal data and the sensitive data ciphertext into an encrypted data set and marking the encryption state to generate a data set.
4. The method of claim 1, wherein, The format of the data set is converted into the required format of the transaction message to generate message format data, including the following steps: Based on the mapping rules of the 8583 protocol adaptation configuration, the fields in the encrypted data set are associated with the 8583 protocol standard domain / custom domain; Based on the message composition basic packet format, format conversion is performed on the mapped fields, and long fields are padded / handled; Based on the bitmap generated by the transaction processing party according to the 8583 protocol rules, the 8583 protocol standard domain data and custom domain data are spliced to generate an 8583 protocol data domain splice; Adding a message header containing message length and message type information to the 8583 protocol data domain splice to generate an assembled message; Verifying the length, bitmap, and variable length domain consistency of the assembled message to generate message format data.
5. The method of claim 1, wherein, The configuration of operating system basic parameters and external device service interaction parameters includes: Configuring the operating system underlying path and compiling environment adaptation parameters, and the compiling environment adaptation parameters select the compiling dependencies supported by the operating system natively; Configuring the communication protocol of the access institution device, the device identification coding rules, and the communication address, connection timeout time, and data transmission protocol of the encryption machine.
6. The method of claim 3, wherein, The encryption of sensitive encrypted data based on the preset rules includes: Loading encryption parameters from the preset configuration, including the main encryption algorithm, algorithm parameters, algorithm priority, and encryption machine communication parameters; Based on the encryption machine communication parameters, a communication connection with the encryption machine is established; Encrypting track 1 / track 2 data based on the track data encryption range to generate track ciphertext; Combining PIN and part of the primary account number fields based on the PIN Block format and then encrypting to generate PIN ciphertext.
7. A message switching system characterised by The system for implementing the method of any one of claims 1-6 includes: The transaction data acquisition module receives transaction dynamic data, separates non-business necessary data and core business data, and provides a data transmission interface to the outside; The message format loading module preconfigures the basic packet format adapted to the 8583 protocol data format, and adjusts the configuration according to the differences in the 8583 protocol of different transaction processing parties; The message generation and encryption / decryption module generates a transaction message based on the core business data and the 8583 complete domain information defined by the basic packet format, and is used for sensitive data encryption, key verification, and MAC calculation; The message data verification and analysis module receives a transaction processing party response message and performs MAC verification, and after verification, based on a basic packet format, the message is parsed into original data, and an original data calling interface is provided.
8. The system of claim 7, wherein, The length type of the data field is configured as fixed length or variable length, the data format is configured as numeric type, character type or binary type, and the padding type is configured as space padding, zero padding or specific character padding.
Citation Information
Patent Citations
Cross-operating-system message exchange method and device and control system
CN115834737A