A carrier channel adaptation method for RCS messages across three networks

By adjusting the card content boundaries and determining the operator channels, the problem of inconsistent content in the RCS message processing of the three networks was solved, operator channel adaptation was achieved, and the compatibility and reliability of message submission were improved.

CN123123830APending Publication Date: 2026-11-17SUZHOU LIJINGHE INFORMATION TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611214505.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-11
Publication Date
2026-11-17

AI Technical Summary

Technical Problem

In the current RCS message processing of the three major networks, there are differences in request format, field length, character encoding, and media resource upload methods among the channels of each operator. This leads to inconsistencies in the correspondence between the text, media resources, and interactive buttons in the card. Switching channels may result in inconsistencies between the displayed content and the interactive operation. Furthermore, the existing processing methods are prone to causing content to exceed limits or fail to meet the submission requirements.

Method used

By obtaining the RCS message sending request, the operator channel is determined, and the card content boundary is adjusted according to the access information of the target operator. The correspondence between the text content segment and media resources and interactive buttons is established, and the associated content is moved to meet the message submission requirements. The operator channel is re-determined and the card content boundary is adjusted until it meets the message submission format of the target operator.

Benefits of technology

It improves the compatibility and content integrity of RCS rich media messages across three networks, ensures that the submission path complies with the operator's access conditions, avoids the separation of content and interactive functions, and improves submission reliability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123123830A_ABST
    Figure CN123123830A_ABST
Patent Text Reader

Abstract

This invention discloses a method for operator channel adaptation for RCS messages across three networks, relating to the fields of rich media communication and mobile communication message processing technology. It addresses the problem that rich media cards struggle to maintain content association and complete adaptation submission due to differences in operator channel access specifications and content limitations during RCS message transmission across three networks. The method involves: obtaining a sending request and determining the operator channel; dividing the card text into content segments and determining their correspondence with media resources and interactive buttons; generating a submission request based on RCS service access data and calculating the number of bytes; adjusting card content boundaries when fields exceed limits, moving the overall associated content, and if the requirements are still not met, re-determining the operator channel to achieve rich media message adaptation and submission.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of rich media communication and mobile communication message processing technology, and more specifically, to an operator channel adaptation method for RCS messages across three networks. Background Technology

[0002] RCS messages can carry text, images, audio / video, files, rich media cards, and interactive buttons. Existing RCS services across the three major networks establish message submission channels according to each operator's access specifications. These channels differ in request format, field length, character encoding, field escaping, media resource upload methods, number of cards, number of buttons, and maximum request length. Current processing typically involves message type validation and field length checks; if the content exceeds the limit, the text is truncated, media resources are deleted, or interactive buttons are reduced. However, the text, media resources, and interactive buttons within a card correspond to each other, and the request length can only be determined after character encoding, field escaping, and media resource identifiers are written. Deletion can easily lead to inconsistencies between displayed content and interactive operations; after switching channels, the original processing results may also fail to meet submission requirements.

[0003] To address the above problems, this invention proposes a solution. Summary of the Invention

[0004] In order to overcome the above-mentioned defects of the prior art, embodiments of the present invention provide an operator channel adaptation method for RCS messages of three networks, so as to solve the problems mentioned in the background art.

[0005] To achieve the above objectives, the present invention provides the following technical solution: In a preferred embodiment, it includes: Obtain the RCS message sending request and determine the operator channel used to send the RCS message; When the message type in the RCS message sending request is a rich media card message or an interactive message, the card text is divided into text content segments according to the card hierarchy and arrangement order of the message content, and the correspondence between the text content segments and media resources and interactive buttons is determined. Based on the target operator's RCS service access data corresponding to the operator channel, obtain the message submission request format, field length, and maximum length of the RCS message submission request, form an RCS message submission request, and calculate the actual number of bytes occupied. When the card content exceeds the corresponding field length and the number of bytes does not exceed the maximum length of the RCS message submission request, adjust the card content boundary and move the content segment after the boundary, along with its corresponding media resources and interactive buttons, to the next rich media card. If the adjusted message submission requirements are still not met, the operator channel will be redefined, and the RCS message submission request and card content boundaries will be redefined based on the redefined operator channel.

[0006] In a preferred embodiment, determining the operator channel for sending RCS messages includes: Extract the target number, sender identifier, and message type from the RCS message sending request; determine the target operator based on the target number; and obtain the operator sender identifier based on the target operator and the sender identifier. Query the RCS service status and supported message types of the target number in the target operator's network to determine the RCS receiving capability of the target number; When the RCS receiving capability indicates that the target number has the RCS receiving capability corresponding to the message type, the operator channel used to send the RCS message is determined from the operator channels that match the target operator, the operator sender identifier, and the message type.

[0007] In a preferred embodiment, the determination of the operator channel for sending RCS messages further includes: The communication status of operator channels that match the target operator, operator sender identifier, and message type is determined, and operator channels that are in an available state are identified as candidate operator channels. Based on the number of RCS message submission requests that have received acceptance responses in the current transmission cycle for each candidate operator channel, and the number of RCS message submission requests that have been sent but have not yet received submission responses, it is determined whether the candidate operator channel has the transmission capacity to continue submitting RCS messages. The operator channel for sending RCS messages is determined from the candidate operator channels with the stated transmission capacity.

[0008] In a preferred embodiment, when two or more candidate operator channels have the capacity to continue submitting RCS messages, the selection value of each candidate operator channel is calculated based on the number of RCS message submission requests that can still be submitted within the current transmission period, the number of RCS message submission requests that can currently wait for submission responses, the proportion of the number of RCS message submission requests that have received acceptance responses within a preset evaluation time range to the total number of RCS message submission requests that have been sent, and the average submission response time. The candidate operator channel with the largest selection value is then determined as the operator channel used to send RCS messages.

[0009] In a preferred embodiment, the formation of the RCS message submission request includes: Based on the operator channel used to send RCS messages, obtain the correspondence between message submission request format, message type and operator message type code, and message content requirements from the target operator's RCS service access data; The message type is converted into the operator message type code according to the correspondence, and the message content is checked according to the message content requirements. When the message content includes media resources, and the target operator requires that media resources be uploaded before sending the RCS message submission request, the media resource upload interface address, media resource upload request field, and media resource upload response field are obtained from the RCS service access data. A media resource upload request is formed according to the media resource upload request field and sent to the media resource upload interface address. The media resource identifier is obtained from the media resource upload response according to the media resource upload response field. According to the message submission request format, the target number, operator sender identifier, operator message type code and message content are written into the message submission request field, and when the media resource identifier is obtained, the media resource identifier is written into the corresponding message submission request field to form an RCS message submission request.

[0010] In a preferred embodiment, determining the correspondence between the main text content segment and the media resources and interactive buttons includes: Read the operation content corresponding to the interactive button; Determine the text segment corresponding to the interactive button based on the order of the text segments in the card text and the position of the interactive button in the message content; When all interactive buttons are arranged after the card text, the operation content is compared with the web page address, phone number or return content in each text content segment to determine the text content segment corresponding to the interactive button. Determine the corresponding text content segment of the media resource according to its original arrangement in the RCS message sending request; If the corresponding text content segment of an interactive button cannot be determined, the interactive button is determined to correspond to all text content segments in the same rich media card; if the corresponding text content segment of a media resource cannot be determined, the media resource is determined to correspond to all text content segments in the same rich media card.

[0011] In a preferred embodiment, adjusting the card content boundaries includes: Obtain the maximum length of the RCS message submission request and the number of rich media cards allowed to be written from the target operator's RCS service access data; When the card content exceeds the corresponding field length, the number of bytes actually occupied by the RCS message submission request does not exceed the maximum length of the RCS message submission request, and the number of rich media cards that can be written is greater than one, the card content boundary is determined before the content segment at the end of the current rich media card, and the content segment after the card content boundary and its corresponding media resources and interactive buttons are moved to the next rich media card. After each move, the RCS message submission request is re-formed according to the message submission request format, character encoding and field escaping are re-executed, and the actual number of bytes occupied by the RCS message submission request is recalculated. If the original rich media card still exceeds the corresponding field length after being moved, the card content boundary is moved forward; if the next rich media card exceeds the corresponding field length after being moved, and the current number of rich media cards has not reached the number of rich media cards allowed to be written, the card content boundary is determined in the next rich media card until the card body of each rich media card does not exceed the corresponding field length, and the number of bytes actually occupied by the RCS message submission request does not exceed the maximum length of the RCS message submission request.

[0012] In a preferred embodiment, when the number of interactive buttons exceeds the number of interactive buttons specified by the target operator for a single rich media card, starting with the interactive buttons at the end of the list, the interactive buttons and their corresponding text content segments are moved to the next rich media card; if the text content segment also corresponds to other interactive buttons, all interactive buttons corresponding to the text content segment are moved together; after the move, the number of interactive buttons in the original rich media card and the next rich media card is recalculated, and the actual number of bytes occupied by the RCS message submission request is recalculated; if the number of interactive buttons meets the target operator's requirements and the number of bytes does not exceed the maximum length of the RCS message submission request, the moved interactive buttons and card content boundaries are retained; if the number of bytes exceeds the maximum length of the RCS message submission request, the move is canceled, and it is determined that the current operator channel cannot construct an RCS message submission request according to the current number of rich media cards.

[0013] In a preferred embodiment, the step of readjusting the card content boundaries according to the redefined operator channel includes: Read the media resource upload interface address, media resource upload request field, and media resource upload response field corresponding to the redefined operator channel; form a media resource upload request according to the media resource upload request field and send it to the media resource upload interface address; and obtain the media resource identifier from the media resource upload response according to the media resource upload response field. Read the message submission request format, field length, number of rich media cards allowed to be written, number of interactive buttons allowed to be written to each rich media card, character encoding method, field escaping method, and maximum length of RCS message submission request corresponding to the redefined operator channel; write the media resource identifier into the corresponding message submission request field; reformulate the RCS message submission request according to the message submission request format; perform character encoding and field escaping; and calculate the number of bytes actually occupied by the RCS message submission request. When any rich media card before or after the card content boundary determined under the original operator channel exceeds the range specified by the redefined operator channel, the card content boundary is moved forward or backward according to the re-formed RCS message submission request, and the RCS message submission request is re-formed and the actual number of bytes occupied is calculated after each movement. If the fields of each message submission request do not exceed the corresponding field length, the number of rich media cards does not exceed the number of rich media cards allowed to be written, the number of interactive buttons in each rich media card does not exceed the number of interactive buttons allowed to be written, and the number of bytes actually occupied by the RCS message submission request does not exceed the maximum length of the RCS message submission request, the boundaries of the moved card content will be preserved.

[0014] The technical effects and advantages of the operator channel adaptation method for RCS messages in three networks according to the present invention are as follows: This invention determines the operator channel based on the target number, message type, RCS receiving capability, channel status, and sending capacity, ensuring the submission path complies with operator access conditions. By establishing a correspondence between text content segments and media resources and interactive buttons, it adjusts card content boundaries to avoid separation between content and interactive functions. After each adjustment, a new request is generated and the byte count is calculated to determine if field length, number of cards, number of buttons, and maximum request length are compliant. If the channel is incompatible, a new operator channel is selected, improving the compatibility, content integrity, and submission reliability of rich media messages across the three major RCS networks. Attached Figure Description

[0015] Figure 1 This invention provides a method for operator channel adaptation for RCS messages across three networks, and includes a flowchart for determining the operator channel.

[0016] Figure 2 This invention provides a method for operator channel adaptation of RCS messages across three networks, including a flowchart of the RCS message submission request formation and length verification process. Detailed Implementation

[0017] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0018] In this embodiment, the present invention discloses an operator channel adaptation method for RCS messages across three networks, including: In step one, an RCS message sending request is obtained, and the target number, sender identifier, message type, and message content are extracted from the RCS message sending request. The target number is the mobile user number receiving the RCS message; the sender identifier is used to determine the RCS service access information obtained by the message sender from the three major operators; the message type indicates whether this message is a text message, media message, file message, rich media card message, or interactive message; the message content is the text, image, audio, video, file, card content, or interactive button content sent to the target number according to the message type.

[0019] The target number is processed according to the number format specified by the number attribution query interface. Spaces, connectors, and other characters that are not involved in mobile user number identification are removed from the target number. The country code or domestic number prefix in the target number is converted according to the requirements of the number attribution query interface for country codes and domestic mobile user number formats, so as to obtain the target number for number attribution query.

[0020] According to the request fields specified by the number attribution query interface, the processed target number is written into the number attribution query request, and the number attribution query request is sent to the number attribution query interface. The number attribution query interface returns the operator identifier based on the current attribution information of the mobile user number. For mobile user numbers that have undergone number portability, the operator identifier is returned based on the current attribution information after number portability.

[0021] The system receives the number attribution query response returned by the number attribution query interface, extracts the operator identifier from the number attribution query response according to the response fields specified by the number attribution query interface, and identifies the operator corresponding to the operator identifier as the target operator.

[0022] When the number attribution query response does not contain a valid operator identifier, a number prefix for number segment identification is extracted from the processed target number. This number prefix is ​​then matched against the number segment correspondence, and the matched operator is identified as the target operator. The number segment correspondence is established based on mobile communication number allocation information published by the telecommunications regulatory authority or number segment data published by the three major operators, recording the correspondence between the number prefix and the operator. When the number attribution query response contains a valid operator identifier, the operator identifier is used to determine the target operator, and the number segment correspondence is no longer used to change the target operator.

[0023] Specifically, if the operator identifier contained in the number attribution query response can identify an operator according to the correspondence between the operator identifier and the three operators as specified in the number attribution query interface, the operator identifier is determined to be a valid operator identifier; if the number attribution query response does not contain an operator identifier, the operator identifier is empty, the value of the operator identifier does not fall within the value range specified in the number attribution query interface, or the corresponding operator cannot be determined based on the operator identifier, the number attribution query response is determined to not contain a valid operator identifier.

[0024] When there are two or more number prefixes in the number segment mapping relationship that can match the processed target number, the number prefixes are compared starting from the first position of the processed target number, and the operator corresponding to the number prefix with the most consecutive identical characters is determined as the target operator. For example, if the number segment mapping relationship records number prefixes with different character counts that can all match the starting position of the processed target number, the operator corresponding to the number prefix with more character counts is used, and the operator corresponding to the number prefix with fewer character counts is not used to change the target operator.

[0025] Based on the target operator and sender identifier, the capability query interface address, capability query request field, authentication method, authentication parameters, capability query response field, and the operator sender identifier corresponding to the sender identifier are obtained from the target operator's RCS service access data. The RCS service access data is generated by the message sender when accessing the target operator's RCS service, based on the interface specifications provided by the target operator and the access information allocated by the target operator.

[0026] The capability query interface address is the network address where the target operator receives RCS capability query requests; the capability query request field specifies the target number, operator sender identifier, and other fields required by the target operator that need to be carried in the capability query request; the authentication method specifies how authentication parameters are used in the communication connection, request header, or request body; the authentication parameters are access tokens, application identifiers, application keys, digital certificates, or other access credentials specified in the target operator's interface specification that are assigned by the target operator to the message sender; the capability query response field is used to identify the RCS service status and message types supported by the target number from the response returned by the target operator.

[0027] According to the target operator's capability query request fields, the target number and operator sender identifier are written into the capability query request, and authentication parameters are used according to the authentication method specified by the target operator. When the target operator uses request header authentication, the authentication parameters are written into the request header of the capability query request; when the target operator uses request body authentication, the authentication parameters are written into the corresponding authentication field in the capability query request; when the target operator uses digital certificate authentication, the digital certificate is used to complete identity verification when establishing a communication connection with the capability query interface.

[0028] The capability query request, which completes the field filling and authentication processing, is sent to the capability query interface address of the target operator to query the RCS service status of the target number in the target operator's network and the message types it supports.

[0029] The system receives the capability query response from the target operator and extracts the RCS service status and capability code from the response according to the target operator's specified capability query response fields. The RCS service status indicates whether the target number has activated and can use the target operator's RCS service; the capability code indicates the message types the target number can receive. When different target operators use different capability codes, the message types represented by each capability code are determined according to the corresponding target operator's interface specifications.

[0030] Based on the correspondence between capability codes and message types recorded in the target operator's interface specifications, the capability codes in the capability query response are converted into message types supported by the target number, and the message types supported by the target number are compared with the message types in the RCS message sending request.

[0031] When a capability query response contains more than two capability codes, each capability code is converted according to the correspondence between the capability code and the message type, and all the resulting message types are identified as message types supported by the target number. For example, if the capability codes in the capability query response correspond to both text messages and rich media card messages, both text messages and rich media card messages are identified as message types supported by the target number.

[0032] If the capability code in the capability query response cannot be found in the correspondence between the capability codes and message types of the corresponding target operator, the capability code is not directly identified as a message type not supported by the target number; instead, the RCS receiving capability of the target number is determined to be unconfirmed. If the capability query response contains both convertible and non-convertible capability codes, only the message type corresponding to the convertible capability code is determined to be a message type supported by the target number. If the message type in the RCS message sending request corresponds to a non-convertible capability code, the RCS receiving capability of the target number is determined to be unconfirmed.

[0033] When the RCS service status indicates that the target number can use the RCS service, and the message types supported by the target number include the message types in the RCS message sending request, it is determined that the target number has the RCS receiving capability corresponding to the RCS message sending request.

[0034] When the RCS service status indicates that the target number has not been activated or cannot use the RCS service, or when the target number supports message types that do not include the message types in the RCS message sending request, it is determined that the target number does not have the RCS receiving capability corresponding to the RCS message sending request.

[0035] If no capability query response is received within the response time specified by the target operator, or if the capability query response lacks a response field used to determine the RCS service status or the message types supported by the target number, the RCS receiving capability of the target number is not confirmed. The response time is the interface response time specified in the target operator's capability query interface specification; if the target operator does not specify an interface response time, the communication timeout time agreed upon when the message sender accesses the target operator's RCS service is used.

[0036] After the above processing, the target operator, operator sender identifier, message type, and target number's RCS receiving capability corresponding to the RCS message sending request are obtained, and the target operator, operator sender identifier, message type, and RCS receiving capability are used for subsequent operator channel screening and determination.

[0037] In step two, the target operator, operator sender identifier, message type, and RCS receiving capability obtained in step one are read. Based on the target operator, the corresponding operator channel is searched from the operator channels already connected to by the message sender. The operator channel is an RCS message submission path established by the message sender according to the RCS service access specifications provided by the operator. Each operator channel corresponds to a channel identifier, an operator, at least one operator sender identifier, a message submission interface address, an authentication method, a set of authentication parameters, the types of messages that can be sent, and the sending restrictions specified by the operator.

[0038] The channel identifier is set by the message sender when accessing the operator's channel, and is used to distinguish RCS message submission paths established under the same operator using different message submission interface addresses, different authentication parameters, or different operator sender identifiers. The message submission interface address is the network address where the operator receives RCS message submission requests. The authentication method and authentication parameters are provided by the operator after the message sender completes RCS service access, and are used to verify the message sender's access permissions when establishing a communication connection or sending an RCS message submission request. The types of messages that can be sent are determined according to the operator's RCS service access specifications. The sending restrictions include limitations imposed by the operator on the number of message submissions per unit time and the number of RCS message submission requests waiting for submission responses simultaneously.

[0039] The operator corresponding to each operator channel is compared with the target operator. Operator channels whose corresponding operators are the same as the target operator are retained, while other operator channels are excluded. The operator sender identifier corresponding to the retained operator channel is compared with the operator sender identifier obtained in step one. Operator channels containing the aforementioned operator sender identifier are retained so that subsequent RCS message submission requests are sent using the operator sender identifier that has been approved by the target operator.

[0040] The message type is compared with the message types that each operator's channel can send, and the operator channel that can send the specified message type is retained. When the message type in the RCS message sending request is a rich media card message, the operator channel that can send rich media card messages is retained; when the message type in the RCS message sending request is an interactive message, the operator channel that can send interactive messages is retained. Other message types are processed using the same comparison method, and media messages, file messages, rich media card messages, or interactive messages are not sent using operator channels that only support text messages.

[0041] If Step 1 determines that the target number has the RCS receiving capability corresponding to the RCS message sending request, the availability of the operator channels retained after filtering by operator, operator sender identifier, and message type will continue to be assessed. If Step 1 determines that the target number does not have the RCS receiving capability corresponding to the RCS message sending request, the operator channel used for sending the RCS message will no longer be determined, and the result that the target number does not have the RCS receiving capability will be used for subsequent message sending processing.

[0042] If step one determines that the target number's RCS receiving capability is not confirmed, the target operator's RCS service access specifications for each operator's channel are read to determine whether the target operator allows the submission of RCS messages when the target number's RCS receiving capability is not confirmed. If the target operator allows submission, the availability of the corresponding operator's channel is further assessed. If the target operator requires confirmation of the target number's RCS receiving capability before submitting the RCS message, the corresponding operator's channel is not used to send RCS messages, and the result of the unconfirmed RCS receiving capability of the target number is used for subsequent message sending processing.

[0043] For each operator channel that remains active, the message submission interface address, authentication method, and authentication parameters are checked. If all three are present, and the authentication parameters have not exceeded the validity period specified by the operator, the communication status of the operator channel is further assessed. If a message submission interface address, authentication method, or authentication parameters are missing, or the authentication parameters have exceeded their validity period, the corresponding operator channel is excluded. The validity period of the authentication parameters is determined based on the expiration time provided by the operator when issuing the authentication parameters. When the operator uses access tokens and allows access token updates, a new access token is obtained according to the token update interface specified by the operator before determining whether the operator channel can continue to be used.

[0044] According to the authentication method of the operator's channel, a communication connection is established with the message submission interface address corresponding to the operator's channel. When the operator specifies a connection detection request, a connection detection request is sent according to the connection detection request format specified by the operator, and the communication connection is judged to be normal based on the connection detection response; when the operator does not specify a connection detection request, after completing domain name resolution, transmission connection establishment and identity authentication, the communication connection is judged to be normal based on the identity authentication result.

[0045] If a communication connection is established and authentication is completed within the connection response time specified by the operator, and the connection detection response or authentication result indicates that access to the message submission interface is permitted, the corresponding operator channel is determined to be in an available state. If a communication connection cannot be established within the specified connection response time, authentication fails, or the connection detection response indicates that the message submission interface is inaccessible, the corresponding operator channel is determined to be in an unavailable state, and unavailable operator channels are excluded. The connection response time is the time specified in the operator's RCS service access specification; if the operator does not specify a connection response time, the communication timeout time agreed upon by the message sender when accessing the operator channel is used.

[0046] The carrier channels retained after the aforementioned screening and availability assessment are determined as candidate carrier channels. These candidate carrier channels are those that match the target carrier, carrier sender identifier, and message type, have valid authentication parameters, and can normally connect to the message submission interface.

[0047] The system reads the number of RCS message submission requests that have received acceptance responses for each candidate operator channel within the current sending period, as well as the number of RCS message submission requests that have been sent but have not yet received a submission response. The current sending period is determined according to the time range used by the operator when calculating the number of message submissions per unit time. The number of RCS message submission requests that have received acceptance responses is accumulated from RCS message submission requests previously sent through the same candidate operator channel and for which the operator has returned acceptance results. The number of RCS message submission requests that have been sent but have not yet received a submission response is statistically calculated from RCS message submission requests that have been sent through the same candidate operator channel and are still within the submission response time specified by the operator.

[0048] The number of RCS message submission requests that have received acceptance responses is compared with the number of message submissions allowed per unit time by the operator. The number of RCS message submission requests that have been sent but have not yet received a submission response is compared with the number of RCS message submission requests waiting for submission responses simultaneously by the operator. If the number of RCS message submission requests that have received acceptance responses does not reach the number of message submissions per unit time, and the number of RCS message submission requests that have been sent but have not yet received a submission response does not reach the number of RCS message submission requests waiting for submission responses simultaneously, then the corresponding candidate operator channel is determined to have the sending capacity to continue submitting RCS messages. If either of these conditions is met, the corresponding candidate operator channel will not be used to send this RCS message.

[0049] When two or more RCS message sending requests are processed for operator channel filtering within the same time frame, the sending capacity is determined sequentially according to the order in which the RCS message sending requests are received. The sending capacity is determined only after the RCS message submission request corresponding to the previous RCS message sending request has been fully sent and counted in the number of RCS message submission requests that have been sent but have not yet received a submission response for the corresponding candidate operator channel. This is to prevent two or more RCS message sending requests from using the same sending capacity of the same candidate operator channel.

[0050] At the end of the current sending cycle, the number of RCS message submission requests that have received an acceptance response in the next current sending cycle will be re-accumulated from zero. The number of RCS message submission requests that have been sent but have not yet received a submission response is not directly cleared upon the end of the current sending cycle; once the corresponding RCS message submission request receives a message submission response, or after the submission response time specified by the target operator has expired, the RCS message submission request will be removed from the number of RCS message submission requests that have been sent but have not yet received a submission response.

[0051] For example, if the target operator specifies that the number of message submissions per unit time is one hundred, and the number of RCS message submission requests waiting for submission responses is ten, and the number of RCS message submission requests that have received acceptance responses within the current sending cycle of the candidate operator channel is ninety, and the number of RCS message submission requests that have been sent but have not yet received submission responses is eight, the candidate operator channel still has the sending capacity to continue submitting RCS messages; when either of these numbers reaches one hundred or ten, the candidate operator channel will not be used to send this RCS message. When only one candidate operator channel has the sending capacity to continue submitting RCS messages, the candidate operator channel is determined as the operator channel for sending RCS messages.

[0052] When two or more candidate operator channels have the sending capacity to continue submitting RCS messages, the selection value for each candidate operator channel is calculated separately. The selection value for a candidate operator channel is calculated using the following formula: ; In the formula, This represents the selection value for the i-th candidate operator channel; This represents the proportion of the number of RCS message submission requests that can still be submitted in the current transmission period for the i-th candidate operator channel to the total number of message submissions within a unit time period specified by the operator. The number of RCS message submission requests that can still be submitted is the total number of message submissions within a unit time period specified by the operator minus the number of RCS message submission requests that have already received an acceptance response. This represents the ratio of the number of RCS message submission requests that can still wait for a response simultaneously for the i-th candidate operator channel to the number of RCS message submission requests that can wait for a response simultaneously as specified by the operator. The number of RCS message submission requests that can still wait for a response simultaneously is the number of RCS message submission requests that can wait for a response simultaneously as specified by the operator minus the number of RCS message submission requests that have been sent but have not yet received a response. This represents the proportion of the number of RCS message submission requests that received an acceptance response within the preset evaluation time range for the i-th candidate operator channel to the total number of RCS message submission requests that have been sent within that evaluation time range. This represents the ratio of the shortest average submission response time among all candidate operator channels to the average submission response time of the i-th candidate operator channel.

[0053] The average submission response time is calculated based on the time difference between the sending time of each RCS message submission request and the receiving time of the corresponding submission response within a preset evaluation time range for the same candidate operator channel. If no RCS message submission record exists for a candidate operator channel within the preset evaluation time range, the time difference between the sending time of the current connection detection request and the receiving time of the connection detection response is used as the average submission response time for that candidate operator channel. The preset evaluation time range is set by the message sender when accessing the operator channel and is used to obtain sending results that reflect the recent communication status of the candidate operator channel; the preset evaluation time range includes at least one completed RCS message submission process or the currently completed connection detection process.

[0054] Before each calculation of the candidate operator channel selection value, the RCS message submission records are read according to the start and end times of the preset evaluation time range. RCS message submission records that are earlier than the start time of the preset evaluation time range are not used for calculation. and average submission response time.

[0055] When no RCS message submission record exists for any candidate operator channel within the preset evaluation time range, this method will not be used when comparing the selection values ​​of each candidate operator channel. Set c to zero, and adjust a, b, and d according to their original size relationships, so that the sum of the adjusted a, b, and d is one, so that each candidate operator channel can be compared under the same calculation conditions.

[0056] If a candidate operator channel has no RCS message submission records within a preset evaluation time range, and the target operator has not specified a connection detection request, the time difference between the time when the communication connection is established with the message submission interface address and the time when the authentication result is returned will be used as the average submission response time for that candidate operator channel. If the calculated time difference is zero, the minimum time that can be distinguished when the message sender records the sending and receiving times will be used as the average submission response time to avoid... The calculation involves a divisor of zero.

[0057] If the target operator does not specify the number of messages submitted per unit time, this selection value calculation will not use [the specified value]. Set 'a' to zero; if the target operator does not specify the number of RCS message submission requests waiting for a submission response simultaneously, this value calculation will not use 'a'. Set b to zero. After setting the corresponding weight to zero, adjust the remaining weights according to their original relative sizes so that the sum of the weights involved in the selection value calculation is one.

[0058] In the formula, a, b, c, and d represent respectively and The corresponding weights, a, b, c, and d, are all greater than or equal to zero, and the sum of a, b, c, and d is one. These weights are pre-set by the message sender based on the sending limits stipulated by the target operator and the requirements for sending capacity, successful submission, and submission response time for this RCS message. For the same RCS message sending request, each candidate operator channel uses the same a, b, c, and d to ensure that the selection values ​​of each candidate operator channel are compared under the same conditions. When it is necessary to prioritize avoiding reaching the operator's sending limits, a and b are increased; when it is necessary to prioritize using operator channels with better recent acceptance response rates, c is increased; and when it is necessary to prioritize shortening the submission response time, d is increased.

[0059] Compare the selection values ​​of each candidate operator channel, and determine the candidate operator channel with the highest selection value as the operator channel to send RCS messages. When two or more candidate operator channels have the same selection value, determine the candidate operator channel with the shortest average submission response time as the operator channel to send RCS messages; if the average submission response time is still the same, select the candidate operator channel with the earlier establishment time according to the order of the establishment time of each candidate operator channel.

[0060] When there are no candidate operator channels that are available and have the capacity to continue submitting RCS messages, it is determined that no operator channel was selected for sending RCS messages. Based on the judgment results corresponding to the excluded operator channels, the reasons for not being selected, such as invalid authentication parameters, inability to connect to the message submission interface, or reaching the sending limit, are obtained.

[0061] After the above processing, the operator channel used to send RCS messages is obtained, along with the corresponding channel identifier, message submission interface address, authentication method, authentication parameters, operator sender identifier, and message submission request fields specified by the target operator. These are then used to construct and send RCS message submission requests according to the target operator's RCS service access specifications. Figure 1 As shown.

[0062] In step three, when the operator channel used to send the RCS message is determined in step two, the channel identifier, message submission interface address, authentication method, authentication parameters, operator sender identifier, and message submission request field specified by the target operator corresponding to the operator channel are read. The target number, message type, and message content are also read from the RCS message sending request obtained in step one. Furthermore, a request identifier is obtained from the RCS message sending request. This request identifier is set by the message sender who submitted the RCS message sending request and is used to associate this RCS message sending request, RCS message submission request, and message submission response as the same message sending process.

[0063] When the message sender sets a request identifier, the request identifier is set to character content that is different from the request identifiers corresponding to other RCS message sending requests that have not yet formed a final sending result. When performing resending, operator channel switching, or message status query for the same RCS message sending request, the request identifier remains unchanged; when the message sender submits a new RCS message sending request, it sets a different request identifier than the previous RCS message sending request.

[0064] For example, when the same RCS message sending request changes carrier channel due to the message submission interface being temporarily unavailable, the same request identifier is used in the RCS message sending request before and after the carrier channel change; when the message sender submits an RCS message sending request with the same content but belonging to another sending process, a different request identifier is used.

[0065] If step two fails to determine the operator channel for sending the RCS message, the RCS message submission request is not constructed and sent, and the reason for not being selected obtained in step two is used for subsequent processing in step four.

[0066] Based on the operator channel used to send RCS messages, the message submission request format, the correspondence between message type and operator message type code, message content requirements, character encoding method, message submission response fields, and submission response time are obtained from the target operator's RCS service access data. The message submission request format specifies the name, arrangement, and data format of each message submission request field in the RCS message submission request; the operator message type code is the field value used by the target operator to distinguish between text messages, media messages, file messages, rich media card messages, and interactive messages; the message content requirements specify the required fields for different message types, allowed file formats, allowed content length, and other content restrictions specified by the target operator; the character encoding method specifies the character encoding used when converting text content into communication data; the message submission response fields are used to identify the submission result and the message identifier assigned by the target operator from the message submission response; and the submission response time is the time allowed by the target operator from sending the RCS message submission request to receiving the message submission response.

[0067] Based on the mapping between message types and operator message type codes, the message type in the RCS message sending request is converted to the operator message type code specified by the target operator. When different target operators use different operator message type codes for the same message type, the operator message type code specified by the target operator corresponding to the operator channel used to send the RCS message is used, and operator message type codes specified by other operators are not used.

[0068] Check whether the message type and message content correspond to the target operator's message content requirements. When the message type is a text message, check whether the message content includes the text to be sent; when the message type is a media message, check whether the message content includes images, audio, or video; when the message type is a file message, check whether the message content includes the file to be sent; when the message type is a rich media card message, check whether the message content includes the card title, card body, and card display content specified by the target operator; when the message type is an interactive message, check whether the message content includes the interactive button content and corresponding operation content specified by the target operator.

[0069] When the message content lacks the required fields corresponding to the message type, it is determined that the RCS message sending request does not meet the message submission requirements of the target operator. The RCS message submission request is not constructed, and the missing required fields are determined as the reason for the failure to submit the RCS message this time.

[0070] When the message content includes text, the text content is encoded according to the character encoding method specified by the target operator, and the length of the encoded text content is determined according to the content length calculation method specified by the target operator. If the target operator limits the content length based on the number of characters, the length is determined based on the number of characters before encoding; if the target operator limits the content length based on the number of bytes, the length is determined based on the number of bytes after encoding. If the text content length does not exceed the content length specified by the target operator, the encoded text content is retained; if the text content length exceeds the content length specified by the target operator, it is determined that the RCS message sending request does not meet the message submission requirements of the target operator, and the text content is not automatically deleted or truncated.

[0071] When the message content includes images, audio, video, or files, these images, audio, video, or files are identified as media resources. If the media resource is directly included in the RCS message sending request, it is read from the message content; if the message content records a media resource address, the corresponding media resource is obtained through that address. The file format and size of the media resource are checked according to the target operator's message content requirements. If both the file format and size meet the target operator's message content requirements, the media resource continues to be processed; if the file format or size does not meet the target operator's message content requirements, the RCS message sending request is determined to not meet the target operator's message submission requirements.

[0072] When the target operator allows the media resource address to be directly entered in the RCS message submission request, the media resource address in the RCS message sending request is written into the corresponding message submission request field according to the message submission request field specified by the target operator.

[0073] When a target operator requests the uploading of media resources before sending an RCS message submission request, the media resource upload interface address, media resource upload request field, and media resource upload response field are obtained from the target operator's RCS service access data. The media resource upload interface address is the network address where the target operator receives media resources; the media resource upload request field specifies the file name, file format, and the location of the resource data in the media resource upload request; the media resource upload response field is used to obtain the media resource identifier assigned by the target operator to the uploaded media resources from the media resource upload response.

[0074] According to the media resource upload request field, the file name, file format and resource data of the media resource are written into the media resource upload request, and the authentication parameters are used according to the authentication method corresponding to the operator channel used to send RCS messages, and the media resource upload request is sent to the media resource upload interface address.

[0075] The system receives the media resource upload response from the target operator and extracts the media resource identifier from the media resource upload response fields. The media resource identifier is generated by the target operator after receiving and saving the media resource and is used to specify the media resource used in this transmission in subsequent RCS message submission requests. When the media resource upload response indicates successful media resource upload and contains a valid media resource identifier, the media resource identifier is written into the message submission request field specified by the target operator. When the media resource upload response indicates media resource upload failure, or the media resource upload response does not contain a valid media resource identifier, no further RCS message submission request is constructed, and the media resource upload result is used for subsequent processing in step four.

[0076] It should be noted that even if the target number has the capability to receive rich media card messages, and the operator channel used to send RCS messages is capable of sending rich media card messages, the message content in the RCS message sending request may still not be able to be directly formed into a submittable RCS message submission request by writing each item into the corresponding field.

[0077] For example, the message content in an RCS message sending request includes a card title, card body, media resources, and multiple interactive buttons. These buttons are used to open a webpage, make a phone call, and return to preset content, respectively. The displayed text and action of each interactive button are related to the corresponding content in the card body, which in turn needs to combine with the media resources to express the complete meaning of the message. Therefore, the card title, card body, media resources, and interactive buttons are not components that can be independently deleted or replaced.

[0078] After processing the card title, card body, and interactive button display text according to the character encoding method specified by the target operator, the number of bytes formed by different characters may vary; the media resource identifier obtained after the media resource upload is completed can only be determined after the target operator returns the media resource upload response. Therefore, the message content length that can be obtained when the RCS message sending request begins processing is different from the actual request length formed after writing the operator message type code, operator sender identifier, media resource identifier, and encoded text content.

[0079] When the actual request length is close to the content length or request load limit specified by the target operator, changes in the length of the media resource identifier, changes in the number of bytes after text encoding, or changes in the length of any interactive button operation content may cause the final RCS message submission request to exceed the range allowed by the target operator.

[0080] In this situation, if the card text or interactive button display text is truncated only according to the length limit of each message submission request field, the interactive button may be retained, but the content in the card text explaining the function of the interactive button will be deleted; if interactive buttons exceeding the limit are directly deleted, the text in the card text that requires the target number to perform the corresponding operation may be retained, but there is no interactive button in the receiving terminal that can perform the operation; if media resources are deleted, the card title or the content in the card text that depends on the media resources may lose its corresponding object.

[0081] Furthermore, different carrier channels under the same target carrier can correspond to different message submission request fields, character encoding methods, and media resource upload interfaces. If a media resource identifier obtained through one carrier channel cannot be used for another carrier channel, switching carrier channels requires re-uploading media resources and obtaining a new media resource identifier. After the new media resource identifier is written into the RCS message submission request, the actual request length will change again. Message content that already meets the content length requirements under the original carrier channel may not continue to meet the message content requirements specified by the changed carrier channel.

[0082] Therefore, when rich media card messages simultaneously contain interrelated card titles, card text, media resources, and multiple interactive buttons, and the final request length can only be determined after character encoding, media resource uploading, and message submission request field filling are completed, simply judging the existence of message type and various message contents at the beginning of processing cannot determine whether the final RCS message submission request meets both the target operator's message content requirements and maintains the correspondence between card text, media resources, and interactive buttons.

[0083] If the request limits stipulated by the target operator are met only by shortening a single field or deleting a single message item, it may result in rich media card messages that can be received by the message submission interface, but the content displayed on the receiving terminal and the interactive operation no longer correspond. If the entire message content is always retained, it may fail to be submitted because the final request length exceeds the range stipulated by the target operator. Furthermore, after changing the operator channel, the media resource identifier, character encoding method, and message submission request fields change, making the results of the previous content processing unusable directly for the new operator channel.

[0084] Therefore, in this embodiment, when the message type is a rich media card message or an interactive message, the card title, card body, media resources, interactive button display text, and corresponding operation content of each rich media card are read according to the card hierarchy and arrangement order of the message content in the RCS message sending request. When the card title, card body, media resources, and interactive buttons are located at the same rich media card hierarchy in the RCS message sending request, it is determined that the aforementioned content belongs to the same rich media card; when the interactive button is located after the card body, the correspondence between the interactive button and its corresponding rich media card is maintained according to the arrangement position of the interactive button in the rich media card.

[0085] The card's main text is divided into sections based on the end of each paragraph; if no paragraph end is set, the main text is divided into sections based on the end of each sentence. Each section is a range of text that can be moved as a whole when adjusting the content of the multimedia card, and the text is not truncated from the middle of the section during adjustment.

[0086] When the operation content corresponding to the interactive button is a web page address, phone number, or return content, the interactive button's displayed text, the operation content corresponding to the interactive button, and the main text segment of the rich media card containing the interactive button are kept in the same rich media card. When the media resource is located before, between, or after the card title and card body of the rich media card, the correspondence between the media resource and the card title and main text segment of the rich media card is maintained according to the original arrangement position of the media resource in the RCS message sending request.

[0087] When determining the correspondence between interactive buttons and text content segments, the process is first performed within the same rich media card level, according to the order of the text content segments in the card body and the position of the interactive buttons in the message content. If an interactive button is placed after one text content segment and before the next text content segment, then the interactive button is determined to correspond to its preceding text content segment.

[0088] When interactive buttons are all arranged after the card body, the operation content corresponding to the interactive buttons is compared with the web page address, phone number, or return content in each body content segment. If a body content segment contains the same web page address, phone number, or return content as the operation content corresponding to the interactive button, that body content segment is determined to be the body content segment corresponding to the interactive button. If two or more body content segments contain the same operation content, the body content segment whose arrangement is closest to the interactive button is determined to be the corresponding body content segment.

[0089] If the corresponding text segment for an interactive button cannot be determined based on the aforementioned arrangement or operation content, the interactive button will be identified as corresponding to all text segments within the same rich media card. In this case, the interactive button will not be separated from any individual text segment; the interactive button will only be moved along with all text segments within the same rich media card when the entire set of text segments is moved.

[0090] When determining the correspondence between media resources and main text segments, if a media resource is arranged after the card title and before the first main text segment, the media resource is determined to correspond to the first main text segment; if a media resource is arranged between two main text segments, the media resource is determined to correspond to the next main text segment; if a media resource is arranged after the last main text segment, the media resource is determined to correspond to the last main text segment.

[0091] If the corresponding text content segment cannot be determined based on the original arrangement position of the media resource in the RCS message sending request, the media resource is determined to correspond to all text content segments in the same rich media card, and the media resource is not separated from any text content segment.

[0092] For example, if the card text is divided into three sections, media resources are arranged between the first and second sections, and the phone number corresponding to the interactive button is recorded in the second section, then both the media resources and the interactive button are identified as corresponding to the second section. When moving the second section, the media resources, the interactive button text, and the corresponding operation content are moved together.

[0093] From the target operator's RCS service access data corresponding to the operator channel used to send RCS messages, obtain the maximum length of the RCS message submission request, the field length of each message submission request field, the number of rich media cards allowed to be written, the number of interactive buttons allowed to be written to each rich media card, the character encoding method, and the field escaping method. The field length refers to the maximum number of bytes specified by the target operator for each of the card title, card body, media resource address, media resource identifier, interactive button display text, or the operation content corresponding to the interactive button. The field escaping method refers to the replacement method specified by the target operator for specific characters in quotation marks, separators, newlines, and web page addresses.

[0094] Following the message submission request format specified by the target operator, the request identifier, target number, operator sender identifier, and operator message type code are written into the corresponding message submission request fields, along with the field names, field separators, and request level markers specified by the target operator. The written content is processed according to the character encoding and field escaping methods specified by the target operator, and the number of bytes occupied by the written content is calculated.

[0095] The writable length for writing card titles, card text, media resources, and interactive buttons is obtained by subtracting the number of bytes already written from the maximum length of the RCS message submission request specified by the target operator. This writable length is determined based on the actual length of the operator sender identifier, the actual length of the operator message type code, and the message submission request format specified by the target operator, and is not a pre-set fixed value.

[0096] When the target operator requires media resources to be uploaded before sending the RCS message submission request, after obtaining the media resource identifier, the media resource identifier is processed according to the character encoding and field escaping methods specified by the target operator. The processed media resource identifier is temporarily written into the corresponding message submission request field, and the writable length is recalculated. When the target operator allows the media resource address to be directly filled in the RCS message submission request, the same processing is performed on the media resource address, and the writable length is recalculated based on the actual number of bytes occupied by the media resource address.

[0097] Following the original order in the RCS message sending request, the card title, body content segment, media resource address or media resource identifier, interactive button display text, and corresponding operation content of the interactive button are written into the message submission request field specified by the target operator, and character encoding and field escaping are performed on all written content.

[0098] In this embodiment, when performing character encoding and field escaping on all written content, firstly, according to the field escaping method specified by the target operator, specific characters in quotation marks, field separators, newlines, and web page addresses are replaced with character content specified by the target operator. Then, according to the character encoding method specified by the target operator, the content with completed field escaping is converted into bytes. If the target operator's RCS service access specification explicitly stipulates that character encoding and field escaping should be performed in a different order, the order specified by the target operator shall be followed, and the same order shall be used each time an RCS message submission request is re-formed.

[0099] After character encoding and field escaping are completed, all message submission request fields are arranged according to the message submission request format specified by the target operator, and the start and end byte positions of each message submission request field in the RCS message submission request are determined. The start and end byte positions are used to determine the actual byte range occupied by the corresponding message submission request field, and are used to determine which message submission request fields have changed byte positions after subsequent adjustments to the rich media card content.

[0100] The first byte after the arrangement is completed is determined as the starting byte position one, and the positions of subsequent bytes are determined continuously according to the order of the bytes in the RCS message submission request. The actual number of bytes occupied by a message submission request field is the sum of the ending byte position and the starting byte position, plus one.

[0101] When the maximum length of the RCS message submission request specified by the target operator is used to limit all message submission request fields, the actual number of bytes occupied by the RCS message submission request includes the request identifier, target number, operator sender identifier, operator message type code, card title, body content segment, media resource address or media resource identifier, interactive button display text, operation content corresponding to the interactive button, field name, field separator, request level marker, and the actual number of bytes occupied by the authentication parameters written in the message submission request fields.

[0102] When authentication parameters are written into the request header, and the maximum length of the RCS message submission request specified by the target operator is only used to limit the fields of the message submission request, the authentication parameters in the request header, the digital certificate used to establish the communication connection, and other data in the communication connection are not included in the actual number of bytes occupied by the RCS message submission request; when the maximum length of the RCS message submission request specified by the target operator also includes the request header, the contents of the request header that need to be calculated according to the target operator's specifications are included.

[0103] Based on the start and end byte positions of each message submission request field, calculate the actual number of bytes occupied by each field, and then calculate the total number of bytes occupied by the arranged RCS message submission requests. Compare the actual number of bytes occupied by each field with the corresponding field length specified by the target operator, and also compare the actual number of bytes occupied by each RCS message submission request with the maximum length specified by the target operator. Figure 2 As shown.

[0104] When the fields of each message submission request do not exceed the corresponding field length, the number of rich media cards does not exceed the number of rich media cards allowed to be written, the number of interactive buttons in each rich media card does not exceed the number of interactive buttons allowed to be written, and the number of bytes actually occupied by the RCS message submission request does not exceed the maximum length of the RCS message submission request, the content range and arrangement order of the current rich media card are preserved.

[0105] When the card body exceeds the corresponding field length, and the actual number of bytes occupied by the current RCS message submission request does not exceed the maximum length of the RCS message submission request, it is determined whether the target operator allows more than two rich media cards to be written in the same RCS message submission request. If the target operator does not allow more than two rich media cards to be written, it is determined that the current operator channel cannot construct an RCS message submission request according to the message content.

[0106] When the target operator allows writing to more than two rich media cards, the initial content boundary of the card is determined before the main text segment at the end of the current rich media card. The main text segment following this boundary is then moved to the next rich media card. If the moved main text segment corresponds to an interactive button, the button's display text and corresponding operation content are moved to the next rich media card. If the moved main text segment corresponds to a media resource, the media resource address or identifier is moved to the next rich media card.

[0107] When the same text content segment corresponds to both a media resource and at least one interactive button, the entire text content segment, media resource, and all corresponding interactive buttons are moved, without leaving any one of them separately in the original rich media card. When a media resource corresponds to text content segments before and after the card content boundary, it is determined whether the target operator allows the reuse of the same media resource identifier in the same RCS message submission request.

[0108] When the target operator allows the reuse of the same media resource identifier, the same media resource identifier is written into two rich media cards before and after the card content boundary; when the target operator does not allow the reuse of the same media resource identifier, all text content segments and interactive buttons corresponding to the media resource are moved to the same rich media card.

[0109] Each time a text content segment, media resource, or interactive button is moved, all message submission request fields are rearranged according to the message submission request format specified by the target operator, character encoding and field escaping are re-executed, and the start byte position, end byte position, and actual number of bytes occupied by each message submission request field are re-determined.

[0110] The number of bytes released from the original rich media card during this move is calculated by subtracting the number of bytes actually occupied by the corresponding field of the original rich media card after the move from the number of bytes actually occupied by the corresponding field of the original rich media card before the move. The number of format bytes added during this move is determined based on the field name, field separator, request level marker, and repeatedly written media resource identifier added to the new rich media card. The number of bytes released is used to determine whether the corresponding field of the original rich media card has changed within the field length range, and the number of format bytes is included in the number of bytes actually occupied by the re-formed RCS message submission request.

[0111] If the original rich media card still exceeds the corresponding field length after being moved, the card content boundary will be moved forward to between the previous text content segment and its previous text content segment. The expanded text content segment range, along with the corresponding media resources and interactive buttons, will then be moved as a whole again.

[0112] If the next rich media card exceeds the corresponding field length after being moved, and the current number of rich media cards does not reach the number of rich media cards allowed to be written by the target operator, the next rich media card will be used as the new current rich media card, and the card content boundaries will continue to be determined between adjacent text content segments in the next rich media card in the same way.

[0113] The current card content boundary is preserved only if the message submission request fields corresponding to each rich media card do not exceed the corresponding field length, the number of interactive buttons in each rich media card does not exceed the number of interactive buttons specified by the target operator, the number of rich media cards does not exceed the number of rich media cards allowed to be written by the target operator, and the number of bytes actually occupied by the regenerated RCS message submission request does not exceed the maximum length of the RCS message submission request.

[0114] Without changing the entire content segment and without deleting card titles, media resources, or interactive buttons, the added format bytes of a new rich media card will not reduce the actual number of bytes occupied by the RCS message submission request. Therefore, if the number of bytes actually occupied by the initially generated RCS message submission request already exceeds the maximum length of the RCS message submission request, instead of reducing the number of bytes occupied by the RCS message submission request by adding more rich media cards or moving the content segments, it is determined that the current operator channel cannot construct an RCS message submission request according to the message content, and other candidate operator channels whose maximum length of the RCS message submission request can accommodate the message content are selected according to the subsequent operator channel re-determination process.

[0115] If the card content boundary has moved to before the first body content segment, or the number of rich media cards has reached the number of rich media cards allowed to be written by the target operator, but there are still rich media cards whose corresponding message submission request fields exceed the corresponding field length, it is determined that the current operator channel cannot construct an RCS message submission request according to the message content.

[0116] By successively moving the card content boundaries until all rich media cards before and after the card content boundaries meet the field length and number of interactive buttons specified by the target operator, and the number of bytes actually occupied by the RCS message submission request does not exceed the maximum length of the RCS message submission request.

[0117] When the number of interactive buttons exceeds the number of interactive buttons specified by the target operator for a single rich media card, starting with the interactive button that appears later in the list, all interactive buttons and the corresponding text content segments within the same text content segment are moved to the next rich media card. If an interactive button corresponds to a text content segment that also corresponds to other interactive buttons, all interactive buttons corresponding to that text content segment are moved together; interactive buttons corresponding to the same text content segment are not placed in different rich media cards.

[0118] After moving the interactive buttons, the number of interactive buttons in the original and subsequent rich media cards is recalculated, as is the actual number of bytes occupied by all message submission request fields. If the number of interactive buttons in both the original and subsequent rich media cards complies with the target operator's requirements, and the actual number of bytes occupied by the RCS message submission request does not exceed the maximum length of the RCS message submission request, the moved interactive buttons and card content boundaries are retained.

[0119] If the number of bytes added by the mobile interactive button to the rich media card format causes the actual number of bytes occupied by the RCS message submission request to exceed the maximum length of the RCS message submission request, the current move is cancelled. It is determined that the current operator channel cannot construct the RCS message submission request according to the current number of rich media cards, and the actual number of bytes occupied by the RCS message submission request is not reduced by continuing to move the same message content.

[0120] When the text displayed on the interactive button exceeds the field length specified by the target operator, complete characters are removed one by one from the end of the text, according to the character encoding method specified by the target operator. After each complete character is removed, the character encoding is re-performed, and the encoded text displayed on the interactive button is checked to ensure it conforms to the corresponding field length. During the removal process, the encoded bytes corresponding to the same character are not split, and the operation content corresponding to the interactive button is not changed.

[0121] If, after removing each complete character, the text displayed on the interactive button matches the corresponding field length and still contains at least one complete character, then the processed text displayed on the interactive button is retained. If, after removing all characters, the text still does not match the corresponding field length, or if the target operator specifies that the text displayed on the interactive button cannot be empty but the processed text displayed on the interactive button is empty, then it is determined that the current operator channel cannot construct an RCS message submission request according to the interactive button.

[0122] For example, if the number of bytes occupied by the last character of the text displayed by the interactive button after character encoding causes the text displayed by the interactive button to exceed the corresponding field length, the complete character is removed and the character encoding is re-executed; however, no bytes are removed from the encoded bytes corresponding to the character.

[0123] When the operation content corresponding to the interactive button exceeds the field length specified by the target operator, the web page address, phone number, or returned content will not be truncated. If the target operator's RCS service access documentation specifies a corresponding address translation interface, the web page address will be sent to the address translation interface, the alternative address returned by the target operator will be received, and character encoding, field escaping, and field length checks will be re-executed using the alternative address. If the target operator has not specified an address translation interface, or the alternative address still exceeds the corresponding field length, it will be determined that the current operator channel cannot construct an RCS message submission request according to the operation content corresponding to the interactive button.

[0124] If the operation content corresponding to the interactive button is a phone number or a return content, and the phone number or return content exceeds the field length specified by the target operator, the address translation interface used to convert the network page address will not be used to process the phone number or return content, nor will the phone number or return content be truncated. Instead, it will be determined that the current operator channel cannot construct an RCS message submission request according to the operation content corresponding to the interactive button.

[0125] For example, if a phone number exceeds the field length specified by the target operator after character encoding and field escaping, some digits in the phone number will not be deleted; if the returned content exceeds the field length specified by the target operator after character encoding and field escaping, some characters in the returned content will not be deleted.

[0126] When the number of rich media cards exceeds the number of rich media cards allowed to be written by the target operator, the operation content corresponding to the interactive button cannot be written to the corresponding message submission request field, the card content boundary has been moved to before the first body content segment but there are still message submission request fields that exceed the corresponding field length, or the number of bytes actually occupied by the RCS message submission request exceeds the maximum length of the RCS message submission request, the current operator channel is excluded from the candidate operator channels obtained in step two, and the operator channel used to send RCS messages is re-determined from the remaining candidate operator channels.

[0127] The redefined operator channel should be able to send the aforementioned message type, allow the writing of no fewer rich media cards and interactive buttons than the current processing result requires, and the corresponding field length and the maximum length of the RCS message submission request should be able to accommodate the message content after character encoding, field escaping, and media resource uploading are completed.

[0128] When the carrier channel used to send RCS messages changes, the media resources are re-uploaded according to the media resource upload request field corresponding to the newly determined carrier channel, and the media resource identifier corresponding to the newly determined carrier channel is obtained. The message submission request format, field length, number of rich media cards, number of interactive buttons, character encoding method, field escaping method, and maximum length of the RCS message submission request corresponding to the newly determined carrier channel are read.

[0129] The newly acquired media resource identifier is written into the message submission request field corresponding to the redefined operator channel, and the start byte position, end byte position, and actual number of bytes occupied by each message submission request field are redefined. The card content boundary determined under the original operator channel is only used as the initial position during reprocessing and is not directly used as the final card content boundary under the redefined operator channel.

[0130] When the length of the re-acquired media resource identifier, character encoding method, field escaping method, or message submission request field changes, causing any rich media card before or after the original card content boundary to exceed the range specified by the redefined operator channel, the card content boundary is moved forward or backward again according to the re-formed RCS message submission request, and the field arrangement, character encoding, field escaping, and actual byte count are re-executed after each movement.

[0131] When the card content boundary moves forward, more text content segments, along with corresponding media resources and interactive buttons, are moved to the next rich media card; when the card content boundary moves backward, the text content segments at the beginning of the next rich media card, along with corresponding media resources and interactive buttons, are moved back to the previous rich media card. The moved card content boundary is retained only if both the preceding and following rich media cards meet the corresponding field length, number of interactive buttons, and maximum length of the RCS message submission request.

[0132] After the aforementioned processing, all message submission request fields meet the field length requirements specified by the target operator, the number of rich media cards and interactive buttons are within the range specified by the target operator, the actual number of bytes occupied by the RCS message submission request does not exceed the maximum length of the RCS message submission request, and when the same text content segment and its corresponding media resources and interactive buttons are located in the same rich media card, it is determined that the processed message content meets the message submission requirements of the operator channel used to send RCS messages.

[0133] For example, the target operator stipulates that the maximum length of the RCS message submission request is 1,000 bytes, the field length corresponding to the card body in each rich media card is 300 bytes, three rich media cards are allowed to be written in the same RCS message submission request, and two interactive buttons are allowed to be written in each rich media card.

[0134] The message submission request format specified by the target operator is written as follows: request identifier, target number, operator sender identifier, operator message type code, field name, field separator, request level marker, card title, media resource identifier, interactive button display text and corresponding operation content of the interactive button. After completing character encoding and field escaping, the above content actually occupies 370 bytes.

[0135] The card body is divided into three content segments, which, after character encoding and field escaping, occupy 220 bytes, 180 bytes, and 160 bytes respectively. When the three content segments are written to the same rich media card, the actual card body occupies 560 bytes, exceeding the corresponding 300-byte field length; the RCS message submission request actually occupies 930 bytes, not exceeding the maximum length of 1000 bytes for an RCS message submission request.

[0136] Define the card content boundaries between the first and second content segments, and between the second and third content segments. Write the three content segments into three rich media cards, and also write the corresponding media resources and interactive buttons for each content segment into the corresponding rich media card. The added field names, field separators, and request level markers for the two new rich media cards occupy a total of 40 bytes, and the re-formed RCS message submission request actually occupies 970 bytes.

[0137] After the adjustment, the card text in the three rich media cards occupies 220 bytes, 180 bytes and 160 bytes respectively, none of which exceed the field length of 300 bytes; the RCS message submission request actually occupies 970 bytes, which does not exceed the maximum length of 1,000 bytes for the RCS message submission request, so the content boundaries of the two cards are preserved.

[0138] After the operator channel used to send RCS messages changes, the redefined operator channel uses different message submission request fields and media resource identifiers. After rewriting the request identifier, target number, operator sender identifier, operator message type code, field name, field separator, request level marker, card title, new media resource identifier, interactive button display text, and corresponding operation content, the aforementioned content actually occupies 420 bytes; the three body content segments still occupy 560 bytes, the format bytes for the newly added rich media card remain 40 bytes, and the re-formed RCS message submission request actually occupies 1020 bytes.

[0139] When the redefined operator channel specifies a maximum RCS message submission request length of 980 bytes, the RCS message submission request exceeds this maximum length. Since the three text content segments, media resources, and interactive buttons have not been deleted, further changes to the rich media cards containing the three text content segments will not reduce their actual byte count. Therefore, the redefined operator channel is excluded, and the remaining candidate operator channels are used to send the RCS message.

[0140] According to the message submission request format specified by the target operator, write the processed card title, body content, media resource address or media resource identifier, interactive button display text, and corresponding operation content of the interactive button into the corresponding message submission request fields.

[0141] When a target operator requires an RCS message submission request to include a message receipt receiving address, the system reads the message receipt receiving address registered by the message sender with the target operator when accessing the operator's channel used for sending RCS messages, and writes the message receipt receiving address into the message submission request field specified by the target operator. The message receipt receiving address is the network address used by the target operator when sending message delivery results or message retrieval results.

[0142] If, after adjusting the card content boundaries and re-determining the operator channel, there are still cases where the message submission request field exceeds the corresponding field length, the number of rich media cards exceeds the allowed number of rich media cards to be written, the number of interactive buttons exceeds the allowed number of interactive buttons to be written, or the number of bytes actually occupied by the RCS message submission request exceeds the maximum length of the RCS message submission request, then it is determined that the RCS message sending request does not meet the message submission requirements of the currently accessed operator channel, and the RCS message submission request is not constructed by deleting media resources, deleting the operation content corresponding to the interactive buttons, or truncating the network page address.

[0143] According to the authentication method corresponding to the operator channel used to send RCS messages, the authentication parameters are used in the RCS message submission request. When the target operator uses request header authentication, the authentication parameters are written into the request header of the RCS message submission request; when the target operator uses request body authentication, the authentication parameters are written into the corresponding authentication field in the RCS message submission request; when the target operator uses digital certificate authentication, the digital certificate is used to complete the authentication when establishing a communication connection with the message submission interface address.

[0144] After completing the message submission request field filling, message content processing, and authentication, an RCS message submission request conforming to the target operator's RCS service access specifications is obtained. This request is then sent to the corresponding message submission interface address via the operator's channel used for sending RCS messages. The time it takes for the RCS message submission request to be completely sent to the message submission interface address is recorded and determined as the submission sending time. This submission sending time is used to calculate the submission response time of the operator's channel used to send the RCS message.

[0145] The system receives a message submission response from the target operator and extracts the submission result code and operator message identifier from the response according to the message submission response fields specified by the target operator. The submission result code indicates whether the target operator has received and accepted the RCS message submission request; the operator message identifier is generated by the target operator when accepting the RCS message submission request and is used to associate the subsequent message receipt returned by the target operator with this RCS message submission request.

[0146] When the submission result code indicates that the target operator has accepted the RCS message submission request, and the message submission response contains the operator message identifier specified by the target operator, it is determined that the RCS message submission request has been accepted, and the reception time, channel identifier, request identifier, operator message identifier, and submission result code of the message submission response are recorded. The time difference between the reception time of the message submission response and the submission sending time is used as the submission response time of this message submission process for the operator channel used to send the RCS message.

[0147] When the submission result code indicates that the target operator has refused to accept the RCS message submission request, it is determined that the RCS message submission request has not been accepted, and the rejection reason code is extracted from the message submission response field specified by the target operator. The rejection reason code is used to indicate the reason why the target operator has refused to accept the RCS message submission request, and its specific meaning is determined according to the target operator's RCS service access specification.

[0148] If no message submission response is received within the submission response time, or if the received message submission response lacks a submission result code, making it impossible to determine whether the target operator has accepted the RCS message submission request, it is determined that a valid message submission response was not obtained this time.

[0149] After the above processing, one of the following submission results is obtained: RCS message submission request accepted, RCS message submission request not accepted, or no valid message submission response obtained. The content already obtained from the request identifier, channel identifier, operator message identifier, submission result code, rejection reason code, submission sending time, and message submission response receiving time is used for message receipt judgment, resending, operator channel switching, or message fallback processing in step four.

[0150] In step four, the request identifier, channel identifier, operator message identifier, submission result code, rejection reason code, submission sending time, and message submission response reception time obtained in step three are read. Based on the submission result obtained in step three, the cases of RCS message submission request being accepted, RCS message submission request not being accepted, and no valid message submission response being obtained are handled respectively.

[0151] When step three confirms that the RCS message submission request has been accepted, the message receipt format, message receipt authentication method, the correspondence between message receipt status codes and message sending status, and the message receipt waiting time are obtained from the target operator's RCS service access data, based on the operator channel used to send the RCS message. The message receipt format specifies the names, arrangement, and data format of each field in the message receipt sent by the target operator; the message receipt authentication method verifies whether the received message receipt was sent by the target operator; the message receipt status code indicates whether the RCS message is in a delivered, read, or failed-to-send state; and the message receipt waiting time is the time allowed by the target operator from accepting the RCS message submission request to returning the message delivery result.

[0152] The message receipt received by the target operator is processed through the message receipt receiving address described in step three, and verified according to the message receipt authentication method specified by the target operator. When the target operator uses digital signature verification, the signature field, signature algorithm, and signature verification key are obtained from the target operator's RCS service access data, and the signature field in the message receipt is verified according to the signature algorithm. When the target operator uses digital certificate verification, the communication identity of the message receipt sender is verified using the digital certificate information provided by the target operator during the establishment of the communication connection for receiving the message receipt. When the target operator limits the source of the message receipt based on the network address, the source network address of the message receipt is compared with the network address pre-provided by the target operator. If the message receipt fails the verification specified by the target operator, it is not used to determine the message sending result.

[0153] After the message receipt is verified, the operator message identifier, message receipt status code, and message receipt time are extracted from the message receipt according to the message receipt format specified by the target operator. The message receipt time is the time when the RCS message status occurred, recorded by the target operator in the message receipt, indicating the time when the RCS message was delivered, read, or failed to be sent.

[0154] The operator message identifier in the message receipt is compared with the operator message identifier obtained in step three. If the two operator message identifiers are the same, the message receipt is determined as the message receipt corresponding to this RCS message submission request; if the two operator message identifiers are different, the message receipt is not used to change the message sending result of this RCS message submission request.

[0155] When two or more verified message receipts are received for the same operator message identifier, the message receipts are processed according to the message receipt time in each message receipt. When two or more message receipts contain the same message receipt status code, the corresponding message sending status is recorded only once, and the final sending result is not changed due to receiving the same message receipt repeatedly.

[0156] A message receipt status code indicates that if, after an RCS message has been read, a message receipt with a time earlier than the corresponding message receipt time for the read status (either already delivered or failed to send) is received, the message receipt will not be used to change the message sending status of the already read RCS message. Similarly, a message receipt status code indicates that if, after an RCS message has been delivered, a message receipt with a time earlier than the corresponding message receipt time for the delivered status (failed to send) is received, the message sending status of the already delivered RCS message will not be used to change.

[0157] If two or more verified message receipts indicate inconsistent message sending statuses and the order cannot be determined based on the message receipt time, and the target operator provides a message status query interface, the message sending status of the corresponding operator message identifier will be queried according to the query request fields specified by the target operator; if the target operator does not provide a message status query interface, the message sending result will be determined as unconfirmed.

[0158] Based on the correspondence between message receipt status codes and message sending statuses recorded in the target operator's RCS service access specifications, determine the message sending status represented by the message receipt corresponding to this RCS message submission request. When the message receipt status code indicates that the RCS message has been delivered to the target number or has been read by the target number, determine that this RCS message was successfully sent, and record the corresponding message receipt status code and message receipt time.

[0159] When the message receipt status code indicates that the RCS message transmission failed, the message failure reason code is extracted from the message receipt according to the message receipt format specified by the target operator. The message failure reason code is used to indicate why the target operator failed to send the RCS message to the target number after accepting the RCS message submission request, and its specific meaning is determined according to the target operator's RCS service access specifications.

[0160] The message failure reason code is mapped to the handling method specified in the target operator's RCS service access specification. When the message failure reason code indicates that the target number does not have the corresponding RCS receiving capability, the target number has been discontinued, or the message content violates the target operator's sending requirements, the RCS message transmission is determined to have failed, and no retransmission request for the same RCS message is submitted. When the message failure reason code indicates that the target operator's network is temporarily unavailable, the target number is temporarily unable to connect, or other reasons allowed for retransmission specified by the target operator, retransmission is performed according to the retransmission time and allowed number of retransmissions specified by the target operator.

[0161] The resend time is the waiting time specified by the target operator in the RCS service access specification or message receipt before resubmitting the RCS message; the allowed number of resends is the maximum number of times the target operator allows the same RCS message submission request to be resubmitted. If the target operator does not specify the allowed number of resends, the number agreed upon when the message sender accesses the operator channel used to send RCS messages shall be used. When the number of resends already performed reaches the allowed number of resends, the same RCS message submission request will not be sent again.

[0162] If no verified message receipt corresponding to the operator's message identifier is received within the message receipt waiting time, the message sending result of this RCS message is determined to be unconfirmed. The message receipt waiting time adopts the time specified in the target operator's RCS service access specification; if the target operator does not specify a message receipt waiting time, the message receipt waiting time agreed upon by the message sender when accessing the target operator's RCS service shall be adopted.

[0163] When step three determines that the RCS message submission request has not been accepted, the rejection reason code is matched with the rejection reasons and corresponding handling methods recorded in the target operator's RCS service access specifications. If the rejection reason code indicates that the target number format is incorrect, the message type is not supported, the message content is missing required fields, or the message content does not comply with the target operator's regulations, it is determined that the RCS message sending request does not meet the target operator's message submission requirements, and the same RCS message submission request will not be resent.

[0164] When the rejection reason code indicates that the authentication parameters have expired, new authentication parameters are obtained according to the authentication parameter update method specified by the target operator, and the authentication process in step three and the RCS message submission request are re-executed using the new authentication parameters. If the target operator uses an access token, a new access token is obtained through the access token update interface provided by the target operator; if the target operator uses a digital certificate, the expired digital certificate is replaced with a valid digital certificate issued by the target operator. If valid authentication parameters cannot be obtained, the corresponding operator channel is not used to send RCS messages.

[0165] When the rejection reason code indicates that the number of message submissions per unit time specified by the target operator has been reached, or the number of RCS message submission requests waiting for a submission response simultaneously has been reached, the allowed resending time returned by the target operator in the message submission response is read. If the allowed resending time is not returned in the message submission response, the time when an RCS message can be submitted again is determined based on the end time of the current sending cycle described in step two. After the time when an RCS message can be submitted again is reached, the sending capacity judgment in step two is re-executed, and if the corresponding operator channel has the sending capacity to continue submitting RCS messages, step three is executed again.

[0166] When the rejection reason code indicates that the message submission interface is temporarily unavailable or there are other reasons specified by the target operator that allow changing the operator channel, the operator channel to be used in this case is excluded from the candidate operator channels obtained in step two, and the sending capacity judgment and selection value comparison are re-executed for the remaining candidate operator channels. If there is an operator channel that is available and has the sending capacity to continue submitting RCS messages among the remaining candidate operator channels, the re-selected operator channel is determined as the operator channel for re-sending RCS messages, and step three is re-executed according to the message submission request format, authentication method, authentication parameters, and message submission request fields corresponding to the re-selected operator channel.

[0167] When the changed operator channel requires the use of a different media resource identifier, the media resource identifier obtained through the original operator channel will not be used. Instead, the media resource will be re-uploaded according to the media resource upload interface address, media resource upload request field, and media resource upload response field corresponding to the changed operator channel, and the newly obtained media resource identifier will be written into the RCS message submission request.

[0168] When step three determines that no valid message submission response has been obtained, it is determined whether the target operator provides a message status query interface based on the target operator's RCS service access data. The message status query interface allows the target operator to query whether the RCS message submission request has been accepted by the network address based on the request identifier or the operator's message identifier. When the target operator provides a message status query interface, the corresponding query request fields, authentication methods, and query response fields are obtained from the target operator's RCS service access data.

[0169] When the target operator provides a message status query interface, the request identifier is written into the message status query request according to the query request fields specified by the target operator; if the operator's message identifier has been obtained in step three, the operator's message identifier is also written into the message status query request. Authentication parameters are used according to the authentication method specified by the target operator, and the message status query request is sent to the message status query interface.

[0170] Receive the message status query response from the target operator and extract the query results according to the query response fields. If the query result indicates that the RCS message submission request has been accepted, do not resend the same RCS message submission request, and wait for the message receipt according to the operator message identifier returned by the target operator; if the query result indicates that the RCS message submission request has not been accepted, resend or switch operator channels according to the processing method specified by the target operator; if the query result cannot determine whether the RCS message submission request has been accepted, confirm that the message sending result has not been confirmed.

[0171] The target operator does not provide a message status query interface. However, it explicitly stipulates that when using a request identifier to identify duplicate RCS message submission requests, the request identifier should remain unchanged, and the RCS message submission request should be resent according to the resending conditions specified by the target operator. This allows the target operator to identify duplicate RCS message submission requests based on the same request identifier. The target operator does not provide a message status query interface and does not specify that when duplicate processing can be avoided based on the request identifier, RCS message submission requests that have been fully sent to the message submission interface address but have not received a valid message submission response should not be automatically resent, and the message sending result should be determined as unacknowledged.

[0172] If the RCS message submission request is not sent in step three due to media resource upload failure, the process follows the failure reason returned in the target operator's media resource upload response. If the media resource upload failure is due to the file format or file size not conforming to the target operator's requirements, the same media resource will not be uploaded again. If the media resource upload failure is due to the media resource upload interface being temporarily unavailable, communication connection interruption, or other reasons allowed by the target operator, the media resource will be re-uploaded according to the re-upload time and allowed number of re-uploads specified by the target operator. After successfully re-uploading the media resource and obtaining a valid media resource identifier, the construction and sending of the RCS message submission request in step three continues.

[0173] If, in step one, it is determined that the target number does not have the RCS receiving capability corresponding to the RCS message sending request; in step one, the RCS receiving capability of the target number is not confirmed and the target operator does not allow the submission of RCS messages; in step two, an operator channel for sending RCS messages cannot be selected; or after resending a number of times allowed and switching operator channels, the RCS message still cannot be successfully sent, the message fallback flag and fallback message content in the RCS message sending request are read. The message fallback flag is set by the message sender who submitted the RCS message sending request and is used to indicate whether it is allowed to switch to sending ordinary SMS messages when RCS messages cannot be sent; the fallback message content is provided by the message sender in the RCS message sending request and is text content suitable for sending via ordinary SMS messages.

[0174] The message fallback flag indicates that sending a regular short message is not allowed, or that the RCS message sending request does not contain fallback message content. In such cases, message fallback will not be performed, and the RCS message sending will be determined to have failed or the message sending result will not be confirmed based on the aforementioned processing result.

[0175] The message fallback flag indicates that switching to regular SMS sending is permitted and the RCS message sending request includes fallback message content. Based on the target operator determined in step one, a regular SMS sending channel corresponding to the target operator and in an available state is selected from the regular SMS sending channels already connected to by the message sender. The regular SMS sending channel is a message sending path established by the message sender according to the target operator's regular SMS service access specifications, corresponding to the regular SMS submission interface address, regular SMS sender identifier, authentication method, and authentication parameters.

[0176] When the message sender has connected to two or more ordinary SMS sending channels corresponding to the target operator, the ordinary SMS submission interface address, ordinary SMS sender identifier, authentication method, and authentication parameters of each ordinary SMS sending channel are checked. If all of the above exists, the authentication parameters have not exceeded the validity period specified by the target operator, and a communication connection can be established with the ordinary SMS submission interface address, the corresponding ordinary SMS sending channel is determined to be in an available state.

[0177] When only one regular SMS sending channel is available, the regular SMS sending channel is selected; when two or more regular SMS sending channels are available, the regular SMS sending channel with the earlier establishment time is selected according to the order of their establishment time; when no regular SMS sending channel is available, it is determined that the message fallback has not been accepted, and no regular SMS submission request is constructed or sent.

[0178] According to the target operator's standard SMS service access specifications, the target number, standard SMS sender identifier, and fallback message content are written into the standard SMS submission request. Using the corresponding authentication parameters and the appropriate authentication method, the standard SMS submission request is sent to the standard SMS submission interface address. The system receives the standard SMS submission response from the target operator and determines whether the submission request has been accepted based on the standard SMS submission response fields specified by the target operator.

[0179] A normal SMS submission response indicates that the normal SMS submission request has been accepted, confirming that the message fallback has been accepted; a normal SMS submission response indicates that the normal SMS submission request has not been accepted, or that no normal SMS submission response has been received within the normal SMS submission response time specified by the target operator, confirming that the message fallback has not been accepted.

[0180] After completing message submission response, message receipt, resending, operator channel switching, or message fallback processing, the data used in step two for selecting the operator channel is updated according to the corresponding channel identifier. When an RCS message submission request has been sent, it is counted in the total number of RCS message submission requests sent by the corresponding operator channel within the preset evaluation time range. When a message submission response indicates that an RCS message submission request has been accepted, it is counted in the number of RCS message submission requests that have received an acceptance response, and the time difference between the message submission response reception time and the submission sending time is used to calculate the average submission response time of the corresponding operator channel. When a message receipt indicates that an RCS message has been delivered or read, it is counted in the number of successfully sent RCS message submission requests within the preset evaluation time range.

[0181] When the preset evaluation time range is moved backward, RCS message submission requests that are earlier than the start time of the preset evaluation time range are removed from the total number of RCS message submission requests that have been sent, the number of RCS message submission requests that have received an acceptance response, and the number of RCS message submission requests that have been successfully sent within the preset evaluation time range. The average submission response time is then recalculated based on the RCS message submission requests that remain within the preset evaluation time range.

[0182] The calculation is performed using the number of RCS message submission requests that have received an acceptance response within a preset evaluation time range and the total number of RCS message submission requests that have been sent. The number of successfully sent RCS message submission requests is not used to replace the number of RCS message submission requests that have received an acceptance response. The number of successfully sent RCS message submission requests is used to record the RCS message submission requests that have been delivered or read by each operator's channel, and does not change the nature of this embodiment. This indicates the percentage of responses received.

[0183] Based on the aforementioned processing results, a final sending result corresponding to the request identifier is generated. The final sending result includes one of the following: RCS message sent successfully, RCS message sent failed, message sending result not confirmed, message fallback accepted, or message fallback not accepted. It also records the obtained target operator, channel identifier, operator message identifier, submission result code, rejection reason code, message receipt status code, message failure reason code, and message receipt time, ensuring that the RCS message sending process corresponding to the same request identifier has a definite processing result.

[0184] The above formulas are all dimensionless calculations. The formulas are derived from software simulations based on a large amount of collected data to obtain the most recent real-world results. The preset parameters in the formulas are set by those skilled in the art according to the actual situation.

[0185] The above embodiments can be implemented, in whole or in part, by software, hardware, firmware, or any other combination thereof. When implemented using software, the above embodiments can be implemented, in whole or in part, in the form of a computer program product.

[0186] Those skilled in the art will recognize that the modules and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and inventive constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0187] In addition, the functional modules in the various embodiments of this application can be integrated into one processing module, or each module can exist physically separately, or two or more modules can be integrated into one module.

[0188] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

[0189] In conclusion, the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A method for operator channel adaptation for RCS messages across three networks, characterized in that, include: Obtain the RCS message sending request and determine the operator channel used to send the RCS message; When the message type in the RCS message sending request is a rich media card message or an interactive message, the card text is divided into text content segments according to the card hierarchy and arrangement order of the message content, and the correspondence between the text content segments and media resources and interactive buttons is determined. Based on the target operator's RCS service access data corresponding to the operator channel, obtain the message submission request format, field length, and maximum length of the RCS message submission request, form an RCS message submission request, and calculate the actual number of bytes occupied. When the card content exceeds the corresponding field length and the number of bytes does not exceed the maximum length of the RCS message submission request, adjust the card content boundary and move the content segment after the boundary, along with its corresponding media resources and interactive buttons, to the next rich media card. If the adjusted message submission requirements are still not met, the operator channel will be redefined, and the RCS message submission request and card content boundaries will be redefined based on the redefined operator channel.

2. The operator channel adaptation method for RCS messages across three networks according to claim 1, characterized in that: The determination of the operator channel used to send RCS messages includes: Extract the target number, sender identifier, and message type from the RCS message sending request; determine the target operator based on the target number; and obtain the operator sender identifier based on the target operator and the sender identifier. Query the RCS service status and supported message types of the target number in the target operator's network to determine the RCS receiving capability of the target number; When the RCS receiving capability indicates that the target number has the RCS receiving capability corresponding to the message type, the operator channel used to send the RCS message is determined from the operator channels that match the target operator, the operator sender identifier, and the message type.

3. The operator channel adaptation method for RCS messages across three networks as described in claim 2, characterized in that: The determination of the operator channel used to send RCS messages also includes: The communication status of operator channels that match the target operator, operator sender identifier, and message type is determined, and operator channels that are in an available state are identified as candidate operator channels. Based on the number of RCS message submission requests that have received acceptance responses in the current transmission cycle for each candidate operator channel, and the number of RCS message submission requests that have been sent but have not yet received submission responses, it is determined whether the candidate operator channel has the transmission capacity to continue submitting RCS messages. The operator channel for sending RCS messages is determined from the candidate operator channels with the stated transmission capacity.

4. The operator channel adaptation method for RCS messages across three networks as described in claim 3, characterized in that: When two or more candidate operator channels have the capacity to continue submitting RCS messages, the selection value of each candidate operator channel is calculated based on the number of RCS message submission requests that can still be submitted within the current transmission cycle, the number of RCS message submission requests that can currently wait for submission responses, the proportion of the number of RCS message submission requests that have received acceptance responses within the preset evaluation time range to the total number of RCS message submission requests that have been sent, and the average submission response time. The candidate operator channel with the highest selection value is then determined as the operator channel used to send RCS messages.

5. The operator channel adaptation method for RCS messages across three networks according to claim 4, characterized in that: The formation of the RCS message submission request includes: Based on the operator channel used to send RCS messages, obtain the correspondence between message submission request format, message type and operator message type code, and message content requirements from the target operator's RCS service access data; The message type is converted into the operator message type code according to the correspondence, and the message content is checked according to the message content requirements. When the message content includes media resources, and the target operator requires that media resources be uploaded before sending the RCS message submission request, the media resource upload interface address, media resource upload request field, and media resource upload response field are obtained from the RCS service access data. A media resource upload request is formed according to the media resource upload request field and sent to the media resource upload interface address. The media resource identifier is obtained from the media resource upload response according to the media resource upload response field. According to the message submission request format, the target number, operator sender identifier, operator message type code and message content are written into the message submission request field, and when the media resource identifier is obtained, the media resource identifier is written into the corresponding message submission request field to form an RCS message submission request.

6. The operator channel adaptation method for RCS messages across three networks according to claim 5, characterized in that: Determining the correspondence between the main text content segments and media resources and interactive buttons includes: Read the operation content corresponding to the interactive button; Determine the corresponding text segment for each interactive button based on the order of the text segments within the card text and the position of the interactive buttons within the message content. When all interactive buttons are arranged after the card text, the operation content is compared with the web page address, phone number or return content in each text content segment to determine the text content segment corresponding to the interactive button. Determine the corresponding text content segment of the media resource according to its original arrangement in the RCS message sending request; If the corresponding text content segment of an interactive button cannot be determined, the interactive button is determined to correspond to all text content segments in the same rich media card; if the corresponding text content segment of a media resource cannot be determined, the media resource is determined to correspond to all text content segments in the same rich media card.

7. The operator channel adaptation method for RCS messages across three networks according to claim 1, characterized in that: The adjustment of card content boundaries includes: Obtain the maximum length of the RCS message submission request and the number of rich media cards allowed to be written from the target operator's RCS service access data; When the card content exceeds the corresponding field length, the number of bytes actually occupied by the RCS message submission request does not exceed the maximum length of the RCS message submission request, and the number of rich media cards that can be written is greater than one, the card content boundary is determined before the content segment at the end of the current rich media card, and the content segment after the card content boundary and its corresponding media resources and interactive buttons are moved to the next rich media card. After each move, the RCS message submission request is re-formed according to the message submission request format, character encoding and field escaping are re-executed, and the actual number of bytes occupied by the RCS message submission request is recalculated. If the original rich media card still exceeds the corresponding field length after being moved, the card content boundary is moved forward; if the next rich media card exceeds the corresponding field length after being moved, and the current number of rich media cards has not reached the number of rich media cards allowed to be written, the card content boundary is determined in the next rich media card until the card body of each rich media card does not exceed the corresponding field length, and the number of bytes actually occupied by the RCS message submission request does not exceed the maximum length of the RCS message submission request.

8. The operator channel adaptation method for RCS messages across three networks according to claim 7, characterized in that: When the number of interactive buttons exceeds the number of interactive buttons specified by the target operator for a single rich media card, starting from the interactive buttons that are later in the arrangement, the interactive buttons and their corresponding text content segments are moved to the next rich media card. When the main content segment corresponds to other interactive buttons, all interactive buttons corresponding to the main content segment are moved together; after moving, the number of interactive buttons in the original rich media card and the next rich media card are recalculated, and the number of bytes actually occupied by the RCS message submission request is recalculated; when the number of interactive buttons meets the target operator's requirements and the number of bytes does not exceed the maximum length of the RCS message submission request, the moved interactive buttons and card content boundaries are retained. If the number of bytes exceeds the maximum length of the RCS message submission request, the current move is cancelled, and it is determined that the current operator channel cannot construct an RCS message submission request based on the current number of rich media cards.

9. A method for operator channel adaptation for RCS messages across three networks as described in claim 8, characterized in that: The process of readjusting card content boundaries according to the newly determined operator channel includes: Read the media resource upload interface address, media resource upload request field, and media resource upload response field corresponding to the redefined operator channel; form a media resource upload request according to the media resource upload request field and send it to the media resource upload interface address; and obtain the media resource identifier from the media resource upload response according to the media resource upload response field. Read the message submission request format, field length, number of rich media cards allowed to be written, number of interactive buttons allowed to be written to each rich media card, character encoding method, field escaping method, and maximum length of RCS message submission request corresponding to the redefined operator channel; write the media resource identifier into the corresponding message submission request field; reformulate the RCS message submission request according to the message submission request format; perform character encoding and field escaping; and calculate the number of bytes actually occupied by the RCS message submission request. When any rich media card before or after the card content boundary determined under the original operator channel exceeds the range specified by the redefined operator channel, the card content boundary is moved forward or backward according to the re-formed RCS message submission request, and the RCS message submission request is re-formed and the actual number of bytes occupied is calculated after each movement. If the fields of each message submission request do not exceed the corresponding field length, the number of rich media cards does not exceed the number of rich media cards allowed to be written, the number of interactive buttons in each rich media card does not exceed the number of interactive buttons allowed to be written, and the number of bytes actually occupied by the RCS message submission request does not exceed the maximum length of the RCS message submission request, the boundaries of the moved card content will be preserved.