Data interaction method, device and storage medium
By introducing an independent middleware platform in the self-service equipment and management system, using pre-generated mapping relationships and test response messages to automatically identify and convert message protocols, the docking problem caused by protocol standards is solved, and the equipment and system is realized Efficient and secure data interaction reduces development costs.
Patent Information
- Application Number
- CN202211499323.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-28
- Publication Date
- 2025-01-14
- Estimated Expiration
- 2042-11-28
AI Technical Summary
In the docking process between self-service equipment and management systems in the prior art, due to differences in protocol standards, the equipment and the system cannot be connected, which increases development costs and poses safety risks.
Using a middleware platform independent of the equipment and management system, the pre-generated mapping relationship and test response messages automatically identify and convert message protocols to realize data interaction between the equipment and the system, avoiding secondary development of the management system.
It realizes that the data interaction between the device and the system does not require secondary development, shortens the docking time, improves accuracy and security, and expands the application scope of the middleware platform.
Smart Images

Figure CN116095187B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data management, and in particular to a data interaction method, device and storage medium. Background Art
[0002] With the continuous development of science and technology, various business operations have been platform-based and intelligent. For example, service places such as libraries, hospitals, and banks have not only introduced management systems for business and data management, but also added relevant self-service equipment in the venues to provide users with more convenient services.
[0003] In actual application, self-service equipment needs to be connected to the management system before it is put into use, so as to realize data interaction between the equipment and the system. However, as market demand continues to expand, there are more and more equipment suppliers and system suppliers, and there are differences in the interaction protocols used by each company. Therefore, in the process of connecting the equipment and the system, there may be situations where the connection cannot be completed due to differences in protocol standards.
[0004] Based on this, relevant technologies have proposed secondary development of the management system to adapt to different device docking requirements, which undoubtedly increases development costs. At the same time, it is more or less invasive to the native programs of the system and the device, posing security risks. Summary of the invention
[0005] In order to help solve the problem of difficulty in deploying self-service devices, the present application provides a data interaction method, device and storage medium.
[0006] In a first aspect, the present application provides a data interaction method, which adopts the following technical solution:
[0007] A data interaction method is applied to a middleware platform, wherein the middleware platform is respectively connected to at least one self-service device and at least one management system for communication, and the method comprises:
[0008] In response to the request message sent by the self-service device, determining a target management system pointed to by the request message from the at least one management system;
[0009] The request message is converted based on a first message protocol, and the converted request message is sent to the target management system, wherein the first message protocol is a message protocol used by the target management system, and a first mapping relationship between the first message protocol and the target management system is pre-generated.
[0010] By adopting the above technical solution, data interaction between the device and the system is realized through a middleware platform independent of the device and the management system. At the same time, in the process of message forwarding, the middleware platform can quickly determine the first message protocol used by the target management system based on the predetermined first mapping relationship, thereby completing the format conversion and forwarding of the request message, so that the forwarded message received by the target management system meets the protocol standard of the system, so there is no need to carry out secondary development of the management system. Furthermore, since the middleware platform can automatically identify the corresponding target management system according to the request message, the middleware platform can also be applied to scenarios where different devices interact with different systems for data, and has a wide range of applications.
[0011] Optionally, the determining the target management system to which the request message points includes:
[0012] Obtaining device identification information of the self-service device;
[0013] The target management system corresponding to the device identification information is determined according to the pre-stored second mapping relationship.
[0014] By adopting the above technical solution, the target management system pointed to by the request message can be quickly determined according to the pre-stored second mapping relationship and the device identification information.
[0015] Optionally, a method for generating a first mapping relationship between the first message protocol and the target management system includes:
[0016] Obtaining a test response message returned by the target management system;
[0017] The first message protocol is determined according to the test response message.
[0018] By adopting the above technical solution, the middleware platform can automatically determine the first message protocol based on the test response message, so that the first mapping relationship can be accurately established during the docking test process without relying on complex manual configuration.
[0019] Optionally, obtaining a test response message returned by the target management system includes:
[0020] Generate docking test data;
[0021] Generate at least one detection message based on at least one preset message protocol and the docking test data;
[0022] The at least one detection message is sent to the target management system to obtain the test response message.
[0023] By adopting the above technical solution, since the test response message is generated based on the detection message, the docking test data can be set according to the actual test requirements, thereby improving the accuracy of the first message protocol determined based on the test response message.
[0024] Optionally, the sending the at least one detection message to the target management system includes:
[0025] The at least one detection message is sent to the target management system in a polling or group manner.
[0026] By adopting the above-mentioned technical scheme, since each management system has a different mechanism for receiving data, some unrecognizable messages will be automatically discarded and not responded to, while some may respond to notification messages. Therefore, when at least one probe message is sent using a polling method, the preset message protocol corresponding to the test response message can be uniquely determined, thereby achieving rapid identification of the first message protocol to a certain extent; when at least one probe message is sent using a group method, the test response message can be obtained more quickly, thereby shortening the time to determine the first message protocol.
[0027] Optionally, determining the first message protocol according to the test response message includes:
[0028] Obtaining message features contained in the test response message;
[0029] The first message protocol is determined from all preset message protocols according to the message characteristics.
[0030] By adopting the above technical solution, it can help solve the problem of low accuracy of analysis results when the protocol characteristics of the test response message are directly parsed based on the preset parsing method; since the first message protocol is determined from the preset message protocol, it can help improve the accuracy of the determined first message protocol.
[0031] Optionally, the obtaining a message feature contained in the test response message includes:
[0032] The test response message is parsed according to the protocol characteristics of each of the preset message protocols to obtain the message characteristics.
[0033] By adopting the above technical solution, the accuracy of the first message protocol determined from all preset message protocols according to the message characteristics can be improved.
[0034] Optionally, the determining the first message protocol from all the preset message protocols according to the message feature includes:
[0035] The service data in the test response message is parsed, and the first message protocol is determined from all the preset message protocols according to the service data and the message characteristics.
[0036] By adopting the above technical solution, the problem that the message features corresponding to different preset message protocols may have high similarity, resulting in the inability to determine the first message protocol or the determined first message protocol is inaccurate, can be solved. In this way, further determination can be made based on the characteristics of the business data to improve the recognition accuracy.
[0037] In a second aspect, the present application provides an electronic device, which adopts the following technical solution:
[0038] An electronic device, comprising:
[0039] at least one processor;
[0040] Memory;
[0041] At least one application, wherein the at least one application is stored in a memory and configured to be executed by at least one processor, and the at least one application is configured to: execute any one of the data interaction methods provided in the first aspect.
[0042] In a third aspect, the present application provides a computer-readable storage medium, which adopts the following technical solution:
[0043] A computer-readable storage medium stores a computer program, which, when executed in a computer, causes the computer to execute any one of the data interaction methods provided in the first aspect.
[0044] In summary, the present application includes at least one of the following beneficial technical effects:
[0045] 1. Data interaction between the device and the system is realized through a middleware platform independent of the device and the management system. At the same time, during the message forwarding process, the middleware platform can quickly determine the first message protocol used by the target management system based on a predetermined first mapping relationship, thereby completing the format conversion and forwarding of the request message, so that the forwarded message received by the target management system meets the system's protocol standard, thereby eliminating the need for secondary development of the management system.
[0046] 2. Since the middleware platform can automatically identify the corresponding target management system based on the request message, the middleware platform can also be applied to scenarios where different devices and different systems interact with each other, and has a wide range of applications.
[0047] 3. Since the middleware platform can automatically determine the first message protocol based on the test response message, the first mapping relationship can be accurately established during the docking test process without relying on complex manual configuration. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] Figure 1 It is a flowchart of a data interaction method provided in an embodiment of the present application;
[0049] Figure 2 It is a structural diagram of a data interaction model provided in an embodiment of the present application;
[0050] Figure 3 It is a structural diagram of another data interaction model provided in an embodiment of the present application;
[0051] Figure 4 It is a flowchart of a first mapping relationship generation method provided in an embodiment of the present application;
[0052] Figure 5 It is a flowchart of an example of a first message protocol determination method provided in an embodiment of the present application;
[0053] Figure 6 It is a flowchart of another data interaction method provided in an embodiment of the present application;
[0054] Figure 7 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0055] In order to make the purpose, technical solutions and advantages of this application more clear, the following Figure 1-7 It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0056] The embodiment of the present application discloses a data interaction method, which is applied to a middleware platform, wherein the middleware platform is respectively connected to at least one self-service device and at least one management system for communication. The data interaction between the self-service devices and the management system is realized through the middleware platform.
[0057] This embodiment uses a library as an application example to specifically illustrate the above method.
[0058] The management system can be a library management system used by the library, a comprehensive management system, or a processing system for specific business, such as a book query system, a book lending system, etc.
[0059] Self-service equipment can be equipment for users to complete related business requests by themselves, or equipment used for information display, such as self-service inquiry terminals, self-service borrowing and returning terminals, inventory robots, intelligent navigation devices, etc.
[0060] The middleware platform is respectively connected to the library management system and the self-service device for realizing data interaction between the library management system and the self-service device. It is worth noting that in the embodiments of the present application, the middleware platform can simultaneously communicate with multiple book management systems in the same library, or each management system of multiple libraries, and can also simultaneously communicate with different self-service devices in the same library, or various self-service devices in different libraries.
[0061] Specific reference Figure 1 , the data interaction method includes the following steps:
[0062] Step 101: In response to a request message sent by a self-service device, determine a target management system to which the request message points from at least one management system.
[0063] Optionally, determining the target management system pointed to by the request message includes: obtaining device identification information of the self-service device; and determining the target management system corresponding to the device identification information according to a pre-stored second mapping relationship.
[0064] The device identification information refers to information that can uniquely identify the self-service device. Optionally, the device identification information includes at least one of the device port number, device IP address, device ID, etc. This embodiment does not limit the type of the device identification information.
[0065] The second mapping relationship refers to: a mapping relationship between a self-service device and a management system. In one example, one target management system corresponds to one or more target self-service devices, and one target self-service device corresponds to one target management system.
[0066] Optionally, the second mapping relationship can be directly set, for example, directly input into the platform, or can be input by the implementation personnel through the client interface provided by the middleware platform according to the equipment and system information collected on site during the docking test process. This embodiment does not limit the method of obtaining the second mapping relationship. Since the target management system pointed to by the request message can be determined based on the device identification information and the pre-stored second mapping relationship, the target management system pointed to by the request message can be quickly determined based on the pre-stored second mapping relationship and the device identification information.
[0067] Optionally, the method for obtaining the device identification information of the self-service device can be direct acquisition, such as: obtaining the self-service device identification corresponding to the port number, or it can be the device identification information obtained by parsing the request message, such as: parsing the device identification information in the request message. This embodiment does not limit the method for obtaining the device identification information of the self-service device.
[0068] In one example, the second mapping relationship between the self-service device and the target management system is variable, and the second mapping relationship between the self-service device and the target management system can be set and adjusted according to actual needs. This can improve the reusability of the self-service device. For example, when the self-service device is returned to the factory for repair, the self-service device returned for repair can be flexibly scheduled by modifying the second mapping relationship between the self-service device and the target management system, which can facilitate the repair and replacement of the self-service device.
[0069] In actual implementation, the target management system pointed to by the request message may also be determined based on other methods, such as parsing the content of the request message to determine the target management system pointed to by the request message. This embodiment does not limit the method of determining the target management system pointed to by the request message.
[0070] Step 102: convert the request message based on the first message protocol, and send the converted request message to the target management system.
[0071] The first message protocol is a message protocol used by the target management system, and a first mapping relationship between the first message protocol and the target management system is generated in advance.
[0072] The first mapping relationship refers to: a corresponding relationship between the first message protocol and the target management system. In an example, one target management system corresponds to one first message protocol.
[0073] Optionally, the first mapping relationship between the first message protocol and the target management system can be directly input by the implementation personnel through the configuration interface provided by the middleware platform. For example, the middleware platform provides an input interface for management system information. After the implementation personnel input the relevant information of the library management system, the middleware platform matches and determines the protocol used by the system according to the relevant information of the library management system, and generates and stores the corresponding first mapping relationship. In other embodiments of the present application, the first mapping relationship can also be automatically generated by the middleware platform. This embodiment does not limit the method for generating the first mapping relationship between the first message protocol and the target management system.
[0074] In this embodiment, the deployment mode of the middleware platform includes local deployment and cloud deployment.
[0075] In one example, reference Figure 2The middleware platform is deployed locally in the library, so that the middleware platform can communicate with the library management system and self-service equipment based on the local area network in the library, manage data locally, and improve data security.
[0076] In another example, refer to Figure 3 The middleware platform is deployed in the cloud. When data security requirements are high, the middleware platform can communicate with the systems and equipment in each library through a dedicated network. The middleware platform can be used to connect the systems and equipment of multiple libraries, and connected to several management systems and several self-service devices. In this way, information interaction between several self-service devices and the corresponding management systems can be achieved through one middleware platform.
[0077] The implementation principle of a data interaction method in an embodiment of the present application is: in response to a request message sent by a self-service device, determine the target management system pointed to by the request message from at least one management system; convert the request message based on a first message protocol, and send the converted request message to the target management system, wherein the first message protocol is the message protocol used by the target management system, and the first mapping relationship between the first message protocol and the target management system is pre-generated; the problems caused by the secondary development of the management system can be solved, because the data interaction between the device and the system is realized through a middleware platform independent of the device and the management system, and at the same time, during the message forwarding process, the middleware platform can quickly determine the first message protocol used by the target management system based on the pre-determined first mapping relationship, thereby completing the format conversion and forwarding of the request message, so that the forwarded message received by the target management system meets the protocol standard of the system, so there is no need for secondary development of the management system.
[0078] Furthermore, since the middleware platform can automatically identify the corresponding target management system based on the request message, the middleware platform can also be applied to scenarios where different devices interact with different systems for data, and has a wide range of applications.
[0079] Based on the above technical solution, in one implementation, the first mapping relationship between the first message protocol and the target management system is automatically generated by the middleware platform during the test docking process. Figure 4 The method for generating the first mapping relationship between the first message protocol and the target management system includes the following steps:
[0080] Step 401: Obtain a test response message returned by the target management system.
[0081] Optionally, a method for obtaining a test response message returned by a target management system includes: generating docking test data; generating at least one probe message based on at least one preset message protocol and the docking test data; and sending at least one probe message to the target management system to obtain a test response message.
[0082] The preset message protocol is a message protocol used by a known management system, for example, the preset message protocol is a pre-collected protocol used by a library management system on the market. By analyzing the differences between different preset message protocols, the protocol features and business data features of each preset message protocol can be obtained, wherein at least one of the protocol features or business data features of each preset message protocol can be uniquely distinguished from other preset message protocols, so that different preset message protocols can be distinguished based on the protocol features and business data features, wherein the difference analysis can be obtained based on a preset algorithm or machine learning.
[0083] It is worth noting that since the library management systems on the market may propose new protocol types, in order to improve the adaptability of the middleware platform, the local preset message protocol information library can be regularly collected and updated. At the same time, when new preset protocols are added or old preset protocols are eliminated, it is necessary to re-analyze the differences between the preset message protocols and adaptively adjust the protocol features and business features corresponding to each preset message protocol to ensure that after the preset message protocol library changes, there is still at least one feature in the protocol features or business data features of each preset message protocol that can be uniquely distinguished from other preset message protocols.
[0084] In one example, the preset message protocol is defined by each management system manufacturer based on the standard interface protocol. In this case, different preset message protocols include both the same features and different protocol features.
[0085] In one example, the standard interface protocol includes the SIP2 (Standard Interchange Protocol V2.00) protocol.
[0086] In one example, the connection test data may include service request data, such as the book name and book code of the requested book.
[0087] Optionally, sending at least one detection message to the target management system includes: sending at least one detection message to the target management system in a polling or group manner.
[0088] Since different methods are provided for sending probe messages to the target management system, when at least one probe message is sent in a polling manner, the preset message protocol corresponding to the test response message can be uniquely determined, thereby facilitating the determination of the first message protocol from the preset message protocols; when at least one probe message is sent in a group manner, the probability of receiving a test response message each time it is sent can be increased, thereby shortening the time for determining the first message protocol. In this way, different sending methods can be selected according to actual needs, thereby broadening the applicable scenarios of the middleware platform.
[0089] In one example, the number of probe messages is multiple, and at least one probe message is sent to the target management system in a polling manner, including: sending a probe message to the target management system; if no test response message is received within a preset time period, repeating the step of sending a probe message to the target management system, that is, sending the next probe message in sequence until a test response message is received or all probe messages are sent; if a test response message is received, executing step 202.
[0090] In actual implementation, the test response message can also be generated by the target management system when establishing a connection with the middleware platform based on the test data input by the user or the test data sent by other devices and returned to the middleware platform. This embodiment does not limit the method of obtaining the test response message.
[0091] Step 402: Determine the first message protocol according to the test response message.
[0092] Optionally, determining the first message protocol according to the test response message includes: obtaining message features contained in the test response message; and determining the first message protocol from all preset message protocols according to the message features.
[0093] Since different preset message protocols correspond to different message features or business features, the first message protocol can be determined from all preset message protocols based on the message features contained in the test response message, which can help solve the problem of low accuracy of the parsing result when the protocol features of the test response message are parsed directly based on the preset parsing method; since the first message protocol is determined from the preset message protocols, it can help improve the accuracy of the determined first message protocol.
[0094] In one example, determining a first message protocol from all preset message protocols according to message features includes: determining whether an expected message protocol matches the message features, and if the expected message protocol matches the message features, determining the first message protocol based on the expected message protocol.
[0095] Optionally, when the expected message protocol does not match the message feature, the first message protocol is determined from other message protocols based on the message feature, so as to increase the speed of determining the first message protocol.
[0096] Among them, the expected message protocol refers to: the preset message protocol of the probe message corresponding to the test response message. Optionally, the number of expected message protocols can be one or more than two, and this embodiment does not limit the number of expected message protocols. In the case of sending a probe message to the target management system in a polling manner, the test response message corresponds to the probe message one-to-one, and accordingly, the expected message protocol is the preset message protocol corresponding to the probe message; in the case of sending a probe message to the target management system in a group manner, the number of probe messages corresponding to the test response message is more than one, and accordingly, the number of expected message protocols is more than one.
[0097] Other message protocols refer to: message protocols other than the expected message protocol among all preset message protocols.
[0098] In actual implementation, when the expected message protocol does not match the message feature, the test response message can also be directly determined as an error message, thereby triggering the step of continuing to send a probe message to the target management system, and the probe message is generated based on other preset message protocols. In this way, the accuracy of the determined first message protocol can be improved.
[0099] Since the first message protocol is first determined based on the matching relationship between the expected message protocol and the message characteristics, when the expected message protocol matches the message characteristics, the first message protocol is determined based on the expected message protocol. This can help reduce the amount of calculation in the process of determining the first message protocol and improve the speed of determining the first message protocol.
[0100] Optionally, obtaining message features contained in the test response message includes: parsing the test response message according to protocol features of each preset message protocol to obtain the message features.
[0101] Since the message feature is obtained by parsing the test response message based on the protocol features of each preset message protocol, the accuracy of the first message protocol determined from all the preset message protocols according to the message feature can be improved.
[0102] Optionally, the test response message is parsed according to the protocol features of each preset message protocol to obtain the message features, including: determining the protocol message features based on the matching relationship between the protocol features of each preset message protocol and the test response message. Specifically, the protocol features that match the test response message among the protocol features of each preset message protocol are determined as the message protocol features.
[0103] Optionally, when the acquired message features are not obtained, it is determined that the first message protocol does not exist in all preset message protocols. In one example, when the first message protocol does not exist in all preset message protocols, the protocol features of the test response message can be directly parsed based on a preset parsing method, or a prompt message can be issued to prompt the operator to process the test response message. This embodiment does not limit the execution content when the first message protocol does not exist in all preset message protocols.
[0104] In one example, parsing the test response message according to protocol features of each preset message protocol to obtain the message features includes: parsing the test response message according to protocol features of the expected message protocol to obtain the expected message features.
[0105] Correspondingly, determining the first message protocol from all preset message protocols according to the message feature includes: determining the first message protocol based on the expected message protocol when the expected message feature is obtained.
[0106] Optionally, if the expected message features are not obtained, the test response message is parsed according to the protocol features of other message protocols to obtain other message features, and the first message protocol is determined from other message protocols based on the other message features. In this way, the speed of determining the first message protocol can be improved.
[0107] In actual implementation, when the expected message protocol does not match the expected message feature, the test response message can be directly determined as an error message, thereby triggering the step of continuing to send a detection message to the target management system. In this way, the accuracy of the determined first message protocol can be improved.
[0108] In one example, the protocol characteristics include encoding rules adopted by a preset message protocol, and the message characteristics include encoding rules. At this time, the test response message is parsed according to the protocol characteristics of each preset message protocol to obtain the message characteristics, including: parsing the test response message according to the encoding rules adopted by each preset message protocol to obtain the target encoding rules.
[0109] Correspondingly, determining the first message protocol from all preset message protocols according to the message characteristics includes: determining the first message protocol from all message protocols based on the target encoding rule.
[0110] The encoding rule may be GBK, utf-8, GB-2312, etc., which is determined based on the encoding rule actually used by the preset message protocol, and the present embodiment does not limit the type of encoding rule. Since message features corresponding to different encoding rules may be different, the test response message is parsed according to the encoding rule used by the preset message protocol, and the target encoding rule corresponding to the test response message can be parsed, so that the first message protocol can be determined from all preset message protocols based on the target encoding rule.
[0111] Optionally, when the target encoding rule is obtained, the first message protocol is determined from all message protocols based on the target encoding rule, including the following cases:
[0112] The first one is, when there is only one reference message protocol corresponding to the target encoding rule, determining a first message protocol from all message protocols based on the target encoding rule, including: determining the reference message protocol as the first message protocol.
[0113] The second type, when there are multiple reference message protocols corresponding to the target coding rules, the protocol characteristics also include format characteristics of the preset message protocol, and the message characteristics also include format characteristics. Based on the target coding rules, the first message protocol is determined from all message protocols, including: parsing the test response message based on the format characteristics of each reference message protocol to obtain the target format characteristics; determining the first message protocol from all reference message protocols based on the target format characteristics.
[0114] The format feature refers to the feature of the file format corresponding to the preset message protocol. Specifically, the file format type may be XML format, json format, etc.
[0115] Since the message features corresponding to different format features may be different, by parsing the test response message based on the format features of each reference message protocol, the target format features corresponding to the test response message can be parsed, and the first message protocol can be determined from each preset message protocol based on the target format features.
[0116] Optionally, determining the first message protocol from various reference message protocols based on the target format feature includes: determining the reference message protocol corresponding to the target format feature as the first message protocol.
[0117] Since the message features corresponding to different preset message protocols may have high similarity, in the process of determining the first message protocol from all preset message protocols based on the message features, more than two preset message protocols may be determined. At this time, it is necessary to further determine the first message protocol from multiple preset message protocols.
[0118] In one example, determining a first message protocol from all preset message protocols based on message characteristics includes: parsing business data in a test response message, and determining the first message protocol from all preset message protocols based on the business data and message characteristics.
[0119] The business data refers to the value corresponding to the business field.
[0120] In one example, the test data includes a book number, and the business data includes a numerical value corresponding to a book name field.
[0121] Since the first message protocol is determined based on business data and message characteristics, the problem that the message characteristics corresponding to different preset message protocols may be highly similar, resulting in the inability to determine the first message protocol or the determined first message protocol is inaccurate, can be solved. Since the business data corresponding to different preset message protocols are also different, further determination can be made based on the characteristics of the business data to improve recognition accuracy.
[0122] Optionally, parsing the business data in the test response message includes: parsing the test response message according to encoding rules adopted by each preset message protocol to obtain decoded data; parsing the business data in each decoded data.
[0123] Correspondingly, the first message protocol is determined from all preset message protocols according to the business data and message characteristics, including: determining the target encoding rule based on the matching relationship between the business data in the decoded data corresponding to each encoding rule and the template business data; determining the pending message protocol from all preset message protocols based on the target encoding rule; determining the first message protocol from all pending message protocols according to the message characteristics.
[0124] The template business data is determined based on the docking test data. For example, the test data includes a book number, and the template business data includes a book name corresponding to the book number.
[0125] Since different decoding methods obtain different decoding results, if the test response data is decoded using a decoding method different from the encoding rule of the test response data, the business data in the decoded data will not match the template business data. Therefore, the encoding rule corresponding to the test response message can be determined based on the matching relationship between the business data in the decoded data and the template business data, thereby determining the pending message protocol from all preset message protocols based on the encoding rule of the test response message, and determining the first message protocol from each pending message protocol based on the message characteristics, thereby improving the accuracy of the determined first message protocol.
[0126] At the same time, since the pending message protocol is determined from all preset message protocols based on business data, and then the first message protocol is determined from the pending message protocols, the amount of calculation in the process of determining the first message protocol based on message characteristics can be reduced, thereby improving the speed of determining the first message protocol.
[0127] In another example, a first message protocol is determined from all preset message protocols based on message characteristics, including: determining a pending message protocol from all preset protocols based on the message characteristics; generating confirmation data based on the pending message protocol; generating a confirmation message based on the confirmation data and the pending message protocol; sending a confirmation message to a target management system; obtaining a confirmation response message returned by the target management system; and determining a first message protocol from each pending message protocol based on the confirmation response message.
[0128] Optionally, generating confirmation data based on the pending message protocol includes: generating confirmation data based on the difference between the protocol features of each pending message protocol. In this way, a confirmation response message containing a distinguishing mark can be obtained, so that the first message protocol can be determined from each pending message protocol based on the confirmation response message.
[0129] In order to facilitate understanding of the above method of determining the first message protocol according to the test response message, an example is given below for explanation. Figure 5 , step 402, the specific process of determining the first message protocol according to the test response message includes the following steps:
[0130] Step 501: parse the test response message according to the encoding rules adopted by each preset message protocol to obtain a reference encoding rule.
[0131] Step 502, determine the number of reference coding rules. If more than two reference coding rules are parsed, execute step 503; if one reference coding rule is parsed, determine the reference coding rule as the target coding rule and execute step 505; if no reference coding rule is parsed, execute step 509.
[0132] Step 503: parse the test response message according to the encoding rules adopted by each reference message protocol to obtain decoded data.
[0133] Step 504: determine the target coding rule based on the matching relationship between the business data in the decoded data corresponding to each reference coding rule and the template business data.
[0134] Step 505, determine the number of reference message protocols corresponding to the target encoding rule in all message protocols; when there is one reference message protocol, execute step 506; when there are more than two reference message protocols, execute step 507.
[0135] Step 506: determine the reference message protocol as the first message protocol.
[0136] Step 507: Parse the test response message according to the format characteristics of each reference message protocol to obtain the target format characteristics.
[0137] Step 508, determining whether the target format feature is parsed out; if the target format feature is parsed out, executing step 509; if the target format feature is not parsed out, executing step 510.
[0138] Step 509: determine the reference message protocol corresponding to the target format feature as the first message protocol.
[0139] Step 510: Determine that the first message protocol does not exist in all preset message protocols.
[0140] In the above implementation, the first message protocol is determined based on the test response message returned by the target management system, so that automatic matching of the library system protocol can be achieved, reducing the demand for implementation personnel during the library system connection process. At the same time, it also helps to solve the problem of errors that are prone to manual operation, and can ensure the accuracy of the determined first mapping relationship.
[0141] In addition, since a probe message is generated based on the docking test data, and at least one probe message is sent to the target management system to obtain a test response message, and the test response message is generated based on the probe message, the docking test data can be set according to actual test requirements, thereby improving the accuracy of the first message protocol determined based on the test response message.
[0142] Based on the above technical solution, in one implementation, reference Figure 6 , after step 102, further comprising:
[0143] Step 601: In response to a request response message returned by a target management system, a target self-service device to which the request response message points is determined from at least one self-service device.
[0144] In one example, determining a target self-service device pointed to by a request response message includes: determining a target request message corresponding to the request response message; and determining the self-service device corresponding to the target request message as the target self-service device.
[0145] The method of determining the self-service device corresponding to the target request message is the same as the method of obtaining the identification information of the self-service device in the above step 101, and will not be described in detail in this embodiment.
[0146] In another example, determining the target self-service device pointed to by the request response message includes: acquiring system identification information of the management system; and determining the target self-service device corresponding to the identification information according to a pre-stored second mapping relationship.
[0147] The method of acquiring the system identification information of the management system is the same as the method of acquiring the identification information of the self-service device in the above step 101, and will not be described in detail in this embodiment.
[0148] Step 602: convert the request response message based on the second message protocol, and return the converted request response message to the target self-service device.
[0149] The second message protocol is a message protocol used by the target self-service device.
[0150] In one example, a middleware platform may be provided by a device supplier to enable data interaction between self-produced devices and various management systems. In this case, the second message protocol is a device protocol customized by the device supplier, that is, all self-service devices use the same protocol to communicate with the middleware platform.
[0151] In another example, the middleware platform can also adapt to the protocol standards of various equipment suppliers. In this way, the second message protocol is determined according to a pre-established third mapping relationship, where the third mapping relationship records the correspondence between the self-service device and the second message protocol it uses.
[0152] The third mapping relationship refers to: the corresponding relationship between the second message protocol and the self-service device. In an example, one self-service device corresponds to one second message protocol, or one device supplier corresponds to one second message protocol.
[0153] Optionally, the third mapping relationship between the second message protocol and the self-service device can be directly input by the implementation personnel through the configuration interface provided by the middleware. For example, the middleware platform provides an input interface for self-service device information. After the implementation personnel input the relevant information of the self-service device, the middleware platform determines the protocol used by the self-service device based on the relevant information of the self-service device, and generates and stores the corresponding third mapping relationship. In other examples of the present application, the third mapping relationship can also be automatically generated by the middleware platform. This embodiment does not limit the method of generating the third mapping relationship between the second message protocol and the self-service device.
[0154] In one example, the third mapping relationship between the second message protocol and the self-service device is automatically generated by the middleware platform during the docking test process. At this time, the method for generating the third mapping relationship between the second message protocol and the self-service device includes: obtaining a test request message sent by the self-service device; and determining the second message protocol based on the test request message.
[0155] The method of determining the second message protocol according to the test request message is the same as the method of determining the first message protocol according to the test response message in the above step 402, and this embodiment will not be repeated here.
[0156] In one example, a test request message is a test request message that a self-service device actively sends to a middleware platform during a connection test between a device and a system. The test request message may be generated based on preset connection test content, or may be generated based on content input by a user. This embodiment does not limit the method for generating the connection message.
[0157] In the above technical solution, since the target self-service device pointed to by the request response message can be automatically determined, and the request response message can be converted based on the second message protocol used by the target self-service device, the converted request response message can be returned to different self-service devices. Therefore, full-automatic docking based on the middleware platform can be achieved, that is, during the test docking process, the middleware platform can not only automatically identify the message protocol used by the management system, but also self-identify the message protocol used by the self-service device, so that the access of the self-service device can be completed without relying on manual configuration. In this way, the protocol restrictions on the device side and the system side are lifted at the same time, and barrier-free docking of multiple device suppliers and multiple management systems can be achieved.
[0158] The present application also provides an electronic device, such as Figure 7 As shown, Figure 7 The electronic device 700 shown includes: a processor 701 and a memory 703. The processor 701 and the memory 703 are connected, such as through a bus 702. Optionally, the electronic device 700 may also include a transceiver 704. It should be noted that in actual applications, the transceiver 704 is not limited to one, and the structure of the electronic device 700 does not constitute a limitation on the embodiments of the present application.
[0159] Processor 701 may be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof. It may implement or execute various exemplary logic blocks, modules and circuits described in conjunction with the disclosure of this application. Processor 701 may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc.
[0160] The bus 702 may include a path to transmit information between the above components. The bus 702 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus. The bus 702 may be divided into an address bus, a data bus, a control bus, etc. Figure 7 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0161] The memory 703 may be a ROM (Read Only Memory) or other types of static storage devices that can store static information and instructions, a RAM (Random Access Memory) or other types of dynamic storage devices that can store information and instructions, or an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read Only Memory) or other optical disk storage, optical disk storage (including compressed optical disk, laser disk, optical disk, digital versatile disk, Blu-ray disk, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto.
[0162] The memory 703 is used to store the application code for executing the solution of the present application, and the execution is controlled by the processor 701. The processor 701 is used to execute the application code stored in the memory 703 to implement the contents shown in the above method embodiment.
[0163] The electronic devices include, but are not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), and fixed terminals such as digital TVs, desktop computers, etc. It can also be a server, etc. Figure 7 The electronic device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0164] An embodiment of the present application also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed in a computer, the computer is caused to execute the data interaction method provided in the above embodiment.
[0165] It should be understood that although the steps in the flowchart of the accompanying drawings are shown in sequence according to the instructions of the arrows, these steps are not necessarily performed in the order indicated by the arrows. Unless otherwise clearly stated in this document, the execution of these steps is not strictly limited in order and can be performed in other orders.
[0166] The above are only some 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 interaction method, characterized in that: Applied to a middleware platform, the middleware platform is respectively connected to at least one self-service device and at least one management system in communication, the method comprising: In response to the request message sent by the self-service device, determining a target management system pointed to by the request message from the at least one management system; Converting the request message based on a first message protocol, and sending the converted request message to the target management system, wherein the first message protocol is a message protocol used by the target management system, and a first mapping relationship between the first message protocol and the target management system is pre-generated; The method for generating the first mapping relationship between the first message protocol and the target management system includes: generating docking test data, the docking test data including service request data; generating at least one detection message based on at least one preset message protocol and the docking test data; sending the at least one detection message to the target management system to obtain a test response message returned by the target management system; determining the first message protocol according to the test response message; The determining the first message protocol according to the test response message includes: Determine the pending message protocol from all the preset message protocols according to the message features contained in the test response message; generate confirmation data based on the differences between the protocol features of each of the pending message protocols; generate a confirmation message based on the confirmation data and the pending message protocol; send a confirmation message to the target management system; and determine the first message protocol from each of the pending message protocols according to the confirmation response message returned by the target management system.
2. The method according to claim 1, characterized in that The step of determining the target management system to which the request message points includes: Obtaining device identification information of the self-service device; The target management system corresponding to the device identification information is determined according to the pre-stored second mapping relationship.
3. The method according to claim 1, characterized in that The sending the at least one detection message to the target management system includes: The at least one detection message is sent to the target management system in a polling or group manner.
4. The method according to claim 1, characterized in that: The method for determining the message features contained in the test response message includes: The test response message is parsed according to the protocol characteristics of each of the preset message protocols to obtain the message characteristics.
5. An electronic device, characterized in that: The electronic device includes: at least one processor; Memory; At least one application, wherein the at least one application is stored in a memory and configured to be executed by at least one processor, and the at least one application is configured to: execute the data interaction method according to any one of claims 1 to 4.
6. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed in a computer, the computer is caused to execute the data interaction method according to any one of claims 1 to 4.
Citation Information
Patent Citations
Protocol adaptation method and device, equipment and storage medium
CN114827297A
Network asset custom protocol identification method and device, terminal and storage medium
CN115242692A