A retail system protocol conversion method, system, device and storage medium
Patent Information
- Application Number
- CN202311309026.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-10
- Publication Date
- 2026-10-09
- Estimated Expiration
- 2043-10-10
AI Technical Summary
不同的通讯协议造成了数据集成和交换的复杂性,限制了不同系统之间的互操作性和数据流畅性,给云平台管理带来了极大的挑战
1.本申请根据零售终端设备发送的指令数据建立与零售终端设备对应的数据模型,即建立与零售终端设备的通信连接。然后,再根据业务信息及数据模型中的运行状态得到用于控制零售终端设备执行任务的任务指令。由此可知,本申请的方法用于支持云平台与多个零售终端设备进行通信连接,以达到降低云平台管控零售终端设备的难度的目的;
Smart Images

Figure CN117315842B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of intelligent unmanned vending machine control system technology, and in particular to a retail system protocol conversion method, system, device and storage medium. Background Technology
[0002] As the smart retail terminal market matures, there are more and more smart retail terminal devices on the market, such as coffee machines, fruit and vegetable cabinets, and other types of retail terminal devices.
[0003] However, because various types of retail terminal devices come from different manufacturers, the protocols used by these manufacturers for remote control also vary. For example, some manufacturers use TCP, while others use HTTP or MQTT. These different communication protocols complicate data integration and exchange, limit interoperability and data flow between different systems, and pose significant challenges to cloud platform management. Summary of the Invention
[0004] This application provides a retail system protocol conversion method, system, device, and storage medium, which reduces the difficulty of cloud platform management of retail terminal devices.
[0005] The purpose of this application is to provide a method for converting retail system protocols.
[0006] The aforementioned objective of this application is achieved through the following technical solution: A retail system protocol conversion method, comprising: A data model is established based on the instruction data sent by the retail terminal equipment. The data model includes the equipment protocol and operating status of the retail terminal equipment. Receive business information, which is used to drive the retail terminal device to perform tasks; Based on the business information and the operating status, a task instruction supporting the device protocol transmission is generated.
[0007] By adopting the above technical solution, firstly, a data model corresponding to the retail terminal device is established based on the instruction data sent by the retail terminal device, that is, a communication connection is established with the retail terminal device. Then, task instructions for controlling the retail terminal device to execute tasks are obtained based on business information and the operating status in the data model. Therefore, the method of this application is used to support communication connections between a cloud platform and multiple retail terminal devices, thereby reducing the difficulty of cloud platform management of retail terminal devices.
[0008] In a preferred embodiment, this application can be further configured as follows: the step of generating task instructions supporting the device protocol transmission based on the service information and the operating status includes: The operational elements are determined based on the business information, and the operational elements are at least one of the multiple functional components included in the retail terminal equipment. The current attitude of the operational element is determined based on the operating status; The next posture is determined based on the current posture and the service information; The next posture is encapsulated as a task instruction that supports the transmission of the device protocol.
[0009] By adopting the above technical solution, the operational elements are first determined, then the current posture of the operational elements is obtained according to the operating status, and finally the next posture is determined according to the current posture and business information. The next posture is then encapsulated into a task instruction that supports device protocol transmission, so that the task instruction can be successfully transmitted to the retail terminal device, thereby providing technical support for the cloud platform to manage the retail terminal device.
[0010] In a preferred embodiment, this application can be further configured such that: encapsulating the next posture into a task instruction supporting the device protocol transmission includes: The encoder converts the next pose into a next pose that supports the device protocol transmission; The next pose that supports the device protocol transmission is encapsulated to obtain the task instruction.
[0011] By adopting the above technical solution, the next posture is first decoded into the next posture that supports the transmission of the device protocol, and then the next posture is encapsulated to obtain the task instruction, so that the task instruction can be successfully transmitted to the retail terminal device.
[0012] In a preferred embodiment, this application can be further configured to: establish a data model based on instruction data sent by the retail terminal device, including: Receive instruction data sent by retail terminal equipment; The identity information of the retail terminal device is determined based on the instruction data; The device protocol of the retail terminal device is obtained based on the identity information; According to the device protocol, the device type corresponding to the device protocol is obtained. Different types of retail terminal devices correspond to different uplink and downlink commands. The data model is established based on the device protocol, the uplink command, and the downlink command.
[0013] By adopting the above technical solution, firstly, after receiving the instruction data sent by the retail terminal device, the identity of the retail terminal device is authenticated. After the identity authentication is successful, the device protocol and the device type corresponding to the device protocol are obtained. Then, a data model is established based on the uplink and downlink instructions corresponding to the device protocol and device type, so that the cloud platform of this application can manage the retail terminal device according to the data model.
[0014] In a preferred embodiment, this application can be further configured such that: determining the identity information of the retail terminal device based on the instruction data includes: Extract the IP address from the command data; Determine if the same IP address exists in the blacklist; If so, then identity verification failed; If not, then determine the identity information of the retail terminal device.
[0015] By adopting the above technical solution, this application pre-sets a blacklist. Therefore, when receiving instruction data sent by a retail terminal device, it first determines whether the IP address of the retail terminal device is in the blacklist. If so, the authentication of the retail terminal device fails; otherwise, the authentication of the retail terminal device passes. This facilitates communication between the cloud platform of this application and the authenticated retail terminal device, thereby ensuring the network security of the cloud platform.
[0016] In a preferred embodiment, this application can be further configured such that the instruction data is formatted as a protocol header, data length, instruction type, instruction content, and verification bit. The protocol header contains the protocol used when transmitting the instruction data, the data length is the size of the numerical value in the instruction data, the instruction type is the type to which the instruction data belongs, the instruction content is the information contained in the instruction data, and the verification bit is used to verify the authenticity of the instruction data.
[0017] By adopting the above technical solution, the instruction data contains rich information, which can be used to confirm the identity information of the retail terminal device based on the instruction data sent by the retail terminal device, thereby facilitating the cloud platform of this application to decide whether to establish a communication connection with the retail terminal device.
[0018] The second objective of this application is to provide a retail system protocol conversion system.
[0019] The second objective of this application is achieved through the following technical solution: A retail system protocol conversion system includes a communication interface module, a protocol adaptation module, and a core processing module for executing any of the above-mentioned retail system protocol conversion methods. The communication interface module is communicatively connected to the retail terminal equipment, and the communication interface module is used to receive instruction data sent by the retail terminal equipment; The protocol adaptation module stores a protocol database; The core processing module is connected to the communication interface module and the protocol adaptation module respectively. The core processing module is used to establish a data model corresponding to the retail terminal device based on the instruction data, and is also used to obtain task instructions based on business information and the data model.
[0020] By adopting the above technical solution, the core processing module, as the scheduling center, can retrieve the required data from the communication interface module and the protocol adaptation module respectively, so as to achieve the purpose of remotely controlling retail terminal equipment.
[0021] In a preferred embodiment, this application can be further configured such that the core processing module includes: A data processing unit is used to establish a data model based on instruction data sent by the retail terminal equipment. The data model includes the equipment protocol and operating status of the retail terminal equipment. A data receiving unit is used to receive business information, which is used to drive the retail terminal device to perform tasks. The data generation unit is used to generate task instructions that support the device protocol transmission based on the business information and the operating status.
[0022] The third objective of this application is to provide a retail system protocol conversion device.
[0023] The aforementioned objective three of this application is achieved through the following technical solution: A retail system protocol conversion device includes a memory and a processor. The memory stores a computer program, and the processor executes the program to implement any of the above-described retail system protocol conversion methods.
[0024] The fourth objective of this application is to provide a computer-readable storage medium capable of storing a corresponding program.
[0025] The fourth objective of this application is achieved through the following technical solution: A computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements any of the above-described retail system protocol conversion methods.
[0026] In summary, this application includes at least one of the following beneficial technical effects: 1. This application establishes a data model corresponding to the retail terminal device based on the instruction data sent by the retail terminal device, that is, establishes a communication connection with the retail terminal device. Then, based on the business information and the operating status in the data model, it obtains task instructions for controlling the retail terminal device to perform tasks. Therefore, the method of this application is used to support communication connections between a cloud platform and multiple retail terminal devices, thereby reducing the difficulty of cloud platform management of retail terminal devices. 2. In addition, before sending task instructions, the operation elements are first determined, and then the current attitude of the operation elements is obtained according to the running status. Finally, the next attitude is determined according to the current attitude and business information, and then the next attitude is encapsulated into a task instruction that supports device protocol transmission, so that the task instruction can be successfully transmitted to the retail terminal device, thereby providing technical support for the cloud platform to manage retail terminal devices. Attached Figure Description
[0027] Figure 1 This is a schematic diagram of an exemplary operating environment of an embodiment of this application.
[0028] Figure 2 This is a flowchart of a retail system protocol conversion method according to an embodiment of this application.
[0029] Figure 3 This is a block diagram of a retail system protocol conversion system according to an embodiment of this application.
[0030] Explanation of reference numerals in the attached diagram: 1. Cloud platform; 11. Communication interface module; 12. Core processing module; 121. Data processing unit; 122. Data receiving unit; 123. Data generation unit; 13. Protocol adaptation module; 14. Service application module; 2. Retail terminal equipment. Detailed Implementation
[0031] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0032] Figure 1 A schematic diagram of an exemplary operating environment in which embodiments of this application can be implemented is shown. This operating environment includes a cloud platform 1 and various types of retail terminal devices 2 communicatively connected to the cloud platform 1. The retail terminal devices 2 include machines such as beverage vending machines, food vending machines, multi-purpose vending machines, and cosmetic vending machines that automatically dispense goods based on consumer payment.
[0033] With the rise of the retail industry, various types of retail terminal devices 2 have been introduced into the market. To manage these retail terminal devices 2, this application establishes a cloud platform 1. The cloud platform 1 consists of one or more servers and contains a protocol database comprising various protocol types. The protocol types used in this application include M205, M406, HaiRong protocol, Megvii, Zhigoumao Cloud protocol, SimpleGoCloud protocol, and protocols built by Jingpin itself. Through the protocol database, the cloud platform 1 can interact with retail terminal devices 2 that support different protocol types, enabling remote control of the retail terminal devices 2.
[0034] In a specific example, cloud platform 1 includes a communication interface module 11, a core processing module 12, a protocol adaptation module 13, and a service application module 14. The communication interface module 11 is an application programming interface (API) supporting multiple communication protocols. The API not only adapts to various types of retail terminal devices 2 but also provides standard interfaces for upstream terminal devices, such as smartphones, tablets, and computers. Upstream terminal devices allow consumers to send commands to cloud platform 1 to open the cabinet doors of retail terminal devices 2. Simultaneously, upstream terminal devices also allow different suppliers to send commands to cloud platform 1 to report the remaining stock of goods in retail terminal devices 2, facilitating timely replenishment of goods by suppliers.
[0035] The protocol adaptation module 13 stores a protocol database. As described above, the protocol types in the database include M205, M406, HaiRong protocol, Megvii, ZhiGouMao Cloud protocol, SimpleGoCloud protocol, and Jingpin's self-built protocol, etc. The service application module 14 has the function of deploying application services in the cloud platform 1. That is, the service application module 14 stores various container images and can switch the running container image according to the needs of the core processing module 12 to provide different application services. In addition, the service application module 14 can also provide services to upstream terminal devices. That is, upstream terminal devices can access the cloud platform 1 through interfaces or instant messaging software MQ, and the service application module 14 will provide services to them.
[0036] The core processing module 12 is connected to the communication interface module 11, the protocol adaptation module 13, and the service application module 14. As a scheduling center, the core processing module 12 not only retrieves data from different modules as needed, but also constructs data models corresponding to different types of retail terminal devices 2. It even stores uplink and downlink instruction sets internally. The uplink instruction set enables intelligent interaction with upstream terminal devices, while the downlink instruction set enables remote intelligent control of the retail terminal devices 2. The uplink instruction set mainly includes instructions for responding to requests from upstream terminal devices and can be established based on the historical access records of the upstream terminal devices. The downlink instruction set includes operation instructions for all types of retail terminal devices 2. The downlink instruction set can be manually entered or established by collecting functional descriptions of the retail terminal devices 2 from their manufacturers. Of course, in practical applications, other functional modules, such as a timing module, can be integrated into the core processing module 12 as needed, thereby enabling the core processing module 12 to perform more functions. This application does not impose any limitations on this.
[0037] It should be noted that, Figure 1 The operating environment shown is illustrative only and is not intended to limit the application or use of the embodiments of the present invention.
[0038] Figure 2 A flowchart of a retail system protocol conversion method according to an embodiment of this application is shown, the method being applied to Figure 1 The core processing module 12 is used in the system. Specifically, the main process of the retail system protocol conversion method is described as follows.
[0039] Step S100: Obtain instruction data sent by retail terminal device 2.
[0040] Specifically, when retail terminal device 2 connects to the network and starts its internal applications, it sends instruction data to cloud platform 1. The instruction data format includes a protocol header, data length, instruction type, instruction content, and verification bit. The protocol header contains the protocol used for transmission, such as HTTP or TCP. The data length is the size of the numerical values in the instruction data, and it varies depending on the values. The instruction type indicates the type of instruction data, and the instruction content contains the specific information it includes. For example, if the instruction content includes the temperature of retail terminal device 2, the temperature will be displayed. The verification bit is used to verify the authenticity of the instruction data.
[0041] In this example, the communication interface module 11 receives the instruction data and transmits it to the core processing module 12, that is, the core processing module 12 receives the instruction data.
[0042] Step S200: Establish a data model based on the instruction data.
[0043] After receiving the instruction data, the core processing module 12 extracts the IP address from the instruction data and then checks if there is an IP address in the blacklist that matches the IP address in the instruction data. If so, it means that the retail terminal device 2 is a terminal device on the blacklist, and since retail terminal device 2 on the blacklist is an untrusted terminal device, the communication connection with the untrusted retail terminal device 2 is disconnected to improve network security when the cloud platform 1 and the retail terminal device 2 communicate. If there is no IP address in the blacklist that matches the IP address in the instruction data, it means that the retail terminal device 2 is an authorized retail terminal device. Of course, in other examples, the core processing module 12 can also determine whether the retail terminal device 2 is an authorized terminal device by extracting the MAC address or other data used to identify the retail terminal device 2 from the instruction data.
[0044] For retail terminal device 2 that is under trust, the core processing module 12 retrieves the cached data table. This cached data table stores the identifiers of retail terminal devices 2 that have established communication connections with the cloud platform 1. These identifiers can be IP addresses, MAC addresses, or other data used to identify the retail terminal device 2. Then, it determines whether retail terminal device 2 belongs to the retail terminal device 2 in the cached data table. If so, since retail terminal device 2 has a communication record with the cloud platform 1, the protocol historically used by retail terminal device 2 is directly retrieved as the device protocol for retail terminal device 2; otherwise, the protocol database needs to be retrieved to match the corresponding device protocol for retail terminal device 2.
[0045] The specific matching process is as follows: First, after the cloud platform 1 starts, the core processing module 12 retrieves the protocol database from the protocol adaptation module 13. Then, when the retail terminal device 2 is communicating with the cloud platform 1 for the first time, the core processing module 12 uses loose coupling technology (service provider interface, SPI) to obtain all protocols from the protocol database, and searches for the same protocol in the protocol database according to the protocol header in the instruction data. The found protocol is then used as the device protocol of the retail terminal device 2 to complete the protocol matching work.
[0046] Therefore, based on the instruction data sent by retail terminal device 2, the identity information of retail terminal device 2 can be determined, such as whether retail terminal device 2 is communicating with cloud platform 1 for the first time, or whether it exists in the blacklist, etc. Then, based on the identity information, the device protocol of retail terminal device 2 is obtained. That is, if retail terminal device 2 exists in the cache data table, the device protocol of retail terminal device 2 can be directly retrieved; if retail terminal device 2 is accessing cloud platform 1 for the first time, the corresponding device protocol is matched for it in the protocol database.
[0047] After obtaining the device protocol, the device type corresponding to the device protocol is obtained. In this example, various retail terminal devices 2 are classified according to their device protocols. For example, those supporting the M205 protocol are of the same device type, and those supporting the M406 protocol are of the same device type. Therefore, after obtaining the device protocol of the retail terminal device 2, the device type corresponding to the device protocol can be obtained. In addition, this application sets up uplink instructions and downlink execution for each type of retail terminal device 2. The uplink instructions come from the uplink instruction set, and the downlink instructions come from the downlink instruction set. For example, a type of retail terminal device 2 that supports the HTTP protocol is set to support 10 uplink instructions and 5 downlink instructions simultaneously. For example, it can simultaneously report 10 uplink instructions such as temperature, remaining goods, and cabinet door opening time, and execute 5 downlink instructions such as closing the cabinet door, lowering the temperature, and turning off the lights.
[0048] Finally, a data model corresponding to the retail terminal device 2 is established based on the uplink and downlink commands corresponding to the device protocol and device type. In a specific example, a corresponding data model can be established for each retail terminal device 2 separately. In other examples, a corresponding data model can be established for the same type of retail terminal device 2, thereby facilitating the management of the retail terminal device 2 based on the data model. To save time in establishing the data model, this application adopts the approach of establishing only one corresponding data model for the same type of retail terminal device 2.
[0049] Specifically, when multiple retail terminal devices 2 correspond to the same data model, a data packet is generated for each retail terminal device 2. This data packet is used to record the operating status of the retail terminal device 2. Therefore, when business information that drives the retail terminal device 2 to perform tasks is received, the data packet corresponding to the retail terminal device 2 is retrieved to know the current status of the retail terminal device 2, such as the retail terminal device 2 being in a mobile state.
[0050] After establishing the data model corresponding to retail terminal device 2, if retail terminal device 2 continuously sends instruction data to cloud platform 1 within a preset time period, retail terminal device 2 will be added to the blacklist to prevent it from continuing to maliciously access cloud platform 1 and causing data leakage. If retail terminal device 2 operates normally within the preset time period, the core processing module 12 will update the retail terminal device 2 identifier in the cached data table and send notification information to the upstream terminal device so that the supplier can know the operating status of retail terminal device 2 and review its device protocol. Simultaneously, it will return confirmation information to retail terminal device 2 to inform it that the data model has been successfully established, indicating that the communication link has been successfully established.
[0051] Therefore, steps S100 and S200 are the process of establishing a communication connection between the retail terminal device 2 and the cloud platform 1. After the retail terminal device 2 establishes a communication connection with the cloud platform 1, it proceeds to step S300.
[0052] Step S300: Receive service information.
[0053] Business information can be generated periodically by cloud platform 1 or input into cloud platform 1 by upstream terminal devices. Specifically, business information is mainly used to drive retail terminal device 2 to perform tasks. Therefore, if cloud platform 1 wants to know data such as the temperature and remaining stock of retail terminal device 2, it needs to generate business information periodically. After receiving the business information, retail terminal device 2 collects its internal temperature and remaining stock and then reports it to cloud platform 1. If a supplier needs to replenish retail terminal device 2, it inputs business information into cloud platform 1, and cloud platform 1 controls the opening of the cabinet door of retail terminal device 2 to perform the replenishment operation. Similarly, if a consumer wants to take goods, they also need to send business information to cloud platform 1, and cloud platform 1 controls the opening of the cabinet door of retail terminal device 2 to take their purchased goods.
[0054] Specifically, when the business information is generated periodically by the cloud platform 1, the implementation method is as follows: a timing function module, such as a clock chip, is set in the core processing module 12. The clock chip keeps time, and when the time reaches the next transmission cycle, the core processing module 12 automatically generates a business information. When the business information is input by an upstream terminal device, the communication interface module 11 receives the business information and transmits the received business information to the core processing module 12, that is, the core processing module 12 receives the business information.
[0055] In addition, after the core processing module 12 receives the business information, it will also determine whether the retail terminal device 2 used to execute the task is online. If it is online, it will proceed to step S400; if not, it will retry connecting to the retail terminal device 2 n times, where n≥2. In this example, n=3. By retrying the connection with the retail terminal device 2 multiple times, it will determine whether the retail terminal device 2 is online. If it is still determined that the retail terminal device 2 is offline after n times, the processing of business information will stop.
[0056] Step S400: Generate task instructions that support device protocol transmission based on business information and operating status.
[0057] First, after obtaining the business information, the operational elements are determined. The operational elements are at least one of the multiple functional components included in the retail terminal equipment 2. For example, if the task to be performed by the retail terminal equipment 2 is to open the cabinet door, then the cabinet door is the operational element. When the task to be performed by the retail terminal equipment 2 is to move its position, then the drive motor and the pulley are the operational elements.
[0058] Then, the current posture of the operational element is determined from the running status in the data model. The next posture of the operational element is then determined based on the current posture and business information. That is, the business information contains the path of the operational element when the retail terminal device 2 executes the task. Therefore, the next posture can be determined based on the current posture of the operational element. For example, if the business information is to open the cabinet door, the path of the cabinet door is the entire process from closing to opening. If the cabinet door of the retail terminal device 2 is currently in a half-open state, the next posture is a fully open state. Alternatively, if the business information is to report the remaining quantity of goods, the next posture is to start the acquisition module in the retail terminal device 2 so that the acquisition module can report the goods to the cloud platform 1 after collecting the remaining quantity. After obtaining the next posture of the operational element, the encoder converts the next posture into the transmission format of the device protocol supported by the retail terminal device 2. Then, the converted next posture is encapsulated to obtain the task instruction, which is transmitted to the retail terminal device 2. After receiving the task instruction, the retail terminal device 2 executes the task according to the task instruction.
[0059] In summary, the implementation principle of the retail system protocol conversion method in this application is as follows: First, the cloud platform 1 establishes a communication connection with the retail terminal device 2. Then, upon receiving business information, it determines the task to be executed by the retail terminal device 2 based on the business information. Finally, it sends the task instruction based on the established communication link, thereby facilitating the retail terminal device 2 to execute the task according to the task instruction. This enables the cloud platform 1 of this application to adapt to more types of retail terminal devices 2, thereby reducing the difficulty of the cloud platform 1 in managing the retail terminal devices 2.
[0060] Figure 3The diagram illustrates a block diagram of a retail system protocol conversion system according to an embodiment of this application, the system comprising, in addition to, Figure 1 In addition to the various modules of the cloud platform 1 described herein, it also includes the data processing unit 121, the data receiving unit 122, and the data generating unit 123 included in the core processing module 12.
[0061] The data processing unit 121 is used to establish a data model based on the instruction data sent by the retail terminal device 2. The data model includes the device protocol and operating status of the retail terminal device 2. The data receiving unit 122 is used to receive business information, which drives the retail terminal device 2 to perform tasks. The data generation unit 123 is used to generate task instructions that support device protocol transmission based on the business information and operating status.
[0062] The modules described in the embodiments of this application can be implemented in software or hardware. The described modules can also be housed in a processor; for example, a processor may be described as including a data processing unit 121, a data receiving unit 122, and a data generating unit 123. The names of these modules do not necessarily limit the module itself; for example, the data processing unit 121 may also be described as "a unit for establishing a data model based on instruction data sent by the retail terminal device 2".
[0063] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the described module can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0064] To better execute the above-described method, this application also provides an apparatus including a memory and a processor.
[0065] The memory can be used to store instructions, programs, code, code sets, or instruction sets. The memory may include a program storage area and a data storage area. The program storage area may store instructions for implementing an operating system, instructions for at least one function, and instructions for implementing the aforementioned retail system protocol conversion method; the data storage area may store data involved in the aforementioned retail system protocol conversion method.
[0066] A processor may include one or more processing cores. The processor executes instructions, programs, code sets, or instruction sets stored in memory, and calls data stored in memory to perform various functions and process data as described in this application. The processor may be at least one of a specific application-specific integrated circuit, a digital signal processor, a digital signal processing device, a programmable logic device, a field-programmable gate array, a central processing unit, a controller, a microcontroller, and a microprocessor. It is understood that, for different devices, the electronic devices used to implement the above-described processor functions may also be other types, and the embodiments of this application do not specifically limit the specific implementation.
[0067] This application also provides a computer-readable storage medium, such as a USB flash drive, a portable hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, and other media capable of storing program code. This computer-readable storage medium stores a computer program that can be loaded by a processor and executed using the aforementioned retail system protocol conversion method.
[0068] The above description is merely a preferred embodiment of this application and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of disclosure in this application is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the foregoing disclosed concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features with similar functions disclosed in this application.
Claims
1. A method for converting protocols in a retail system, characterized in that, include: A data model is established based on the instruction data sent by the retail terminal device (2), and the data model includes the device protocol and operating status of the retail terminal device (2); Receive business information, which is used to drive the retail terminal device (2) to perform tasks; Based on the business information and the operating status, generate task instructions that support the device protocol transmission; The step of generating task instructions that support the device protocol transmission based on the service information and the operating status includes: The operational elements are determined based on the business information, and the operational elements are at least one of the multiple functional components included in the retail terminal equipment (2); The current attitude of the operational element is determined based on the operating status; The next posture is determined based on the current posture and the service information; The next posture is encapsulated into a task instruction that supports the transmission of the device protocol; The step of encapsulating the next posture into a task instruction that supports the device protocol transmission includes: The encoder converts the next pose into a next pose that supports the device protocol transmission; The next pose that supports the device protocol transmission is encapsulated to obtain the task instruction; A data model is established based on the instruction data sent by the retail terminal device (2), including: Receive instruction data sent by retail terminal equipment (2); The identity information of the retail terminal device (2) is determined based on the instruction data; The device protocol of the retail terminal device (2) is obtained based on the identity information; According to the device protocol, the device type corresponding to the device protocol is obtained. Different types of retail terminal devices (2) correspond to different uplink and downlink instructions. The data model is established based on the device protocol, the uplink command, and the downlink command; The step of determining the identity information of the retail terminal device (2) based on the instruction data includes: Extract the IP address from the command data; Determine if there is an IP address identical to the stated IP address in the blacklist; If so, then identity verification failed; If not, then determine the identity information of the retail terminal device (2); The format of the instruction data includes a protocol header, data length, instruction type, instruction content, and verification bit. The protocol header contains the protocol used when transmitting the instruction data, the data length is the size of the numerical value in the instruction data, the instruction type is the type to which the instruction data belongs, the instruction content is the information contained in the instruction data, and the verification bit is used to verify the authenticity of the instruction data.
2. A retail system protocol conversion system, characterized in that, It includes a communication interface module (11), a protocol adaptation module (13), and a core processing module (12) for performing the method as described in claim 1; The communication interface module (11) is communicatively connected to the retail terminal device (2), and the communication interface module (11) is used to receive instruction data sent by the retail terminal device (2); The protocol adaptation module (13) stores a protocol database; The core processing module (12) is connected to the communication interface module (11) and the protocol adaptation module (13) respectively. The core processing module (12) is used to establish a data model corresponding to the retail terminal device (2) based on the instruction data, and is also used to obtain task instructions based on business information and the data model. The core processing module (12) includes: The data processing unit (121) is used to establish a data model based on the instruction data sent by the retail terminal device (2), the data model including the device protocol and operating status of the retail terminal device (2); Data receiving unit (122) is used to receive business information, which is used to drive the retail terminal device (2) to perform tasks: The data generation unit (123) is used to generate task instructions that support the transmission of the device protocol based on the business information and the operating status; A data model is established based on the instruction data sent by the retail terminal device (2), including: Receive instruction data sent by retail terminal equipment (2); The identity information of the retail terminal device (2) is determined based on the instruction data; The device protocol of the retail terminal device (2) is obtained based on the identity information; According to the device protocol, the device type corresponding to the device protocol is obtained. Different types of retail terminal devices (2) correspond to different uplink and downlink instructions. The data model is established based on the device protocol, the uplink command, and the downlink command; The step of determining the identity information of the retail terminal device (2) based on the instruction data includes: Extract the IP address from the command data; Determine if there is an IP address identical to the stated IP address in the blacklist; If so, then identity verification failed; If not, then determine the identity information of the retail terminal device (2); The format of the instruction data includes a protocol header, data length, instruction type, instruction content, and verification bit. The protocol header contains the protocol used when transmitting the instruction data, the data length is the size of the numerical value in the instruction data, the instruction type is the type to which the instruction data belongs, the instruction content is the information contained in the instruction data, and the verification bit is used to verify the authenticity of the instruction data.
3. A retail system protocol conversion device, characterized in that, It includes a memory and a processor, wherein the memory stores a computer program, and the processor executes the program to implement the method as described in claim 1.
4. A computer-readable storage medium, characterized in that, It stores a computer program that, when executed by a processor, implements the method as described in claim 1.
Citation Information
Patent Citations
State monitoring method and state monitoring system of vending machine
CN109451007A
Method for accessing networking device to cloud platform and control system
CN116418810A