Data configuration method, device, computer equipment and storage medium
By obtaining the environment files and configuration files of the POS terminal, adapting the docking interface and generating data processing strategies, the problem of low data conversion efficiency caused by the complex types of POS machines is solved, the structured processing and format consistency of transaction data are achieved, and the data processing efficiency is improved.
Patent Information
- Application Number
- CN202111525957.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-14
- Publication Date
- 2025-10-03
- Estimated Expiration
- 2041-12-14
AI Technical Summary
In the prior art, there are many different types of POS machines, and their applicable data exchange formats are different, which results in the server side needing to perform a large amount of data conversion during docking, reducing data processing efficiency.
A data configuration method is provided. By obtaining a configuration file, collecting the environment file of the target terminal, determining its operating environment category, and adapting the docking interface in the configuration file according to the environment category, a data processing strategy is generated, and transaction data is collected and converted into structured data.
The format consistency of transaction data output by different terminals in the communication terminal is improved, which indirectly improves the processing efficiency of the communication terminal for multi-dimensional data.
Smart Images

Figure CN114201316B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the field of data processing, and in particular to a data configuration method, apparatus, computer equipment, and storage medium. Background Art
[0002] The card swiping machine is referred to as a POS terminal. The terminal first sends information to the UnionPay platform through telephone dialing. After the UnionPay platform identifies the relevant information, it will send the deduction information to the issuing bank. After confirmation by the issuing bank, the information will be sent back to the UnionPay platform. After confirmation by UnionPay, the processed information will be sent to the front-end terminal. After receiving the confirmed information, the terminal will print the document.
[0003] The inventors of this invention discovered during their research that, in the prior art, different POS manufacturers produce a wide variety of POS machines, each with its own unique data exchange formats. This requires the server to perform extensive data conversion before batch processing, reducing data processing efficiency when connecting to different POS machines. Summary of the Invention
[0004] The embodiments of the present invention provide a data configuration method, device, computer equipment and storage medium capable of unifying data formats for different terminals.
[0005] To solve the above technical problems, a technical solution adopted in an embodiment of the present invention is to provide a data configuration method, comprising:
[0006] Get the preset configuration file;
[0007] Collecting an environment file of the target terminal according to the configuration file, and determining an environment category of the target terminal's operating environment according to the environment file;
[0008] Adapting a docking interface applicable to the target terminal in the configuration file according to the environment category, and generating a data processing strategy according to the docking interface;
[0009] collecting transaction data of the target terminal according to the docking interface, wherein the transaction data is ciphertext data generated by the target terminal performing financial transactions;
[0010] The transaction data is converted into structured data in a preset format according to the data processing strategy, and the structured data is sent to a preset communication terminal.
[0011] Optionally, before obtaining the preset configuration file, the method includes:
[0012] collecting terminal interface data of each access terminal, wherein the terminal interface data includes an interface type and an interface field of each access terminal;
[0013] Collecting statistics on the terminal interface data of each access terminal according to the interface type, and generating a full interface list of each access terminal;
[0014] The configuration file is generated according to the full interface list and the interface fields.
[0015] Optionally, when the type of the target terminal is a preset first terminal, adapting a docking interface applicable to the target terminal in the configuration file according to the environment category includes:
[0016] Calling a preset protobuf-c encoding according to the environment category, encoding the configuration file to generate a serialization source code and a deserialization source code, wherein the serialization source code and the deserialization source code constitute the data processing strategy;
[0017] A docking interface suitable for the first terminal is adapted according to the serialized source code.
[0018] Optionally, when the type of the target terminal is a preset second terminal, adapting a docking interface applicable to the target terminal in the configuration file according to the environment category includes:
[0019] Reading a preset parsing tool, and parsing the configuration file using the parsing tool to generate multiple source code containers;
[0020] Adapting at least one target source code container suitable for the second terminal among the multiple source code containers according to the environment category, wherein the at least one target source code container is the data processing policy carrier container;
[0021] An API interface of the at least one target source code container is read, and the docking interface is generated through the API interface.
[0022] Optionally, collecting transaction data of the target terminal according to the docking interface includes:
[0023] The docking interface monitors the task progress of the task thread according to the preset tracking tool, and reads the task data generated by the task thread when the task of the task thread is completed;
[0024] Performing a hash operation on the transaction data according to a preset hash function to generate verification data of the transaction data, wherein the verification data is constrained within a preset threshold range;
[0025] The task data and the verification data are merged to generate the transaction data.
[0026] Optionally, after merging the task data and the verification data to generate the transaction data, the process further includes:
[0027] Reading the transaction data and extracting verification data from the transaction data;
[0028] Comparing the value represented by the verification data with the threshold range;
[0029] When the value represented by the verification data falls within the threshold range, the outgoing data is confirmed to be safe data; otherwise, the outgoing data is confirmed to be illegal data, and a preset warning message is sent to the target terminal.
[0030] Optionally, converting the transaction data into structured data in a preset format according to the data processing strategy, and sending the structured data to a preset communication terminal includes:
[0031] Reading a data structure file of the data processing strategy, wherein the data structure file includes data fields of required data;
[0032] Reading target data in the transaction data according to the data field;
[0033] The target data is written into a corresponding position of the data structure file according to the data field to generate the structured data, and the structured data is sent to a preset communication terminal.
[0034] To solve the above technical problems, an embodiment of the present invention further provides a data configuration device, comprising:
[0035] The acquisition module is used to obtain the preset configuration file;
[0036] A collection module, configured to collect an environment file of a target terminal according to the configuration file, and determine an environment category of an operating environment of the target terminal according to the environment file;
[0037] an adaptation module, configured to adapt a docking interface applicable to the target terminal in the configuration file according to the environment category, and generate a data processing strategy according to the docking interface;
[0038] a processing module, configured to collect transaction data of the target terminal according to the docking interface, wherein the transaction data is ciphertext data generated by financial transactions performed by the target terminal;
[0039] An execution module is used to convert the transaction data into structured data in a preset format according to the data processing strategy, and send the structured data to a preset communication terminal.
[0040] Optionally, the data configuration device further includes:
[0041] a first collection submodule, configured to collect terminal interface data of each access terminal, wherein the terminal interface data includes an interface type and an interface field of each access terminal;
[0042] A first processing submodule, configured to collect statistics on the terminal interface data of each access terminal according to the interface type, and generate a full interface list of each access terminal;
[0043] The first execution submodule is configured to generate the configuration file according to the full interface list and the interface fields.
[0044] Optionally, when the type of the target terminal is a preset first terminal, the data configuration device further includes:
[0045] A first encoding submodule is configured to call a preset protobuf-c encoding according to the environment category, encode the configuration file to generate a serialization source code and a deserialization source code, wherein the serialization source code and the deserialization source code constitute the data processing strategy;
[0046] A first adapter module is configured to adapt a docking interface suitable for the first terminal according to the serialized source code.
[0047] Optionally, when the type of the target terminal is a preset second terminal, the data configuration device further includes:
[0048] A first reading submodule is configured to read a preset parsing tool and parse the configuration file using the parsing tool to generate multiple source code containers;
[0049] a second processing submodule, configured to adapt at least one target source code container suitable for the second terminal from among the multiple source code containers according to the environment category, wherein the at least one target source code container is the data processing policy carrier container;
[0050] The second execution submodule is configured to read the API interface of the at least one target source code container and generate the docking interface through the API interface.
[0051] Optionally, the data configuration device further includes:
[0052] A first monitoring submodule is used for the docking interface to monitor the task progress of the task thread according to a preset tracking tool, and when the task of the task thread is completed, read the task data generated by the task thread;
[0053] a third processing submodule, configured to perform a hash operation on the transaction data according to a preset hash function to generate verification data of the transaction data, wherein the verification data is constrained within a preset threshold range;
[0054] The third execution submodule is configured to merge the task data and the verification data to generate the transaction data.
[0055] Optionally, the data configuration device further includes:
[0056] a second reading submodule, configured to read the transaction data and extract verification data from the transaction data;
[0057] a fourth processing submodule, configured to compare the value represented by the verification data with the threshold value interval;
[0058] The fourth execution submodule is configured to confirm that the outgoing data is safe data when the value represented by the verification data falls within the threshold range; otherwise, confirm that the outgoing data is illegal data and send a preset warning message to the target terminal.
[0059] Optionally, the data configuration device further includes:
[0060] A third reading submodule is configured to read a data structure file of the data processing strategy, wherein the data structure file includes data fields of required data;
[0061] a fifth processing submodule, configured to read target data from the transaction data according to the data field;
[0062] The fifth execution submodule is configured to write the target data into a corresponding position of the data structure file according to the data field, generate the structured data, and send the structured data to a preset communication terminal.
[0063] To solve the above technical problems, an embodiment of the present invention further provides a computer device, comprising a memory and a processor, wherein the memory stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, the processor executes the steps of the above-mentioned data configuration method.
[0064] To solve the above technical problems, an embodiment of the present invention further provides a computer storage medium, wherein when the computer-readable instructions are executed by one or more processors, the one or more processors execute the steps of the above data configuration method.
[0065] The beneficial effects of the embodiments of the present invention are as follows: after the configuration file is sent to the target terminal, the environment category of the target terminal is obtained through the environment file of the target terminal. Then, the docking interface of the target terminal is adapted in the configuration file according to the environment category, and transaction data of the target terminal is collected according to the docking interface. The collected transaction data is then unified through the data processing strategy, so that the transaction data output by different terminals is unified into structured data. This improves the consistency of the data format sent to the communication terminal by different terminals, and indirectly improves the efficiency of the communication terminal in processing multi-dimensional data. BRIEF DESCRIPTION OF THE DRAWINGS
[0066] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:
[0067] Figure 1 This is a basic flow chart of a data configuration method according to a specific embodiment of the present application;
[0068] Figure 2 A schematic diagram of a process for generating a configuration file according to a specific embodiment of the present application;
[0069] Figure 3 This is a schematic diagram of a first process flow of an adaptation docking interface according to a specific embodiment of the present application;
[0070] Figure 4 This is a schematic diagram of a second process flow of an adaptation docking interface according to a specific embodiment of the present application;
[0071] Figure 5 A schematic diagram of a process for generating transaction data according to a specific embodiment of the present application;
[0072] Figure 6 A schematic diagram of a process for verifying the security of transaction data according to a specific embodiment of the present application;
[0073] Figure 7 A schematic diagram of a process for generating structured data according to an embodiment of the present application;
[0074] Figure 8 This is a schematic diagram of the basic structure of a data configuration device according to an embodiment of the present application;
[0075] Figure 9 This is a basic structural block diagram of a computer device according to an embodiment of the present application. DETAILED DESCRIPTION
[0076] The following describes in detail embodiments of the present application, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present application, and are not to be construed as limiting the present application.
[0077] Those skilled in the art will understand that, unless otherwise stated, the singular forms "a," "an," "said," and "the" used herein may also include plural forms. It should be further understood that the term "comprising" used in the specification of this application refers to the presence of the stated features, integers, steps, operations, elements, and / or components, but does not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof.
[0078] It will be understood by those skilled in the art that, unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by those skilled in the art to which this application belongs. It should also be understood that terms such as those defined in common dictionaries should be understood to have meanings consistent with their meanings in the context of the prior art and will not be interpreted in an idealized or overly formal sense unless specifically defined as herein.
[0079] As will be understood by those skilled in the art, the term "terminal" as used herein includes both devices that are wireless signal receivers, i.e., devices that only have wireless signal receivers without transmission capabilities, and devices that have receiving and transmitting hardware capable of performing two-way communication over a two-way communication link. Such devices may include: cellular or other communication devices with single-line displays, multi-line displays, or cellular or other communication devices without multi-line displays; PCS (Personal Communications Service) devices that may combine voice, data processing, fax, and / or data communication capabilities; PDAs (Personal Digital Assistants) that may include a radio frequency receiver, a pager, Internet / Intranet access, a web browser, a notepad, a calendar, and / or a GPS (Global Positioning System) receiver; and conventional laptop and / or palmtop computers or other devices that have and / or include a radio frequency receiver. As used herein, a "terminal" may be portable, transportable, installed in a vehicle (air, sea, and / or land), or adapted and / or configured to operate locally, and / or in a distributed manner, at any other location on Earth and / or in space. As used herein, a "terminal" may also be a communication terminal, an Internet access terminal, or a music / video playback terminal, such as a PDA, an MID (Mobile Internet Device), and / or a mobile phone with music / video playback capabilities, or a device such as a smart TV or a set-top box.
[0080] See also Figure 1 , Figure 1 Schematic diagram of the basic flow of the data configuration method of this embodiment.
[0081] like Figure 1 As shown, a data configuration method includes:
[0082] S110, obtaining a preset configuration file;
[0083] The execution subject of the data configuration method in this embodiment is a terminal device used by the user, such as a POS machine, a PC, or a mobile terminal, etc. However, the execution terminal of the data configuration method is not limited thereto. In some embodiments, the execution subject can also be a gateway device connected to the terminal.
[0084] The configuration file in this embodiment is a PB interface file (.proto format) that is collected by the server side to aggregate the outgoing data interfaces of all different types of terminals. The PB interface file contains the interface information of all terminal types, including fields, types, sizes, etc., and the proto file is readable and can replace the interface document.
[0085] The terminal for collecting the configuration file is defined as a target terminal, which is any one of the multiple access terminals accessing the server.
[0086] S120: collecting an environment file of the target terminal according to the configuration file, and determining an environment category of the target terminal's operating environment according to the environment file;
[0087] After receiving the configuration file, the target terminal triggers a pre-configured script in the configuration file. This pre-configured script is used to read the target terminal's environment file, where the environment file refers to the target terminal's data outbound system. For example, some target terminals' data outbound systems include (but are not limited to): Android systems, HTTPS+JSON messaging systems, or HTTP / HTTPS communication systems.
[0088] Different target terminals have different environment files, which can be read using pre-built scripts. Each environment file contains the name and model of the data outbound system for the corresponding target terminal. This name and model represent the environment category for each target terminal.
[0089] S130, adapting a docking interface applicable to the target terminal in the configuration file according to the environment category, and generating a data processing strategy according to the docking interface;
[0090] Based on the environment type, the configuration file is configured with a data processing strategy suitable for the target terminal. Because different target terminals use different environment files, they generate different types of message data, such as SON, 8583, and XML. Different message formats generate different task threads, so the message output of different target terminals needs to be collected and converted.
[0091] The data interfaces for outputting data of different environmental categories are recorded in the configuration file. Therefore, by searching the configuration file with the environmental category as the search keyword, the docking interface adapted to the environmental category can be obtained. After obtaining the docking interface, the corresponding data processing strategy is generated according to the docking interface. Different message formats need to be converted into messages of a unified format, so different processing strategies are required for data conversion. Specifically, the data processing strategy corresponding to each docking interface is recorded in the configuration file. After adapting to the docking interface corresponding to the target terminal environment category, the data processing strategy can be adapted according to the processing strategy associated with the storage in the configuration file.
[0092] The data processing strategy records the message format of the corresponding transaction data and converts it into the data types and fields required by the unified data message format.
[0093] S140. Collect transaction data of the target terminal according to the docking interface, wherein the transaction data is ciphertext data generated by the target terminal performing financial transactions;
[0094] After determining the target terminal's docking interface, the target terminal's transaction data can be retrieved through the docking interface, where the transaction data contains the target terminal's message data. For example, if the target terminal's external environment is the Android system, the Android system's unified external interface is the SDK interface. The docking interface can call the SDK interface to obtain the transaction data output by the SDK interface.
[0095] The target terminal referred to in this embodiment is a terminal or gateway for conducting financial transactions. Therefore, when each transaction is carried out, the target terminal needs to send transaction data to the corresponding server. The transaction data records various data generated by the transaction and is encrypted in the form of a message. Therefore, the transaction data is actually a form of encrypted data. The encryption technology can be asymmetric encryption.
[0096] S150: Convert the transaction data into structured data in a preset format according to the data processing strategy, and send the structured data to a preset communication terminal.
[0097] The data processing strategy records the types required for unified structured data and the data fields of each data type in the transaction data. Therefore, the transaction data is extracted according to the data fields in the data processing strategy, and the extracted data fields are written into the positions of the corresponding fields of the structured data in sequence. This completes the data conversion of the message data in the transaction data and converts the non-standard transaction data into structured data with unified standards.
[0098] In some implementations, after receiving transaction data, it is necessary to first decrypt the transaction data according to a decryption policy corresponding to the encryption policy of the transaction data, and then convert the transaction data using the data processing policy.
[0099] In some embodiments, structured data is converted from a topological graph. Specifically, a blank data topology table is pre-configured in a configuration file. Each node in the data topology table contains the node's data category and the data field corresponding to the data category. Target data corresponding to the data category is extracted from the transaction data based on the data field. The target data is then written to the corresponding node location. This process is repeated until all nodes in the data topology table have been written, completing the conversion of the transaction data.
[0100] Since transaction data must be sent to the corresponding server for transaction confirmation, the generated structured data must also be sent to the corresponding server, which is defined as the communication terminal of the target terminal. The target terminal is addressed using the server's IP address, connecting to the communication terminal and sending the structured data to the communication terminal.
[0101] In this implementation, after the configuration file is distributed to the target terminal, the target terminal's environment category is determined from the target terminal's environment file. Based on the environment category, the target terminal's docking interface is adapted in the configuration file. Transaction data from the target terminal is collected using this docking interface. The collected transaction data is then standardized using a data processing strategy, ensuring that the transaction data output by different terminals is uniformly structured. This improves the consistency of the data formats sent to the communication terminal by different terminals, indirectly increasing the communication terminal's efficiency in processing diverse data.
[0102] In some implementations, the server needs to generate a configuration file by collecting the interface types of each access terminal. Figure 2 , Figure 2 A schematic diagram of the process of generating a configuration file in this embodiment.
[0103] like Figure 2 As shown, before S110, it included:
[0104] S101. Collect terminal interface data of each access terminal, wherein the terminal interface data includes an interface type and an interface field of each access terminal;
[0105] All user terminals connected to the communication terminal are defined as access terminals. In order to count the total number of interface types of access terminals, the server sends an interface data call request to each access terminal. After receiving the request, each access terminal uploads its own terminal interface data to the server.
[0106] Each terminal interface data includes the interface type and interface field of the corresponding access terminal, wherein the interface type can be used to count the terminal interface data, and the interface field is used to call the corresponding terminal data interface.
[0107] S102: Collect statistics on the terminal interface data of each access terminal according to the interface type, and generate a full interface list of each access terminal;
[0108] After receiving terminal interface data uploaded by each access terminal, the server compiles statistics based on interface type and writes the resulting data into an interface list. After categorizing all terminal interface data, a complete interface list for all access terminals is generated. The complete interface list contains the interface types of all access terminals currently connected to the server. As more access terminals are added, the complete interface list is regularly updated to ensure comprehensive coverage of terminal interface data.
[0109] S103: Generate the configuration file according to the full interface list and the interface fields.
[0110] According to the interface types obtained from the full interface list, find the interface fields corresponding to each interface type, and encapsulate the above interface fields to form a configuration file.
[0111] In some embodiments, the configuration file also includes: the environment type corresponding to each interface type. Since the interface type needs to be determined by the environment type in the target terminal or gateway device, the environment type of each type of interface and the corresponding interface type need to be associated and stored and packaged into the configuration file together.
[0112] In some implementations, a data processing strategy is set for each interface type to convert transaction data generated by different types of interfaces into unified structured data. Therefore, a data processing strategy is set for each interface type, and the data processing strategy is also stored in the configuration file.
[0113] In some implementations, when the target terminal is a first terminal, the configuration file needs to be compiled using protobuf-c encoding. Figure 3 , Figure 3 This is a schematic diagram of the first process of adapting the docking interface in this embodiment.
[0114] like Figure 3 As shown, S130 includes:
[0115] S131. Calling a preset protobuf-c encoding according to the environment category, encoding the configuration file to generate a serialization source code and a deserialization source code, wherein the serialization source code and the deserialization source code constitute the data processing strategy;
[0116] When it is determined according to the environment category that the target terminal belongs to the first terminal, it indicates that the target terminal is a terminal of a non-intelligent system, for example, a Java or Symbian system.
[0117] For non-intelligent terminals, the configuration file needs to be compiled using protobuf-c encoding. The protobuf-c encoding can be pre-stored in the local storage space of the target terminal or obtained by requesting it from the server.
[0118] The protobuf-c code converts the configuration file into serialized and deserialized source code. The serialized source code converts the transaction data into a byte sequence, while the deserialized source code restores the byte sequence back to transaction data. The deserialized source code processes the structured data sent by the server to the target terminal, specifically converting this structured data into transaction data that the target terminal can execute.
[0119] S132: Adapt a docking interface suitable for the first terminal according to the serialized source code.
[0120] Since the serialized source code is obtained through conversion of the configuration file, and the configuration file stores interface data, it is possible to search the serialized source code through the environment category to obtain the docking interface adapted to the environment category. The docking interface adapted to the environment category is also adapted to the first terminal.
[0121] In some implementations, when the target terminal is a second terminal, the configuration file needs to be modularized. Figure 4 , Figure 4 This is a schematic diagram of the second process of adapting the docking interface in this embodiment.
[0122] like Figure 4 As shown, S120 also includes:
[0123] S133: Read a preset parsing tool, and parse the configuration file using the parsing tool to generate multiple source code containers;
[0124] When it is determined through the environment category that the target terminal belongs to the second terminal, it means that the second terminal is a smart terminal, for example, an Android system or a Windows Embedded system.
[0125] For smart terminals, after obtaining the configuration file, the target terminal needs to parse the configuration file through a parsing tool. The parsing tool can be pre-stored in the local storage space of the target terminal or downloaded after sending a request to the server.
[0126] After parsing the configuration file, the parsing tool obtains multiple source code containers, each of which processes the function of a target terminal. In other words, a source code container is an independent processing unit that can run in the target terminal system, and each source code container processes the transaction data generated by a target terminal functional module. At the same time, each source code container includes an independent API interface.
[0127] S134. Adapt at least one target source code container suitable for the second terminal from among the multiple source code containers according to the environment category, wherein the at least one target source code container is the data processing policy carrier container;
[0128] When the target terminal is a smart terminal, each target terminal has different functional modules. For example, a smart POS terminal can handle different transaction behaviors, such as credit cards, savings cards, international credit cards, or QR code payment. Each transaction behavior supported by the target terminal corresponds to a functional module of the target terminal. Therefore, after obtaining the target terminal's environmental category, the functional modules supported by the target terminal can be obtained based on the terminal model represented by the environmental category. Each source code container records the data processing strategy for transaction data corresponding to its adapted functional module. In other words, the source code container is the carrier container corresponding to the data processing strategy.
[0129] Since each source code container corresponds to a functional module of the target terminal, once the functional module of the target terminal is determined by the environment terminal, the source code container adapted to the target terminal can be obtained. If the target terminal supports only one function, the corresponding source code container is one; if the target terminal supports two functions, the corresponding source code container is two. Thus, if the target terminal supports n functions (n is greater than 2), the corresponding source code container is also n.
[0130] S135: Read the API interface of the at least one target source code container, and generate the docking interface through the API interface.
[0131] After determining at least one target source code container corresponding to the target terminal, each target source code container corresponds to an API interface. The API interfaces of each target source code container are aggregated to generate a unified SDK interface. This standardizes the transaction data output by the API interfaces of each target source code container. The SDK interface serves as the docking interface for the second terminal.
[0132] When the target terminal is a smart terminal, to accommodate the diverse functional modules of different smart terminals, a parsing tool converts the configuration file into multiple source code containers. These source code containers are then adapted according to the functional modules of each terminal. After obtaining the target source code container corresponding to the functional module, a unified SDK interface is generated by integrating the API interfaces of the target source code container as the docking interface. This improves the configuration file's environmental adaptability, covers the diverse functions of different smart terminals, and improves the efficiency of interface configuration.
[0133] In some implementations, in order to increase the security of transaction data, it is necessary to verify the transaction data. Figure 5 , Figure 5 A schematic diagram of the process of generating transaction data for this embodiment.
[0134] like Figure 5 As shown, S140 includes:
[0135] S141: The docking interface monitors the task progress of the task thread according to a preset tracking tool, and reads the task data generated by the task thread after the task of the task thread is completed;
[0136] After the docking interface is determined, a tracking tool (hook) is pre-set in the task thread that executes the transaction function. When the monitored task thread completes its task, the tracking tool reads the task data generated by the task thread during the transaction. If the target terminal is a smart terminal, each target source code container monitors a corresponding functional module. When a functional module executes a transaction task, the corresponding target source code container monitors the functional module's task thread and obtains the corresponding functional module's task data.
[0137] S142. Perform a hash operation on the transaction data according to a preset hash function to generate verification data of the transaction data, wherein the verification data is constrained within a preset threshold range;
[0138] After receiving the task data, the docking interface calls a preset hash function to perform a hash operation on the transaction data to obtain a first hash value. The first hash value is then compared with a preset threshold interval to determine whether the first hash value falls within the threshold interval. If the first hash value falls within the threshold interval, the first hash value is determined to be verification data. If the first hash value does not fall within the threshold interval, a random hash number of the same length as the first hash value is randomly generated, and the first hash value and the random hash number are hashed together using the hash function to obtain a second hash value. The second hash value is then compared with the preset threshold interval to determine whether the second hash value falls within the threshold interval. If the second hash value does fall within the threshold interval, the second hash value is determined to be verification data. If the second hash value does not fall within the threshold interval, a random hash number of the same length as the second hash value is randomly generated, and the second hash value and the random hash number are hashed together using the hash function to generate a third hash value. This process is repeated until the final hash value falls within the threshold interval, at which point the hash value is determined to be verification data.
[0139] S143: Merge the task data and the verification data to generate the transaction data.
[0140] After obtaining the task data and verification data, the task data and verification data are merged, and then the merged data is asymmetrically encrypted to generate transaction data.
[0141] In some implementations, after the docking interface obtains the transaction data, the security module in the target terminal needs to call back the transaction data and verify whether the transaction data has been illegally tampered with at the docking interface. Figure 6 , Figure 6 This is a flow chart of verifying the security of transaction data in this embodiment.
[0142] like Figure 6 As shown, S143 and subsequent sections include:
[0143] S144. Read the transaction data and extract verification data from the transaction data;
[0144] After the security module of the target terminal generates transaction data in the docking interface, it calls the transaction data to the security module in the target terminal that performs independent security management through a callback function, decodes the transaction data through an asymmetric encryption decoding process, obtains task data and verification data, and extracts the verification data from the transaction data.
[0145] S145, comparing the value represented by the verification data with the threshold range;
[0146] In the security module, the value represented by the verification data is compared with the preset threshold interval. There are two comparison structures: first, the value represented by the verification data falls within the threshold interval; second, the value represented by the verification data does not fall within the threshold interval.
[0147] S146. When the value represented by the verification data falls within the threshold range, confirm that the outgoing data is safe data; otherwise, confirm that the outgoing data is illegal data, and send a preset warning message to the target terminal.
[0148] When the value represented by the verification data falls within the threshold range, it indicates that the transaction data has not been tampered with within the docking interface and the transaction data is secure. When the value represented by the verification data does not fall within the threshold range, it indicates that the transaction data was not collected and generated by the docking interface, but was illegally inserted into the docking interface by someone else. In this case, the transaction data is confirmed to be illegal data, and the security module sends a warning message to the target terminal, notifying the user of the target terminal that someone is illegally intruding and modifying the transaction data.
[0149] The security module calls back and verifies the transaction data. Since the verification process is very simple, which is to check whether the verification data is within the threshold range, the security of the transaction data can be improved without complex calculations, preventing the transaction data from being tampered with before external transmission.
[0150] In some implementations, after the docking interface obtains the transaction data, it is necessary to convert the transaction data into structured data in a unified format. Figure 7 , Figure 7 A schematic diagram of the process of generating structured data for this embodiment.
[0151] like Figure 7 As shown, the S150 includes:
[0152] S151, reading a data structure file of the data processing strategy, wherein the data structure file includes data fields of required data;
[0153] The data processing strategy includes a data structured file, which is a blank file containing data fields of the required data. It is necessary to extract the target data (parameter values) of the corresponding data fields in the transaction data in sequence according to the data fields recorded therein.
[0154] S152, reading target data in the transaction data according to the data field;
[0155] The data processing strategy records the required types of unified structural data and the target data of each data type in the transaction data.
[0156] S153: Write the target data into a corresponding position of the data structure file according to the data field to generate the structured data, and send the structured data to a preset communication terminal.
[0157] The transaction data is extracted according to the data fields in the data processing strategy, and the extracted data fields are written into the positions of the corresponding fields of the structured data in sequence. This completes the data conversion of the message data in the transaction data and converts the non-standard transaction data into structured data with unified standards.
[0158] In some implementations, after receiving transaction data, it is necessary to first decrypt the transaction data according to a decryption policy corresponding to the encryption policy of the transaction data, and then convert the transaction data using the data processing policy.
[0159] In some embodiments, structured data is converted from a topological graph. Specifically, a blank data topology table is pre-configured in a configuration file. Each node in the data topology table contains the node's data category and the data field corresponding to the data category. Target data corresponding to the data category is extracted from the transaction data based on the data field. The target data is then written to the corresponding node location. This process is repeated until all nodes in the data topology table have been written, completing the conversion of the transaction data.
[0160] In order to solve the above technical problems, the embodiment of the present invention also provides a data configuration device. Figure 8 , Figure 8 Schematic diagram of the basic structure of the data configuration device in this embodiment.
[0161] like Figure 8 As shown, a data configuration device includes: an acquisition module 110, a collection module 120, an adaptation module 130, a processing module 140, and an execution module 150. The acquisition module 110 is used to obtain a preset configuration file; the collection module 120 is used to collect an environment file of a target terminal based on the configuration file, and determine the environment category of the target terminal's terminal operating environment based on the environment file; the adaptation module 130 is used to adapt a docking interface suitable for the target terminal in the configuration file based on the environment category, and generate a data processing strategy based on the docking interface; the processing module 140 is used to collect transaction data of the target terminal based on the docking interface, wherein the transaction data is ciphertext data generated by the target terminal performing financial transactions; and the execution module 150 is used to convert the transaction data into structured data in a preset format according to the data processing strategy, and send the structured data to a preset communication terminal.
[0162] After the data configuration device sends the configuration file to the target terminal, it obtains the target terminal's environment type from the target terminal's environment file. Based on the environment type, the device then adapts the target terminal's docking interface in the configuration file. Transaction data from the target terminal is collected using this docking interface. The collected transaction data is then standardized using a data processing strategy, ensuring that the transaction data output by different terminals is unified into structured data. This improves the consistency of the data formats sent from different terminals to the communication terminal, indirectly increasing the communication terminal's efficiency in processing diverse data.
[0163] In some embodiments, the data configuration device further includes:
[0164] a first collection submodule, configured to collect terminal interface data of each access terminal, wherein the terminal interface data includes an interface type and an interface field of each access terminal;
[0165] A first processing submodule, configured to collect statistics on the terminal interface data of each access terminal according to the interface type, and generate a full interface list of each access terminal;
[0166] The first execution submodule is configured to generate the configuration file according to the full interface list and the interface fields.
[0167] In some implementations, when the type of the target terminal is a preset first terminal, the data configuration apparatus further includes:
[0168] A first encoding submodule is configured to call a preset protobuf-c encoding according to the environment category, encode the configuration file to generate a serialization source code and a deserialization source code, wherein the serialization source code and the deserialization source code constitute the data processing strategy;
[0169] A first adapter module is configured to adapt a docking interface suitable for the first terminal according to the serialized source code.
[0170] In some implementations, when the type of the target terminal is a preset second terminal, the data configuration device further includes:
[0171] A first reading submodule is configured to read a preset parsing tool and parse the configuration file using the parsing tool to generate multiple source code containers;
[0172] a second processing submodule, configured to adapt at least one target source code container suitable for the second terminal from among the multiple source code containers according to the environment category, wherein the at least one target source code container is the data processing policy carrier container;
[0173] The second execution submodule is configured to read the API interface of the at least one target source code container and generate the docking interface through the API interface.
[0174] In some embodiments, the data configuration device further includes:
[0175] A first monitoring submodule is used for the docking interface to monitor the task progress of the task thread according to a preset tracking tool, and when the task of the task thread is completed, read the task data generated by the task thread;
[0176] a third processing submodule, configured to perform a hash operation on the transaction data according to a preset hash function to generate verification data of the transaction data, wherein the verification data is constrained within a preset threshold range;
[0177] The third execution submodule is configured to merge the task data and the verification data to generate the transaction data.
[0178] In some embodiments, the data configuration device further includes:
[0179] a second reading submodule, configured to read the transaction data and extract verification data from the transaction data;
[0180] a fourth processing submodule, configured to compare the value represented by the verification data with the threshold value interval;
[0181] The fourth execution submodule is configured to confirm that the outgoing data is safe data when the value represented by the verification data falls within the threshold range; otherwise, confirm that the outgoing data is illegal data and send a preset warning message to the target terminal.
[0182] In some embodiments, the data configuration device further includes:
[0183] A third reading submodule is configured to read a data structure file of the data processing strategy, wherein the data structure file includes data fields of required data;
[0184] a fifth processing submodule, configured to read target data from the transaction data according to the data field;
[0185] The fifth execution submodule is configured to write the target data into a corresponding position of the data structure file according to the data field, generate the structured data, and send the structured data to a preset communication terminal.
[0186] To solve the above technical problems, the embodiment of the present invention also provides a computer device. Figure 9 , Figure 9This is a basic structural block diagram of the computer device in this embodiment.
[0187] like Figure 9 As shown, a schematic diagram of the internal structure of a computer device. The computer device includes a processor, a non-volatile storage medium, a memory and a network interface connected via a system bus. Among them, the non-volatile storage medium of the computer device stores an operating system, a database and computer-readable instructions, and the database may store a control information sequence. When the computer-readable instructions are executed by the processor, the processor can implement a data configuration method. The processor of the computer device is used to provide computing and control capabilities to support the operation of the entire computer device. The memory of the computer device may store computer-readable instructions. When the computer-readable instructions are executed by the processor, the processor can execute a data configuration method. The network interface of the computer device is used to connect and communicate with the terminal. Those skilled in the art will understand that Figure 9 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
[0188] In this embodiment, the processor is used to execute Figure 8 The memory stores the program code and various data required to execute the specific functions of the acquisition module 110, acquisition module 120, adaptation module 130, processing module 140, and execution module 150. The network interface is used to transmit data between user terminals or servers. The memory in this embodiment stores the program code and data required to execute all submodules in the data configuration device. The server can call the server's program code and data to execute the functions of all submodules.
[0189] After the computer device sends the configuration file to the target terminal, it uses the target terminal's environment file to determine the target terminal's environment category. Based on the environment category, the computer device then adapts the target terminal's docking interface in the configuration file. Transaction data from the target terminal is collected using this docking interface. The collected transaction data is then standardized using a data processing strategy, ensuring that the transaction data output by different terminals is unified into structured data. This improves the consistency of the data formats sent from different terminals to the communication terminal, indirectly increasing the communication terminal's efficiency in processing diverse data.
[0190] The present invention also provides a computer storage medium, which, when the computer-readable instructions are executed by one or more processors, causes the one or more processors to execute the steps of the data configuration method in any of the above embodiments.
[0191] Those skilled in the art will appreciate that all or part of the processes in the above-described method embodiments can be implemented by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When executed, the program can include the processes in the above-described method embodiments. The aforementioned storage medium can be a non-volatile storage medium such as a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).
[0192] Those skilled in the art will appreciate that the steps, measures, and schemes in the various operations, methods, and processes discussed in this application may be interchanged, modified, combined, or deleted. Furthermore, other steps, measures, and schemes in the various operations, methods, and processes discussed in this application may also be interchanged, modified, rearranged, decomposed, combined, or deleted. Furthermore, steps, measures, and schemes in the prior art that are similar to those disclosed in this application may also be interchanged, modified, rearranged, decomposed, combined, or deleted.
[0193] The above description is only part of the implementation methods of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A data configuration method, characterized in that: include: Get the preset configuration file; collecting an environment file of the target terminal according to the configuration file, and determining an environment category of the operating environment of the target terminal according to the environment file; Adapting a docking interface applicable to the target terminal in the configuration file according to the environment category, and generating a data processing strategy according to the docking interface; Collecting transaction data of the target terminal according to the docking interface, wherein the transaction data is ciphertext data generated by the target terminal performing a financial transaction; collecting the transaction data of the target terminal according to the docking interface includes: the docking interface monitoring the task progress of a task thread according to a preset tracking tool, and when the task of the task thread is completed, reading the task data generated by the task thread; performing a hash operation on the task data according to a preset hash function to generate verification data, wherein the verification data is constrained within a preset threshold range; and merging the task data and the verification data to generate the transaction data; The transaction data is converted into structured data in a preset format according to the data processing strategy, and the structured data is sent to a preset communication terminal.
2. The data configuration method according to claim 1, characterized in that: Before obtaining the preset configuration file, the following steps are included: collecting terminal interface data of each access terminal, wherein the terminal interface data includes an interface type and an interface field of each access terminal; Collecting statistics on the terminal interface data of each access terminal according to the interface type, and generating a full interface list of each access terminal; The configuration file is generated according to the full interface list and the interface fields.
3. The data configuration method according to claim 1, characterized in that: When the type of the target terminal is a preset first terminal, adapting the docking interface applicable to the target terminal in the configuration file according to the environment category includes: Calling a preset protobuf-c encoding according to the environment category, encoding the configuration file to generate a serialization source code and a deserialization source code, wherein the serialization source code and the deserialization source code constitute the data processing strategy; A docking interface suitable for the first terminal is adapted according to the serialized source code.
4. The data configuration method according to claim 1, characterized in that: When the type of the target terminal is a preset second terminal, adapting the docking interface applicable to the target terminal in the configuration file according to the environment category includes: Reading a preset parsing tool, and parsing the configuration file using the parsing tool to generate multiple source code containers; Adapting at least one target source code container suitable for the second terminal among the multiple source code containers according to the environment category, wherein the at least one target source code container is the data processing policy carrier container; An API interface of the at least one target source code container is read, and the docking interface is generated through the API interface.
5. The data configuration method according to claim 1, characterized in that: After merging the task data and the verification data to generate the transaction data, the method includes: Reading the transaction data and extracting verification data from the transaction data; Comparing the value represented by the verification data with the threshold range; When the value represented by the verification data falls within the threshold range, the outgoing data is confirmed to be safe data; otherwise, the outgoing data is confirmed to be illegal data, and a preset warning message is sent to the target terminal.
6. The data configuration method according to claim 1, characterized in that: The converting the transaction data into structured data in a preset format according to the data processing strategy, and sending the structured data to a preset communication terminal includes: Reading a data structure file of the data processing strategy, wherein the data structure file includes data fields of required data; Reading target data in the transaction data according to the data field; The target data is written into a corresponding position of the data structure file according to the data field to generate the structured data, and the structured data is sent to a preset communication terminal.
7. A data configuration device, characterized in that: include: The acquisition module is used to obtain the preset configuration file; a collection module, configured to collect an environment file of a target terminal according to the configuration file, and determine an environment category of an operating environment of the target terminal according to the environment file; an adaptation module, configured to adapt a docking interface applicable to the target terminal in the configuration file according to the environment category, and generate a data processing strategy according to the docking interface; A processing module is configured to collect transaction data of the target terminal according to the docking interface, wherein the transaction data is ciphertext data generated by the target terminal performing financial transactions; the collecting of transaction data of the target terminal according to the docking interface comprises: the docking interface monitoring the task progress of a task thread according to a preset tracking tool, and when the task of the task thread is completed, reading the task data generated by the task thread; performing a hash operation on the task data according to a preset hash function to generate verification data, wherein the verification data is constrained within a preset threshold range; and merging the task data and the verification data to generate the transaction data; An execution module is used to convert the transaction data into structured data in a preset format according to the data processing strategy, and send the structured data to a preset communication terminal.
8. A computer device, characterized in that: The method comprises a memory and a processor, wherein the memory stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, the processor executes the steps of the data configuration method according to any one of claims 1 to 6.
9. A computer storage medium, characterized in that When the computer-readable instructions are executed by one or more processors, the one or more processors are caused to perform the steps of the data configuration method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Parameter consultation method and equipment for accessing POS terminal access interface of server
CN101847300A
Multi-source data processing method, system and related device
CN112270600A