CN115623085A - Vending machine-oriented data transmission and analysis method and device - Google Patents
Vending machine-oriented data transmission and analysis method and device Download PDFInfo
- Publication number
- CN115623085A CN115623085A CN202211158074.9A CN202211158074A CN115623085A CN 115623085 A CN115623085 A CN 115623085A CN 202211158074 A CN202211158074 A CN 202211158074A CN 115623085 A CN115623085 A CN 115623085A
- Authority
- CN
- China
- Prior art keywords
- data
- communication protocol
- vending machine
- protocol
- server
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L69/00—Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
- H04L69/03—Protocol definition or specification
-
- G—PHYSICS
- G07—CHECKING-DEVICES
- G07F—COIN-FREED OR LIKE APPARATUS
- G07F9/00—Details other than those peculiar to special kinds or types of apparatus
- G07F9/002—Vending machines being part of a centrally controlled network of vending machines
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L69/00—Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
- H04L69/22—Parsing or analysis of headers
Landscapes
- Engineering & Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Control Of Vending Devices And Auxiliary Devices For Vending Devices (AREA)
Abstract
本申请涉及一种面向售货机的数据传输、解析方法和装置。通过制定协议格式,包括固定字段和可变数据体,固定字段包括大类和小类;售货机根据固定字段和可变数据体构建通信协议,并将通信协议发送给服务端;服务端对接收到的通信协议进行校验,并将校验通过的通信协议发送给数据适配器进行解析,得到通信协议中的大类和小类;根据大类和小类选择对应的数据解析器,对所述通信协议进行数据串转换,得到售货机业务数据;其中,售货机业务数据为可变数据体;通过对可变数据体进行扩展以满足不同指令需求,提高了协议的可扩展性。
The present application relates to a vending machine-oriented data transmission and analysis method and device. By formulating the protocol format, including fixed fields and variable data bodies, the fixed fields include major categories and small categories; the vending machine constructs a communication protocol based on the fixed fields and variable data bodies, and sends the communication protocol to the server; The received communication protocol is verified, and the verified communication protocol is sent to the data adapter for analysis, and the major and minor categories in the communication protocol are obtained; the corresponding data parser is selected according to the major and minor categories, and the The communication protocol performs data string conversion to obtain vending machine business data; among them, the vending machine business data is a variable data body; the scalability of the protocol is improved by expanding the variable data body to meet different instruction requirements.
Description
技术领域technical field
本申请涉及售货机技术领域,特别是涉及一种面向售货机的数据传输、解析方法和装置。The present application relates to the technical field of vending machines, in particular to a vending machine-oriented data transmission and analysis method and device.
背景技术Background technique
随着社会发展,自助售货系统在城市当中已经非常普及。在售货机与售货机管理平台之间,需要对与机器相关的各种数据进行双向传输和解析,协议是对数据格式和计算机之间传输交换数据时必须遵守的约定,这样计算机之间才能互通交流,随着不同型号设备的增多以及业务场景的复杂化,需要不断的对协议进行更新升级,来满足业务场景,从而造成对应的协议长度、内容都需要不断的变化,然而,传统的制定协议的方法可读性较差,已经不能满足现在的业务场景。With the development of society, self-service vending systems have become very popular in cities. Between the vending machine and the vending machine management platform, it is necessary to carry out two-way transmission and analysis of various data related to the machine. The protocol is the data format and the agreement that must be followed when transferring and exchanging data between computers, so that computers can communicate with each other. Communication, with the increase of different types of equipment and the complexity of business scenarios, it is necessary to continuously update and upgrade the protocol to meet the business scenarios, resulting in constant changes in the length and content of the corresponding protocol. However, the traditional formulation of the protocol The readability of the method is poor, and it can no longer meet the current business scenario.
发明内容Contents of the invention
基于此,有必要针对上述技术问题,提供一种具备可扩展性的面向售货机的数据传输、解析方法和装置。Based on this, it is necessary to provide a scalable vending machine-oriented data transmission and analysis method and device for the above technical problems.
一种面向售货机的数据传输、解析方法,所述方法包括:A vending machine-oriented data transmission and analysis method, the method comprising:
制定协议格式,包括固定字段和可变数据体,所述固定字段包括大类和小类;Formulate the protocol format, including fixed fields and variable data bodies, the fixed fields include major categories and subcategories;
售货机根据所述固定字段和所述可变数据体构建通信协议,并将所述通信协议发送给服务端;The vending machine constructs a communication protocol according to the fixed field and the variable data body, and sends the communication protocol to the server;
服务端对接收到的通信协议进行校验,并将校验通过的通信协议发送给数据适配器进行解析,得到通信协议中的大类和小类;The server verifies the received communication protocol, and sends the verified communication protocol to the data adapter for analysis to obtain the major and minor classes in the communication protocol;
根据所述大类和所述小类选择对应的数据解析器,对所述通信协议进行数据串转换,得到售货机业务数据;其中,所述售货机业务数据为可变数据体;Select a corresponding data parser according to the major category and the subcategory, and perform data string conversion on the communication protocol to obtain vending machine business data; wherein, the vending machine business data is a variable data body;
通过对所述可变数据体进行扩展以满足不同指令需求。The requirements of different instructions are met by expanding the variable data body.
其中一个实施例中,所述固定字段还包括:帧头,表示协议的起始位置;帧长,为整个协议数据的字节数;流水号,用于区分消息是不是重复发送;校验位,用于校验该协议是否符合要求;帧尾,表示协议帧的结束位置。In one of the embodiments, the fixed field also includes: frame header, which indicates the starting position of the protocol; frame length, which is the number of bytes of the entire protocol data; serial number, which is used to distinguish whether the message is repeatedly sent; check digit , used to check whether the protocol meets the requirements; frame tail, indicating the end position of the protocol frame.
其中一个实施例中,服务端对接收到的通信协议进行校验包括:服务端按顺序对帧头和帧尾、帧长、校验位进行校验。In one embodiment, the server verifying the received communication protocol includes: the server verifying the frame header and frame tail, frame length, and check digit in sequence.
其中一个实施例中,服务端按顺序对帧头和帧尾、帧长、校验位进行校验包括:服务端接收到通信协议,对帧头和帧尾的固定字符进行校验,校验通过后进入最小帧长校验,最小帧长校验通过后进行校验位校验。In one of the embodiments, the server checks the frame header and the frame tail, the frame length, and the check digit in order, including: the server receives the communication protocol, checks the fixed characters of the frame header and the frame tail, and verifies After passing the minimum frame length check, the check digit check is performed after the minimum frame length check is passed.
其中一个实施例中,所述大类为一个大场景的标识,包括但不限于设备数据上报、设备数据下发;所述小类为根据大场景下划分的小类,与所述大类对应,包括但不限于上电设备信息上报、设备温湿度数据上报。In one of the embodiments, the major category is an identification of a major scenario, including but not limited to device data reporting and device data delivery; the minor category is a subcategory divided according to the major scenario, corresponding to the major category , including but not limited to the reporting of powered-on equipment information and the reporting of equipment temperature and humidity data.
其中一个实施例中,通过修改所述大类和所述小类,对应用场景进行扩展。In one of the embodiments, the application scenario is extended by modifying the major class and the minor class.
其中一个实施例中,根据所述修改的大类和小类,在服务端增加对应的数据解析器。In one of the embodiments, according to the modified category and subcategory, a corresponding data parser is added on the server side.
一种面向售货机的数据传输、解析装置,所述装置包括:A vending machine-oriented data transmission and parsing device, said device comprising:
制定协议模块,用于制定协议格式,包括固定字段和可变数据体,所述固定字段包括大类和小类;Formulating a protocol module, used to formulate a protocol format, including fixed fields and variable data bodies, the fixed fields include major categories and subcategories;
传输模块,售货机根据所述固定字段和所述可变数据体构建通信协议,并将所述通信协议发送给服务端;A transmission module, the vending machine constructs a communication protocol according to the fixed field and the variable data body, and sends the communication protocol to the server;
校验模块,用于服务端对接收到的通信协议进行校验,并将校验通过的通信协议发送给数据适配器进行解析,得到通信协议中的大类和小类;The verification module is used for the server to verify the received communication protocol, and send the verified communication protocol to the data adapter for analysis to obtain the major and minor classes in the communication protocol;
解析模块,用于根据所述大类和所述小类选择对应的数据解析器,对所述通信协议进行数据串转换,得到售货机业务数据;其中,所述售货机业务数据为可变数据体;An analysis module is used to select a corresponding data parser according to the major category and the subcategory, perform data string conversion on the communication protocol, and obtain vending machine business data; wherein, the vending machine business data is variable data body;
扩展模块,用于对所述可变数据体进行扩展以满足不同指令需求。The expansion module is used to expand the variable data body to meet different instruction requirements.
上述面向售货机的数据传输、解析方法和装置,通过制定协议格式,包括固定字段和可变数据体,固定字段包括大类和小类;售货机根据固定字段和可变数据体构建通信协议,并将通信协议发送给服务端;服务端对接收到的通信协议进行校验,并将校验通过的通信协议发送给数据适配器进行解析,得到通信协议中的大类和小类;根据大类和所述小类选择对应的数据解析器,对通信协议进行数据串转换,得到售货机业务数据;其中,售货机业务数据为可变数据体;通过对可变数据体进行扩展以满足不同指令需求。本发明通过制定协议格式定义了可变数据体;将通信协议转换成数据串,提高了协议的可读性;数据体解析器根据大类和小类自动分配到不同的数据体解析器来解析指令,针对不同场景方便扩展协议;通过对可变数据体进行扩展以满足不同指令需求,提高了协议的可扩展性。The above vending machine-oriented data transmission and analysis method and device, by formulating a protocol format, include fixed fields and variable data bodies, the fixed fields include major categories and small categories; the vending machine constructs a communication protocol based on the fixed fields and variable data bodies, And send the communication protocol to the server; the server verifies the received communication protocol, and sends the verified communication protocol to the data adapter for analysis, and obtains the major and minor classes in the communication protocol; according to the major class The data parser corresponding to the selection of the subclass performs data string conversion on the communication protocol to obtain the vending machine business data; wherein, the vending machine business data is a variable data body; the variable data body is expanded to meet different instructions need. The present invention defines a variable data body by formulating a protocol format; the communication protocol is converted into a data string, which improves the readability of the protocol; the data body parser is automatically assigned to different data body parsers for parsing according to the large and small classes Instructions, it is convenient to expand the protocol for different scenarios; by expanding the variable data body to meet the needs of different instructions, the scalability of the protocol is improved.
附图说明Description of drawings
图1为面向售货机的数据传输、解析方法流程图;Fig. 1 is a flow chart of a vending machine-oriented data transmission and analysis method;
图2为协议格式示意图;Figure 2 is a schematic diagram of the protocol format;
图3为对通信协议格式进行校验的流程图;Fig. 3 is a flow chart of verifying the communication protocol format;
图4为对通信协议格进行解析的流程示意图;Fig. 4 is a schematic flow chart of parsing the communication protocol lattice;
图5为其中一个实施例中进行传输和解析的示意图;Figure 5 is a schematic diagram of transmission and analysis in one of the embodiments;
图6为面向售货机的数据传输、解析装置模块图。Fig. 6 is a block diagram of a vending machine-oriented data transmission and analysis device.
具体实施方式detailed description
为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。In order to make the purpose, technical solution and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described here are only used to explain the present application, and are not intended to limit the present application.
在一个实施例中,如图1所示,提供了一种面向售货机的数据传输、解析方法,包括以下步骤:In one embodiment, as shown in FIG. 1 , a vending machine-oriented data transmission and analysis method is provided, including the following steps:
步骤202,制定协议格式,包括固定字段和可变数据体,固定字段包括大类和小类。In step 202, a protocol format is formulated, including fixed fields and variable data bodies. The fixed fields include major categories and subcategories.
具体地,如图2所示,为协议格式示意图,包括帧头,大类,小类,帧长,流水号,数据体,校验位,帧尾。其中数据体是可变的,可根据不同业务场景制定不同的数据体。Specifically, as shown in FIG. 2 , it is a schematic diagram of a protocol format, including a frame header, a category, a category, a frame length, a serial number, a data body, a parity bit, and a frame trailer. The data body is variable, and different data bodies can be formulated according to different business scenarios.
帧采用不定长帧格式,传输的数据采用16进制形式传输,不使用ASCII码(美国信息互换标准代码)。The frame adopts an indefinite length frame format, and the transmitted data is transmitted in hexadecimal form, without using ASCII code (American Standard Code for Information Interchange).
帧头为2个字节的特定字符,表示协议帧的起始位置。The frame header is a specific character of 2 bytes, indicating the starting position of the protocol frame.
大类为1个字节,表示一个大场景的标识,如设备数据上报,设备数据下发按顺序使用不同的大类标识。The category is 1 byte, which represents the identifier of a large scenario, such as device data reporting, and device data delivery using different category identifiers in sequence.
小类为1个字节,根据大类场景下进行划分的小类,比如设备数据上报下又分为上电设备信息上报,设备温湿度数据上报等等。与大类对应,1个大类包含1个或多个小类。The sub-category is 1 byte, and it is divided into sub-categories according to the large-scale scenarios. For example, the reporting of device data is divided into reporting of power-on device information, reporting of device temperature and humidity data, and so on. Corresponding to major categories, a major category contains one or more subcategories.
帧长为2个字节,为整个协议数据的字节数。The frame length is 2 bytes, which is the number of bytes of the entire protocol data.
流水号为1个字节,按发送顺序从0-255循环累计,用于区分消息是不是重复发送。The serial number is 1 byte, which is accumulated circularly from 0-255 in the order of sending, and is used to distinguish whether the message is sent repeatedly.
可变数据体为n个字节,根据指令类型不同,可变数据体包含的数据也不同。数据采用字符串方式传输,每个数据采用*号隔开,提高数据的可读性以及降低解析开发难度。The variable data body is n bytes, and the data contained in the variable data body is also different according to the instruction type. The data is transmitted in the form of strings, and each data is separated by *, which improves the readability of the data and reduces the difficulty of analysis and development.
校验位为2个字节,采用特定的校验方法,校验方法的输入为除去帧头帧尾以外的所有字节。用于校验该协议是否符合要求的一个重要检查点。因为校验方法不公开,伪造协议困难,提高协议传输的安全性。The check digit is 2 bytes, and a specific check method is adopted. The input of the check method is all bytes except the frame header and frame tail. An important checkpoint for verifying compliance with the protocol. Because the verification method is not disclosed, it is difficult to forge the protocol, which improves the security of protocol transmission.
帧尾为2个字节的特定字符,表示协议帧的结束位置。The end of the frame is a specific character of 2 bytes, indicating the end position of the protocol frame.
步骤204,售货机根据固定字段和可变数据体构建通信协议,并将通信协议发送给服务端。In step 204, the vending machine constructs a communication protocol according to the fixed field and variable data body, and sends the communication protocol to the server.
具体地,售货机在嵌入式程序中设置服务端接受数据的IP和端口,通过4G模块与服务端程序建立连接,售货机嵌入式程序按照步骤202中的协议格式组成通信协议。Specifically, the vending machine sets the IP and port for the server to accept data in the embedded program, establishes a connection with the server program through the 4G module, and the embedded program of the vending machine forms a communication protocol according to the protocol format in step 202.
步骤206,服务端对接收到的通信协议进行校验,并将校验通过的通信协议发送给数据适配器进行解析,得到通信协议中的大类和小类。Step 206, the server verifies the received communication protocol, and sends the communication protocol that passes the verification to the data adapter for analysis, and obtains the major category and minor category in the communication protocol.
具体地,如图3、4所示,对通信协议进行处理,服务端程序在接收到通信协议后首先会校验协议帧是否符合要求。包括三方面的校验,包括帧头帧尾的固定字符校验、最小帧长校验,检验位校验。首先判断帧头帧尾是否要求,不符合就会再收到的数据上移动1个字节,再进行检验,如果循环10次未符合条件则丢弃该协议数据。如果通过帧头帧尾校验后则进入协议最新长度判断,如果小于最新长度12个字节,则丢弃。通过最小帧长判断后再进入检验位判断,校验方法相当于一个加密算法,输入为除去帧头帧尾的数据,用以提高协议传输的安全性。如果协议中的校验位数据与检验方法输出的值一样则符合要求进入下一步处理流程;否则丢弃该协议数据。Specifically, as shown in Figures 3 and 4, the communication protocol is processed, and the server program first checks whether the protocol frame meets the requirements after receiving the communication protocol. Including three aspects of verification, including fixed character verification of frame header and tail, minimum frame length verification, and check digit verification. First judge whether the frame header and frame tail are required. If it does not meet the requirements, it will move 1 byte on the received data, and then check it. If the condition is not met after 10 cycles, the protocol data will be discarded. If it passes the frame header and frame tail check, it will enter the latest length judgment of the protocol, and if it is less than 12 bytes of the latest length, it will be discarded. After judging the minimum frame length, enter the check bit judgment. The check method is equivalent to an encryption algorithm, and the input is the data except the frame header and frame tail to improve the security of protocol transmission. If the check digit data in the agreement is the same as the value output by the inspection method, it meets the requirements and enters the next processing flow; otherwise, the agreement data is discarded.
对校验通过的通信协议进行解析,得到大类和小类,再根据约定的格式,进入对应的解析程序进行处理。比如售货机通知商品出货协议帧:对应的大类为0x29,小类为0x01,通过大类小类标识找到对应的数据解析器进行解析。Analyze the communication protocol that passed the verification to obtain the major and minor categories, and then enter the corresponding analysis program for processing according to the agreed format. For example, the vending machine notifies the commodity shipment protocol frame: the corresponding major category is 0x29, and the minor category is 0x01, and the corresponding data parser is found for analysis through the identifier of the major category and minor category.
步骤208,根据大类和小类选择对应的数据解析器,对通信协议进行数据串转换,得到售货机业务数据;其中,售货机业务数据为可变数据体。Step 208, select the corresponding data parser according to the category and subcategory, perform data string conversion on the communication protocol, and obtain the business data of the vending machine; wherein, the business data of the vending machine is a variable data body.
具体地,数据解析器获取到数据协议后,进行协议转换,根据约定格式,获取协议的业务数据。比如在售货机上交易完成,通知售货机出货指令的数据体格式为:数据体约定格式为“*机器类型*出货信息*商品编号列表*来源*组合键(附加信息)*”这种格式可读性较高,有利于提高开发效率,服务端程序解析该数据体获取到机器类型,出货信息(包括在哪个货道,出货数量等)等。Specifically, after obtaining the data protocol, the data parser performs protocol conversion, and obtains the business data of the protocol according to the agreed format. For example, when the transaction is completed on the vending machine, the format of the data body that notifies the vending machine of the shipping instruction is: the agreed format of the data body is "*machine type*shipping information*item number list*source*combination key (additional information)*" The format is highly readable, which is conducive to improving development efficiency. The server-side program parses the data body to obtain the machine type, shipment information (including which cargo lane, shipment quantity, etc.), etc.
步骤210,通过对可变数据体进行扩展以满足不同指令需求Step 210, expand the variable data body to meet different instruction requirements
上述面向售货机的数据传输、解析方法中,通过制定协议格式定义了可变数据体;将通信协议转换成数据串,提高了协议的可读性;数据体解析器根据大类和小类自动分配到不同的数据体解析器来解析指令,针对不同场景方便扩展协议;通过对可变数据体进行扩展以满足不同指令需求,提高了协议的可扩展性。In the above vending machine-oriented data transmission and analysis method, the variable data body is defined by formulating the protocol format; the communication protocol is converted into a data string, which improves the readability of the protocol; the data body parser automatically Different data body parsers are assigned to parse instructions, which facilitates the expansion of the protocol for different scenarios; the scalability of the protocol is improved by expanding the variable data body to meet the needs of different instructions.
应该理解的是,虽然图1的流程图中的各个步骤按照箭头的指示依次显示,但是这些步骤并不是必然按照箭头指示的顺序依次执行。除非本文中有明确的说明,这些步骤的执行并没有严格的顺序限制,这些步骤可以以其它的顺序执行。而且,图1中的至少一部分步骤可以包括多个子步骤或者多个阶段,这些子步骤或者阶段并不必然是在同一时刻执行完成,而是可以在不同的时刻执行,这些子步骤或者阶段的执行顺序也不必然是依次进行,而是可以与其它步骤或者其它步骤的子步骤或者阶段的至少一部分轮流或者交替地执行。It should be understood that although the various steps in the flow chart of FIG. 1 are displayed sequentially as indicated by the arrows, these steps are not necessarily executed sequentially in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be executed in other orders. Moreover, at least some of the steps in Fig. 1 may include multiple sub-steps or multiple stages, these sub-steps or stages are not necessarily executed at the same time, but may be executed at different times, the execution of these sub-steps or stages The order is not necessarily performed sequentially, but may be performed alternately or alternately with at least a part of other steps or sub-steps or stages of other steps.
其中一个实施例中,通过修改大类和小类,对应用场景进行扩展。In one of the embodiments, the application scenario is extended by modifying the major class and the minor class.
其中一个实施例中,根据修改的大类和小类,在服务端增加对应的数据解析器。In one of the embodiments, according to the modified major category and minor category, a corresponding data parser is added on the server side.
其中一个实施例中,为了使本公开发明的目的、技术方案和优点更加清楚明白,下面结合具体实施例,并根据附图5,对本发明进一步详细说明。In one of the embodiments, in order to make the purpose, technical solution and advantages of the disclosed invention clearer, the present invention will be further described in detail below in combination with specific embodiments and according to the accompanying drawing 5 .
1、基于协议体框架制定协议格式,以设备校验登录指令为例,约定登录帧的大类:0x12,小类0x21数据体:*设备编号(IMEI)*加密密码*。1. Formulate the protocol format based on the protocol body framework. Taking the device verification login command as an example, the major category of the login frame is agreed: 0x12, and the small category 0x21 data body: *equipment number (IMEI)*encrypted password*.
2、售货机上线通电后通过4G网络TCP通信发送登录指令到服务端。2. After the vending machine is powered on, the login command is sent to the server through the 4G network TCP communication.
2.1售货机发送登录指令到服务端。2.1 The vending machine sends a login command to the server.
2.2服务端收到协议后按流程进行校验,包括帧头帧尾,最小帧长以及校验位校验,全部通过后进入数据适配器。2.2 After receiving the agreement, the server performs verification according to the process, including frame header and frame tail, minimum frame length and check digit verification, and enters the data adapter after all pass.
2.3数据适配器根据大类小类0x12|0x21,选择对应的数据解析器解析解析处理数据体业务数据。解析出IMEI+密码后,比对数据库内容,校验通过后,该条指令发送成功,售货机成功入网上线平台。2.3 The data adapter selects the corresponding data parser to analyze and process the business data of the data body according to the major category and the minor category 0x12|0x21. After parsing the IMEI+ password, compare the contents of the database. After the verification is passed, the command is sent successfully, and the vending machine successfully enters the online platform.
3、基于该登录协议,如果要进行扩展协议体内容,只需要在数据协议体中加入想要的字段比如登录时间,就将数据体改成*设备编号(IMEI)*加密密码*登录时间*,只需要稍微调整数据解析程序即可满足该要求。3. Based on the login protocol, if you want to expand the content of the protocol body, you only need to add the desired fields in the data protocol body, such as login time, and then change the data body to *equipment number (IMEI)*encrypted password*login time* , only minor adjustments to the data parser are required to meet this requirement.
4、基于场景扩展,可修改大类小类,如上电信息上报大类小类可改成0x22,0x01,服务端增加该数据体解析器即可满足要求。4. Based on the expansion of the scene, the categories and subcategories can be modified. For example, the categories and subcategories can be changed to 0x22, 0x01 when the power-on information is reported, and the server can add the data body parser to meet the requirements.
如图6所示,一种面向售货机的数据传输、解析装置,包括:As shown in Figure 6, a vending machine-oriented data transmission and parsing device includes:
制定协议模块,用于制定协议格式,包括固定字段和可变数据体,所述固定字段包括大类和小类;Formulating a protocol module, used to formulate a protocol format, including fixed fields and variable data bodies, the fixed fields include major categories and subcategories;
传输模块,售货机根据所述固定字段和所述可变数据体构建通信协议,并将所述通信协议发送给服务端;A transmission module, the vending machine constructs a communication protocol according to the fixed field and the variable data body, and sends the communication protocol to the server;
校验模块,用于服务端对接收到的通信协议进行校验,并将校验通过的通信协议发送给数据适配器进行解析,得到通信协议中的大类和小类;The verification module is used for the server to verify the received communication protocol, and send the verified communication protocol to the data adapter for analysis to obtain the major and minor classes in the communication protocol;
解析模块,用于根据所述大类和所述小类选择对应的数据解析器,对所述通信协议进行数据串转换,得到售货机业务数据;其中,所述售货机业务数据为可变数据体;An analysis module is used to select a corresponding data parser according to the major category and the subcategory, perform data string conversion on the communication protocol, and obtain vending machine business data; wherein, the vending machine business data is variable data body;
扩展模块,用于对所述可变数据体进行扩展以满足不同指令需求。The expansion module is used to expand the variable data body to meet different instruction requirements.
关于面向售货机的数据传输、解析装置的具体限定可以参见上文中对于面向售货机的数据传输、解析方法的限定,在此不再赘述。上述面向售货机的数据传输、解析装置中的各个模块可全部或部分通过软件、硬件及其组合来实现。上述各模块可以硬件形式内嵌于或独立于计算机设备中的处理器中,也可以以软件形式存储于计算机设备中的存储器中,以便于处理器调用执行以上各个模块对应的操作。For the specific limitations of the vending machine-oriented data transmission and analysis device, please refer to the above-mentioned limitations on the vending machine-oriented data transmission and analysis method, which will not be repeated here. Each module in the above vending machine-oriented data transmission and analysis device can be fully or partially realized by software, hardware and combinations thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, and can also be stored in the memory of the computer device in the form of software, so that the processor can invoke and execute the corresponding operations of the above-mentioned modules.
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,所述的计算机程序可存储于一非易失性计算机可读取存储介质中,该计算机程序在执行时,可包括如上述各方法的实施例的流程。其中,本申请所提供的各实施例中所使用的对存储器、存储、数据库或其它介质的任何引用,均可包括非易失性和/或易失性存储器。非易失性存储器可包括只读存储器(ROM)、可编程ROM(PROM)、电可编程ROM(EPROM)、电可擦除可编程ROM(EEPROM)或闪存。易失性存储器可包括随机存取存储器(RAM)或者外部高速缓冲存储器。作为说明而非局限,RAM以多种形式可得,诸如静态RAM(SRAM)、动态RAM(DRAM)、同步DRAM(SDRAM)、双数据率SDRAM(DDRSDRAM)、增强型SDRAM(ESDRAM)、同步链路(Synchlink)DRAM(SLDRAM)、存储器总线(Rambus)直接RAM(RDRAM)、直接存储器总线动态RAM(DRDRAM)、以及存储器总线动态RAM(RDRAM)等。Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be implemented through computer programs to instruct related hardware, and the computer programs can be stored in a non-volatile computer-readable memory In the medium, when the computer program is executed, it may include the processes of the embodiments of the above-mentioned methods. Wherein, any references to memory, storage, database or other media used in the various embodiments provided in the present application may include non-volatile and/or volatile memory. Nonvolatile memory can include read only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Chain Synchlink DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
以上实施例的各技术特征可以进行任意的组合,为使描述简洁,未对上述实施例中的各个技术特征所有可能的组合都进行描述,然而,只要这些技术特征的组合不存在矛盾,都应当认为是本说明书记载的范围。The technical features of the above embodiments can be combined arbitrarily. To make the description concise, all possible combinations of the technical features in the above embodiments are not described. However, as long as there is no contradiction in the combination of these technical features, they should be It is considered to be within the range described in this specification.
以上所述实施例仅表达了本申请的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对发明专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本申请构思的前提下,还可以做出若干变形和改进,这些都属于本申请的保护范围。因此,本申请专利的保护范围应以所附权利要求为准。The above-mentioned embodiments only express several implementation modes of the present application, and the description thereof is relatively specific and detailed, but it should not be construed as limiting the scope of the patent for the invention. It should be noted that those skilled in the art can make several modifications and improvements without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the scope of protection of the patent application should be based on the appended claims.
Claims (8)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202211158074.9A CN115623085A (en) | 2022-09-22 | 2022-09-22 | Vending machine-oriented data transmission and analysis method and device |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202211158074.9A CN115623085A (en) | 2022-09-22 | 2022-09-22 | Vending machine-oriented data transmission and analysis method and device |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN115623085A true CN115623085A (en) | 2023-01-17 |
Family
ID=84858195
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202211158074.9A Pending CN115623085A (en) | 2022-09-22 | 2022-09-22 | Vending machine-oriented data transmission and analysis method and device |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN115623085A (en) |
Citations (7)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20080025308A1 (en) * | 2006-07-27 | 2008-01-31 | Dewi Gerwyn Morgan | Classifying data packet protocol values |
| CN106656914A (en) * | 2015-10-29 | 2017-05-10 | 阿里巴巴集团控股有限公司 | Anti-attack data transmission method and apparatus |
| CN107147657A (en) * | 2017-05-31 | 2017-09-08 | 飞智控(天津)科技有限公司 | Suitable for the communication protocol of multimachine reliable communication, decoding method and communication apparatus |
| CN108429764A (en) * | 2018-05-28 | 2018-08-21 | 烽火通信科技股份有限公司 | A method of the data transmission based on proprietary protocol and parsing |
| CN110719296A (en) * | 2019-10-25 | 2020-01-21 | 福建网能科技开发有限责任公司 | A method for automatic analysis of message data in terminal communication protocol |
| CN111190851A (en) * | 2019-12-11 | 2020-05-22 | 深圳市优必选科技股份有限公司 | Analysis method, device, device and medium of variable length protocol |
| CN111278062A (en) * | 2019-01-18 | 2020-06-12 | 维沃移动通信有限公司 | Transmission method of Ethernet frame and related equipment |
-
2022
- 2022-09-22 CN CN202211158074.9A patent/CN115623085A/en active Pending
Patent Citations (7)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20080025308A1 (en) * | 2006-07-27 | 2008-01-31 | Dewi Gerwyn Morgan | Classifying data packet protocol values |
| CN106656914A (en) * | 2015-10-29 | 2017-05-10 | 阿里巴巴集团控股有限公司 | Anti-attack data transmission method and apparatus |
| CN107147657A (en) * | 2017-05-31 | 2017-09-08 | 飞智控(天津)科技有限公司 | Suitable for the communication protocol of multimachine reliable communication, decoding method and communication apparatus |
| CN108429764A (en) * | 2018-05-28 | 2018-08-21 | 烽火通信科技股份有限公司 | A method of the data transmission based on proprietary protocol and parsing |
| CN111278062A (en) * | 2019-01-18 | 2020-06-12 | 维沃移动通信有限公司 | Transmission method of Ethernet frame and related equipment |
| CN110719296A (en) * | 2019-10-25 | 2020-01-21 | 福建网能科技开发有限责任公司 | A method for automatic analysis of message data in terminal communication protocol |
| CN111190851A (en) * | 2019-12-11 | 2020-05-22 | 深圳市优必选科技股份有限公司 | Analysis method, device, device and medium of variable length protocol |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN109474578B (en) | Message checking method, device, computer equipment and storage medium | |
| CN111683066B (en) | Heterogeneous system integration method, heterogeneous system integration device, computer equipment and storage medium | |
| CN111819589B (en) | Systems and methods for establishing joint request processing | |
| WO2020140663A1 (en) | Microservice grayscale publishing method, device, computer device and storage medium | |
| CN111694749A (en) | Automatic interface testing method and device, computer equipment and readable storage medium | |
| CN107730385A (en) | Simulation process method, apparatus, storage medium and the computer equipment of sequence information | |
| CN110380932B (en) | Test method and device for safety equipment and test system | |
| CN112286815A (en) | Interface test script generation method and related equipment thereof | |
| WO2024108940A1 (en) | Performance supervision method, apparatus and system, and device and medium | |
| CN114116268A (en) | Method and device for checking Flink SQL statement, computer equipment and storage medium | |
| CN117390696A (en) | Integrity detection system, method, equipment and medium for electronic file | |
| CN114185808A (en) | Automatic testing method and device, electronic equipment and computer readable storage medium | |
| CN116738745B (en) | Communication method, device, equipment and medium of electromagnetic transient simulation system | |
| CN113254767A (en) | Big data searching method and device, computer equipment and storage medium | |
| CN119011329B (en) | IO module firmware upgrading method, device, equipment and readable storage medium | |
| CN119071204A (en) | A method, device, electronic device and medium for analyzing multiple power communication protocols | |
| CN115623085A (en) | Vending machine-oriented data transmission and analysis method and device | |
| CN118245319A (en) | SWC program monitoring method, system, controller and vehicle-mounted operating system | |
| CN113645052B (en) | A firmware debugging method and related equipment | |
| CN113497735A (en) | Open interface management method, electronic device and storage medium | |
| CN114329097B (en) | Method and device, electronic device and storage medium for batch registration of product identification | |
| CN110825538A (en) | MQ-based method for dynamically interacting data by self-defining data types | |
| CN116775769A (en) | Distributed data verification method and device, computer equipment and storage medium | |
| CN113641557B (en) | Data monitoring processing method, device, equipment and storage medium | |
| CN116303176A (en) | Data transmission method, device, equipment and storage medium |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| RJ01 | Rejection of invention patent application after publication |
Application publication date: 20230117 |
|
| RJ01 | Rejection of invention patent application after publication |