Message forwarding method and device of multi-channel multi-data structure, electronic equipment and storage medium
Patent Information
- Application Number
- CN202310304584.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-20
- Publication Date
- 2026-09-25
- Estimated Expiration
- 2043-03-20
AI Technical Summary
[0003]在对现有技术的研究和实践中,本发明的发明人发现,如果要对消息通道进行集成的实现,需为每种消息通道建立单独的发送系统,且可能会由于增加新的消息通道而造成系统极大的调整和改动甚至出现冲突兼容问题,从而导致消息发送的效率和可靠性不足,且开发和维护成本高
[0030]应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,而非限制本公开。
Smart Images

Figure CN116506500B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of information processing technology, and in particular to a message forwarding method, apparatus, electronic device, and storage medium with multiple channels and multiple data structures. Background Technology
[0002] Major domestic mobile phone manufacturers support message notification functionality at the system level in their released mobile phones (operating systems), requiring integration with interfaces defined by different manufacturers. Furthermore, for numerous apps, there are third-party push notification platforms such as JPush and Getui, requiring integration with their interfaces. Moreover, major international apps like WhatsApp also have their own push notification functions, requiring separate interface integration for each app. Therefore, the push notification interfaces of various manufacturers, third-party integration platforms, and individual apps differ in their methods, parameters, and implementations, necessitating independent integration.
[0003] In their research and practice of existing technologies, the inventors of this invention have discovered that if message channels are to be integrated, a separate sending system needs to be established for each message channel. Furthermore, the addition of new message channels may cause significant adjustments and modifications to the system, or even lead to conflict and compatibility issues, resulting in insufficient efficiency and reliability of message sending, as well as high development and maintenance costs.
[0004] Therefore, it is necessary to provide a multi-channel, multi-data-structure message forwarding method to solve the above problems. Summary of the Invention
[0005] To address at least one of the aforementioned technical problems, the present invention provides a multi-channel, multi-data-structure message forwarding method, apparatus, electronic device, and storage medium.
[0006] In a first aspect, a multi-channel, multi-data-structure message forwarding method is provided. The method includes: parsing a received message to determine the data structure of the message and converting it into a preset standard data structure; determining one or at least two target channels for message forwarding based on a forwarding strategy corresponding to the message, converting the standard data structure of the message into a data structure corresponding to the target channel, and forwarding the message through the target channel.
[0007] In this regard, by converting the data structure of network access requests into a unified standard data structure, and through a forwarding strategy, adapting messages with the system's internal standard data structure to the outgoing channels, and then converting the standard data structure of the messages back into the data structure required by the corresponding channels, multi-channel, multi-data-format message forwarding can be achieved. Based on this, it is possible to uniformly and compatiblely manage multiple message channels and improve the efficiency and reliability of message sending.
[0008] In one possible implementation, the forwarding strategy includes strategy orchestration and target orchestration; wherein, the strategy orchestration defines the forwarding priority and forwarding compensation for multi-channel message forwarding; and the target orchestration defines the sending targets supported by the target channel corresponding to the message.
[0009] In this possible implementation, the message delivery strategy can be defined and orchestrated through strategy orchestration, while the sending target is parsed and orchestrated according to the requirements of different channels, so that the connection of each channel is as independent as possible, so as not to affect each other and to decouple from the internal system as much as possible.
[0010] In one possible implementation, defining the sending targets supported by the target channel corresponding to the message through the target orchestration includes: identifying whether the input target parameter corresponding to the message is a system-defined user identifier or a channel-defined user identifier; if it is a system-defined user identifier, performing a mapping query based on the database to obtain the channel-defined user identifier; determining the target channel and the sending targets supported by the target channel based on the channel-defined user identifier, and splitting the standard data structure of the message into a data structure adapted to the target channel, and forwarding the message through the target channel.
[0011] In this possible implementation, target orchestration involves parsing and orchestrating sending targets based on the requirements of different channels. For example, WhatsApp channels require sending only one target at a time, while WeChat Official Accounts can support sending a batch of targets at once. Target orchestration achieves unified definition and decoupling. Specifically, it identifies the user identifier defined by the channel by recognizing whether the input target parameter corresponding to the message is a system-defined user identifier or a channel-defined user identifier. The standard data structure of the message is then split into data structures adapted to the target channel. For instance, the standard data structure of the message is split into a data structure defined by the Enterprise WeChat sender module and multiple data structures defined by WhatsApp sender modules. These are then sent to the sender modules of WhatsApp and Enterprise WeChat respectively using gRPC. By decoupling the connections between the various channels, the independence and non-interference of each message channel are achieved, reducing the development costs of integrating new channels and modifying old channels.
[0012] In one possible implementation, after parsing the received message to determine its data structure and converting it into a preset standard data structure, the method further includes: preprocessing the message converted into a standard data structure, wherein the preprocessing includes data correctness verification and IP blacklist / whitelist verification.
[0013] In this possible implementation, data integrity verification checks the correctness of data flowing into the system, while IP blacklist / whitelist verification is a security measure that verifies IP addresses. Additionally, there's circuit breaker and rate limiting, which provide automatic protection for the system.
[0014] In one possible implementation, the data structure of the message is json, xml, protobuf, or tcp-raw; the standard data structure is a unified data structure defined to meet the internal data transmission requirements of the message forwarding system.
[0015] In this possible implementation, by defining a unified data structure within the system and allowing it to flow within the system, message forwarding or other functions can be implemented without relying on external data formats.
[0016] In one possible implementation, the method further includes transmitting data via MQ, HTTP, or TCP when transmitting data from within the message forwarding system to an external system.
[0017] In this possible implementation, corresponding to the data structure of the network access request, the data structure of the network outgoing data can be in formats such as json, xml, protobuf, and tcp-raw. Data can be transmitted via MQ, HTTP, or TCP, and can also be transmitted in formats such as json, xml, or protobuf.
[0018] In one possible implementation, after forwarding the message through the target channel, the method further includes: responding to the forwarding result of the message by writing the forwarding result into a local database for backup.
[0019] In this possible implementation, outbound data needs to be reported / statistically analyzed. After messages are forwarded through various channels to platforms such as WeChat Official Accounts, Lark, DingTalk, and WhatsApp, a result (e.g., receipt, read receipt, error report, etc.) is returned, which is the forwarding result. The forwarding result responds to the message and is written to a local database for backup. It is understood that the forwarding result can be sent to the statistics system via message queue (MQ) (or directly written to the database).
[0020] Secondly, a multi-channel, multi-data-structure message forwarding device is provided. The device includes: a parsing unit for parsing received messages to determine the data structure of the messages and converting them into a preset standard data structure; a processing unit for determining one or at least two target channels for forwarding the messages based on a forwarding strategy corresponding to the messages, and converting the standard data structure of the messages into the data structure corresponding to the target channels; and a forwarding unit for forwarding the messages through the target channels.
[0021] In one possible implementation, the forwarding strategy includes strategy orchestration and target orchestration; wherein, the processing unit includes a strategy orchestration subunit and a target orchestration subunit, the strategy orchestration subunit being used to define the forwarding priority and forwarding compensation for multi-channel message forwarding of a message; the target orchestration subunit being used to define the sending targets supported by the target channel corresponding to the message.
[0022] In one possible implementation, the target orchestration subunit is used to identify whether the input target parameter corresponding to the message is a system-defined user identifier or a channel-defined user identifier; if it is a system-defined user identifier, a mapping query is performed according to the database to obtain the channel-defined user identifier; the target channel and the sending targets supported by the target channel are determined according to the channel-defined user identifier, and the standard data structure of the message is split into a data structure adapted to the target channel, and the message is forwarded through the target channel.
[0023] In one possible implementation, the apparatus further includes a preprocessing unit, configured to preprocess the message converted to a standard data structure after the parsing unit parses the received message to determine the data structure of the message and converts it into a preset standard data structure. The preprocessing includes data correctness verification and IP blacklist / whitelist verification.
[0024] In one possible implementation, the data structure of the message is json, xml, protobuf, or tcp-raw; the standard data structure is a unified data structure defined to meet the internal data transmission requirements of the message forwarding system.
[0025] In one possible implementation, the processing unit further includes an interface subunit for transmitting data via MQ, HTTP, or TCP when transmitting data from within the message forwarding system to an external system.
[0026] In one possible implementation, the processing unit further includes a statistics subunit, which responds to the forwarding result of the message by writing the forwarding result into a local database for backup.
[0027] Thirdly, a processor is provided for performing the methods described in the first aspect above and any possible implementation thereof.
[0028] Fourthly, an electronic device is provided, comprising: a processor, a transmitting device, an input device, an output device, and a memory, the memory being used to store computer program code, the computer program code including computer instructions, wherein when the processor executes the computer instructions, the electronic device performs a method as described in the first aspect above and any possible implementation thereof.
[0029] Fifthly, a computer-readable storage medium is provided, wherein a computer program is stored therein, the computer program including program instructions that, when executed by a processor of an electronic device, cause the processor to perform a method as described in the first aspect and any possible implementation thereof.
[0030] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description
[0031] To more clearly illustrate the technical solutions in the embodiments of this application or the background art, the accompanying drawings used in the embodiments of this application or the background art will be described below.
[0032] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this disclosure and, together with the specification, serve to illustrate the technical solutions of this disclosure.
[0033] Figure 1 A flowchart illustrating a multi-channel, multi-data-structure message forwarding method provided in this application embodiment;
[0034] Figure 2 A schematic diagram of the system architecture for the message forwarding method with multiple channels and multiple data structures provided in the embodiments of this application;
[0035] Figure 3 A schematic diagram of a message forwarding device for eliminating multi-channel, multi-data structures provided in this application embodiment;
[0036] Figure 4 A schematic diagram of another message forwarding device for eliminating multi-channel, multi-data structures provided in this application embodiment;
[0037] Figure 5 This is a schematic diagram of the hardware structure of a multi-channel, multi-data-structure message forwarding device provided in an embodiment of this application. Detailed Implementation
[0038] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present application.
[0039] The terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish different objects, not to describe a specific order. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or apparatuses.
[0040] In this document, the term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent three cases: A alone, A and B simultaneously, and B alone. Furthermore, the term "at least one" in this document means any combination of at least two of any one or more elements. For example, including at least one of A, B, and C can mean including any one or more elements selected from the set consisting of A, B, and C.
[0041] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0042] Furthermore, to better illustrate the present invention, numerous specific details are set forth in the following detailed embodiments. Those skilled in the art will understand that the present invention can be practiced without certain specific details. In some instances, methods, means, elements, and circuits well known to those skilled in the art have not been described in detail in order to highlight the spirit of the invention.
[0043] In existing technologies, mainstream domestic mobile phone manufacturers support message notification functions at the system level in their released mobile phones (operating systems), requiring integration with interfaces defined by different manufacturers. Furthermore, for numerous apps, there are third-party push notification platforms such as JPush and Getui, requiring integration with their interfaces. Moreover, mainstream international apps like WhatsApp also have their own message push notification functions, requiring separate interface integration for each app. Therefore, the message notification push interfaces of various manufacturers, third-party integration platforms, and individual apps differ in their methods, parameters, and implementations, necessitating independent integration.
[0044] Based on this, this application proposes a robust architecture to address the needs of multi-channel message delivery. It allows for unified and compatible management of multiple message channels and message sending through a central system. Unlike conventional systems that integrate message channels, this approach eliminates the need for separate sending systems for each message channel. It also avoids significant system adjustments and modifications, and potential conflicts and compatibility issues, caused by adding new message channels. This approach saves development and maintenance costs and improves the efficiency and reliability of message sending.
[0045] Please see Figure 1-2 , Figure 1 This is a flowchart illustrating a multi-channel, multi-data-structure message forwarding method provided in an embodiment of this application. Figure 2 A schematic diagram of the system architecture for the message forwarding method with multiple channels and multiple data structures provided in this application embodiment.
[0046] S101. Parse the received message to determine the data structure of the message and convert it into a preset standard data structure;
[0047] In one possible implementation, given the varying interfaces of different vendor channels, independent apps, and third-party platforms, a unified interface requires designing a system integration solution that is compatible with multiple message channels. This would allow enterprises / developers to easily and quickly access different push notification channels. Therefore, the system needs to be layered, achieving both upper-layer transparency and lower-layer transparency, using a unified method and format to connect the upper and lower layers, thus decoupling them as much as possible as a prerequisite for compatibility with different message channels.
[0048] like Figure 2As shown, the system entry layer is defined. After an external request is invoked, the parameters of the external request can be uniformly converted into a standard data structure defined internally by the system. This allows for convenient support of external request parameters, whether they are JSON, XML, or other formats, without affecting the internal processing implementation of the system (the internal implementation of the system does not change due to changes in the external parameter passing method).
[0049] Taking the integration with WhatsApp and WeChat Work channels as an example, we define the structure of the network access data, and then define the requests directory, which contains methods for parsing JSON, XML, and protobuf.
[0050] In one possible implementation, after step S101, the multi-channel multi-data-structure message forwarding method further includes preprocessing the message converted into a standard data structure, the preprocessing including data correctness verification and IP blacklist / whitelist verification.
[0051] like Figure 2 As shown, the middleware layer is the middleware definition made according to system requirements. For example, data validation is to verify the correctness of the data flowing into the system, IP blacklist and whitelist restriction is a security measure function for verifying IPs, and circuit breaking and rate limiting is a function for automatic protection of the system, etc.
[0052] Taking the integration with WhatsApp and WeChat Work channels as an example, a middlewares directory is defined, which contains methods for data verification and IP blacklist processing. In data verification, the common parameter fields in the network access structure are validated, such as the message validity period must be in integer format (timestamp) and be a positive integer. For IP blacklist, it is determined whether the data source IP is in the IP blacklist. If it is, an error response is given.
[0053] In one possible implementation, the data structure of the message is json, xml, protobuf, or tcp-raw; the standard data structure is a unified data structure defined to meet the internal data transmission requirements of the message forwarding system.
[0054] By defining a unified data structure within the system and allowing data to flow within the system, message forwarding and other functions can be implemented without relying on external data formats.
[0055] S102. Based on the forwarding strategy corresponding to the message, determine one or at least two target channels for forwarding the message, convert the standard data structure of the message into the data structure corresponding to the target channel, and forward the message through the target channel.
[0056] In one possible implementation, the forwarding strategy includes strategy orchestration and target orchestration; wherein, the strategy orchestration defines the forwarding priority and forwarding compensation for multi-channel message forwarding; and the target orchestration defines the sending targets supported by the target channel corresponding to the message.
[0057] Policy orchestration allows for the definition and orchestration of message delivery strategies, while target orchestration involves parsing and orchestrating delivery targets based on the requirements of different channels. This ensures that the connections between channels are as independent as possible, preventing mutual interference and decoupling from the internal system as much as possible.
[0058] In one possible implementation, defining the sending targets supported by the target channel corresponding to the message through the target orchestration includes: identifying whether the input target parameter corresponding to the message is a system-defined user identifier or a channel-defined user identifier; if it is a system-defined user identifier, performing a mapping query based on the database to obtain the channel-defined user identifier; determining the target channel and the sending targets supported by the target channel based on the channel-defined user identifier, and splitting the standard data structure of the message into a data structure adapted to the target channel, and forwarding the message through the target channel.
[0059] Target orchestration involves parsing and orchestrating sending targets based on the requirements of different channels. For example, WhatsApp channels require sending only one target at a time, while WeChat Official Accounts can support sending a batch of targets simultaneously. Target orchestration achieves unified definition and decoupling. Specifically, it identifies whether the input target parameter of the message corresponds to a system-defined user identifier or a channel-defined user identifier, thereby determining the channel-defined user identifier. The standard message data structure is then split into data structures adapted to the target channel. For instance, the standard message data structure is split into a data structure defined by the WeChat Work sender module and multiple data structures defined by WhatsApp sender modules, and then sent to the WhatsApp and WeChat Work sender modules respectively using gRPC. By decoupling the connections between channels, the independence and non-interference of each message channel are achieved, reducing the development costs of integrating new channels and modifying existing channels.
[0060] In one possible implementation, the method further includes: when transmitting data from within the message forwarding system to an external system, data transmission is performed via MQ, HTTP, or TCP. Corresponding to the data structure of the network inbound request, the data structure of the outbound data can be in formats such as JSON, XML, protobuf, and TCP-raw, and can be transmitted via MQ, HTTP, or TCP, while also supporting data transmission in formats such as JSON, XML, or protobuf.
[0061] like Figure 2 As shown, the components defined in the core processing module are functional modules for unified data processing and flow to decouple different message channels. Strategy orchestration defines and orchestrates message delivery strategies, such as sending to channel A first, and if that fails, sending to channel B; or sending messages to both channels A and B simultaneously. Target orchestration parses and orchestrates sending targets based on the requirements of different channels. For example, WhatsApp channels require sending only one target at a time, while WeChat official accounts can support sending a batch of targets at once. The target orchestration module provides unified definition and decoupling.
[0062] The outgoing data format encapsulation layer is the system exit layer mentioned above. It can transmit data via MQ, HTTP, or TCP to meet the needs of internal data flow to external systems. It can also transmit data in formats such as JSON, XML, or protobuf. Through the encapsulation layer, it decouples the data from other processing logic modules within the system.
[0063] Each channel's sender module defines and implements the ability to connect to the interfaces of various message channels. It converts the system's unified data format into a format and field that is compatible with the requirements of message channel interfaces such as WeChat Official Accounts, Lark, DingTalk, and WhatsApp, and performs actual parameter connection. Due to the definition of the sender module, other processing logic modules at the upper layer of the system are decoupled from the lower-level message channels, thereby achieving the independence of each message channel and preventing them from affecting each other, reducing the development cost of accessing new channels and modifying old channels.
[0064] Taking the integration with WhatsApp and WeChat Work channels as an example, a handlers directory is defined, which includes target orchestration and statistical reporting functions. Target orchestration will identify whether the target parameter of the input parameter is a user ID defined internally by the system or a user defined by the channel. If it is a user ID defined internally by the system, a mapping query is performed according to the database to obtain the user identifier defined by the channel. The structure is then split into a structure defined by the WeChat Work sender module and multiple structures defined by the WhatsApp sender module. Then, the structures are sent to the sender modules of WhatsApp and WeChat Work respectively using gRPC.
[0065] Define the senders directory, which contains the WhatsApp channel integration module and the WeChat Work channel integration module. Define its own independent structure, and make actual call requests based on the request methods and parameter fields of the WhatsApp channel and the WeChat Work channel, and return the results to the upper layer.
[0066] In the statistics module of the handlers directory, after the downstream responds with data results, the results are sent to the statistics system via message queue (or written directly to the database).
[0067] In one possible implementation, after forwarding the message through the target channel, the method further includes: responding to the forwarding result of the message by writing the forwarding result into a local database for backup.
[0068] In this possible implementation, outbound data needs to be reported / statistically analyzed. After messages are forwarded through various channels to platforms such as WeChat Official Accounts, Lark, DingTalk, and WhatsApp, a result (e.g., receipt, read receipt, error report, etc.) is returned, which is the forwarding result. The forwarding result responds to the message and is written to a local database for backup. It is understood that the forwarding result can be sent to the statistics system via message queue (MQ) (or directly written to the database).
[0069] In the above embodiments, by converting the data structure of the network access request into a unified standard data structure, and through a forwarding strategy, adapting the message with the standard data structure inside the system to the outgoing channel, and then converting the standard data structure of the message back into the data structure required by the corresponding channel, message forwarding across multiple channels and data formats can be achieved. Based on this, it is possible to uniformly and compatiblely manage multiple message channels and improve the efficiency and reliability of message sending.
[0070] Those skilled in the art will understand that, in the above-described method of the specific implementation, the order in which each step is written does not imply a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of each step should be determined by its function and possible internal logic.
[0071] The methods of the embodiments of this application have been described in detail above, and the apparatus of the embodiments of this application is provided below.
[0072] Please see Figure 3 , Figure 3 This is a schematic diagram of a message forwarding device for eliminating multi-channel, multi-data structures, provided in an embodiment of this application.
[0073] A multi-channel, multi-data-structure message forwarding device, comprising: a parsing unit 100, configured to parse received messages to determine the data structure of the messages and convert them into a preset standard data structure; a processing unit 200, configured to determine one or at least two target channels for forwarding the messages based on a forwarding strategy corresponding to the messages, and convert the standard data structure of the messages into the data structure corresponding to the target channels; and a forwarding unit, configured to forward the messages through the target channels.
[0074] Please see Figure 4 , Figure 4 This is a schematic diagram of another message forwarding device for eliminating multi-channel, multi-data structures provided in an embodiment of this application.
[0075] In one possible implementation, the forwarding strategy includes strategy orchestration and target orchestration; wherein, the processing unit 200 includes a strategy orchestration subunit 210 and a target orchestration subunit 220, the strategy orchestration subunit 210 being used to define the forwarding priority of multi-channel message forwarding and forwarding compensation; the target orchestration subunit 220 being used to define the sending targets supported by the target channel corresponding to the message.
[0076] In one possible implementation, the target orchestration subunit 220 is used to identify whether the input target parameter corresponding to the message is a system-defined user identifier or a channel-defined user identifier; if it is a system-defined user identifier, a mapping query is performed according to the database to obtain the channel-defined user identifier; the target channel and the sending targets supported by the target channel are determined according to the channel-defined user identifier, and the standard data structure of the message is split into a data structure adapted to the target channel, and the message is forwarded through the target channel.
[0077] In one possible implementation, the apparatus further includes a preprocessing unit 300, which is used to preprocess the message converted into a standard data structure after the parsing unit 100 parses the received message to determine the data structure of the message and converts it into a preset standard data structure. The preprocessing includes data correctness verification and IP blacklist / whitelist verification.
[0078] In one possible implementation, the data structure of the message is json, xml, protobuf, or tcp-raw; the standard data structure is a unified data structure defined to meet the internal data transmission requirements of the message forwarding system.
[0079] In one possible implementation, the processing unit 200 further includes an interface subunit 230, used to transmit data via MQ, HTTP, or TCP when transmitting data from within the message forwarding system to an external system.
[0080] In one possible implementation, the processing unit further includes a statistics subunit, which responds to the forwarding result of the message by writing the forwarding result into a local database for backup.
[0081] In some embodiments, the functions or modules of the apparatus provided in this disclosure can be used to perform the methods described in the above method embodiments. The specific implementation can be referred to the description of the above method embodiments, and for the sake of brevity, it will not be repeated here.
[0082] This application also provides a processor for performing a method as described in any of the possible implementations above.
[0083] This application also provides an electronic device, including: a processor, a transmitting device, an input device, an output device, and a memory, wherein the memory is used to store computer program code, the computer program code including computer instructions, and when the processor executes the computer instructions, the electronic device performs a method as described in any of the above possible implementations.
[0084] This application also provides a computer-readable storage medium storing a computer program, the computer program including program instructions that, when executed by a processor of an electronic device, cause the processor to perform a method as described in any of the possible implementations above.
[0085] Please see Figure 5 , Figure 5 This is a schematic diagram of the hardware structure of a message push device provided in an embodiment of this application.
[0086] The automated testing device 2 includes a processor 21, a memory 22, an input device 23, and an output device 24. The processor 21, memory 22, input device 23, and output device 24 are coupled together via connectors, which may include various interfaces, transmission lines, or buses, etc., and are not limited in this embodiment. It should be understood that in the various embodiments of this application, coupling refers to mutual connection through a specific method, including direct connection or indirect connection through other devices, such as through various interfaces, transmission lines, buses, etc.
[0087] Processor 21 can be one or more graphics processing units (GPUs). If processor 21 is a GPU, the GPU can be a single-core GPU or a multi-core GPU. Optionally, processor 21 can be a processor group composed of multiple GPUs, with the multiple processors coupled to each other via one or more buses. Optionally, the processor can also be other types of processors, etc., which are not limited in this embodiment.
[0088] The memory 22 can be used to store computer program instructions, as well as various types of computer program code, including program code for executing the scheme of this application. Optionally, the memory includes, but is not limited to, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), or compact disc read-only memory (CD-ROM), which is used for related instructions and data.
[0089] Input device 23 is used to input data and / or signals, and output device 24 is used to output data and / or signals. Output device 23 and input device 24 can be independent devices or an integrated device.
[0090] It is understood that in this embodiment of the application, the memory 22 can be used not only to store related instructions, but also the specific data stored in the memory is not limited.
[0091] Understandable, Figure 5 This illustration only shows a simplified design of an automated testing apparatus. In practical applications, the automated testing apparatus may also include other necessary components, including, but not limited to, any number of input / output devices, processors, memory, etc., and all video analysis devices that can implement the embodiments of this application are within the protection scope of this application.
[0092] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0093] Those skilled in the art will readily understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here. Those skilled in the art will also readily understand that the various embodiments of this application have different focuses, and for the sake of convenience and brevity, the same or similar parts may not be repeated in different embodiments. Therefore, parts not described or not described in detail in one embodiment can be referred to the descriptions in other embodiments.
[0094] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0095] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0096] In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0097] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially as a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted through the computer-readable storage medium. The computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available media may be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., digital versatile discs (DVDs)), or semiconductor media (e.g., solid-state disks (SSDs)).
[0098] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. This program can be stored in a computer-readable storage medium, and when executed, it can include the processes described in the above method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
Claims
1. A message forwarding method with multiple channels and multiple data structures, characterized in that, The method includes: The received message is parsed to determine its data structure and then converted into a preset standard data structure. Based on the forwarding strategy corresponding to the message, one or at least two target channels for message forwarding are determined. The forwarding strategy includes strategy orchestration and target orchestration. The strategy orchestration defines the forwarding priority and forwarding compensation for multi-channel message forwarding. The target orchestration defines the sending targets supported by the target channel corresponding to the message. The target input parameter for the identification message is either a user identifier defined by the system or a user identifier defined by the channel. If it is a system-defined user identifier, then a mapping query is performed based on the database to obtain the user identifier defined for the channel; The target channel and the sending targets supported by the target channel are determined based on the user identifier defined in the channel definition. The standard data structure of the message is split into data structures that are adapted to the sender modules defined in each channel. Then, the message is sent to the corresponding sender modules in gRPC and forwarded through the target channel.
2. The method according to claim 1, characterized in that, After parsing the received message to determine its data structure and converting it into a preset standard data structure, the process further includes: The messages converted to standard data structures are preprocessed, including data integrity verification and IP blacklist / whitelist verification.
3. The method according to claim 1, characterized in that, The data structure of the message is json, xml, protobuf or tcp-raw; the standard data structure is a unified data structure defined to meet the internal data transmission requirements of the message forwarding system.
4. The method according to claim 3, characterized in that, The method further includes: When transmitting data from the internal message forwarding system to the external system, data transmission is carried out via MQ, HTTP, or TCP.
5. The method according to claim 1, characterized in that, After forwarding the message through the target channel, the method further includes: In response to the forwarding result of the message, the forwarding result is written to the local database for backup.
6. A multi-channel, multi-data-structure message forwarding device, characterized in that, The device includes: The parsing unit is used to parse the received message to determine the data structure of the message and convert it into a preset standard data structure; The processing unit is configured to determine one or at least two target channels for forwarding the message based on the forwarding strategy corresponding to the message. The forwarding strategy includes strategy orchestration and target orchestration. The strategy orchestration defines the forwarding priority and forwarding compensation for multi-channel message forwarding. The target orchestration defines the sending targets supported by the target channel corresponding to the message. The target input parameter for the identification message is either a user identifier defined by the system or a user identifier defined by the channel. If it is a system-defined user identifier, then a mapping query is performed based on the database to obtain the user identifier defined for the channel; The target channel and the sending targets supported by the target channel are determined based on the user identifier defined in the channel definition. The standard data structure of the message is split into data structures that are adapted to the sender modules of each channel. Then, the message is sent to the corresponding sender modules in the gRPC manner. A forwarding unit is used to forward the message through the target channel.
7. An electronic device, characterized in that, include: The electronic device includes a processor, a transmitting device, an input device, an output device, and a memory, the memory being used to store computer program code, the computer program code including computer instructions, wherein when the processor executes the computer instructions, the electronic device performs the method as described in any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, the computer program including program instructions that, when executed by a processor of an electronic device, cause the processor to perform the method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Multi-channel multi-format instant message forwarding method and system and computer equipment
CN113271250A
5G message processing method and device, computer equipment and storage medium
CN113453175A
Distributed simulation data interaction method based on LVC and related equipment
CN115758668A