CN115988058A - A message processing method, device, electronic device, and computer-readable medium - Google Patents
A message processing method, device, electronic device, and computer-readable medium Download PDFInfo
- Publication number
- CN115988058A CN115988058A CN202310001639.0A CN202310001639A CN115988058A CN 115988058 A CN115988058 A CN 115988058A CN 202310001639 A CN202310001639 A CN 202310001639A CN 115988058 A CN115988058 A CN 115988058A
- Authority
- CN
- China
- Prior art keywords
- broadcast
- message
- task
- target cloud
- execution
- 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.)
- Granted
Links
Images
Landscapes
- Information Transfer Between Computers (AREA)
- Mobile Radio Communication Systems (AREA)
Abstract
本申请公开了消息处理方法、装置、电子设备及计算机可读介质,涉及物联网技术领域,特别涉及网络与通讯技术领域,一具体实施方式包括响应于检测到支付交易数据,获取对应的用户标识和终端标识,进而生成播报消息;基于用户标识和终端标识,确定目标云播报设备;获取目标云播报设备的状态,响应于状态为在线,基于播报消息生成播报任务;调用目标云播报设备以执行播报任务,响应于检测到执行所述播报任务时网络异常,调用连接服务以修复网络异常并重新执行所述播报任务直至执行成功,输出播报结果信息。可使用相对低廉的设备,降低成本。提高任务执行成功率,提高消息处理效率,保证消息处理时效。
The application discloses a message processing method, device, electronic equipment, and computer-readable medium, which relate to the technical field of the Internet of Things, and in particular to the technical field of network and communication. A specific implementation method includes obtaining the corresponding user identification in response to the detection of payment transaction data and terminal ID, and then generate a broadcast message; based on the user ID and terminal ID, determine the target cloud broadcast device; obtain the status of the target cloud broadcast device, and generate a broadcast task based on the broadcast message in response to the status being online; call the target cloud broadcast device to execute The broadcast task, in response to detecting a network anomaly when executing the broadcast task, invokes the connection service to repair the network anomaly and re-executes the broadcast task until the execution is successful, and outputs broadcast result information. Relatively cheap equipment can be used to reduce costs. Improve the success rate of task execution, improve the efficiency of message processing, and ensure the timeliness of message processing.
Description
技术领域technical field
本申请涉及物联网技术领域,特别涉及网络与通讯技术领域,尤其涉及一种消息处理方法、装置、电子设备及计算机可读介质。The present application relates to the technical field of the Internet of Things, in particular to the technical field of network and communication, and in particular to a message processing method, device, electronic equipment and computer-readable medium.
背景技术Background technique
移动支付近年来得到了广泛的普及,目前已经成为众多消费者日常主要支付方式。移动支付主要包括二维码支付、闪付、跳转第三方客户端支付等。对于不稳定的网络,无法原生地实现从断开的故障中回恢复,导致任务执行失败率较高,并且在用户支付成功后,无法快速地第一时间通知卖家,导致消息处理不及时、效率低。Mobile payment has been widely popularized in recent years, and has become the main payment method for many consumers in daily life. Mobile payment mainly includes two-dimensional code payment, quick payment, jumping to third-party client payment, etc. For an unstable network, it is impossible to recover from a disconnected fault natively, resulting in a high failure rate of task execution, and after the user's payment is successful, the seller cannot be notified immediately at the first time, resulting in untimely message processing and low efficiency. Low.
发明内容Contents of the invention
有鉴于此,本申请实施例提供一种消息处理方法、装置、电子设备及计算机可读介质,能够解决现有的任务执行失败率高、消息处理不及时、效率低的问题。In view of this, the embodiments of the present application provide a message processing method, device, electronic device, and computer-readable medium, which can solve the existing problems of high task execution failure rate, untimely message processing, and low efficiency.
为实现上述目的,根据本申请实施例的一个方面,提供了一种消息处理方法,包括:To achieve the above purpose, according to an aspect of the embodiment of the present application, a message processing method is provided, including:
响应于检测到支付交易数据,获取对应的用户标识和终端标识,进而生成播报消息;In response to detecting the payment transaction data, obtain the corresponding user ID and terminal ID, and then generate a broadcast message;
基于用户标识和终端标识,确定目标云播报设备;Determine the target cloud broadcast device based on the user ID and the terminal ID;
获取目标云播报设备的状态,响应于状态为在线,基于播报消息生成播报任务;Obtain the status of the target cloud broadcast device, and generate a broadcast task based on the broadcast message in response to the status being online;
调用目标云播报设备以执行播报任务,响应于检测到执行所述播报任务时网络异常,调用连接服务以修复网络异常并重新执行所述播报任务直至执行成功,输出播报结果信息。Invoking the target cloud broadcast device to execute the broadcast task, in response to detecting a network anomaly during the execution of the broadcast task, invoking the connection service to repair the network anomaly and re-executing the broadcast task until the execution is successful, outputting broadcast result information.
可选地,生成播报消息,包括:Optionally, a broadcast message is generated, including:
调用分布式消息队列,以从对应的消费分区集合中确定目标消费分区;Call the distributed message queue to determine the target consumption partition from the corresponding consumption partition set;
调用目标消费分区,以基于用户标识和终端标识,生成播报消息。Call the target consumption partition to generate a broadcast message based on the user ID and terminal ID.
可选地,确定目标云播报设备,包括:Optionally, determine the target cloud broadcast device, including:
确定与用户标识和终端标识绑定的一个或多个设备标识对应的云播报设备;Determine the cloud broadcast device corresponding to one or more device identifiers bound to the user identifier and the terminal identifier;
获取一个或多个设备标识对应的云播报设备中的未执行播报任务数量;Obtain the number of unexecuted broadcast tasks in the cloud broadcast device corresponding to one or more device identifiers;
基于未执行播报任务数量,确定目标云播报设备。Determine the target cloud broadcast device based on the number of unexecuted broadcast tasks.
可选地,基于未执行播报任务数量,确定目标云播报设备,包括:Optionally, based on the number of unexecuted broadcast tasks, the target cloud broadcast device is determined, including:
对未执行播报任务数量进行递增排序;Incrementally sort the number of unexecuted broadcast tasks;
将排序第一的未执行播报任务数量对应的云播报设备确定为目标云播报设备。The cloud broadcast device corresponding to the number of unexecuted broadcast tasks ranked first is determined as the target cloud broadcast device.
可选地,调用目标云播报设备以执行播报任务,包括:Optionally, call the target cloud broadcast device to perform the broadcast task, including:
响应于当前时间到达播报任务对应的预设执行时间,将播报任务对应的报文消息格式化为目标云播报设备可解析消息;In response to the current time reaching the preset execution time corresponding to the broadcast task, formatting the message message corresponding to the broadcast task into a message that can be parsed by the target cloud broadcast device;
调用目标云播报设备播报目标云播报设备可解析消息;Call the target cloud broadcast device to broadcast the message that the target cloud broadcast device can parse;
输出消息处理结果报文。Output the message processing result message.
可选地,在输出消息处理结果报文之后,方法还包括:Optionally, after outputting the message processing result message, the method further includes:
解析消息处理结果报文,以获取播报任务消息编号、处理结果状态和失败描述信息字段值;Parse the message processing result message to obtain the broadcast task message number, processing result status and failure description field value;
基于播报任务消息编号、处理结果状态和失败描述信息字段值更新目标云播报设备日志。Update the target cloud broadcast device log based on the broadcast task message number, processing result status and failure description field value.
可选地,在响应于检测到执行所述播报任务时网络异常,调用连接服务以修复网络异常并重新执行所述播报任务直至执行成功,输出播报结果信息之后,方法还包括:Optionally, after detecting that the network is abnormal when executing the broadcast task, calling the connection service to repair the network abnormality and re-executing the broadcast task until the execution is successful, and outputting the broadcast result information, the method further includes:
响应于播报任务为目标云播报设备对应的播报任务列表中的最后一个播报任务,更新状态为下线。In response to the broadcast task being the last broadcast task in the broadcast task list corresponding to the target cloud broadcast device, the update status is offline.
另外,本申请还提供了一种消息处理装置,包括:In addition, the present application also provides a message processing device, including:
获取单元,被配置成响应于检测到支付交易数据,获取对应的用户标识和终端标识,进而生成播报消息;The obtaining unit is configured to obtain the corresponding user identification and terminal identification in response to the detection of the payment transaction data, and then generate a broadcast message;
设备确定单元,被配置成基于用户标识和终端标识,确定目标云播报设备;The device determination unit is configured to determine the target cloud broadcast device based on the user identification and the terminal identification;
任务生成单元,被配置成获取目标云播报设备的状态,响应于状态为在线,基于播报消息生成播报任务;The task generation unit is configured to obtain the status of the target cloud broadcast device, and generate a broadcast task based on the broadcast message in response to the status being online;
执行单元,被配置成调用目标云播报设备以执行播报任务,响应于检测到执行所述播报任务时网络异常,调用连接服务以修复网络异常并重新执行所述播报任务直至执行成功,输出播报结果信息。The execution unit is configured to call the target cloud broadcast device to execute the broadcast task, and in response to detecting a network anomaly when performing the broadcast task, call the connection service to repair the network anomaly and re-execute the broadcast task until the execution is successful, and output the broadcast result information.
可选地,获取单元进一步被配置成:Optionally, the acquisition unit is further configured to:
调用分布式消息队列,以从对应的消费分区集合中确定目标消费分区;Call the distributed message queue to determine the target consumption partition from the corresponding consumption partition set;
调用目标消费分区,以基于用户标识和终端标识,生成播报消息。Call the target consumption partition to generate a broadcast message based on the user ID and terminal ID.
可选地,设备确定单元进一步被配置成:Optionally, the device determination unit is further configured to:
确定与用户标识和终端标识绑定的一个或多个设备标识对应的云播报设备;Determine the cloud broadcast device corresponding to one or more device identifiers bound to the user identifier and the terminal identifier;
获取一个或多个设备标识对应的云播报设备中的未执行播报任务数量;Obtain the number of unexecuted broadcast tasks in the cloud broadcast device corresponding to one or more device identifiers;
基于未执行播报任务数量,确定目标云播报设备。Determine the target cloud broadcast device based on the number of unexecuted broadcast tasks.
可选地,设备确定单元进一步被配置成:Optionally, the device determination unit is further configured to:
对未执行播报任务数量进行递增排序;Incrementally sort the number of unexecuted broadcast tasks;
将排序第一的未执行播报任务数量对应的云播报设备确定为目标云播报设备。The cloud broadcast device corresponding to the number of unexecuted broadcast tasks ranked first is determined as the target cloud broadcast device.
可选地,执行单元进一步被配置成:Optionally, the execution unit is further configured to:
响应于当前时间到达播报任务对应的预设执行时间,将播报任务对应的报文消息格式化为目标云播报设备可解析消息;In response to the current time reaching the preset execution time corresponding to the broadcast task, formatting the message message corresponding to the broadcast task into a message that can be parsed by the target cloud broadcast device;
调用目标云播报设备播报目标云播报设备可解析消息;Call the target cloud broadcast device to broadcast the message that the target cloud broadcast device can parse;
输出消息处理结果报文。Output the message processing result message.
可选地,执行单元进一步被配置成:Optionally, the execution unit is further configured to:
解析消息处理结果报文,以获取播报任务消息编号、处理结果状态和失败描述信息字段值;Parse the message processing result message to obtain the broadcast task message number, processing result status and failure description field value;
基于播报任务消息编号、处理结果状态和失败描述信息字段值更新目标云播报设备日志。Update the target cloud broadcast device log based on the broadcast task message number, processing result status and failure description field value.
可选地,消息处理装置还包括状态更新单元,被配置成:Optionally, the message processing device further includes a status update unit configured to:
响应于播报任务为目标云播报设备对应的播报任务列表中的最后一个播报任务,更新状态为下线。In response to the broadcast task being the last broadcast task in the broadcast task list corresponding to the target cloud broadcast device, the update status is offline.
另外,本申请还提供了一种消息处理电子设备,包括:一个或多个处理器;存储装置,用于存储一个或多个程序,当一个或多个程序被一个或多个处理器执行,使得一个或多个处理器实现如上述的消息处理方法。In addition, the present application also provides a message processing electronic device, including: one or more processors; a storage device for storing one or more programs, when the one or more programs are executed by the one or more processors, One or more processors are made to implement the above message processing method.
另外,本申请还提供了一种计算机可读介质,其上存储有计算机程序,程序被处理器执行时实现如上述的消息处理方法。In addition, the present application also provides a computer-readable medium, on which a computer program is stored, and when the program is executed by a processor, the above message processing method is realized.
为实现上述目的,根据本申请实施例的又一个方面,提供了一种计算机程序产品。To achieve the above purpose, according to still another aspect of the embodiments of the present application, a computer program product is provided.
本申请实施例的一种计算机程序产品,包括计算机程序,程序被处理器执行时实现本申请实施例提供的消息处理方法。A computer program product according to an embodiment of the present application includes a computer program, and when the program is executed by a processor, the message processing method provided in the embodiment of the present application is implemented.
上述发明中的一个实施例具有如下优点或有益效果:本申请通过响应于检测到支付交易数据,获取对应的用户标识和终端标识,进而生成播报消息;基于用户标识和终端标识,确定目标云播报设备;获取目标云播报设备的状态,响应于状态为在线,基于播报消息生成播报任务;调用目标云播报设备以执行播报任务,响应于检测到执行所述播报任务时网络异常,调用连接服务以修复网络异常并重新执行所述播报任务直至执行成功,输出播报结果信息。可使用相对低廉的设备,降低成本。对于不稳定的网络导致的任务执行异常可以无痕恢复任务执行,提高任务执行成功率,并且不需要依赖厂商接口协议和规范,提高消息处理效率,保证消息处理时效。An embodiment of the above invention has the following advantages or beneficial effects: the application obtains the corresponding user ID and terminal ID in response to the detection of payment transaction data, and then generates a broadcast message; based on the user ID and terminal ID, determine the target cloud broadcast equipment; obtain the status of the target cloud broadcast device, and generate a broadcast task based on the broadcast message in response to the status being online; call the target cloud broadcast device to perform the broadcast task, and in response to detecting that the network is abnormal when performing the broadcast task, call the connection service to Repair the network anomaly and re-execute the broadcast task until the execution is successful, and output the broadcast result information. Relatively cheap equipment can be used to reduce costs. For task execution exceptions caused by unstable networks, task execution can be resumed without trace, improving the success rate of task execution, and does not need to rely on vendor interface protocols and specifications, improving message processing efficiency and ensuring message processing timeliness.
上述的非惯用的可选方式所具有的进一步效果将在下文中结合具体实施方式加以说明。The further effects of the above-mentioned non-conventional alternatives will be described below in conjunction with specific embodiments.
附图说明Description of drawings
附图用于更好地理解本申请,不构成对本申请的不当限定。其中:The accompanying drawings are used for better understanding of the present application, and do not constitute an improper limitation of the present application. in:
图1是根据本申请一个实施例的消息处理方法的主要流程的示意图;FIG. 1 is a schematic diagram of a main flow of a message processing method according to an embodiment of the present application;
图2是根据本申请一个实施例的消息处理方法的主要流程的示意图;FIG. 2 is a schematic diagram of a main flow of a message processing method according to an embodiment of the present application;
图3是根据本申请一个实施例的消息处理方法的主要流程示意图;FIG. 3 is a schematic flowchart of a main message processing method according to an embodiment of the present application;
图4是根据本申请一个实施例的消息处理方法的系统架构示意图;FIG. 4 is a schematic diagram of a system architecture of a message processing method according to an embodiment of the present application;
图5是根据本申请实施例的消息处理装置的主要单元的示意图;Fig. 5 is a schematic diagram of main units of a message processing device according to an embodiment of the present application;
图6是本申请实施例可以应用于其中的示例性系统架构图;FIG. 6 is an exemplary system architecture diagram to which the embodiment of the present application can be applied;
图7是适于用来实现本申请实施例的终端设备或服务器的计算机系统的结构示意图。Fig. 7 is a schematic structural diagram of a computer system suitable for implementing a terminal device or a server according to an embodiment of the present application.
具体实施方式Detailed ways
以下结合附图对本申请的示范性实施例做出说明,其中包括本申请实施例的各种细节以助于理解,应当将它们认为仅仅是示范性的。因此,本领域普通技术人员应当认识到,可以对这里描述的实施例做出各种改变和修改,而不会背离本申请的范围和精神。同样,为了清楚和简明,以下的描述中省略了对公知功能和结构的描述。需要说明的是,本申请的技术方案中,所涉及的用户个人信息的采集、分析、使用、传输、存储等方面,均符合相关法律法规的规定,被用于合法且合理的用途,不在这些合法使用等方面之外共享、泄露或出售,并且接受监管部门的监督管理。应当对用户个人信息采取必要措施,以防止对此类个人信息数据的非法访问,确保有权访问个人信息数据的人员遵守相关法律法规的规定,确保用户个人信息安全。一旦不再需要这些用户个人信息数据,应当通过限制甚至禁止数据收集和/或删除数据的方式将风险降至最低。Exemplary embodiments of the present application are described below in conjunction with the accompanying drawings, which include various details of the embodiments of the present application to facilitate understanding, and they should be regarded as exemplary only. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the application. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness. It should be noted that in the technical solution of this application, the collection, analysis, use, transmission, storage, etc. of the user's personal information involved are in compliance with the relevant laws and regulations, and are used for legal and reasonable purposes. Sharing, divulging or selling other than legitimate use, and accepting the supervision and management of regulatory authorities. Necessary measures should be taken for users' personal information to prevent illegal access to such personal information and data, ensure that those who have access to personal information and data abide by relevant laws and regulations, and ensure the security of users' personal information. Risk should be minimized by limiting or even prohibiting data collection and/or deleting data once such user personal data is no longer required.
当使用时,包括在某些相关应用程序中,通过对数据去标识来保护用户隐私,例如在使用时通过移除特定标识符、控制所存储数据的量或特异性、控制数据如何被存储、和/或其他方法去标识。When used, including in certain related applications, to protect user privacy by de-identifying data, such as by removing specific identifiers at the time of use, controlling the amount or specificity of stored data, controlling how data is stored, and/or other methods to de-identify.
图1是根据本申请一个实施例的消息处理方法的主要流程的示意图,如图1所示,消息处理方法包括:Fig. 1 is a schematic diagram of the main flow of a message processing method according to an embodiment of the present application. As shown in Fig. 1, the message processing method includes:
步骤S101,响应于检测到支付交易数据,获取对应的用户标识和终端标识,进而生成播报消息。Step S101, in response to the detection of payment transaction data, obtain the corresponding user ID and terminal ID, and then generate a broadcast message.
本实施例中,消息处理方法的执行主体(例如,可以是服务器)可以通过有线连接或无线连接的方式,检测是否存在支付交易数据。当检测到支付交易数据时,执行主体可以获取对应的用户标识。具体地,用户标识可以是触发产生支付交易数据的用户的账户名或者用户名称或者商户编号等,本申请实施例对用户标识不做具体限定。执行主体还可以获取支付交易数据对应的终端标识,该终端标识例如可以是触发产生支付交易数据的用户的手持终端产品序列号(SN号)或者手持终端蓝牙地址等,本申请实施例对终端标识的内容和类型不做具体限定。执行主体可以调用消息生成程序以根据支付交易数据(例如y元)、用户标识(例如a)和终端标识(例如c与收款终端d存在支付交易),生成播报消息。示例的,播报消息可以为“d收到a的款项y元,请注意查收”。In this embodiment, the execution subject of the message processing method (for example, it may be a server) may detect whether payment transaction data exists through a wired connection or a wireless connection. When the payment transaction data is detected, the execution subject can obtain the corresponding user ID. Specifically, the user identifier may be the account name or user name or merchant number of the user who triggers the generation of the payment transaction data, and the embodiment of the present application does not specifically limit the user identifier. The execution subject can also obtain the terminal identification corresponding to the payment transaction data. The terminal identification can be, for example, the product serial number (SN number) of the handheld terminal or the Bluetooth address of the handheld terminal of the user who triggered the generation of the payment transaction data. The content and type of are not specifically limited. The execution subject can call the message generation program to generate a broadcast message according to the payment transaction data (for example, y yuan), user identification (for example, a) and terminal identification (for example, there is a payment transaction between c and payment terminal d). For example, the broadcast message may be "d received a payment of y yuan from a, please pay attention to check".
步骤S102,基于用户标识和终端标识,确定目标云播报设备。Step S102, based on the user ID and the terminal ID, determine the target cloud broadcast device.
当用户标识为商户编号,终端标识为商户移动端SN号。执行主体可以根据用户标识和终端标识查询商户绑定设备信息。示例的,设备可以是用于播报信息的音箱。When the user ID is the merchant ID, the terminal ID is the merchant's mobile terminal SN. The execution subject can query the merchant-bound device information according to the user ID and terminal ID. Exemplarily, the device may be a speaker for broadcasting information.
例如,商户人员可以通过移动端H5扫描音箱底座二维码或者通过链接,进入系统,通过商户移动端SN号和音箱SN号确认商户和设备是否绑定。具体地,商户人员通过移动端H5扫描音箱底座二维码或者点击移动端H5页面的链接进入消息处理系统,若商户人员接收到提示:请扫描云播报设备底座二维码进入消息处理系统,则按照提示通过扫描二维码的方式进入消息处理系统,获取商户编号和音箱SN号,音箱绑定信息管理模块可以调用商户信息查询接口以查询传来的商户编号是否存在,若不存在则提示商户不存在,若存在则继续判断音箱是否被其他商户绑定,若被其他商户绑定则提示音箱已经被其他商户绑定并跳转云播报设备列表页展示传来的商户编号可以选择的所有云播报设备以供商户选择使用。若没有被其他商户绑定则判断音箱是否已绑定传来的商户编号,若已绑定传来的商户编号则跳转到云播报设备列表默认查询上送的音箱SN号对应的音箱(也就是目标云播报设备)。若没有绑定传来的商户编号则跳转到云播报设备绑定页面以绑定音箱SN号对应的音箱。For example, merchant personnel can scan the QR code of the speaker base through the mobile terminal H5 or enter the system through a link, and confirm whether the merchant and the device are bound through the SN number of the merchant’s mobile terminal and the SN number of the speaker. Specifically, the business personnel scan the QR code of the speaker base through the mobile terminal H5 or click the link on the mobile terminal H5 page to enter the message processing system. Follow the prompts to enter the message processing system by scanning the QR code to obtain the merchant number and the SN number of the speaker. The speaker binding information management module can call the merchant information query interface to check whether the incoming merchant number exists. If it does not exist, it will prompt the merchant. Does not exist, if it exists, continue to judge whether the speaker is bound by other merchants, if it is bound by other merchants, it will prompt that the speaker has been bound by other merchants and jump to the cloud broadcast device list page to display all the clouds that can be selected by the merchant number sent Broadcast equipment for merchants to choose to use. If it is not bound by other merchants, it will be judged whether the speaker has been bound to the merchant number sent. If it has been bound, it will jump to the cloud broadcast device list and query the speaker corresponding to the SN number of the speaker sent by default. is the target cloud broadcast device). If there is no merchant ID bound, jump to the cloud broadcast device binding page to bind the speaker corresponding to the SN number of the speaker.
可以理解的是,若用户标识对应有唯一的终端标识,例如商户编号有唯一的手持手机SN号时,执行主体可以同时基于用户标识和终端标识校验与音箱SN号对应的音箱是否绑定,例如在用户标识与音箱SN号绑定时继续校验用户标识对应的唯一终端标识是否也已经与音箱SN号对应的音箱绑定,这样比只根据用户标识(例如商户编号)校验是否已经绑定音箱SN号对应的音箱得到的结果更精确。其中,音箱SN号的获取方式可以包括手动输入或者扫码获取,示例的,由商户扫描音箱底座二维码跳转到云播报设备绑定页自动带出音箱SN号,进一步地还可以在扫码登录页扫码获取用户标识(例如商户编号)并自动带出终端编号(例如终端标识)。并以用户标识和终端标识确定目标云播报设备,例如用于消息播报的目标音箱。It is understandable that if the user ID corresponds to a unique terminal ID, for example, when the merchant number has a unique SN number of a handheld mobile phone, the execution subject can simultaneously check whether the speaker corresponding to the speaker SN number is bound based on the user ID and the terminal ID, For example, when the user ID is bound to the speaker SN number, continue to check whether the unique terminal ID corresponding to the user ID has also been bound to the speaker corresponding to the speaker SN number. The result obtained by specifying the speaker corresponding to the SN number of the speaker is more accurate. Among them, the way to obtain the speaker SN number can include manual input or scanning code acquisition. For example, the merchant scans the QR code on the speaker base to jump to the cloud broadcast device binding page to automatically bring up the speaker SN number. Scan the code on the login page to obtain the user ID (such as the merchant ID) and automatically bring out the terminal ID (such as the terminal ID). And use the user ID and the terminal ID to determine the target cloud broadcast device, such as a target speaker for message broadcast.
步骤S103,获取目标云播报设备的状态,响应于状态为在线,基于播报消息生成播报任务。Step S103, acquiring the status of the target cloud broadcast device, and generating a broadcast task based on the broadcast message in response to the status being online.
MQTT协议:MQTT(Message Queuing Telemetry Transport Protocol)的全称是消息队列遥感传输协议的缩写,是一种基于轻量级代理的发布/订阅模式的消息传输协议,运行在TCP协议栈之上,为其提供有序、可靠、双向连接的网络连接保证。目标云播报设备,例如目标音箱。执行主体在确定目标云播报设备之后,可以获取目标云播报设备的状态,例如是否已经与当前用户绑定,是否已经与其他用户绑定等,在与当前用户绑定时提示云播报设备已与当前云播报设备绑定,在没有与当前用户绑定时继续判断音箱是否与其他用户绑定,在与其他用户绑定时提示云播报设备已与其他用户绑定,在既没有与当前用户绑定也没有与其他用户绑定时,获取用户标识对应的其他的候选终端标识,具体可以通过手动输入或者扫码获取的方式得到该候选终端标识。进而,执行主体在获取候选终端标识后可以判断基于候选终端标识绑定云播报设备的绑定页面上的终端标识是否重复添加,若是则提示请勿重复绑定终端设备,若否则传递用户标识、候选终端标识、音箱SN号、音箱名称、备注信息至音箱绑定信息管理模块,进而由音箱绑定信息管理模块发送音箱SN号对应的生产厂商编号至白名单模块,以判断音箱SN号对应的生产厂商是否在白名单内,若不在白名单内则提示云播报设备尚未在后台注册的信息,若在白名单内则保存音箱SN号与用户标识及候选终端标识的绑定关系,生成该音箱SN号对应的云播报设备的MQTT的用户密码、主题名字、主题操作权限(可读写)、双方推送消息的加解密公钥、私钥并保存入远程字典服务redis数据库。然后,提示绑定成功信息,跳转云播报设备列表页按云播报设备最新绑定时间查询设备列表。MQTT protocol: The full name of MQTT (Message Queuing Telemetry Transport Protocol) is the abbreviation of Message Queue Remote Sensing Transport Protocol. Provide orderly, reliable, two-way connection network connection guarantee. The target cloud broadcast device, such as the target speaker. After the execution subject determines the target cloud broadcast device, it can obtain the status of the target cloud broadcast device, such as whether it has been bound with the current user, whether it has been bound with other users, etc., and prompts that the cloud broadcast device has been bound with the current user. The current cloud broadcast device is bound. If it is not bound to the current user, it will continue to judge whether the speaker is bound to other users. When it is bound to other users, it will prompt that the cloud broadcast device has been bound to other users. When the user ID is not bound to other users, other candidate terminal IDs corresponding to the user IDs are obtained. Specifically, the candidate terminal IDs can be obtained through manual input or code scanning. Furthermore, after obtaining the candidate terminal ID, the execution subject can judge whether the terminal ID on the binding page of the cloud broadcast device is bound based on the candidate terminal ID is repeatedly added, and if so, prompts not to bind the terminal device repeatedly, otherwise, pass the user ID, Candidate terminal identification, speaker SN number, speaker name, remark information to the speaker binding information management module, and then the speaker binding information management module sends the manufacturer number corresponding to the speaker SN number to the white list module to determine the speaker SN corresponding Whether the manufacturer is in the white list, if not in the white list, it will prompt the cloud to broadcast the information that the device has not been registered in the background, if it is in the white list, save the binding relationship between the SN number of the speaker, the user ID and the candidate terminal ID, and generate the speaker The MQTT user password of the cloud broadcast device corresponding to the SN number, topic name, topic operation authority (readable and writable), public key and private key for encryption and decryption of messages pushed by both parties are stored in the remote dictionary service redis database. Then, it prompts the binding success information, and jumps to the cloud broadcast device list page to query the device list according to the latest binding time of the cloud broadcast device.
当目标云播报设备与用户标识对应的终端标识(例如可以是候选终端标识)绑定成功后,可以确定目标云播报设备是在线的,可以随时被调用进行消息播报。此时,执行主体可以根据播报消息生成供目标云播报设备执行的播报任务。After the target cloud broadcast device is successfully bound to the terminal identifier (for example, a candidate terminal identifier) corresponding to the user identifier, it can be determined that the target cloud broadcast device is online and can be called at any time to perform message broadcast. At this point, the execution subject can generate a broadcast task for the target cloud broadcast device to execute according to the broadcast message.
步骤S104,调用目标云播报设备以执行播报任务,响应于检测到执行所述播报任务时网络异常,调用连接服务以修复网络异常并重新执行所述播报任务直至执行成功,输出播报结果信息。Step S104, calling the target cloud broadcasting device to execute the broadcasting task, in response to detecting a network abnormality during the execution of the broadcasting task, calling the connection service to repair the network abnormality and re-executing the broadcasting task until the execution is successful, and outputting broadcast result information.
每一个播报任务可以有对应的执行时间,该执行时间可以是实时的也可以是每隔预设时间。Each broadcast task may have a corresponding execution time, and the execution time may be real-time or every preset time.
具体地,调用目标云播报设备以执行播报任务,包括:响应于当前时间到达播报任务对应的预设执行时间,将播报任务对应的报文消息格式化为目标云播报设备可解析消息,示例的,当目标云播报设备为音箱时,可以将播报任务对应的报文消息格式化为音箱更能够解析的数据格式。调用目标云播报设备播报目标云播报设备可解析消息,具体可以是将目标云播报设备可解析消息(例如音箱能够解析的数据格式的消息)推送到播报消息接收主题以供对应的音箱对订阅的播报消息接收主题中的消息进行消息消费;进而输出消息处理结果报文。Specifically, invoking the target cloud broadcast device to execute the broadcast task includes: in response to the current time reaching the preset execution time corresponding to the broadcast task, formatting the message message corresponding to the broadcast task into a message that can be parsed by the target cloud broadcast device, for example , when the target cloud broadcast device is a speaker, the message message corresponding to the broadcast task can be formatted into a data format that the speaker can better parse. Invoke the target cloud broadcast device to broadcast the message that the target cloud broadcast device can parse. Specifically, it can push the message that the target cloud broadcast device can parse (such as a message in a data format that the speaker can parse) to the broadcast message receiving topic for the corresponding speaker pair to subscribe to. Broadcast the messages in the message receiving topic for message consumption; then output the message processing result message.
MQTT协议:MQTT(Message Queuing Telemetry Transport Protocol)的全称是消息队列遥感传输协议的缩写,是一种基于轻量级代理的发布/订阅模式的消息传输协议,运行在TCP协议栈之上,为其提供有序、可靠、双向连接的网络连接保证。当检测到执行所述播报任务时网络异常,调用连接服务,例如MQTT连接服务,以修复网络异常并重新执行所述播报任务直至执行成功,输出播报结果信息。MQTT protocol: The full name of MQTT (Message Queuing Telemetry Transport Protocol) is the abbreviation of Message Queue Remote Sensing Transport Protocol. Provide orderly, reliable, two-way connection network connection guarantee. When it is detected that the network is abnormal during the execution of the broadcast task, call the connection service, such as the MQTT connection service, to repair the network abnormality and re-execute the broadcast task until the execution is successful, and output the broadcast result information.
本实施例通过响应于检测到支付交易数据,获取对应的用户标识和终端标识,进而生成播报消息;基于用户标识和终端标识,确定目标云播报设备;获取目标云播报设备的状态,响应于状态为在线,基于播报消息生成播报任务;调用目标云播报设备以执行播报任务,响应于检测到执行所述播报任务时网络异常,调用连接服务以修复网络异常并重新执行所述播报任务直至执行成功,输出播报结果信息。可使用相对低廉的设备,降低成本。对于不稳定的网络导致的任务执行异常可以无痕恢复任务执行,提高任务执行成功率,并且不需要依赖厂商接口协议和规范,提高消息处理效率,保证消息处理时效。This embodiment obtains the corresponding user ID and terminal ID in response to the detection of payment transaction data, and then generates a broadcast message; based on the user ID and terminal ID, determines the target cloud broadcast device; obtains the state of the target cloud broadcast device, and responds to the state To be online, generate a broadcast task based on the broadcast message; call the target cloud broadcast device to perform the broadcast task, and in response to detecting that the network is abnormal when performing the broadcast task, call the connection service to repair the network exception and re-execute the broadcast task until the execution is successful , output broadcast result information. Relatively cheap equipment can be used to reduce costs. For task execution exceptions caused by unstable networks, task execution can be resumed without trace, improving the success rate of task execution, and does not need to rely on vendor interface protocols and specifications, improving message processing efficiency and ensuring message processing timeliness.
图2是根据本申请一个实施例的消息处理方法的主要流程示意图,如图2所示,消息处理方法包括:Fig. 2 is a schematic flow diagram of a main flow of a message processing method according to an embodiment of the present application. As shown in Fig. 2, the message processing method includes:
步骤S201,响应于检测到支付交易数据,获取对应的用户标识和终端标识。Step S201, in response to detecting the payment transaction data, obtain the corresponding user ID and terminal ID.
支付交易数据,例如可以是一用户在商家进行了商品消费支付产生的交易数据。The payment transaction data may be, for example, transaction data generated by a user paying for commodity consumption at a merchant.
用户标识可以是商家编码,终端标识可以是商家终端产品序列号(例如商家POS机的SN号)。The user identifier may be a merchant code, and the terminal identifier may be a serial number of a merchant's terminal product (for example, the SN number of a merchant's POS machine).
步骤S202,调用分布式消息队列,以从对应的消费分区集合中确定目标消费分区。Step S202, calling the distributed message queue to determine the target consumption partition from the corresponding consumption partition set.
分布式消息队列例如kafka,kafka对消息保存时根据主题Topic进行归类,发送消息者称为Producer,消息接受者称为Consumer,此外kafka集群有多个kafka实例组成,每个实例(server)称为broker(即kafka服务器)。一个主题下包含多个分区,每个分区为单独目录。示例的,分区命名规则为主题+有序序号,例如从零开始到分区n-1。本申请实施例中,示例的,kafka可以配置30个分区,一个主题。执行主体可以调用消费者线程随机抽取分区(或者根据指定的分区)以作为目标消费分区进行消息消费。Distributed message queues such as kafka, kafka classifies messages according to topics when saving them. The message sender is called Producer, and the message receiver is called Consumer. In addition, the kafka cluster consists of multiple kafka instances, and each instance (server) is called It is the broker (that is, the kafka server). A topic contains multiple partitions, and each partition is a separate directory. For example, the partition naming rule is topic + sequence number, for example, from zero to partition n-1. In the embodiment of this application, as an example, Kafka can be configured with 30 partitions and one topic. The execution subject can call the consumer thread to randomly extract partitions (or according to the specified partition) as the target consumption partition for message consumption.
步骤S203,调用目标消费分区,以基于用户标识和终端标识,生成播报消息。Step S203, invoking the target consumption partition to generate a broadcast message based on the user ID and the terminal ID.
调用消费者线程随机抽取分区以作为目标消费分区进行消费可以为调用目标消费分区以获取支付交易数据并根据用户标识(例如a)、终端标识(例如c与收款终端d存在支付交易)以及支付交易数据(例如y)生成播报消息(例如“d收到a的款项y元请查收”)。Calling the consumer thread to randomly extract partitions as the target consumption partition for consumption can be to call the target consumption partition to obtain payment transaction data, and according to the user identification (such as a), terminal identification (for example, there is a payment transaction between c and payment terminal d) and payment The transaction data (eg y) generates a broadcast message (eg "d received a payment of y yuan from a, please check").
步骤S204,基于用户标识和终端标识,确定目标云播报设备。Step S204, based on the user ID and the terminal ID, determine the target cloud broadcast device.
当用户标识对应的终端标识的数量为多个时,例如为2个或者2个以上时,可以获取用户设定的终端标识的优先级,进而根据优先级确定候选云播报设备列表。然后,执行主体可以根据优先级依次确定终端标识是否有已经绑定的云播报设备,若最高优先级对应的终端标识有已经绑定的云播报设备,例如云播报设备Q,则可以将该云播报设备Q确定为目标云播报设备。若最高优先级对应的终端标识没有已经绑定的云播报设备,则将次高优先级更新为最高优先级,若次高优先级对应的终端标识也没有已经绑定的云播报设备,则将次次高优先级更新为最高优先级,直至更新后的最高优先级对应的终端标识有已经绑定的云播报设备位为止。When the number of terminal identities corresponding to the user id is multiple, for example, 2 or more, the priority of the terminal identities set by the user can be obtained, and then the candidate cloud broadcast device list can be determined according to the priority. Then, the executive body can sequentially determine whether the terminal ID has a bound cloud broadcast device according to the priority. If the terminal ID corresponding to the highest priority has a bound cloud broadcast device, such as cloud broadcast device Q, the cloud broadcast device can be Broadcasting device Q is determined as the target cloud broadcasting device. If the terminal ID corresponding to the highest priority does not have a bound cloud broadcast device, update the second highest priority to the highest priority, and if the terminal ID corresponding to the second highest priority does not have a bound cloud broadcast device, the The next highest priority is updated to the highest priority until the terminal ID corresponding to the updated highest priority has a bound cloud broadcast device bit.
步骤S205,获取目标云播报设备的状态,响应于状态为在线,基于播报消息生成播报任务。Step S205, acquiring the status of the target cloud broadcast device, and generating a broadcast task based on the broadcast message in response to the status being online.
目标云播报设备,例如音箱的状态可以为已绑定且在线状态、已绑定且未在线状态、未绑定且在线状态、未绑定且未在线状态等,本申请实施例对目标云播报设备的状态不做具体限定。The status of the target cloud broadcast device, such as a speaker, can be bound and online, bound and offline, unbound and online, unbound and offline, etc. The embodiment of the present application broadcasts to the target cloud The state of the device is not specifically limited.
响应于目标云播报设备的状态为已绑定且在线状态,则基于播报消息生成播报任务。该播报任务可以为同步执行的任务也可以为异步执行的任务,本申请实施例对播报任务的类型不做具体限定。In response to the state of the target cloud broadcast device being bound and online, a broadcast task is generated based on the broadcast message. The broadcast task may be a task executed synchronously or asynchronously, and the embodiment of the present application does not specifically limit the type of the broadcast task.
步骤S206,调用目标云播报设备以执行播报任务,响应于检测到执行所述播报任务时网络异常,调用连接服务以修复网络异常并重新执行所述播报任务直至执行成功,输出播报结果信息。Step S206, calling the target cloud broadcasting device to execute the broadcasting task, in response to detecting a network abnormality during the execution of the broadcasting task, calling the connection service to repair the network abnormality and re-executing the broadcasting task until the execution is successful, and outputting the broadcasting result information.
调用目标云播报设备以根据播报任务的时间和类型执行相对应的播报任务,响应于检测到执行所述播报任务时网络异常,调用连接服务以修复网络异常并重新执行所述播报任务直至执行成功,输出播报结果信息。示例的,播报结果信息可以包括播报任务消息编号、处理结果信息、失败描述信息等,本申请实施例对播报结果信息不做具体限定。Call the target cloud broadcast device to execute the corresponding broadcast task according to the time and type of the broadcast task, in response to detecting a network anomaly when executing the broadcast task, call the connection service to repair the network anomaly and re-execute the broadcast task until the execution is successful , output broadcast result information. For example, the broadcast result information may include the broadcast task message number, processing result information, failure description information, etc., and the embodiment of the present application does not specifically limit the broadcast result information.
具体地,在输出消息处理结果报文之后,消息处理方法还包括:解析消息处理结果报文,以获取播报任务消息编号、处理结果状态和失败描述信息字段值;基于播报任务消息编号、处理结果状态和失败描述信息字段值更新目标云播报设备日志。Specifically, after outputting the message processing result message, the message processing method further includes: parsing the message processing result message to obtain the broadcast task message number, processing result status and failure description information field value; Status and failure description field values update the target cloud broadcast device log.
本申请实施例可使用相对低廉的设备,降低成本。对于不稳定的网络导致的任务执行异常可以无痕恢复任务执行,提高任务执行成功率,并且不需要依赖厂商接口协议和规范,提高消息处理效率,保证消息处理时效。In this embodiment of the present application, relatively cheap equipment can be used to reduce costs. For task execution exceptions caused by unstable networks, task execution can be resumed without trace, improving the success rate of task execution, and does not need to rely on vendor interface protocols and specifications, improving message processing efficiency and ensuring message processing timeliness.
图3是根据本申请一个实施例的消息处理方法的主要流程示意图,如图3所示,消息处理方法包括:Fig. 3 is a schematic flowchart of a main message processing method according to an embodiment of the present application. As shown in Fig. 3, the message processing method includes:
步骤S301,响应于检测到支付交易数据,获取对应的用户标识和终端标识。Step S301, in response to detecting the payment transaction data, obtain the corresponding user ID and terminal ID.
支付交易数据可以是租房交易数据。用户标识可以为租房交易数据对应的租房用户名称等。终端标识可以为租房用户对应的手持终端产品序列号(例如SN号)。The payment transaction data may be house rental transaction data. The user identifier may be the name of the user who rents the house corresponding to the house-renting transaction data, and the like. The terminal identifier may be the serial number (eg SN number) of the handheld terminal product corresponding to the renting user.
步骤S302,调用分布式消息队列,以从对应的消费分区集合中确定目标消费分区。Step S302, calling the distributed message queue to determine the target consumption partition from the corresponding consumption partition set.
分布式消息队列可以从消费分区集合中确定出空闲分区,进而将该空闲分区确定为目标消费分区。The distributed message queue can determine an idle partition from the set of consumption partitions, and then determine the idle partition as the target consumption partition.
步骤S303,调用目标消费分区,以基于用户标识和终端标识,生成播报消息。Step S303, calling the target consumption partition to generate a broadcast message based on the user ID and the terminal ID.
目标消费分区可以调用消息生成程序以根据用户标识和终端标识以及支付交易数据生成对应的播报消息。The target consumption partition can call the message generation program to generate a corresponding broadcast message according to the user ID, terminal ID, and payment transaction data.
步骤S304,确定与用户标识和终端标识绑定的一个或多个设备标识对应的云播报设备。Step S304, determining the cloud broadcast device corresponding to one or more device identifiers bound with the user identifier and the terminal identifier.
步骤S305,获取一个或多个设备标识对应的云播报设备中的未执行播报任务数量。Step S305, acquiring the number of unexecuted broadcast tasks in the cloud broadcast device corresponding to one or more device identifiers.
步骤S306,基于未执行播报任务数量,确定目标云播报设备。Step S306, based on the number of unexecuted broadcast tasks, determine the target cloud broadcast device.
在用户标识和终端标识绑定有一个或者多个云播报设备时,可以根据该一个或者多个云播报设备中的待播报任务的数量(也就是未执行播报任务的数量),确定目标云播报设备。例如可以将待播报任务的数量最少的绑定的云播报设备确定为目标云播报设备,以提升对播报任务的执行效率。When the user ID and the terminal ID are bound to one or more cloud broadcast devices, the target cloud broadcast can be determined according to the number of tasks to be broadcast (that is, the number of unexecuted broadcast tasks) in the one or more cloud broadcast devices equipment. For example, the bound cloud broadcast device with the least number of tasks to be broadcast may be determined as the target cloud broadcast device, so as to improve the execution efficiency of the broadcast task.
具体地,基于未执行播报任务数量,确定目标云播报设备,包括:对未执行播报任务数量进行递增排序;将排序第一的未执行播报任务数量对应的云播报设备(也就是未执行播报任务数量最少的云播报设备)确定为目标云播报设备。Specifically, based on the number of unexecuted broadcast tasks, determining the target cloud broadcast device includes: sorting the number of unexecuted broadcast tasks incrementally; The cloud broadcast device with the least number) is determined as the target cloud broadcast device.
步骤S307,获取目标云播报设备的状态,响应于状态为在线,基于播报消息生成播报任务。Step S307, acquiring the status of the target cloud broadcast device, and generating a broadcast task based on the broadcast message in response to the status being online.
目标云播报设备的数量可以为一个也可以为多个,当目标云播报设备的数量为多个时,执行主体可以查询设备信息以确定出在线状态的目标云播报设备,并基于在线状态的目标云播报设备的SN号生成基于播报消息的播报任务。在播报任务中加入SN号可以使得对播报任务的执行设备更明确,避免产生设备执行任务混乱的情况。The number of target cloud broadcasting devices can be one or more. When the number of target cloud broadcasting devices is multiple, the execution subject can query the device information to determine the online status of the target cloud broadcasting device, and based on the online status of the target cloud broadcasting device The SN number of the cloud broadcast device generates a broadcast task based on the broadcast message. Adding the SN number to the broadcast task can make the execution device of the broadcast task clearer, and avoid the confusion of the device performing the task.
在查询设备信息时,示例的,商户可以通过移动端H5页面查询云播报设备列表,根据音箱SN号查询该设备绑定的信息,进而确定设备状态。示例的,商户点击移动端H5云播报设备列表页的某个音箱,获取到音箱SN号,将音箱SN号发送至音箱绑定信息管理模块以判断音箱是否存在,若否则提示云播报设备不存在进而跳转到云播报设备列表页,若是则基于音箱SN号查询音箱详情信息,并将音箱详情信息(例如音箱名称、音箱SN号、音箱状态是在线还是下线)以及商户编号、备注、终端编号在移动端H5云播报设备详情页展示。When querying device information, for example, merchants can query the list of cloud broadcast devices through the H5 page of the mobile terminal, query the information bound to the device according to the SN number of the speaker, and then determine the status of the device. For example, the merchant clicks on a speaker on the H5 cloud broadcast device list page on the mobile terminal, obtains the speaker SN, and sends the speaker SN to the speaker binding information management module to determine whether the speaker exists. If not, it prompts that the cloud broadcast device does not exist And then jump to the cloud broadcast device list page, if so, query the detailed information of the speaker based on the SN number of the speaker, and send the detailed information of the speaker (such as the name of the speaker, the SN number of the speaker, whether the status of the speaker is online or offline), as well as the merchant number, remarks, terminal The number is displayed on the H5 cloud broadcast device details page on the mobile terminal.
步骤S308,调用目标云播报设备以执行播报任务,响应于检测到执行所述播报任务时网络异常,调用连接服务以修复网络异常并重新执行所述播报任务直至执行成功,输出播报结果信息。Step S308, calling the target cloud broadcasting device to execute the broadcasting task, in response to detecting a network abnormality during the execution of the broadcasting task, calling the connection service to repair the network abnormality and re-executing the broadcasting task until the execution is successful, and outputting broadcast result information.
具体地,在响应于检测到执行所述播报任务时网络异常,调用连接服务以修复网络异常并重新执行所述播报任务直至执行成功,输出播报结果信息之后,消息处理方法还包括:响应于播报任务为目标云播报设备对应的播报任务列表中的最后一个播报任务,更新状态为下线。Specifically, in response to detecting a network anomaly when executing the broadcast task, calling the connection service to repair the network anomaly and re-executing the broadcast task until the execution is successful, after outputting the broadcast result information, the message processing method further includes: responding to the broadcast The task is the last broadcast task in the broadcast task list corresponding to the target cloud broadcast device, and the update status is offline.
示例的,在云播报设备关机下线后,推送下线主体,更新云播报设备为下线状态,即离线状态。例如,云播报设备为音箱,音箱断开连接,通过消息队列遥感传输协议(MQTT协议)向设备下线主题①推送音箱下线消息,云播报设备管理服务系统获取客户端ClientId和音箱SN号并发送至音箱绑定信息管理模块,并由音箱绑定信息管理模块更新音箱为离线状态并将更新后的音箱的离线状态保存至redis数据库。For example, after the cloud broadcast device is shut down and offline, push the offline subject, and update the cloud broadcast device to the offline state, that is, the offline state. For example, if the cloud broadcast device is a speaker, and the speaker is disconnected, the speaker offline message is pushed to the device offline topic ① through the message queue remote sensing transmission protocol (MQTT protocol). The cloud broadcast device management service system obtains the client ClientId and the speaker SN number and Send it to the speaker binding information management module, and the speaker binding information management module updates the speaker as offline and saves the updated offline status of the speaker to the redis database.
本申请实施例可使用相对低廉的设备,降低成本。对于不稳定的网络导致的任务执行异常可以无痕恢复任务执行,提高任务执行成功率,并且不需要依赖厂商接口协议和规范,提高消息处理效率,保证消息处理时效。In this embodiment of the present application, relatively cheap equipment can be used to reduce costs. For task execution exceptions caused by unstable networks, task execution can be resumed without trace, improving the success rate of task execution, and does not need to rely on vendor interface protocols and specifications, improving message processing efficiency and ensuring message processing timeliness.
在本申请的一个实施例中,消费者在扫码支付后,通过推送模块推送所有支付交易数据,交易数据中包含了商户编号,终端编号(例如pos机、柜台号等),由于数据量比较大,通过kafka消息队列分了30个分区,消费者线程随机抽取分区消费,根据商户是否绑定云播报设备完成消息推送。音箱调度模块接收到kafka消息队列推送的消息并解析得到商户编号、终端编号等信息,并将商户编号、终端编号发送至音箱信息绑定模块以基于商户编号、终端编号获取商户、商户终端与音箱的绑定信息,并存储至redis数据库。云播报设备(例如音箱)与商户绑定后,可以通过选择商户名下的支付终端进行绑定,用于播报消息的推送,在绑定过程中还需要验证终端编号是否重复添加,以保证消息推送的准确性。音箱信息绑定模块过滤筛选判断商户、商户终端是否绑定有音箱,若否则不推送播报消息,若是则继续判断音箱是否在线,若不在线则不推送播报消息,若在线则执行主体调用音箱调度模块以发送全局流水号、商户编号、订单编号、音箱SN号、数据来源等信息至一下音箱日志模块,由音箱日志模块修改播报任务记录并更新,进而执行主体调用音箱调度模块以将报文数据格式化为引线更能够解析的数据格式,并将播报消息推送至播报消息接收主题③,推送质量QOS=0,离线消息保留retail=true,设定离线消息保留时间等。基于MQTT协议推送播报消息至音箱,音箱执行播报消息的播报,并将播报消息处理结果推送到消息处理结果主题②,推送质量QOS=2,离线消息保留retail=false,并通过MQTT协议将播报消息处理结果推送至音箱调度模块,由音箱调度模块解析消息处理结果报文,获取播报任务消息编号、处理结果状态、失败描述信息字段值,并将播报任务消息编号、处理结果状态、失败描述信息发送至音箱日志模块,由音箱日志模块执行对播报消息处理结果的更新。全流程采用了kafka分布式消息队列,对并发请求进行销峰,redis内存数据库,把常用数据缓存起来,降低对数据库的压力。In one embodiment of the present application, after the consumer scans the code for payment, he pushes all payment transaction data through the push module. The transaction data includes the merchant number and terminal number (such as POS machine, counter number, etc.). Large, 30 partitions are divided through the kafka message queue, and the consumer thread randomly selects the partitions for consumption, and completes the message push according to whether the merchant is bound to the cloud broadcast device. The speaker scheduling module receives the message pushed by the kafka message queue and parses to obtain information such as the merchant number and terminal number, and sends the merchant number and terminal number to the speaker information binding module to obtain the merchant, merchant terminal and speaker based on the merchant number and terminal number The binding information is stored in the redis database. After the cloud broadcast device (such as a speaker) is bound to the merchant, it can be bound by selecting the payment terminal under the merchant's name to push the broadcast message. During the binding process, it is also necessary to verify whether the terminal number is added repeatedly to ensure that the message push accuracy. The speaker information binding module filters and judges whether the merchant and the merchant terminal are bound with a speaker. If not, it does not push the broadcast message. If so, it continues to judge whether the speaker is online. If it is not online, it does not push the broadcast message. If it is online, the main body calls the speaker scheduling. The module sends information such as the global serial number, merchant number, order number, speaker SN number, data source, etc. to the next speaker log module, and the speaker log module modifies and updates the broadcast task record, and then the execution subject calls the speaker scheduling module to send the message data Format it into a data format that can be more parsed by the lead, and push the broadcast message to the broadcast message receiving topic ③, the push quality QOS=0, offline message retention retail=true, set the offline message retention time, etc. Push the broadcast message to the speaker based on the MQTT protocol. The speaker performs the broadcast of the broadcast message, and pushes the broadcast message processing result to the message processing result topic ②, push quality QOS=2, keep offline messages retail=false, and broadcast the message through the MQTT protocol The processing result is pushed to the speaker scheduling module, and the speaker scheduling module parses the message processing result message, obtains the broadcast task message number, processing result status, and failure description information field value, and sends the broadcast task message number, processing result status, and failure description information to To the speaker log module, the speaker log module performs the updating of the broadcast message processing result. The whole process adopts Kafka distributed message queue to pin the peak of concurrent requests, redis memory database, and caches commonly used data to reduce the pressure on the database.
图4是根据本申请一个实施例的消息处理方法的系统架构示意图。将云播报设备与系统服务保持长连接。发布/订阅模式:基于一个事件通道,接手通知的对象通过自定义事件订阅主体,被激活事件的对象通过发布主体事件的方式通知订阅者该主体的对象。消息的订阅和发布,可以实现布者和订阅者之间一对一的关系。展示层,提供移动端h5和PC的系统功能运维界面,方便商户、运维人员查询、设备绑定/解绑操作。服务层-对外硬件设备打印机/音响:用于云播报设备与MQTT服务保持长连接。服务层-云播报设备信息管理模块:是商户和设备信息绑定/解绑模块。服务层-云播报设备调度模块:消息订阅和发布。服务层-云播报设备日志管理模块:对消息推送的监控,包括消息总数、成功数、失败数及成功率。服务层-云播报设备报表统计模块:对消息的报表统计。持久层:MYSQL、Redis用于进行数据的持久化存储。Fig. 4 is a schematic diagram of a system architecture of a message processing method according to an embodiment of the present application. Keep a persistent connection between the cloud broadcast device and the system service. Publish/subscribe mode: Based on an event channel, the object that takes over the notification subscribes to the subject through a custom event, and the object that is activated events notifies the subscribers of the subject object by publishing the subject event. Subscription and publication of messages can realize a one-to-one relationship between publishers and subscribers. The display layer provides the system function operation and maintenance interface of mobile terminal h5 and PC, which is convenient for merchants, operation and maintenance personnel to query, and device binding/unbinding operations. Service layer-external hardware device printer/audio: used to maintain a long connection between the cloud broadcast device and the MQTT service. Service layer-cloud broadcast device information management module: it is a module for binding/unbinding merchant and device information. Service layer-cloud broadcast device scheduling module: message subscription and publishing. Service layer-cloud broadcast device log management module: monitoring of message push, including total number of messages, number of successes, number of failures and success rate. Service layer-cloud broadcast device report statistics module: report statistics on messages. Persistence layer: MYSQL and Redis are used for persistent storage of data.
本申请实施例中,云播报设备管理服务系统上线后,为云播报设备提供MQTT连接服务,发布和订阅主题,推送播报消息,监听返回结果,对播报失败消息执行消息重发机制。最后生成报表。示例的,用户通过云播报设备管理服务系统启动消息播报项目,连接MQTT,将用户名username、密码password、客户端ClienId、心跳时间keepAlive、连接超时时间timeout发送至MQTT以进行连接,在接收到MQTT返回的连接成功的信息后,向MQTT订阅MQTT系统自带设备上下线主题(更新音箱在线状态、主题模式为通配符,同时监听上下线)①、订阅播报任务消息处理结果主题(更新播报结果状态、主题模式为通配符)②,并在订阅成功后启动生成非对称加密秘钥对的定时任务,每隔3分钟检测redis中的密钥对是否小于3000对,若小于3000对则生成5000对秘钥数量进行补充,为批量导入云播报设备做准备;将厂商白名单信息存入redis为绑定云播报设备与加密下发云播报设备连接MQTT用户信息、数据传输加解密公钥做准备。并监听音箱上线消息MQTT推送,获取对应的音箱客户端ClienID(音箱SN号)并发送至音箱绑定信息管理模块,由音箱绑定信息管理模块更新音箱在线状态,更新音箱状态为在线状态将音箱的在线状态存储至redis,进而执行主体可以调用云播报设备管理服务系统为音箱创建并订阅接收播报消息主题③,在接收到下发的支付信息时推送支付信息到接收播报消息接收主题③,主题规则/terminalPublish/printOrVoice/设备SN号/设备类型编号。并由MQTT推送支付信息至具体音箱,监听音箱播报后反馈消息②,解析反馈消息报文,获取消息编号、消息处理状态、失败处理描述字段值并发送至音箱调度模块以根据消息编号更新播报任务处理状态、失败梳理描述等。In the embodiment of this application, after the cloud broadcast device management service system is online, it provides MQTT connection service for the cloud broadcast device, publishes and subscribes topics, pushes broadcast messages, monitors the returned results, and implements a message resending mechanism for broadcast failure messages. Finally generate the report. For example, the user starts the message broadcast project through the cloud broadcast device management service system, connects to MQTT, and sends the user name username, password password, client ClientId, heartbeat time keepAlive, and connection timeout timeout to MQTT for connection. After receiving MQTT After the successful connection information is returned, subscribe to the MQTT system's own equipment offline topic (update the online status of the speaker, the topic mode is a wildcard, and monitor the online and offline) ①, subscribe to the broadcast task message processing result topic (update the broadcast result status, The topic mode is a wildcard)②, and start the scheduled task of generating asymmetric encryption key pairs after the subscription is successful, and check whether the key pairs in redis are less than 3000 pairs every 3 minutes, and if they are less than 3000 pairs, generate 5000 pairs of secret keys Supplement the quantity to prepare for the batch import of cloud broadcast devices; store the manufacturer whitelist information in redis to prepare for binding cloud broadcast devices and encrypting cloud broadcast devices to connect MQTT user information and data transmission encryption and decryption public keys. And monitor the MQTT push of the speaker's online message, obtain the corresponding speaker client ClienID (speaker SN number) and send it to the speaker binding information management module, and the speaker binding information management module will update the speaker's online status, update the speaker's status to the online status and turn the speaker The online status is stored in redis, and then the execution subject can call the cloud broadcast device management service system to create and subscribe to the topic of receiving broadcast messages for the speakers③, and push the payment information to receive the topic of receiving broadcast messages③ when receiving the payment information. Rules/terminalPublish/printOrVoice/device SN number/device type number. And MQTT pushes the payment information to the specific speaker, listens to the feedback message ② after the speaker broadcasts, parses the feedback message message, obtains the message number, message processing status, failure processing description field value and sends it to the speaker scheduling module to update the broadcast task according to the message number Processing status, failure sorting description, etc.
本申请实施例中,云播报设备上线后云播报设备注册成功,开机自动连接MQTT服务,完成密码校验后自动发布/订阅消息。根据支付成功消息,推送到连接MQTT的设备中。示例的,音箱绑定信息管理模块根据音箱SN号获取MQTT用户认证信息、数据传输加解密公钥,进行MQTT用户认证信息、数据传输加解密公钥密文下发,音箱连接MQTT,MQTT进行用户信息认证、主题读写权限校验,并将结果存储至MYSQL数据库中。MQTT推送设备上线主体①推送音箱上线消息至云播报设备管理服务系统,由云播报设备管理服务系统发送客户端ClientID(音箱SN号)至音箱绑定信息管理模块,由音箱绑定信息管理模块更新音箱为在线状态,将更新的音箱在线状态保存至redis数据库。云播报设备管理服务系统为音箱创建并订阅接收播报消息的主体③,推送测试消息到播报任务接收主题③,MQTT推送测试消息至具体音箱,音箱连接服务器成功时,播报连接服务成功语音提醒,若接收的第一笔数据为交易数据则播报交易数据。In the embodiment of this application, after the cloud broadcast device is online, the cloud broadcast device is registered successfully, automatically connects to the MQTT service when it is turned on, and automatically publishes/subscribes messages after completing the password verification. According to the payment success message, it is pushed to the device connected to MQTT. For example, the speaker binding information management module obtains MQTT user authentication information, data transmission encryption and decryption public key according to the speaker SN number, and sends the MQTT user authentication information, data transmission encryption and decryption public key ciphertext, the speaker is connected to MQTT, and MQTT performs user authentication. Information authentication, topic read and write permission verification, and store the results in the MYSQL database. MQTT push device online subject ①Push the speaker online message to the cloud broadcast device management service system, and the cloud broadcast device management service system sends the client ClientID (speaker SN number) to the speaker binding information management module, which is updated by the speaker binding information management module The speaker is online, and the updated online status of the speaker is saved to the redis database. The cloud broadcast device management service system creates and subscribes to the subject of receiving broadcast messages for the speakers ③, pushes the test message to the broadcast task receiving topic ③, and MQTT pushes the test message to the specific speaker. If the first data received is transaction data, the transaction data will be broadcast.
本申请实施例使用了消息队列遥感传输协议,作为一种低开销、低带宽占用的即时通讯协议取代了http协议,大幅降低了音箱打印机设备硬件成本要求。由行内统一构建接口协议和规范,厂商负责适配,减少了不同厂商设备对接的开发。服务不依赖设备厂商,而是厂商依赖行内服务。本申请实施例保护支付交易数据的安全性,并没有采用厂商云服务,数据不需要发送到厂商后端服务,而是由行内建立云服务,数据推送到音响、打印机。克服了传统的http协议对硬件设备较高的性能要求,可使用相对低廉的设备,降低成本。统一制定接口协议和规范,由厂商适配行内服务,并不需要依赖厂商接口协议和规范。The embodiment of the present application uses the message queue remote sensing transmission protocol, which replaces the http protocol as an instant messaging protocol with low overhead and low bandwidth occupation, and greatly reduces the hardware cost requirements of the speaker and printer equipment. The interface protocols and specifications are unified within the industry, and manufacturers are responsible for adaptation, which reduces the development of equipment docking between different manufacturers. Services do not depend on equipment manufacturers, but manufacturers rely on in-line services. The embodiment of this application protects the security of the payment transaction data, and does not use the manufacturer's cloud service. The data does not need to be sent to the manufacturer's back-end service, but the cloud service is established in the industry, and the data is pushed to the stereo and printer. It overcomes the high performance requirements of the traditional http protocol on hardware equipment, and can use relatively cheap equipment to reduce costs. Interface protocols and specifications are formulated uniformly, and manufacturers adapt in-line services without relying on manufacturer interface protocols and specifications.
图5是根据本申请实施例的消息处理装置的主要单元的示意图。如图5所示,消息处理装置500包括获取单元501、设备确定单元502任务生成单元503和执行单元504。Fig. 5 is a schematic diagram of main units of a message processing device according to an embodiment of the present application. As shown in FIG. 5 , the
获取单元501,被配置成响应于检测到支付交易数据,获取对应的用户标识和终端标识,进而生成播报消息。The obtaining
设备确定单元502,被配置成基于用户标识和终端标识,确定目标云播报设备。The
任务生成单元503,被配置成获取目标云播报设备的状态,响应于状态为在线,基于播报消息生成播报任务。The
执行单元504,被配置成调用目标云播报设备以执行播报任务,响应于检测到执行所述播报任务时网络异常,调用连接服务以修复网络异常并重新执行所述播报任务直至执行成功,输出播报结果信息。The
在一些实施例中,获取单元501进一步被配置成:调用分布式消息队列,以从对应的消费分区集合中确定目标消费分区;调用目标消费分区,以基于用户标识和终端标识,生成播报消息。In some embodiments, the obtaining
在一些实施例中,设备确定单元502进一步被配置成:确定与用户标识和终端标识绑定的一个或多个设备标识对应的云播报设备;获取一个或多个设备标识对应的云播报设备中的未执行播报任务数量;基于未执行播报任务数量,确定目标云播报设备。In some embodiments, the
在一些实施例中,设备确定单元502进一步被配置成:对未执行播报任务数量进行递增排序;将排序第一的未执行播报任务数量对应的云播报设备确定为目标云播报设备。In some embodiments, the
在一些实施例中,执行单元504进一步被配置成:响应于当前时间到达播报任务对应的预设执行时间,将播报任务对应的报文消息格式化为目标云播报设备可解析消息;调用目标云播报设备播报目标云播报设备可解析消息;输出消息处理结果报文。In some embodiments, the
在一些实施例中,执行单元504进一步被配置成:解析消息处理结果报文,以获取播报任务消息编号、处理结果状态和失败描述信息字段值;基于播报任务消息编号、处理结果状态和失败描述信息字段值更新目标云播报设备日志。In some embodiments, the
在一些实施例中,消息处理装置还包括图5中未示出的状态更新单元,被配置成:响应于播报任务为目标云播报设备对应的播报任务列表中的最后一个播报任务,更新状态为下线。In some embodiments, the message processing apparatus further includes a status update unit not shown in FIG. 5, configured to: in response to the broadcast task being the last broadcast task in the broadcast task list corresponding to the target cloud broadcast device, the update status is offline.
需要说明的是,本申请的消息处理方法和消息处理装置在具体实施内容上具有相应关系,故重复内容不再说明。It should be noted that the message processing method and the message processing device of the present application have a corresponding relationship in specific implementation content, so repeated content will not be described again.
图6示出了可以应用本申请实施例的消息处理方法或消息处理装置的示例性系统架构600。Fig. 6 shows an
如图6所示,系统架构600可以包括终端设备601、602、603,网络604和服务器605。网络604用以在终端设备601、602、603和服务器605之间提供通信链路的介质。网络604可以包括各种连接类型,例如有线、无线通信链路或者光纤电缆等等。As shown in FIG. 6 , a
用户可以使用终端设备601、602、603通过网络604与服务器605交互,以接收或发送消息等。终端设备601、602、603上可以安装有各种通讯客户端应用,例如购物类应用、网页浏览器应用、搜索类应用、即时通信工具、邮箱客户端、社交平台软件等(仅为示例)。Users can use
终端设备601、602、603可以是具有消息处理屏并且支持网页浏览的各种电子设备,包括但不限于智能手机、平板电脑、膝上型便携计算机和台式计算机等等。The
服务器605可以是提供各种服务的服务器,例如对用户利用终端设备601、602、603所检测到的支付交易数据提供支持的后台管理服务器(仅为示例)。后台管理服务器可以响应于检测到支付交易数据,获取对应的用户标识和终端标识,进而生成播报消息;基于用户标识和终端标识,确定目标云播报设备;获取目标云播报设备的状态,响应于状态为在线,基于播报消息生成播报任务;调用目标云播报设备以执行播报任务,响应于检测到执行所述播报任务时网络异常,调用连接服务以修复网络异常并重新执行所述播报任务直至执行成功,输出播报结果信息。可使用相对低廉的设备,降低成本。对于不稳定的网络导致的任务执行异常可以无痕恢复任务执行,提高任务执行成功率,并且不需要依赖厂商接口协议和规范,提高消息处理效率,保证消息处理时效。The
需要说明的是,本申请实施例所提供的消息处理方法一般由服务器605执行,相应地,消息处理装置一般设置于服务器605中。It should be noted that the message processing method provided in the embodiment of the present application is generally executed by the
应该理解,图6中的终端设备、网络和服务器的数目仅仅是示意性的。根据实现需要,可以具有任意数目的终端设备、网络和服务器。It should be understood that the numbers of terminal devices, networks and servers in FIG. 6 are only illustrative. According to the implementation needs, there can be any number of terminal devices, networks and servers.
下面参考图7,其示出了适于用来实现本申请实施例的终端设备的计算机系统700的结构示意图。图7示出的终端设备仅仅是一个示例,不应对本申请实施例的功能和使用范围带来任何限制。Referring now to FIG. 7 , it shows a schematic structural diagram of a
如图7所示,计算机系统700包括中央处理单元(CPU)701,其可以根据存储在只读存储器(ROM)702中的程序或者从存储部分708加载到随机访问存储器(RAM)703中的程序而执行各种适当的动作和处理。在RAM703中,还存储有计算机系统700操作所需的各种程序和数据。CPU701、ROM702以及RAM703通过总线704彼此相连。输入/输出(I/O)接口705也连接至总线704。As shown in FIG. 7 , a
以下部件连接至I/O接口705:包括键盘、鼠标等的输入部分706;包括诸如阴极射线管(CRT)、液晶征信授权查询处理器(LCD)等以及扬声器等的输出部分707;包括硬盘等的存储部分708;以及包括诸如LAN卡、调制解调器等的网络接口卡的通信部分709。通信部分709经由诸如因特网的网络执行通信处理。驱动器710也根据需要连接至I/O接口705。可拆卸介质711,诸如磁盘、光盘、磁光盘、半导体存储器等等,根据需要安装在驱动器710上,以便于从其上读出的计算机程序根据需要被安装入存储部分708。The following components are connected to the I/O interface 705: an
特别地,根据本申请公开的实施例,上文参考流程图描述的过程可以被实现为计算机软件程序。例如,本申请公开的实施例包括一种计算机程序产品,其包括承载在计算机可读介质上的计算机程序,该计算机程序包含用于执行流程图所示的方法的程序代码。在这样的实施例中,该计算机程序可以通过通信部分709从网络上被下载和安装,和/或从可拆卸介质711被安装。在该计算机程序被中央处理单元(CPU)701执行时,执行本申请的系统中限定的上述功能。In particular, according to the embodiments disclosed in the present application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, the embodiments disclosed in this application include a computer program product, which includes a computer program carried on a computer-readable medium, where the computer program includes program codes for executing the methods shown in the flowcharts. In such an embodiment, the computer program may be downloaded and installed from a network via
需要说明的是,本申请所示的计算机可读介质可以是计算机可读信号介质或者计算机可读存储介质或者是上述两者的任意组合。计算机可读存储介质例如可以包括但不限于电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。计算机可读存储介质的更具体的例子可以包括但不限于:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机访问存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑磁盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本申请中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。而在本申请中,计算机可读的信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了计算机可读的程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。计算机可读的信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。计算机可读介质上包含的程序代码可以用任何适当的介质传输,包括但不限于:无线、电线、光缆、RF等等,或者上述的任意合适的组合。It should be noted that the computer-readable medium shown in this application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. A computer-readable storage medium, for example, may include, but is not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to, electrical connections with one or more wires, portable computer diskettes, hard disks, random access memory (RAM), read-only memory (ROM), erasable Programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this application, however, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, in which computer-readable program codes are carried. Such propagated data signals may take many forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device. . Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
附图中的流程图和框图,图示了按照本申请各种实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段、或代码的一部分,上述模块、程序段、或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个接连地表示的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图或流程图中的每个方框、以及框图或流程图中的方框的组合,可以用执行规定的功能或操作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。The flowchart and block diagrams in the Figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. In this regard, each block in a flowchart or block diagram may represent a module, program segment, or portion of code that includes one or more logical functions for implementing specified executable instructions. It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or they may sometimes be executed in the reverse order, depending upon the functionality involved. It should also be noted that each block in the block diagrams or flowchart illustrations, and combinations of blocks in the block diagrams or flowchart illustrations, can be implemented by a dedicated hardware-based system that performs the specified function or operation, or can be implemented by a A combination of dedicated hardware and computer instructions.
描述于本申请实施例中所涉及到的单元可以通过软件的方式实现,也可以通过硬件的方式来实现。所描述的单元也可以设置在处理器中,例如,可以描述为:一种处理器包括获取单元、设备确定单元、任务生成单元和执行单元。其中,这些单元的名称在某种情况下并不构成对该单元本身的限定。The units involved in the embodiments described in the present application may be implemented by means of software or by means of hardware. The described units may also be set in a processor. For example, it may be described as: a processor includes an acquisition unit, a device determination unit, a task generation unit, and an execution unit. Wherein, the names of these units do not constitute a limitation of the unit itself under certain circumstances.
作为另一方面,本申请还提供了一种计算机可读介质,该计算机可读介质可以是上述实施例中描述的设备中所包含的;也可以是单独存在,而未装配入该设备中。上述计算机可读介质承载有一个或者多个程序,当上述一个或者多个程序被一个该设备执行时,使得该设备响应于检测到支付交易数据,获取对应的用户标识和终端标识,进而生成播报消息;基于用户标识和终端标识,确定目标云播报设备;获取目标云播报设备的状态,响应于状态为在线,基于播报消息生成播报任务;调用目标云播报设备以执行播报任务,响应于检测到执行所述播报任务时网络异常,调用连接服务以修复网络异常并重新执行所述播报任务直至执行成功,输出播报结果信息。As another aspect, the present application also provides a computer-readable medium. The computer-readable medium may be contained in the device described in the above embodiments, or may exist independently without being assembled into the device. The above-mentioned computer-readable medium carries one or more programs, and when the above-mentioned one or more programs are executed by the device, the device responds to the detection of payment transaction data, acquires the corresponding user ID and terminal ID, and then generates a broadcast message; based on the user ID and the terminal ID, determine the target cloud broadcast device; acquire the status of the target cloud broadcast device, and generate a broadcast task based on the broadcast message in response to the status being online; call the target cloud broadcast device to execute the broadcast task, and respond to the detected When the broadcast task is executed, the network is abnormal, and the connection service is called to repair the network abnormality, and the broadcast task is re-executed until the execution is successful, and the broadcast result information is output.
本申请的计算机程序产品,包括计算机程序,计算机程序在被处理器执行时实现本申请实施例中的消息处理方法。The computer program product of the present application includes a computer program, and when the computer program is executed by a processor, the message processing method in the embodiment of the present application is implemented.
根据本申请实施例的技术方案,可使用相对低廉的设备,降低成本。对于不稳定的网络导致的任务执行异常可以无痕恢复任务执行,提高任务执行成功率,并且不需要依赖厂商接口协议和规范,提高消息处理效率,保证消息处理时效。According to the technical solutions of the embodiments of the present application, relatively cheap equipment can be used to reduce costs. For task execution exceptions caused by unstable networks, task execution can be resumed without trace, improving the success rate of task execution, and does not need to rely on vendor interface protocols and specifications, improving message processing efficiency and ensuring message processing timeliness.
上述具体实施方式,并不构成对本申请保护范围的限制。本领域技术人员应该明白的是,取决于设计要求和其他因素,可以发生各种各样的修改、组合、子组合和替代。任何在本申请的精神和原则之内所作的修改、等同替换和改进等,均应包含在本申请保护范围之内。The above specific implementation methods are not intended to limit the protection scope of the present application. It should be apparent to those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modifications, equivalent replacements and improvements made within the spirit and principles of this application shall be included within the protection scope of this application.
Claims (16)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202310001639.0A CN115988058B (en) | 2023-01-03 | 2023-01-03 | A message processing method, device, electronic device and computer readable medium |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202310001639.0A CN115988058B (en) | 2023-01-03 | 2023-01-03 | A message processing method, device, electronic device and computer readable medium |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN115988058A true CN115988058A (en) | 2023-04-18 |
| CN115988058B CN115988058B (en) | 2025-07-04 |
Family
ID=85972104
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202310001639.0A Active CN115988058B (en) | 2023-01-03 | 2023-01-03 | A message processing method, device, electronic device and computer readable medium |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN115988058B (en) |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN118470869A (en) * | 2024-05-11 | 2024-08-09 | 珠海横琴中澳通电子支付技术有限公司 | ECR mode electronic cash register simulation system and simulation method |
| CN119762055A (en) * | 2024-12-25 | 2025-04-04 | 中国工商银行股份有限公司 | Message sending method, message processing method, message processing system and device |
Citations (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20120158589A1 (en) * | 2010-12-15 | 2012-06-21 | Edward Katzin | Social Media Payment Platform Apparatuses, Methods and Systems |
| CN107423974A (en) * | 2017-08-15 | 2017-12-01 | 阿里巴巴集团控股有限公司 | Intellectual broadcast method and apparatus |
| CN109428921A (en) * | 2017-08-28 | 2019-03-05 | 北京嘀嘀无限科技发展有限公司 | Information push method and device |
| US10489789B1 (en) * | 2019-05-02 | 2019-11-26 | Capital One Services, Llc | Systems and methods for providing notifications to devices |
| CN110572434A (en) * | 2019-08-05 | 2019-12-13 | 威富通科技有限公司 | Push method and device of voice broadcast message, push server and storage medium |
| CN113395315A (en) * | 2021-02-23 | 2021-09-14 | 福建创识科技股份有限公司 | Message broadcasting method, cloud sound box and cloud pushing platform |
-
2023
- 2023-01-03 CN CN202310001639.0A patent/CN115988058B/en active Active
Patent Citations (7)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20120158589A1 (en) * | 2010-12-15 | 2012-06-21 | Edward Katzin | Social Media Payment Platform Apparatuses, Methods and Systems |
| CN107423974A (en) * | 2017-08-15 | 2017-12-01 | 阿里巴巴集团控股有限公司 | Intellectual broadcast method and apparatus |
| US20200051046A1 (en) * | 2017-08-15 | 2020-02-13 | Alibaba Group Holding Limited | Smart broadcasting method and apparatus |
| CN109428921A (en) * | 2017-08-28 | 2019-03-05 | 北京嘀嘀无限科技发展有限公司 | Information push method and device |
| US10489789B1 (en) * | 2019-05-02 | 2019-11-26 | Capital One Services, Llc | Systems and methods for providing notifications to devices |
| CN110572434A (en) * | 2019-08-05 | 2019-12-13 | 威富通科技有限公司 | Push method and device of voice broadcast message, push server and storage medium |
| CN113395315A (en) * | 2021-02-23 | 2021-09-14 | 福建创识科技股份有限公司 | Message broadcasting method, cloud sound box and cloud pushing platform |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN118470869A (en) * | 2024-05-11 | 2024-08-09 | 珠海横琴中澳通电子支付技术有限公司 | ECR mode electronic cash register simulation system and simulation method |
| CN119762055A (en) * | 2024-12-25 | 2025-04-04 | 中国工商银行股份有限公司 | Message sending method, message processing method, message processing system and device |
Also Published As
| Publication number | Publication date |
|---|---|
| CN115988058B (en) | 2025-07-04 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN109767200B (en) | An electronic payment method, device, system and storage medium | |
| CN113067882A (en) | Message processing method and device, electronic equipment and medium | |
| US20200389402A1 (en) | Augmenting functionality in distributed systems with payload headers | |
| EP4131866B1 (en) | Information interaction method and apparatus, server, system, and storage medium | |
| CN115988058A (en) | A message processing method, device, electronic device, and computer-readable medium | |
| CN111127181B (en) | Voucher accounting method and device | |
| CN109933508B (en) | Method and device for sending information | |
| CN111881329A (en) | An account balance management method and system | |
| CN113704222A (en) | Method and device for processing service request | |
| CN116303608A (en) | Data processing method and device for application service | |
| CN113989046A (en) | Transaction processing method, apparatus, electronic device, storage medium and program product | |
| CN113010238A (en) | Permission determination method, device and system for micro application call interface | |
| CN113590243A (en) | Energy enterprise project creation method and device, computer equipment and medium | |
| CN111752625B (en) | Method and device for interface mock | |
| CN112272211A (en) | Service request processing method, device and system | |
| CN103856557B (en) | The processing method of a kind of business object based on third-party platform and system | |
| US20240177200A1 (en) | Business service interaction method and apparatus, device, and storage medium | |
| CN118941300A (en) | Data processing method, device, electronic device and computer readable medium | |
| CN115934375A (en) | An information processing method, device, electronic device, and computer-readable medium | |
| CN114372078A (en) | A data security protection method and device | |
| CN112732471A (en) | Error correction method and error correction device for interface return data | |
| CN111949472A (en) | Method and device for recording application logs | |
| CN114444064B (en) | Account processing method, device, electronic device and computer readable medium | |
| CN119105887B (en) | Message processing method, device, electronic device and storage medium | |
| CN114866538B (en) | File reporting method and device, electronic equipment and computer readable 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 | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant |