Message transmission method and device, electronic equipment and readable medium

By using environment label matching in the asynchronous message queue to determine the target consumption environment, the problem of functional module changes or failures in the asynchronous message queue affecting the entire system is solved, and deployment efficiency and environment stability are improved.

CN118869804APending Publication Date: 2024-10-29TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310480199.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-04-27
Publication Date
2024-10-29

AI Technical Summary

Technical Problem

In a distributed system, the asynchronous message queue server has poor environmental stability and low deployment efficiency due to functional module changes or failures, affecting the operation of the entire system.

Method used

By adding environment tags to messages to be transmitted, the target consumption environment is determined, and based on the candidate consumption environment tags and access information in the message subscription record, the most appropriate consumption environment is matched and selected for message transmission to avoid functional module changes or failures affecting the entire system.

Benefits of technology

It improves deployment efficiency and environment stability, ensuring that differences in different functional modules only affect the environment in which they are located, and preventing a single failure from affecting the entire system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118869804A_ABST
    Figure CN118869804A_ABST
Patent Text Reader

Abstract

The invention provides a message transmission method and device, electronic equipment and a readable medium. The method comprises the following steps: acquiring a to-be-transmitted message containing a target consumption environment label, wherein the target consumption environment label is a message consumption environment label specified by a generator of the to-be-transmitted message; according to the target consumption environment label and a message subscription record, a consumption environment label of a candidate consumption environment of the to-be-transmitted message is determined, and the message subscription record comprises the consumption environment label of the candidate consumption environment and access information; determining a target consumption environment from the candidate consumption environments according to a matching result of the consumption environment labels of the candidate consumption environments and the target consumption environment labels; and sending the to-be-transmitted message to the target consumption environment according to the access information of the target consumption environment in the message subscription record. The method can improve deployment efficiency and environmental stability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a message transmission method, device, electronic device and readable medium. Background Art

[0002] A message queue is a message middleware used in communication between servers in a distributed system. Messages generated by a server as a producer are placed in a message queue and then sent to a server as a consumer according to preset rules, thus realizing an asynchronous communication link between producers and consumers.

[0003] In an asynchronous link, the specific consumer of each message in the asynchronous queue is usually specified according to the load conditions of each server, so that the message is sent to the corresponding server.

[0004] However, this type of solution requires that each server has all the functional modules of the system. Changes or failures in one functional module will affect the operation of all servers, resulting in poor deployment efficiency and low environmental stability. Summary of the invention

[0005] Based on the above technical problems, the present application provides a message transmission method, device, electronic device and readable medium to prevent changes or failures in a functional module from affecting the operating status of all servers, thereby improving deployment efficiency and environmental stability.

[0006] Other features and advantages of the present application will become apparent from the following detailed description, or may be learned in part by the practice of the present application.

[0007] According to one aspect of an embodiment of the present application, a message transmission method is provided, including:

[0008] Acquire a message to be transmitted that includes a target consumption environment tag, where the target consumption environment tag is a message consumption environment tag specified by a generator of the message to be transmitted;

[0009] Determine the consumption environment tag of the candidate consumption environment of the message to be transmitted according to the target consumption environment tag and the message subscription record, wherein the message subscription record includes the consumption environment tag and access information of the candidate consumption environment;

[0010] Determining a target consumption environment from the candidate consumption environments according to a matching result between the consumption environment labels of the candidate consumption environments and the target consumption environment labels;

[0011] The message to be transmitted is sent to the target consumption environment according to the access information of the target consumption environment in the message subscription record.

[0012] According to one aspect of an embodiment of the present application, a message transmission device is provided, including:

[0013] A message acquisition module, used to acquire a message to be transmitted containing a target consumption environment tag, wherein the target consumption environment tag is a message consumption environment tag specified by a generator of the message to be transmitted;

[0014] A label acquisition module, used to determine the consumption environment label of the candidate consumption environment of the message to be transmitted according to the target consumption environment label and the message subscription record, wherein the message subscription record includes the consumption environment label and access information of the candidate consumption environment;

[0015] An environment determination module, configured to determine a target consumption environment from the candidate consumption environments according to a matching result between the consumption environment labels of the candidate consumption environments and the target consumption environment labels;

[0016] The message transmission module is used to send the message to be transmitted to the target consumption environment according to the access information of the target consumption environment in the message subscription record.

[0017] In some embodiments of the present application, based on the above technical solution, the access information includes the communication link of the candidate consumption environment; the message acquisition module includes:

[0018] A message receiving submodule, used to receive the to-be-transmitted messages respectively through the communication link corresponding to each candidate consumption environment between the message queue and the message queue, so as to obtain a plurality of to-be-transmitted messages;

[0019] Tag acquisition module, including:

[0020] The label acquisition submodule is used to obtain the consumption environment label of the current candidate consumption environment from the message subscription record for each message to be transmitted, according to the communication link through which the message to be transmitted is received from the message queue, wherein the message subscription record contains the correspondence between the communication link of the message queue and the consumption environment label of the candidate consumption environment.

[0021] In some embodiments of the present application, based on the above technical solution, the environment determination module includes:

[0022] An environment determination submodule, for each candidate consumption environment, if the consumption environment label of the current candidate consumption environment matches the target consumption environment label, then determining the current candidate consumption environment as the target consumption environment;

[0023] The message discarding submodule is used to discard the message to be transmitted in the communication link of the current candidate consumption environment if the consumption environment tag of the current candidate consumption environment does not match the target consumption environment tag.

[0024] In some embodiments of the present application, based on the above technical solution, the target consumption environment tag and the consumption environment tag both include an environment type; the message discarding submodule includes:

[0025] A first message discarding unit, configured to discard the message to be transmitted in the communication link of the current candidate consumption environment if the environment type in the target consumption environment tag is a baseline environment and the environment type in the consumption environment tag of the current candidate consumption environment is a characteristic environment;

[0026] A label matching unit, configured to obtain matching results of the consumption environment labels of other candidate consumption environments with the target consumption environment label if the environment type in the target consumption environment label is a characteristic environment and the environment type in the consumption environment label of the current candidate consumption environment is a baseline environment;

[0027] A second message discarding unit, configured to discard the message to be transmitted in the communication link of the current candidate consumption environment if the matching result indicates that there are consumption environment tags of other candidate consumption environments that match the target consumption environment tag;

[0028] The first determining unit is configured to determine that the current candidate consumption environment is a target consumption environment if the matching result indicates that the consumption environment tags of other candidate consumption environments do not match the target consumption environment tag.

[0029] In some embodiments of the present application, based on the above technical solution, the message to be transmitted includes module identification information of a functional module for processing the message to be transmitted; and the second message discarding unit includes:

[0030] A module identification acquisition subunit, used to acquire module identification information of the other candidate consumption environments from the message subscription record;

[0031] The first message discarding sub-unit is used to discard the message to be transmitted in the communication link of the current candidate consumption environment if the matching result indicates that there are other candidate consumption environments whose consumption environment tags match the target consumption environment tag and the module identification information of the other candidate consumption environments does not match the module identification information in the message to be transmitted.

[0032] In some embodiments of the present application, based on the above technical solution, the message subscription record also includes the status update time of each communication link; the second message discarding unit includes:

[0033] An update time acquisition subunit, configured to acquire the state update time of the communication link of the other candidate consumption environment from the message subscription record if the matching result indicates that there is a consumption environment tag of the other candidate consumption environment that matches the target consumption environment tag;

[0034] A second message discarding subunit is configured to discard the message to be transmitted in the communication link of the current candidate consumption environment if the time difference between the status update time and the current time is greater than a preset time length;

[0035] The environment confirmation subunit is used to determine that the current candidate consumption environment is the target consumption environment if the time difference between the status update time and the current time is less than or equal to the preset time length.

[0036] In some embodiments of the present application, based on the above technical solution, the message transmission device further includes:

[0037] A link checking module, used for periodically checking instances of each communication link in the message subscription record;

[0038] The time updating module is used to update the state update time of the communication link in the message subscription record for the communication link having the instance.

[0039] In some embodiments of the present application, based on the above technical solution, the message discarding submodule includes:

[0040] A message parsing unit, used for parsing the message to be transmitted and obtaining a message identifier of the message to be transmitted;

[0041] A message generating unit, configured to generate a simulated confirmation message of the message to be transmitted according to the message identifier;

[0042] A confirmation message sending unit is used to send the simulated confirmation message to the message queue.

[0043] In some embodiments of the present application, based on the above technical solution, the message transmission device further includes:

[0044] A subscription receiving module, used to receive an environment subscription request of a candidate consumption environment, wherein the environment subscription request includes a consumption environment tag of the candidate consumption environment;

[0045] A link establishment module, configured to establish a communication link of the candidate consumption environment in response to the environment subscription request;

[0046] A recording module is used to record the corresponding relationship between the communication link and the consumption environment tag in the message subscription record.

[0047] In some embodiments of the present application, based on the above technical solution, the message transmission device further includes:

[0048] A confirmation message receiving module, used to receive a consumption confirmation message sent by the target consumption environment for the message to be transmitted;

[0049] A confirmation message forwarding module is used to forward the consumption confirmation message to the message queue.

[0050] In some embodiments of the present application, based on the above technical solution, the message transmission device further includes:

[0051] A label acquisition request receiving module, used to receive a routing label acquisition request sent by a message generation environment;

[0052] An environment tag sending module is used to respond to the routing tag acquisition request and send the consumption environment tag of the candidate consumption environment to the message generation environment according to the message subscription record, so that the message generation environment generates a message to be transmitted for the candidate consumption environment according to the consumption environment tag.

[0053] According to one aspect of an embodiment of the present application, an electronic device is provided, comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute a message transmission method as in the above technical solution by executing the executable instructions.

[0054] According to one aspect of an embodiment of the present application, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the message transmission method in the above technical solution is implemented.

[0055] According to one aspect of the embodiments of the present application, a computer program product or a computer program is provided, the computer program product or the computer program includes computer instructions, the computer instructions are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the message transmission method provided in the above-mentioned various optional implementations.

[0056] In an embodiment of the present application, by adding an environment tag to the message to be transmitted, the message can reach the specified environment, thereby allowing differences in functional modules of different environments. Changes and failures of functional modules only affect the environment containing the functional module, avoiding changes or failures of a functional module affecting the operating status of all servers, thereby improving deployment efficiency and environmental stability.

[0057] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0058] The drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present application, and together with the specification are used to explain the principles of the present application. Obviously, the drawings described below are only some embodiments of the present application, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0059] In the attached picture:

[0060] Figure 1 A schematic diagram of an exemplary system architecture of the technical solution of this application in an application scenario;

[0061] Figure 2 The overall scheme architecture diagram in the embodiment of the present application;

[0062] Figure 3 A schematic flow chart of a message transmission method in an embodiment of the present application;

[0063] Figure 4 This is a schematic architecture diagram of the internal implementation of the communication process in the embodiment of the present application;

[0064] Figure 5 This is a schematic flowchart of discarding a message in an embodiment of the present application;

[0065] Figure 6 This is a schematic flow chart of the subscription process in an embodiment of the present application;

[0066] Figure 7 A schematic flow chart of sending a message to be transmitted in a communication link in an embodiment of the present application;

[0067] Figure 8 This is a schematic flowchart of the overall process of message transmission in a test environment in an embodiment of the present application;

[0068] Fig. 9 The following schematically shows a block diagram of a message transmission device in an embodiment of the present application;

[0069] Fig.10 A schematic diagram of the structure of a computer system suitable for implementing an electronic device of an embodiment of the present application is shown. DETAILED DESCRIPTION

[0070] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this application will be more comprehensive and complete and fully convey the concept of the example embodiments to those skilled in the art.

[0071] In addition, described feature, structure or characteristic can be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present application. However, those skilled in the art will appreciate that the technical scheme of the present application can be put into practice without one or more of the specific details, or other methods, components, devices, steps, etc. can be adopted. In other cases, known methods, devices, realizations or operations are not shown or described in detail to avoid blurring the various aspects of the application.

[0072] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities may be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.

[0073] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps can be decomposed, and some operations / steps can be combined or partially combined, so the actual execution order may change according to actual conditions.

[0074] It should be understood that the solution of the present application can be applied in the scenario of network message communication, and is specifically applied in the test environment of network communication function based on asynchronous queue. In such a test environment, developers or testers usually need to establish multiple test environments to test each functional module in the system under test. When the functional module involves two-party or multi-party communication, an asynchronous message queue is used to organize the communication of each party, so as to avoid the synchronous link between the communicating parties from occupying too much network and improve the network communication process. In such a communication scenario, there are usually generators and consumers of communication messages. The generator converts the communication request into a communication message delivery asynchronous queue. The asynchronous queue schedules the messages in the queue according to the occupancy of the network and sends the messages to the consumers of the messages. The solution of the present application has the ability to route to the corresponding feature environment first when the message is pushed to the consumer in the asynchronous queue, and when the consumer consumes the message and converts it into a request to the downstream service, otherwise it is routed to the baseline environment.

[0075] The data collection and processing in this application should be strictly in accordance with the requirements of relevant national laws and regulations when applied in practice, and the informed consent or separate consent of the personal information subject should be obtained. Subsequent data use and processing should be carried out within the scope of authorization of laws and regulations and the personal information subject.

[0076] The following is an introduction to the system architecture of the technical solution of this application in an application scenario. Figure 1 , Figure 1 This is a schematic diagram of an exemplary system architecture of the technical solution of this application in an application scenario. Figure 1 As shown, the application scenario specifically includes a message server 110, a queue server 120 and a function server 130. Among them, the message server 110 is the generator of the communication message, and it accesses the function module on the function server 130 by sending a message to the function server 130. The function server 130 is a server that provides functions and executes functions. Among them, a complete system will be deployed on some function servers, that is, all the function modules are included. These servers are called baseline environments, while only the function modules required to execute some functions are deployed on another function server. These servers are called feature environments. For example, if the login function is tested, the corresponding function server may only include the function modules involved in the login function, such as the login verification module. The queue server 120 is used to establish a communication link between the message server 110 and the function server 130. Asynchronous communication is adopted between the message server 110 and the function server 130, and the scheduling process of communication is completed by the queue server 120 according to the specific access situation. For example, if the message server wants to access a specific feature environment to test the functional modules therein, the queue server will determine the functional server 130 where the specific feature environment is located based on the communication message sent by the message server 110, and then send the access message to the specific server to complete the message communication process.

[0077] The above-mentioned server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers. It can also be a cloud server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network) and basic cloud computing services such as big data and artificial intelligence platforms. This is not restricted here. The above-mentioned servers can actually be deployed on the same physical server, and the functions of each server constitute the various functional modules of the management system. Terminal devices include but are not limited to mobile phones, computers, intelligent voice interaction devices, smart home appliances, vehicle-mounted terminals, aircraft, etc. Terminal devices and servers can be directly or indirectly connected via wired or wireless communications, which is not restricted in this application. There is no limit on the number of terminal devices and servers.

[0078] Combine the following Figure 2 This is an overall introduction to the solution architecture of this application. Figure 2 , Figure 2 The overall scheme architecture diagram in the embodiment of this application. Figure 2As shown, the architecture includes message consumer F1 and message consumer BS, a queue platform and three producers. Message consumer F1 and message consumer BS subscribe to topic 1 on the queue platform respectively. The three producers generate corresponding messages for consumer F1, consumer F2 and consumer BS respectively. The messages will be delivered to the queue platform. The queue platform will send the messages to the corresponding consumers based on the subscription information 1 of consumer F1 and consumer BS for the messages of topic 1. Among them, consumer F1 is a feature environment, in which only the functional module for processing F1 messages is deployed, and consumer BS is a baseline environment, which can process all types of messages. As shown Figure 2 As shown, the queue platform sends messages according to subscription information 1 for topic 1. Among them, message F1 and message BS will be sent to consumer F1 and consumer BS respectively according to the subscription, and message F2 will also be sent to consumer BS because there is no corresponding environment to subscribe to the message.

[0079] The following is a detailed description of the technical solution provided by this application in conjunction with the specific implementation method. For ease of introduction, please refer to Figure 3 , Figure 3 This is a schematic flow chart of a message transmission method in an embodiment of the present application. The method can be applied to the above-mentioned queue platform. In the embodiment of the present application, the message transmission method is introduced by taking the message transmission device running in the proxy service on the queue platform server as the execution subject, and the method may include the following steps S310 to S330:

[0080] Step S310: obtaining a message to be transmitted that includes a target consumption environment tag, wherein the target consumption environment tag is a message consumption environment tag specified by a generator of the message to be transmitted.

[0081] The message queue is a communication middleware used to organize and schedule messages from different generators. In this embodiment, an additional proxy service is added between the message queue and the consumption environment to execute the scheme in this embodiment. Specifically, when the message to be transmitted in the message queue is to be sent and is taken out of the queue, it will be sent to the proxy service, and the proxy service will determine the final destination of the message to be transmitted based on the target consumption environment label in the message to be transmitted. The message to be transmitted is a message generated by the message generator. The message is used to request the consumption environment to perform the corresponding function according to the information in the message to be transmitted. Taking the test scenario of the payment module as an example, the message to be transmitted can be a payment request initiated by the payer. When generating the message to be transmitted, the payer will specify the target consumption environment to which the message to be transmitted is to reach by adding a consumption environment label in the message to be transmitted. The message consumption environment label is a label information used to identify the candidate message consumption environment, which is unique between each candidate consumption environment. When the generator of the message to be transmitted selects a candidate consumption environment as the destination of the message to be transmitted, the consumption environment tag of the candidate consumption environment is added to the message to be transmitted as the target consumption environment tag of the message, for example, added to the corresponding field in the metadata.

[0082] Step S320: determining the consumption environment tag of the candidate consumption environment of the message to be transmitted according to the target consumption environment tag and the message subscription record, wherein the message subscription record includes the consumption environment tag and access information of the candidate consumption environment.

[0083] After obtaining the message to be transmitted, the proxy service determines the target consumption environment of the message to be transmitted from the candidate consumption environment according to the target consumption environment tag and message subscription record in the message to be transmitted. The candidate consumption environment refers to an instance of a server, service or application that can be a consumer of the message in the communication network. For example, in a test system, the candidate consumption environment can be each test environment or test server built for testing. It is understandable that different functional modules can be deployed in these test environments or test servers, so that each server is specifically used to test a certain part of the function of the complete system under test. The message subscription record is a record generated when the candidate consumption environment subscribes to the proxy service. The message subscription record contains the consumption environment tag of the candidate consumption environment and the access information of the candidate consumption environment. The candidate consumption environment usually needs to subscribe to the proxy service first, so that the proxy service can perceive the existence of the candidate consumption environment and record the consumption environment tag of the candidate consumption environment. In some embodiments, the message subscription record can be directly input into the proxy service by external data entry or configuration information. The access information of the candidate consumption environment is usually the access method of the server where the candidate consumption environment is located, such as the corresponding network address and port or the access information of the established communication link, channel or other communication methods.

[0084] Step S330: determining a target consumption environment from the candidate consumption environments according to a matching result between the consumption environment labels of the candidate consumption environments and the target consumption environment labels.

[0085] In the process of determining the target consumption environment, the proxy service will find out whether to query the corresponding candidate consumption environment based on the matching relationship between the target consumption environment tag and the consumption environment tag of the candidate consumption environment in the message subscription record. Usually, if there is a corresponding candidate consumption environment, the candidate consumption environment will be used as the target consumption environment, and if it does not exist, the default candidate consumption environment will be selected. The default candidate consumption environment is usually configured with all functional modules to ensure that it can process the pending messages originally intended for any candidate consumption environment.

[0086] Step S340: sending the message to be transmitted to the target consumption environment according to the access information of the target consumption environment.

[0087] After obtaining the access information, the proxy service will send the message to be transmitted to the target consumption environment. Specifically, if there is a consumption environment specified by the generator, the message to be transmitted will be sent to the consumption environment specified by its generator. If there is no consumption environment specified by the generator, for example, the specified consumption environment cannot be reached due to network failure, the message to be transmitted will be sent to the default consumption environment specified by the proxy service, such as the baseline consumption environment. The baseline consumption environment is usually a system with all the functional modules in the system, that is, it can be considered that the baseline consumption environment contains the functional modules to be accessed by the message to be transmitted.

[0088] In an embodiment of the present application, by adding an environment tag to the message to be transmitted, the message can reach the specified environment, thereby allowing differences in functional modules of different environments. Changes and failures of functional modules only affect the environment containing the functional module, avoiding changes or failures of a functional module affecting the operating status of all servers, thereby improving deployment efficiency and environmental stability.

[0089] In one embodiment of the present application, based on the above technical solution, the access information includes the communication link of the candidate consumption environment, and the above step S310, obtaining the message to be transmitted containing the target consumption environment tag in the message queue, specifically includes the following steps:

[0090] Receiving the messages to be transmitted respectively through the communication links corresponding to the candidate consumption environments with the message queue, thereby obtaining a plurality of messages to be transmitted;

[0091] The above step S320, determining the consumption environment tag of the candidate consumption environment of the message to be transmitted according to the target consumption environment tag and the message subscription record, specifically includes the following steps:

[0092] For each message to be transmitted, the consumption environment label of the current candidate consumption environment is obtained from the message subscription record according to the communication link through which the message to be transmitted is received from the message queue. The message subscription record contains the correspondence between the communication link of the message queue and the consumption environment label of the candidate consumption environment.

[0093] In this embodiment, there is a separate communication link between each candidate consumption environment and the message queue, and the information of the communication link is stored in the access information of the message subscription record. The proxy service will receive the messages to be transmitted from the message queue through the communication links between the message queue and the message queue corresponding to each candidate consumption environment. That is to say, there is a corresponding communication link between the message queue and the proxy service for each candidate consumption environment. For example, if there are 10 candidate consumption environments, there will be 10 communication links between the message queue and the proxy service. Of course, correspondingly, there are also 10 links between the proxy service and these 10 candidate consumption environments. The proxy service will receive the messages to be transmitted through each communication link between the message queue and the proxy service, that is, 10 communication links will receive 10 messages to be transmitted, so as to determine whether the messages to be transmitted need to be sent for each candidate consumption environment. The messages to be transmitted in each communication link are usually the same, and the proxy connection is used to determine whether the messages to be transmitted in each communication link are to be sent specifically to the candidate consumption environment. For ease of introduction, please refer to Figure 4 , Figure 4 Schematic diagram of the internal implementation of the communication process in the embodiment of the present application. Figure 4 As shown, the queue platform will send the same message to be transmitted in each communication link of the subscription information. For example, message F1 is sent to two consumption environments respectively. In the communication link, the proxy service obtains the consumption environment label of the current candidate consumption environment from the message subscription record according to the communication link where the message to be transmitted is received. The message subscription record contains the correspondence between the communication link of the candidate consumption environment and the consumption environment label of the candidate consumption environment. The message subscription record is the information recorded when the candidate consumption environment subscribes to the producer's message. Figure 4As shown, the message subscription record of consumer F1 will contain its consumption environment label, i.e., F1, and a communication link from the message queue through the proxy service to consumer F1. Based on the message subscription record, the proxy service can determine that the consumption environment label corresponding to the communication link currently receiving the message to be transmitted is F1. For each candidate consumption environment, the proxy service can determine the target consumption environment from the candidate consumption environments based on the matching results of the consumption environment labels of each candidate consumption environment with the target consumption environment label. For example, for message F1, candidate consumer F1 can be determined as the target consumption environment based on the matching of its consumption environment label F1 with the target consumption environment label F1. Similarly, message BS can determine candidate consumer BS as the target consumption environment. Since message F2 has no corresponding candidate consumption environment subscribed to its consumption environment label F2, it will be sent to candidate consumer BS as the baseline environment.

[0094] In the embodiment of the present application, by transmitting messages through multiple communication lines, it is possible to individually determine whether messages need to be transmitted for each candidate consumption environment, thereby avoiding mutual influence between communication links of the candidate consumption environments and improving the stability of the solution.

[0095] In one embodiment of the present application, based on the above technical solution, the above step S330, according to the matching result of the consumption environment label of the candidate consumption environment and the target consumption environment label, determines the target consumption environment from the candidate consumption environment, specifically comprising the following steps:

[0096] For each candidate consumption environment, if the consumption environment label of the current candidate consumption environment matches the target consumption environment label, then determining the current candidate consumption environment as the target consumption environment;

[0097] If the consumption environment tag of the current candidate consumption environment does not match the target consumption environment tag, the message to be transmitted is discarded in the communication link of the current candidate consumption environment.

[0098] In this embodiment, for each candidate consumption environment, if the consumption environment label of the current candidate consumption environment matches the target consumption environment label, the current candidate consumption environment is determined to be the target consumption environment. Figure 4 , in the communication link of candidate consumer F1, its consumption environment tag matches the target consumption environment tag of message F1, then message F1 is sent to candidate consumer F1 by the proxy service. If the consumption environment tag of the current candidate consumption environment does not match the target consumption environment tag, the message to be transmitted is discarded in the communication link of the current candidate consumption environment. Figure 4For candidate consumer F1, message F2 and message BS are discarded in the communication link of candidate consumer F1 because the consumption environment label does not match the target consumption environment label. The proxy service performs the judgment operation of whether to send the message to be transmitted in each communication link separately, that is, an independent judgment is made in each communication link, and there is no impact on each other. Even for the baseline environment, although it will receive messages that are not received by the feature environment, the judgment of whether a message exists in the feature environment is still independently judged in the communication link of the baseline environment, without the need to receive the results from the connections of other environments. The communication links of each candidate consumption environment are independent of each other and send or discard messages to be transmitted separately, thereby avoiding communication failures in some consumption environments from affecting the processing of messages by other consumption environments, thereby improving the stability of the solution.

[0099] In an embodiment of the present application, messages that do not need to be transmitted are discarded through the matching results of the consumption environment label and the target consumption environment label, thereby reducing the amount of data that needs to be processed by the candidate consumption environment, avoiding useless messages from occupying computing resources, and improving the execution efficiency of message processing.

[0100] In one embodiment of the present application, based on the above technical solution, both the target consumption environment tag and the consumption environment tag include the environment type; the above steps, if the consumption environment tag of the current candidate consumption environment does not match the target consumption environment tag, then discarding the message to be transmitted in the communication link of the current candidate consumption environment, specifically include the following steps:

[0101] If the environment type in the target consumption environment tag is a baseline environment and the environment type in the consumption environment tag of the current candidate consumption environment is a characteristic environment, discarding the message to be transmitted in the communication link of the current candidate consumption environment;

[0102] If the environment type in the target consumption environment tag is a characteristic environment and the environment type in the consumption environment tag of the current candidate consumption environment is a baseline environment, obtaining matching results of consumption environment tags of other candidate consumption environments and the target consumption environment tag;

[0103] If the matching result indicates that there are other candidate consumption environments whose consumption environment tags match the target consumption environment tag, discarding the message to be transmitted in the communication link of the current candidate consumption environment;

[0104] If the matching result indicates that the consumption environment labels of other candidate consumption environments do not match the target consumption environment label, the current candidate consumption environment is determined to be the target consumption environment.

[0105] Both the target consumer environment tag and the consumer environment tag contain the environment type. The environment type includes the feature environment and the baseline environment. A specific environment usually contains only some functions and can only process specific types of messages to be transmitted. When the message generator generates the message to be transmitted, it will add the consumer environment tag of the candidate consumer environment that can perform the required function to the message to be transmitted. The proxy service will allow the message to be transmitted to be transmitted to the corresponding feature environment first, and will only be transmitted to the baseline environment if there is no corresponding feature environment. The baseline environment is an environment that contains all functional modules and has the ability to process messages generated by any producer. The proxy service will determine whether to transmit or discard the message based on the environment type of the current communication link and the environment type of the consumer environment to be reached in the message to be transmitted. Specifically, if the environment type in the target consumer environment tag is the baseline environment, and the environment type in the consumer environment tag of the current candidate consumer environment is the feature environment, it means that the message to be transmitted is to be sent to the baseline environment and is currently connected to the specific environment, and the message to be transmitted is directly discarded. If the environment type in the target consumption environment tag is a baseline environment, and the environment type in the consumption environment tag of the current candidate consumption environment is also a baseline environment, the message to be transmitted will be transmitted in the current communication link to be sent to the current candidate consumption environment. If the environment type in the target consumption environment tag is a characteristic environment and the environment type in the consumption environment tag of the current candidate consumption environment is a baseline environment, it is necessary to determine whether there is a matching target consumption environment in other candidate consumption environments currently connected to the proxy service, and obtain the matching results of the consumption environment tags of other candidate consumption environments and the target consumption environment tags. The proxy service can directly obtain the consumption environment tags of other candidate consumption environments from the message subscription record, thereby matching the target consumption environment tags. If the matching result indicates that there are consumption environment tags of other candidate consumption environments that match the target consumption environment tag, it means that there is a corresponding characteristic environment, and the baseline environment is not required to process the message to be transmitted, so the message to be transmitted is discarded in the communication link of the current candidate consumption environment. If the matching result indicates that the consumption environment labels of other candidate consumption environments do not match the target consumption environment label, it means that there is currently no characteristic environment that can process the message to be transmitted. Therefore, the current candidate consumption environment is determined to be the target consumption environment, and the message to be transmitted is transmitted to the baseline environment.

[0106] In an embodiment of the present application, the target consumption environment is determined based on the environment type of the candidate consumption environment or the message to be transmitted is discarded, so that a specific baseline environment can receive messages that are not received by other characteristic environments, avoiding transmission failures of messages due to the absence of a receiver, and improving the transmission accuracy of the solution.

[0107] In one embodiment of the present application, based on the above technical solution, the message to be transmitted includes module identification information of a functional module for processing the message to be transmitted; in the above step, if the matching result indicates that there are consumption environment tags of other candidate consumption environments that match the target consumption environment tag, then discarding the message to be transmitted in the communication link of the current candidate consumption environment includes:

[0108] Acquire module identification information of the other candidate consumption environments from the message subscription record;

[0109] If the matching result indicates that there are other candidate consumption environments whose consumption environment tags match the target consumption environment tag and the module identification information of the other candidate consumption environments does not match the module identification information in the message to be transmitted, then the message to be transmitted is discarded in the communication link of the current candidate consumption environment.

[0110] In this embodiment, when the consumer environment is subscribing, it will provide the proxy service with the module identification information of the functional module configured locally, such as the name or number of the module. The generator of the message to be transmitted will also additionally specify the module identification information of the functional module involved in the message when generating the message. In addition to determining that the consumer environment tag of a candidate consumer environment matches the target consumer environment tag, the proxy service will further determine that the candidate consumer environment contains the functional module required to process the message to be transmitted. Specifically, in the message subscription record of the proxy service, the main fields stored for a candidate consumer environment will include three fields: subject, consumer module name, and routing tag. When looking for a candidate consumer environment that matches the target consumer environment tag, the proxy service will search according to these three fields. Specifically, if the matching result indicates that there are other candidate consumer environments whose consumer environment tags match the target consumer environment tag, that is, there are candidate consumer environments whose subscription topics and consumer environment tags match the target consumer environment tags, then the module identification information of the candidate consumer environment is obtained in the message subscription record, and the module identification information is compared with the module identification information in the message to be transmitted. If the module identification information in the candidate consumption environment does not match the module identification information in the message to be transmitted, it indicates that the current candidate consumption environment cannot be used to process the message to be transmitted, and the message to be transmitted will be discarded in the communication link of the current candidate consumption environment. The message to be transmitted will be transmitted to the baseline environment. For example, the target consumption environment label of the message to be transmitted indicates that the name of the functional module used to process the message is FM1. When determining the target consumption environment, if the consumption environment label of a candidate consumption environment matches the target consumption environment label, but FM1 does not exist in the functional module of the candidate consumption environment, the candidate consumption environment will not be determined as the target consumption environment. In some embodiments, when looking for a candidate consumption environment that matches the target consumption environment label, the proxy service will splice the three fields of subject, consumer module name and routing label into one field to search in the message subscription record. Specifically, when searching for the corresponding. When matching the consumption environment label of the current candidate consumption environment with the target consumption environment label, the proxy service obtains the subject, module identification information and consumption environment label subscribed by the current candidate consumption environment. Subsequently, the subject, module identification information and consumption environment label are spliced ​​in a predetermined order to obtain a splicing result field. Then, the concatenated result field is used as the search keyword to find out whether there is a corresponding record in the message subscription record. Correspondingly, the message subscription record also records the correspondence between the concatenated result of the subject, consumer module name and routing label subscribed by the candidate consumption environment and the communication link, so as to directly determine whether the candidate consumption environment containing the corresponding functional module exists through a single comparison.

[0111] In an embodiment of the present application, when determining whether to discard a message to be transmitted, it is further considered whether the candidate consumption environment includes a functional module for processing the message to be transmitted, thereby ensuring that the message to be transmitted will not be sent to a candidate consumption environment that does not have the processing capability, which is beneficial to improving the success rate of message transmission.

[0112] In one embodiment of the present application, based on the above technical solution, the message subscription record also includes the status update time of each communication link; the above step, if the matching result indicates that there are consumption environment tags of other candidate consumption environments that match the target consumption environment tag, then discarding the message to be transmitted in the communication link of the current candidate consumption environment, specifically includes the following steps:

[0113] If the matching result indicates that there are other candidate consumption environments whose consumption environment tags match the target consumption environment tag, obtaining the status update time of the communication link of the other candidate consumption environment from the message subscription record;

[0114] If the time difference between the state update time and the current time is greater than a preset time length, discarding the message to be transmitted in the communication link of the current candidate consumption environment;

[0115] If the time difference between the status update time and the current time is less than or equal to the preset duration, the current candidate consumption environment is determined to be the target consumption environment.

[0116] In this embodiment, when determining that the candidate consumption environment matches the target consumption environment tag, it is necessary to further confirm that the candidate consumption environment is in a normal operating state. The operating state is determined according to the state update time of the corresponding communication link. The proxy service will regularly confirm the state of each communication link in the current subscription message record, and update the state update time of each communication link in the message subscription record after confirmation. When the matching result indicates that there is a consumer environment tag of another candidate consumption environment that matches the target consumption environment tag, the proxy service will obtain the state update time of the communication link of the other candidate consumption environment from the message subscription record. If the time difference between the state update time and the current moment is greater than the preset duration, it means that the other candidate consumption environment is already in a disconnected state, that is, it cannot communicate with the candidate consumption environment through the corresponding communication link, and the communication link of the current candidate consumption environment will discard the message to be transmitted. If the time difference between the state update time and the current moment is less than or equal to the preset duration, it means that the other candidate consumption environment is already in a normal connection state, and the current candidate consumption environment is determined to be the target consumption environment. It can be understood that in this embodiment, the other candidate consumption environment is a characteristic environment, that is, an environment that only contains some functional modules. Such an environment discards the message to be transmitted when it is confirmed that the environment cannot communicate. For the baseline environment, the proxy service will send the message to be transmitted to the baseline environment after confirming that the state update time of the candidate consumption environment matched from the message subscription record exceeds the expected time. For example, assuming that the preset time difference is 30 seconds, if the time difference between the state update time and the current time exceeds 30 seconds, it means that the communication link of the current candidate consumption environment cannot communicate normally, so the message to be transmitted is discarded. If it is less than 30 seconds, the message to be transmitted is sent to the current candidate consumption environment.

[0117] In an embodiment of the present application, when judging whether to discard the message to be transmitted, the update time of the link status is further used to ensure that the message to be transmitted will not be sent to an offline candidate consumption environment, which is beneficial to reduce the probability of transmission failure and improve the stability of the solution.

[0118] In one embodiment of the present application, based on the above technical solution, before the above step of obtaining the message to be transmitted containing the target consumption environment tag in the message queue, the solution of the present application further includes the following steps:

[0119] Periodically checking instances of each communication link in the message subscription record;

[0120] For a communication link for which an instance exists, the state update time of the communication link is updated in the message subscription record.

[0121] In this embodiment, the proxy service periodically checks the instances of each communication link in the message subscription record. For example, the status of each communication link instance is checked every 10 seconds. The instance of the communication link is a communication link from the message queue to the candidate consumer environment through the proxy service to be maintained in the proxy service. There is a corresponding separate link for each candidate consumer environment. As long as the candidate consumer environment is still online, the instance of the communication link will exist. Correspondingly, if the instance of the communication link does not exist, it can be considered that the candidate consumer environment is offline. If the instance of the proxy service communication link exists, it will update the status update time of the communication link in the message subscription record. The cycle for checking the communication link instance is usually shorter than the preset duration for confirming the consumer environment status. For example, the preset duration is 30 seconds, and the check cycle is 10 seconds. The initial update of the status update time is usually continuously updated during the period when the communication link is built in the candidate consumer environment online until the candidate consumer environment is disconnected from the message queue.

[0122] In an embodiment of the present application, the example status of the communication link is periodically checked and the status update time is updated, thereby ensuring that the solution can send the message to be transmitted to the online consumer environment, avoiding communication failures caused by link abnormalities, and improving the stability of the solution.

[0123] In an optional embodiment of the present application, before obtaining the message to be transmitted containing the target consumption environment tag in the message queue, the scheme of the present application also establishes a communication link instance corresponding to the candidate consumption environment with the message queue according to the subscription request sent by the candidate consumption environment. The subscription request is a request initiated by the candidate consumption environment according to the user operation or configuration file, which is used to transmit the information of the message producer to which it wants to subscribe to the proxy service. The subscription request contains the consumption environment tag and access information of the candidate consumption environment. After receiving the subscription request, the proxy service establishes a communication link instance corresponding to the candidate consumption environment with the message queue. It can be understood that a communication link or link with the candidate subscription environment will also be established at the same time. Subsequently, the proxy service will add the consumption environment tag and access information of the candidate consumption environment and the corresponding relationship between the communication link of the message queue and the consumption environment tag of the candidate consumption environment in the message subscription record for subsequent message transmission process.

[0124] In one embodiment of the present application, based on the above technical solution, the above step of discarding the message to be transmitted in the communication link of the current candidate consumption environment specifically includes the following steps:

[0125] Parsing the message to be transmitted to obtain a message identifier of the message to be transmitted;

[0126] generating a simulated confirmation message of the message to be transmitted according to the message identifier;

[0127] The simulation confirmation message is sent to the message queue.

[0128] In this embodiment, when the proxy service discards the message to be transmitted, a simulated confirmation message will be generated and fed back to the message queue, and then fed back to the message generation environment of the message to be transmitted. Specifically, after the proxy service confirms that the message to be transmitted is to be discarded, it will parse the message to be transmitted to obtain the message identifier of the message to be transmitted. The message identifier is usually information such as the number of the message to be transmitted, which is used for the communicating parties to confirm the association relationship of the communication content and the response relationship between the confirmation messages. The proxy service generates a simulated confirmation message for the message to be transmitted based on the message identifier. The simulated confirmation message is used to respond to the message generation environment of the message to be transmitted. The proxy service sends a simulated confirmation message to the message generation environment of the message to be transmitted. In an actual scenario, the simulated confirmation message will arrive at the message forwarder in the communication network. The message forwarder will summarize the feedback from each candidate message environment and feed the final result back to the message generation environment. For ease of introduction, please refer to Figure 5 , Figure 5 FIG. 1 is a schematic flow chart of discarding a message in an embodiment of the present application. Figure 5 As shown, the message forwarder of the message queue sends the message to the proxy service. After the proxy service determines that the message needs to be discarded, it generates a simulated confirmation message and feeds it back to the message forwarder.

[0129] In an embodiment of the present application, a simulated confirmation message is generated as a response for the discarded message to be transmitted, without the candidate consumption environment participating in the response process, thereby reducing the processing required by the candidate consumption environment and improving the operating efficiency of the candidate consumption environment.

[0130] In one embodiment of the present application, based on the above technical solution, before the above step S310, in which the message to be transmitted containing the target consumption environment tag in the message queue is obtained, the solution of the present application further includes the following steps:

[0131] Receive an environment subscription request for a candidate consumption environment, wherein the environment subscription request includes a consumption environment tag of the candidate consumption environment;

[0132] In response to the environment subscription request, establishing a communication link with the candidate consumption environment;

[0133] The correspondence between the communication link and the consumption environment tag is recorded in the message subscription record.

[0134] In this embodiment, the subscription request of the message generation environment will first pass through the proxy service and then be forwarded to the message forwarder of the message queue. The proxy service will parse the subscription request and obtain the consumption environment label of the candidate consumption environment from the metadata. In response to the environment subscription request, the proxy service will establish a communication link for the candidate consumption environment, that is, a communication link from the message queue to the candidate consumption environment, and record the correspondence between the communication link and the consumption environment label in the message subscription record, in preparation for the proxy service to filter messages later. Please refer to Figure 6 , Figure 6 FIG. 1 is a schematic flow chart of the subscription process in the embodiment of the present application. Figure 6 As shown, the environment subscription request of the candidate consumption environment is sent to the proxy service, the proxy service identifies the consumption environment tag and requests registration with the message queue, and the subscription result of the message queue is fed back to the candidate consumption environment through the proxy service.

[0135] In an embodiment of the present application, a communication link is established based on a reading request of a candidate consumption environment and the correspondence between the communication link and the consumption environment label is recorded, so that the solution can find the corresponding communication link based on the message subscription record, and establish the communication link before obtaining the message, avoiding establishing the communication link again during the message transmission process, thereby improving the message transmission efficiency.

[0136] In one embodiment of the present application, based on the above technical solution, after the above step S330, sending the message to be transmitted to the target consumption environment, the solution of the present application further includes the following steps:

[0137] Receiving a consumption confirmation message sent by the target consumption environment for the message to be transmitted;

[0138] Forward the consumption confirmation message to the message queue.

[0139] In this embodiment, if the proxy service confirms that the message to be transmitted is delivered to the consumer environment, the consumer environment replies a response confirmation to the proxy service after receiving the message, and the proxy service forwards the response to the message generation environment or to the message queue. Figure 7 , Figure 7 The following is a schematic flow chart of sending a message to be transmitted in a communication link in an embodiment of the present application. The message queue sends the message to be transmitted to the proxy service, and the proxy service determines that the message needs to be transparently transmitted to the candidate consumption environment according to the above method, and then transparently transmits the message to be transmitted to the candidate consumption environment. The consumption confirmation of the candidate consumption environment is fed back to the message queue through the proxy service.

[0140] In the solution of the present application, the consumption confirmation message is forwarded by the proxy service, so that the established communication connection is directly used without the need to establish an additional separate communication connection, thereby improving the communication efficiency of the solution.

[0141] In one embodiment of the present application, based on the above technical solution, before the above step S310, in which the message to be transmitted containing the target consumption environment tag in the message queue is obtained, the solution of the present application further includes the following steps:

[0142] Receive a routing label acquisition request sent by a message generation environment;

[0143] In response to the routing label acquisition request, the consumption environment label of the candidate consumption environment is sent to the message generation environment according to the message subscription record, so that the message generation environment generates a message to be transmitted for the candidate consumption environment according to the consumption environment label.

[0144] In this embodiment, before generating a message to be transmitted, the message generation environment will request the consumption environment tag of the currently existing candidate consumption environment from the proxy service to specify the recipient of the message to be transmitted. The proxy service will receive the routing tag acquisition request sent by the message generation environment. The routing tag acquisition request is usually used to obtain the consumption environment tags of all candidate consumption environments existing in the current subscription message record. In response to the routing tag acquisition request, the proxy service sends the consumption environment tag of the candidate consumption environment to the message generation environment according to the message subscription record. The message generation environment will then generate a message to be transmitted for the candidate consumption environment based on the consumption environment tag.

[0145] In some embodiments, the routing tag acquisition request may include a module identifier of a specific functional module, and the proxy service may query the subscription message record to obtain the consumption environment tag of the candidate consumption environment including the functional module based on the module identifier.

[0146] In an embodiment of the present application, consumption environment tags of candidate consumption environments are provided to the message generation environment request, and a specific implementation plan for obtaining consumption environment tags is provided, which is beneficial to the operability of the plan.

[0147] The following is an introduction to the overall solution of this application with reference to specific examples. Figure 8 , Figure 8 FIG. 1 is a schematic flow chart of the overall process of message transmission in the test environment in the embodiment of the present application. Figure 8 As shown, the communication links in the entire environment are divided into multiple lanes, each lane corresponds to a consumption environment, such as Figure 8The characteristic environment lane 1, characteristic environment lane 2 and baseline environment lane in the . Among them, the characteristic environment lane 1 contains cloud native business, the characteristic environment lane 2 contains non-cloud native business, and the baseline environment lane has both. In the startup structure of the overall environment, the bucket splitting tool is used to split according to the module list of the whole bucket mode, and the environment tool set is declared in the orchestration to pull up the containers of each environment. For the characteristic environment lane 1, the lane will be created during the startup process, and the cloud native module container will be started to form the corresponding consumption environment. The characteristic environment lane 2 is similar, creating a corresponding lane and starting the non-cloud module container to form the corresponding consumption environment. For the baseline environment, the content in the characteristic environment lane 1 and the characteristic environment lane 2 will be started, and for the non-cloud module, the environment tool set will be deployed to a separate process or container to start the environment. The specific process of establishing a lane refers to the process of establishing a communication link described in the above embodiment. After establishing a multi-lane environment, when the message of the message generator enters the asynchronous message queue and is to be sent to the consumer environment, it will pass through the asynchronous queue proxy service and preferentially reach the server in the corresponding feature environment. If there is no corresponding feature environment, it will reach the baseline environment. The specific transmission process is carried out with reference to the message transmission method in the above embodiment. For example, the request message for the cloud native module will include the identifier corresponding to feature environment lane 1. The request message will be sent to feature environment lane 1 by the asynchronous queue proxy service. However, if the environment in feature environment lane 1 fails and goes offline, the request message will be sent to the baseline environment.

[0148] It should be noted that although the steps of the method in the present application are described in a specific order in the drawings, this does not require or imply that the steps must be performed in this specific order, or that all the steps shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps, etc.

[0149] The following introduces the device implementation of the present application, which can be used to execute the message transmission method in the above embodiment of the present application. Fig. 9 The block diagram of the message transmission device in the embodiment of the present application is schematically shown. Fig. 9 As shown, the message transmission device 900 may mainly include:

[0150] A message acquisition module 910 is used to acquire a message to be transmitted that contains a target consumption environment tag in a message queue, where the target consumption environment tag is a consumption environment tag specified by a generator of the message to be transmitted;

[0151] The tag acquisition module 920 is used to determine the consumption environment tag of the candidate consumption environment of the message to be transmitted according to the target consumption environment tag and the message subscription record, wherein the message subscription record includes the consumption environment tag and access information of the candidate consumption environment;

[0152] An environment determination module 930, configured to determine a target consumption environment from the candidate consumption environments according to a matching result between the consumption environment labels of the candidate consumption environments and the target consumption environment labels;

[0153] The message transmission module 940 is used to send the message to be transmitted to the target consumption environment according to the access information of the target consumption environment in the message subscription record.

[0154] In some embodiments of the present application, based on the above technical solution, the access information includes the communication link of the candidate consumption environment; the message acquisition module 910 includes:

[0155] A message receiving submodule, used to receive the to-be-transmitted messages respectively through the communication link corresponding to each candidate consumption environment between the message queue and the message queue, so as to obtain a plurality of to-be-transmitted messages;

[0156] The environment determination module 930 includes:

[0157] The label acquisition submodule is used to obtain the consumption environment label of the current candidate consumption environment from the message subscription record for each message to be transmitted, according to the communication link through which the message to be transmitted is received from the message queue, wherein the message subscription record contains the correspondence between the communication link of the message queue and the consumption environment label of the candidate consumption environment.

[0158] In some embodiments of the present application, based on the above technical solution, the environment determination module 930 includes:

[0159] An environment determination submodule, for each candidate consumption environment, if the consumption environment label of the current candidate consumption environment matches the target consumption environment label, then determining the current candidate consumption environment as the target consumption environment;

[0160] The message discarding submodule is used to discard the message to be transmitted in the communication link of the current candidate consumption environment if the consumption environment tag of the current candidate consumption environment does not match the target consumption environment tag.

[0161] In some embodiments of the present application, based on the above technical solution, the target consumption environment tag and the consumption environment tag both include an environment type; the message discarding submodule includes:

[0162] A first message discarding unit, configured to discard the message to be transmitted in the communication link of the current candidate consumption environment if the environment type in the target consumption environment tag is a baseline environment and the environment type in the consumption environment tag of the current candidate consumption environment is a characteristic environment;

[0163] A label matching unit, configured to obtain matching results of the consumption environment labels of other candidate consumption environments with the target consumption environment label if the environment type in the target consumption environment label is a characteristic environment and the environment type in the consumption environment label of the current candidate consumption environment is a baseline environment;

[0164] A second message discarding unit, configured to discard the message to be transmitted in the communication link of the current candidate consumption environment if the matching result indicates that there are consumption environment tags of other candidate consumption environments that match the target consumption environment tag;

[0165] The first determining unit is configured to determine that the current candidate consumption environment is a target consumption environment if the matching result indicates that the consumption environment tags of other candidate consumption environments do not match the target consumption environment tag.

[0166] In some embodiments of the present application, based on the above technical solution, the message to be transmitted includes module identification information of a functional module for processing the message to be transmitted; and the second message discarding unit includes:

[0167] A module identification acquisition subunit, used to acquire module identification information of the other candidate consumption environments from the message subscription record;

[0168] The first message discarding sub-unit is used to discard the message to be transmitted in the communication link of the current candidate consumption environment if the matching result indicates that there are other candidate consumption environments whose consumption environment tags match the target consumption environment tag and the module identification information of the other candidate consumption environments does not match the module identification information in the message to be transmitted.

[0169] In some embodiments of the present application, based on the above technical solution, the message subscription record also includes the status update time of each communication link; the second message discarding unit includes:

[0170] An update time acquisition subunit, configured to acquire the state update time of the communication link of the other candidate consumption environment from the message subscription record if the matching result indicates that there is a consumption environment tag of the other candidate consumption environment that matches the target consumption environment tag;

[0171] A second message discarding subunit is configured to discard the message to be transmitted in the communication link of the current candidate consumption environment if the time difference between the status update time and the current time is greater than a preset time length;

[0172] The environment confirmation subunit is used to determine that the current candidate consumption environment is the target consumption environment if the time difference between the status update time and the current time is less than or equal to the preset time length.

[0173] In some embodiments of the present application, based on the above technical solution, the message transmission device further includes:

[0174] A link checking module, used for periodically checking instances of each communication link in the message subscription record;

[0175] The time updating module is used to update the state update time of the communication link in the message subscription record for the communication link having the instance.

[0176] In some embodiments of the present application, based on the above technical solution, the message discarding submodule includes:

[0177] A message parsing unit, used for parsing the message to be transmitted and obtaining a message identifier of the message to be transmitted;

[0178] A message generating unit, configured to generate a simulated confirmation message of the message to be transmitted according to the message identifier;

[0179] A confirmation message sending unit is used to send the simulated confirmation message to the message queue.

[0180] In some embodiments of the present application, based on the above technical solution, the message transmission device further includes:

[0181] A subscription receiving module, used to receive an environment subscription request of a candidate consumption environment, wherein the environment subscription request includes a consumption environment tag of the candidate consumption environment;

[0182] A link establishment module, configured to establish a communication link of the candidate consumption environment in response to the environment subscription request;

[0183] A recording module is used to record the corresponding relationship between the communication link and the consumption environment tag in the message subscription record.

[0184] In some embodiments of the present application, based on the above technical solution, the message transmission device further includes:

[0185] A confirmation message receiving module, used to receive a consumption confirmation message sent by the target consumption environment for the message to be transmitted;

[0186] A confirmation message forwarding module is used to forward the consumption confirmation message to the message queue.

[0187] In some embodiments of the present application, based on the above technical solution, the message transmission device further includes:

[0188] A label acquisition request receiving module, used to receive a routing label acquisition request sent by a message generation environment;

[0189] An environment tag sending module is used to respond to the routing tag acquisition request and send the consumption environment tag of the candidate consumption environment to the message generation environment according to the message subscription record, so that the message generation environment generates a message to be transmitted for the candidate consumption environment according to the consumption environment tag.

[0190] It should be noted that the apparatus provided in the above embodiment and the method provided in the above embodiment belong to the same concept, wherein the specific manner in which each module performs the operation has been described in detail in the method embodiment and will not be repeated here.

[0191] Fig.10 A schematic diagram of the structure of a computer system suitable for implementing an electronic device of an embodiment of the present application is shown.

[0192] It should be noted that Fig.10 The computer system 1000 of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0193] like Fig.10 As shown, the computer system 1000 includes a central processing unit (CPU) 1001, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 1002 or the program loaded from the storage part 1008 to the random access memory (RAM) 1003. Various programs and data required for system operation are also stored in the RAM 1003. The CPU 1001, the ROM 1002 and the RAM 1003 are connected to each other through a bus 1004. An input / output (I / O) interface 1005 is also connected to the bus 1004.

[0194] The following components are connected to the I / O interface 1005: an input section 1006 including a keyboard, a mouse, etc.; an output section 1007 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 1008 including a hard disk, etc.; and a communication section 1009 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 1009 performs communication processing via a network such as the Internet. A drive 1010 is also connected to the I / O interface 1005 as needed. A removable medium 1011, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 1010 as needed, so that a computer program read therefrom is installed into the storage section 1008 as needed.

[0195] In particular, according to an embodiment of the present application, the process described in each method flow chart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flow chart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication part 1009, and / or installed from a removable medium 1011. When the computer program is executed by a central processing unit (CPU) 1001, various functions defined in the system of the present application are executed.

[0196] It should be noted that the computer-readable medium shown in the embodiment of the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, - but not limited to - an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by an instruction execution system, device or device or used in combination with it. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, wherein a computer-readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate, or transmit programs for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.

[0197] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the above-mentioned module, program segment or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0198] It should be noted that, although several modules or units of the equipment for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into being embodied by multiple modules or units.

[0199] Through the description of the above implementation methods, it is easy for those skilled in the art to understand that the example implementation methods described here can be implemented by software or by combining software with necessary hardware. Therefore, the technical solution according to the implementation methods of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a touch terminal, or a network device, etc.) to execute the method according to the implementation methods of the present application.

[0200] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary technical means in the art that are not disclosed in the present application.

[0201] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.

Claims

1. A message transmission method, characterized in that: include: Receiving the messages to be transmitted respectively through the communication links corresponding to the candidate consumption environments with the message queue, wherein the target consumption environment tag is the message consumption environment tag specified by the generator of the message to be transmitted; For each message to be transmitted, according to the communication link for receiving the message to be transmitted from the message queue, the consumption environment tag of the current candidate consumption environment is obtained from the message subscription record, wherein the message subscription record includes the consumption environment tag and access information of the candidate consumption environment and the correspondence between the communication link of the message queue and the consumption environment tag of the candidate consumption environment; Determining a target consumption environment from the candidate consumption environments according to a matching result between the consumption environment labels of the candidate consumption environments and the target consumption environment labels; The message to be transmitted is sent to the target consumption environment according to the access information of the target consumption environment in the message subscription record.

2. The method according to claim 1, characterized in that The determining the target consumption environment from the candidate consumption environments according to the matching result of the consumption environment label of the candidate consumption environment and the target consumption environment label comprises: For each candidate consumption environment, if the consumption environment label of the current candidate consumption environment matches the target consumption environment label, then determining the current candidate consumption environment as the target consumption environment; If the consumption environment tag of the current candidate consumption environment does not match the target consumption environment tag, the message to be transmitted is discarded in the communication link of the current candidate consumption environment.

3. The method according to claim 2, characterized in that The target consumption environment tag and the consumption environment tag both include an environment type; if the consumption environment tag of the current candidate consumption environment does not match the target consumption environment tag, discarding the message to be transmitted in the communication link of the current candidate consumption environment includes: If the environment type in the target consumption environment tag is a baseline environment and the environment type in the consumption environment tag of the current candidate consumption environment is a characteristic environment, discarding the message to be transmitted in the communication link of the current candidate consumption environment; If the environment type in the target consumption environment tag is a characteristic environment and the environment type in the consumption environment tag of the current candidate consumption environment is a baseline environment, obtaining matching results of consumption environment tags of other candidate consumption environments and the target consumption environment tag; If the matching result indicates that there are other candidate consumption environments whose consumption environment tags match the target consumption environment tag, discarding the message to be transmitted in the communication link of the current candidate consumption environment; If the matching result indicates that the consumption environment labels of other candidate consumption environments do not match the target consumption environment label, the current candidate consumption environment is determined to be the target consumption environment.

4. The method according to claim 3, characterized in that: The message to be transmitted includes module identification information of a functional module for processing the message to be transmitted; if the matching result indicates that there is a consumption environment tag of another candidate consumption environment that matches the target consumption environment tag, discarding the message to be transmitted in the communication link of the current candidate consumption environment, including: Acquire module identification information of the other candidate consumption environments from the message subscription record; If the matching result indicates that there are other candidate consumption environments whose consumption environment tags match the target consumption environment tag and the module identification information of the other candidate consumption environments does not match the module identification information in the message to be transmitted, then the message to be transmitted is discarded in the communication link of the current candidate consumption environment.

5. The method according to claim 3, characterized in that: The message subscription record also includes the status update time of each communication link; if the matching result indicates that there is a consumption environment tag of another candidate consumption environment that matches the target consumption environment tag, then discarding the message to be transmitted in the communication link of the current candidate consumption environment, including: If the matching result indicates that there are other candidate consumption environments whose consumption environment tags match the target consumption environment tag, obtaining the status update time of the communication link of the other candidate consumption environment from the message subscription record; If the time difference between the state update time and the current time is greater than a preset time length, discarding the message to be transmitted in the communication link of the current candidate consumption environment; If the time difference between the status update time and the current time is less than or equal to the preset duration, the current candidate consumption environment is determined to be the target consumption environment.

6. The method according to claim 5, characterized in that Before obtaining the message to be transmitted including the target consumption environment tag, the method further includes: Periodically checking instances of each communication link in the message subscription record; For a communication link for which an instance exists, the state update time of the communication link is updated in the message subscription record.

7. The method according to claim 5, characterized in that Before obtaining the message to be transmitted including the target consumption environment tag, the method further includes: Establishing a communication link instance corresponding to the candidate consumption environment with the message queue according to a subscription request sent by the candidate consumption environment, wherein the subscription request includes a consumption environment tag and access information of the candidate consumption environment; The consumption environment tag and access information of the candidate consumption environment and the corresponding relationship between the communication link of the message queue and the consumption environment tag of the candidate consumption environment are added to the message subscription record.

8. The method according to claim 3, characterized in that The discarding of the to-be-transmitted message in the communication link of the current candidate consumption environment comprises: Parsing the message to be transmitted to obtain a message identifier of the message to be transmitted; generating a simulated confirmation message of the message to be transmitted according to the message identifier; The simulation confirmation message is sent to the message queue.

9. The method according to claim 2, characterized in that: Before obtaining the message to be transmitted including the target consumption environment tag, the method further includes: Receive an environment subscription request for a candidate consumption environment, wherein the environment subscription request includes a consumption environment tag of the candidate consumption environment; In response to the environment subscription request, establishing a communication link with the candidate consumption environment; The correspondence between the communication link and the consumption environment tag is recorded in the message subscription record.

10. The method according to claim 1, characterized in that After sending the message to be transmitted to the target consumption environment according to the access information of the target consumption environment in the message subscription record, the method further includes: Receiving a consumption confirmation message sent by the target consumption environment for the message to be transmitted; Forward the consumption confirmation message to the message queue.

11. The method according to claim 1, characterized in that: Before obtaining the message to be transmitted including the target consumption environment tag, the method further includes: Receive a routing label acquisition request sent by a message generation environment; In response to the routing label acquisition request, the consumption environment label of the candidate consumption environment is sent to the message generation environment according to the message subscription record, so that the message generation environment generates a message to be transmitted for the candidate consumption environment according to the consumption environment label.

12. A message transmission device, characterized in that: include: A message acquisition module, used to acquire a message to be transmitted containing a target consumption environment tag, wherein the target consumption environment tag is a message consumption environment tag specified by a generator of the message to be transmitted; A label acquisition module, used to determine the consumption environment label of the candidate consumption environment of the message to be transmitted according to the target consumption environment label and the message subscription record, wherein the message subscription record includes the consumption environment label and access information of the candidate consumption environment; An environment determination module, configured to determine a target consumption environment from the candidate consumption environments according to a matching result between the consumption environment labels of the candidate consumption environments and the target consumption environment labels; The message transmission module is used to send the message to be transmitted to the target consumption environment according to the access information of the target consumption environment in the message subscription record.

13. An electronic device, characterized in that: include: processor; A memory, configured to store executable instructions of the processor; The processor is configured to execute the message transmission method according to any one of claims 1 to 11 by executing the executable instructions.

14. A computer readable medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the message transmission method according to any one of claims 1 to 11 is implemented.

15. A computer program product, characterized in that The computer program product includes computer instructions, which are stored in a computer-readable storage medium. A processor of a computer device reads and executes the computer instructions from the computer-readable storage medium, so that the computer device executes the message transmission method according to any one of claims 1 to 11.