Session message processing method and device
By matching the processing conditions and client attribute data in the session message in the client and deleting mismatched content, the code complexity problem caused by the many special objects in the session message is solved, and the code scale is reduced and management is facilitated.
Patent Information
- Application Number
- CN202311524255.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-15
- Publication Date
- 2025-05-16
AI Technical Summary
In the session messages sent between clients, the large number of special objects leads to high complexity of software code and is difficult to manage and maintain.
By obtaining the pending session message and the client's attribute data, matching the client's attribute data and processing conditions in the message, deleting the target content that does not match, obtaining the target session message and processing it.
The scale of session message processing software code is reduced, the code management and maintenance efficiency is improved, and the code redundancy caused by complex conditions and unprocessable fields is avoided.
Smart Images

Figure CN120017623A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a method and device for processing session messages. Background Art
[0002] Clients can send conversation messages to each other to achieve instant messaging. Currently, conversation messages sent between clients can include some fields related to special objects. The so-called special objects can be understood as objects that are processed differently in different environments. For example, the special object is a text that displays "Hello" in the sending client and "hello" in the receiving client.
[0003] Currently, the client can execute software code to process the session message, and the software code for processing the session message can include software code for processing the fields related to the aforementioned special objects. However, in this way, when the number of the aforementioned special objects is large, the complexity of the software code is also relatively high, which is not conducive to the management and maintenance of the software code.
[0004] Therefore, a solution is urgently needed to solve the above problems. Summary of the invention
[0005] In order to solve or at least partially solve the above technical problems, an embodiment of the present application provides a method and device for processing a session message.
[0006] In a first aspect, an embodiment of the present application provides a method for processing a session message, which is applied to a client, and the method includes:
[0007] Acquire a session message to be processed and attribute data of the client, wherein the session message to be processed includes: a plurality of fields corresponding to a target object and a condition for processing each of the plurality of fields;
[0008] Matching the attribute data of the client with the condition for processing each of the multiple fields to obtain a matching result;
[0009] According to the matching result, deleting the target content in the to-be-processed session message to obtain a target session message, wherein the target content includes: a condition for processing each of the multiple fields and a field in the multiple fields that does not match the attribute data;
[0010] The target session message is processed.
[0011] Optionally, the session message to be processed includes multiple fields corresponding to the target object and a condition for processing each of the multiple fields, including:
[0012] The session message to be processed includes: the field name of each field, the condition for processing each field, and the specific value of each field, wherein: a preset identifier is included between the field name of each field and the condition for processing the field, and the field name of each field is the same.
[0013] Optionally, the session message to be processed further includes index information of the target object. Before matching the attribute data of the client with a condition for processing each of the multiple fields, the method further includes:
[0014] A condition for processing each of the multiple fields is determined from the session message to be processed according to the index information of the target object.
[0015] Optionally, the index information of the target object includes:
[0016] The paths of the multiple fields corresponding to the target object in the session message to be processed.
[0017] Optionally, the index information of the target object further includes: attributes included in the condition for processing each of the multiple fields, and obtaining attribute data to be received by the client includes:
[0018] According to the attribute in the index information, the attribute value of the client corresponding to the attribute is acquired to obtain the attribute data of the client.
[0019] Optionally, the client is a sending client, and obtaining the session message to be processed includes:
[0020] A session message sent to the receiving client is obtained as the session message to be processed.
[0021] Optionally, the client is a receiving client, and obtaining the session message to be processed includes:
[0022] Receive the session message to be processed sent by the sending client.
[0023] Optionally, the attribute data of the client includes one or more of the following:
[0024] The version of the client, the type of operating system running the client, and the role of the client, wherein the role of the client includes: a sending client or a receiving client.
[0025] In a second aspect, an embodiment of the present application provides a session message processing device, which is applied to a client, and the device includes:
[0026] An acquisition unit, configured to acquire a session message to be processed and attribute data of the client, wherein the session message to be processed includes: a plurality of fields corresponding to a target object and a condition for processing each of the plurality of fields;
[0027] A matching unit, configured to match the attribute data of the client with a condition for processing each of the multiple fields to obtain a matching result;
[0028] a deleting unit, configured to delete target content in the to-be-processed session message according to the matching result, so as to obtain a target session message, wherein the target content includes: a condition for processing each of the multiple fields and fields in the multiple fields that do not match the attribute data;
[0029] A processing unit is used to process the target session message.
[0030] Optionally, the session message to be processed includes multiple fields corresponding to the target object and a condition for processing each of the multiple fields, including:
[0031] The session message to be processed includes: the field name of each field, the condition for processing each field, and the specific value of each field, wherein: a preset identifier is included between the field name of each field and the condition for processing the field, and the field name of each field is the same.
[0032] Optionally, the to-be-processed session message also includes index information of the target object, and the device further includes:
[0033] A determination unit is used to determine the condition for processing each of the multiple fields from the to-be-processed session message according to the index information of the target object before matching the attribute data of the client with the condition for processing each of the multiple fields.
[0034] Optionally, the index information of the target object includes:
[0035] The paths of the multiple fields corresponding to the target object in the session message to be processed.
[0036] Optionally, the index information of the target object further includes: an attribute included in a condition for processing each of the multiple fields, and the acquiring unit is configured to:
[0037] According to the attribute in the index information, the attribute value of the client corresponding to the attribute is acquired to obtain the attribute data of the client.
[0038] Optionally, the client is a sending client, and the acquiring unit is used to:
[0039] A session message sent to the receiving client is obtained as the session message to be processed.
[0040] Optionally, the client is a receiving client, and the acquiring unit is used to:
[0041] Receive the session message to be processed sent by the sending client.
[0042] Optionally, the attribute data of the client includes one or more of the following:
[0043] The version of the client, the type of operating system running the client, and the role of the client, wherein the role of the client includes: a sending client or a receiving client.
[0044] In a third aspect, an embodiment of the present application provides an electronic device, the electronic device comprising a processor and a memory;
[0045] The processor is used to execute instructions stored in the memory so that the electronic device executes the method described in any one of the first aspects above.
[0046] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, comprising instructions, wherein the instructions instruct a device to execute any of the methods described in the first aspect above.
[0047] In a fifth aspect, an embodiment of the present application provides a computer program product, which, when executed on a computer, enables the computer to execute any of the methods described in the first aspect above.
[0048] Compared with the prior art, the embodiments of the present application have the following advantages:
[0049] The embodiment of the present application provides a method for processing a session message, which can be applied to a client. The client can obtain a session message to be processed and the attribute data of the client, wherein the session message to be processed includes: multiple fields corresponding to a target object and a condition for processing each of the multiple fields. After obtaining the session message to be processed and the attribute data, the attribute data can be matched with the aforementioned condition for processing each of the multiple fields to determine which fields of the multiple fields can be processed by the current client. Further, according to the matching result of matching the attribute data with the aforementioned condition, the target content in the session message to be processed is deleted. The target content includes the aforementioned condition for processing each of the multiple fields and the fields in the multiple fields that do not match the attribute data. After deleting the target content in the session message to be processed, a target session message can be obtained. The target session message is further processed. It is not difficult to understand that the target session message no longer includes the aforementioned conditions, nor does it include the fields that the client cannot process in the aforementioned multiple fields. Therefore, the software code for processing the target session message (hereinafter referred to as the message processing code) does not need to include the code for processing the aforementioned conditions, nor does it need to include the code related to the fields that the client cannot process in the aforementioned multiple fields. That is, by adopting this scheme, the code for processing the aforementioned conditions and the fields that the client cannot process can be separated from the message processing code. Moreover, in the case where the session message to be processed involves multiple target objects, the logic for processing the aforementioned conditions and the fields that the client cannot process corresponding to each target object is the same, so the separated code can be reused. It can be seen that the scheme of the embodiment of the present application effectively reduces the scale of the software code for processing the session message, which is conducive to the management and maintenance of the software code. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0051] Figure 1 A flowchart of a method for processing a session message provided in an embodiment of the present application;
[0052] Figure 2 A scenario diagram of a method for processing a session message provided in an embodiment of the present application;
[0053] Figure 3Structural schematic diagram of a processing device for session messages provided by an embodiment of the present application 。 Detailed implementation manners
[0054] In order to enable those skilled in the art of the present technology to better understand the solution of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.
[0055] The inventors of the present application have found through research that currently, the client can execute software code to process session messages, and the software code for processing session messages can include software code for processing fields related to the aforementioned special objects. For example:
[0056] The target object is text, which shows "Hello" in the sending client and "hello" in the receiving client. Then:
[0057] The session message includes two fields, namely field text1 and field text2. Here, text1 and text2 are field names, the value of field text1 is "Hello", and the value of field text2 is "hello". The software code for the client to process the session message can include software code for determining the role of the current client and performing subsequent operations based on the determination result. Specifically, if the role of the current client is the sending client, the value of field text1 is extracted from the session for processing (such as rendering and displaying); if the role of the current client is the receiving client, the value of field text2 is extracted from the session for processing (such as rendering and displaying). Among them, the sending client refers to the client acting as the sending end, that is, the client sending the session message; the receiving client refers to the client acting as the receiving end, that is, the client receiving the session message.
[0058] In this way, once there are many special objects included in the session message, the aforementioned software code will include software code for processing multiple fields associated with each special object, resulting in a large scale of the software code, which is not conducive to the management and maintenance of the software code. For example, once the logic for processing the fields associated with a certain special object changes, it is necessary to search the entire software code for the software code for processing the fields associated with the target object and further modify the found software code.
[0059] To solve the above problems, the embodiments of the present application provide a method and device for processing session messages.
[0060] Various non-limiting implementations of the present application are described in detail below in conjunction with the accompanying drawings.
[0061] Exemplary Methods
[0062] See also Figure 1 , which is a flow chart of a method for processing a session message provided in an embodiment of the present application. In this embodiment, the method can be applied to a client, and the client can be a client that can provide an instant communication function. Of course, in addition to providing an instant communication function, the client can also provide other functions, which are not specifically limited in the embodiment of the present application.
[0063] In the embodiment of the present application, the client may be a sending client or a receiving client, and the embodiment of the present application does not make any specific limitation. Figure 1 The method shown may, for example, include the following steps: S101 - S104 .
[0064] S101: Acquire a session message to be processed and attribute data of a client, wherein the session message to be processed includes: a plurality of fields corresponding to a target object and a condition for processing each of the plurality of fields.
[0065] In the embodiment of the present application, the to-be-processed session message may be a session message sent by a sending client to a receiving client. Figure 1 When the method shown is applied to a sending client, obtaining the session message to be processed may be, in a specific implementation, obtaining the session message sent to the receiving client as the session message to be processed. In one example, after generating a session message to be sent to the receiving client, the sending client may obtain the session message as the session message to be processed. Figure 1 When the method shown is applied to a receiving client, obtaining the to-be-processed session message in a specific implementation may be receiving the to-be-processed session message sent by the sending client.
[0066] In an embodiment of the present application, the target object is an object that has different processing methods in different environments. The embodiment of the present application does not specifically limit what kind of object the target object is. The target object can be any object that can be involved in a session message and has different processing methods in different environments. The environment mentioned here can be related to the version of the client, the type of operating system running the client, and the role of the client. For example, due to the functional differences provided by different versions of clients, the corresponding processing methods of the target object in different versions of clients are different. For another example, due to the differences between different operating systems, the corresponding processing methods of the target object in different operating systems are different. For another example, due to the differences between the sending client and the receiving client (such as language environment differences), the corresponding processing methods of the target object in different operating systems are different (for example, Chinese characters are displayed in the sending client, and corresponding English characters are displayed in the receiving client).
[0067] In the embodiment of the present application, the session message to be processed may involve multiple target objects. For any target object, the session message to be processed may include multiple fields corresponding to the target object and conditions for processing each of the multiple fields. The client processes the multiple fields corresponding to each target object and the conditions for processing each of the multiple fields in the same manner. In the following description, a certain target object is used as an example for explanation.
[0068] In an embodiment of the present application, the session message to be processed may include multiple fields corresponding to the target object. In addition, the session message to be processed also includes conditions for processing each of the multiple fields. The embodiment of the present application does not specifically limit the conditions for processing each field, and the condition may involve one or more parameters of the client. The client parameters mentioned here include but are not limited to the client version mentioned above, the type of operating system running the client, and the role of the client. Regarding the conditions for processing each field, the following examples are given:
[0069] The session message to be processed includes two fields, namely field 1 and field 2. The processing condition corresponding to field 1 is: the client role is a sending client, and the processing condition corresponding to field 2 is: the client role is a receiving client.
[0070] In one example, for any one of the multiple fields, the session message to be processed may include the field name of the field, the specific value of the field, and the condition for processing the field. In one example, the field name of each field is the same. For each field, a preset identifier may be included between its field name and the condition for processing the field. In this way, even if the field name of each field is the same, different fields can be distinguished by the preset identifier and the condition after the preset identifier. The embodiment of the present application does not specifically limit the preset identifier, and the preset identifier can be set according to actual conditions. In one example, the preset identifier can be "@".
[0071] For example:
[0072] The pending session message includes two fields, field 1 and field 2. The processing condition corresponding to field 1 is: the client role is a sending client, and the processing condition corresponding to field 2 is: the client role is a receiving client. The pending session message may include the following content:
[0073] "text@sender":XXX
[0074] "text@guest": ****
[0075] in:
[0076] ""text@sender":XXX" is field 1 and the condition for processing field 1;
[0077] "text@guest":****" is field 2 and the condition for processing field 2;
[0078] The field names of field 1 and field 2 are both text;
[0079] @ is a preset identifier;
[0080] XXX is the specific value of field 1, for example, the aforementioned "Hello";
[0081] **** is the specific value of field 2, for example, the aforementioned "hello".
[0082] sender indicates that the role of the client is a sending client, that is, the sending client can process field 1;
[0083] guest indicates that the role of the client is a receiving client, that is, the receiving client can process field 2.
[0084] In one example, the client may traverse the session message to be processed to obtain multiple fields corresponding to the target object and the conditions for processing each of the multiple fields. In another example, in order to improve the efficiency of the client in obtaining the multiple fields and the conditions for processing each field, the session message to be processed may include index information of the target object, and the index information is used to enable the client to quickly find the multiple fields and the conditions for processing the target fields from the session message to be processed. In other words, the client does not need to traverse the session message to be processed, but can determine the multiple fields and the conditions for processing each field from the session message to be processed according to the index information of the target object, thereby quickly obtaining the multiple fields and the conditions for processing each field.
[0085] The embodiment of the present application does not specifically limit the index information, and the index information may be any information that can quickly locate the multiple fields. In a specific example, considering that for a certain field, the path of the field in the to-be-processed session message can be used to locate the position of the field in the to-be-processed session message, the index information of the target object may be the path of the multiple fields corresponding to the target object in the to-be-processed session message.
[0086] In an embodiment of the present application, the attribute data of the client may include the attribute values of one or more attributes of the client. The embodiment of the present application does not specifically limit the attributes of the client, and the attributes of the client include, but are not limited to: the version of the client, the type of operating system running the client, and the role of the client. Among them: the type of operating system running the client may be the type of operating system of the terminal device on which the client is installed. The role of the client may include a sending client or a receiving client.
[0087] In an example, attribute values corresponding to all attributes of the client may be obtained as the attribute data.
[0088] In another example, the attribute values of the attributes of the client involved in the aforementioned conditions for processing each field can be obtained as the attribute data, rather than obtaining the attribute values corresponding to all the attributes of the client. For this case, in one example, the index information of the target object also includes: the attributes included in the conditions for processing each of the multiple fields. In this way, the client can obtain the attribute value of the client corresponding to the attribute according to the attribute included in the index information, thereby obtaining the attribute data of the client. For example, the attribute included in the index information is: operating system type, then the client can obtain the operating system type corresponding to itself, and accordingly, the attribute data includes: the operating system type running the client. Regarding the index information, its format can be, for example: [path]: [attributes involved in the conditions], wherein "attributes involved in the conditions" may include one or more attributes, which is not specifically limited in the embodiments of the present application.
[0089] S102: Match the attribute data of the client with the condition for processing each field in the multiple fields to obtain a matching result.
[0090] After obtaining the attribute data and the conditions for processing each of the multiple fields, the attribute data of the client can be matched with the conditions for processing each of the multiple fields to determine which fields of the multiple fields the client can process. Specifically, if the attribute data of the client successfully matches the conditions for processing a certain field, it means that the client can process the field; if the attribute data of the client fails to match the conditions for processing the field, it means that the client cannot process the field. Let's continue with the examples in the above text:
[0091] Assume that the session message to be processed includes the following content:
[0092] "text@sender":XXX
[0093] "text@guest": ****
[0094] in:
[0095] ""text@sender":XXX" is field 1 and the condition for processing field 1;
[0096] ““text@guest”:****” is field 2 and the condition for processing field 2.
[0097] The client's attribute data indicates that the client's role is: sending client. Then:
[0098] If the attribute data of the client successfully matches the condition for processing field 1, the client can process field 1. If the attribute data of the client fails to match the condition for processing field 2, the client cannot process field 2.
[0099] It is not difficult to understand that the matching result mentioned in S102 can indicate which fields of the multiple fields the client can process and which fields of the multiple fields the client cannot process.
[0100] S103: According to the matching result, delete the target content in the to-be-processed session message to obtain a target session message, wherein the target content includes: a condition for processing each of the multiple fields and fields in the multiple fields that do not match the attribute data.
[0101] After obtaining the matching result, the message session to be processed can be processed based on the matching result. Specifically, the content related to the fields that cannot be processed by itself in the multiple fields can be deleted. In addition, since the fields that can be processed by itself are determined, the conditions for processing the fields that can be processed by itself can also be deleted. In a specific example, the content to be deleted is called target content, and the target content may include the conditions for processing each field in the multiple fields and the fields in the multiple fields that do not match the attribute data. In another specific example, the target content may also include the index information of the aforementioned target object.
[0102] After deleting the target content in the session message to be processed, the target session message can be obtained. It is not difficult to understand that, with respect to the target object, the target session message only includes fields corresponding to the target object and that can be processed by the client.
[0103] Let's continue with the examples above:
[0104] Assume that the session message to be processed includes the following content:
[0105] "text@sender":XXX
[0106] "text@guest": ****
[0107] in:
[0108] ""text@sender":XXX" is field 1 and the condition for processing field 1;
[0109] ““text@guest”:****” is field 2 and the condition for processing field 2.
[0110] The client's attribute data indicates that the client's role is: sending client. Then:
[0111] You can delete "@sender" in "text@sender" and "text@guest": ****
[0112] Correspondingly, the content of the target object included in the target conversation message is as follows:
[0113] "text": XXX
[0114] In the embodiment of the present application, the conversation message to be processed involves one or more target objects. In the specific implementation of S103, the target contents corresponding to the target objects in the conversation message to be processed may be deleted to obtain the target conversation message.
[0115] S104: Process the target session message.
[0116] After obtaining the target session message, the target session message may be processed. In a specific example, when processing the target session message, for example, according to the message type of the target session message, a message processing template corresponding to the message type may be selected, so that the target session message is processed using the message processing target. The type of the target session message mentioned here may be understood as the type of information included in the target session message. For example, when the content carried in the target session message is text, the type of the target session message may be a text type. For another example, when the content carried in the target session message is an image, the type of the target session message may be an image type. Processing the target session message includes, but is not limited to, rendering a page based on the content carried in the target session message, and displaying the corresponding content in a display page based on the rendering result.
[0117] In one example, the aforementioned message processing template may correspond to a corresponding message processing code, that is, the client may run the message processing software code to process the target session message. Since the target session message does not include the fields that the client cannot process among the aforementioned multiple fields, nor does it include the aforementioned conditions, the message processing code does not need to include the code for processing the aforementioned conditions, nor does it need to include the code related to the fields that the client cannot process among the aforementioned multiple fields. That is, by adopting this solution, the code for processing the aforementioned conditions and the fields that the client cannot process can be separated from the message processing code. Moreover, in the case where the session message to be processed involves multiple target objects, the logic for processing the aforementioned conditions and the fields that the client cannot process corresponding to each target object is the same. Therefore, the same set of codes can be reused for processing the aforementioned conditions and the fields that the client cannot process corresponding to each target object. In other words, the independent code can be reused. It can be seen that the solution of the embodiment of the present application effectively reduces the scale of the software code for processing the session message, which is conducive to the management and maintenance of the software code.
[0118] The above introduces the method for processing session messages provided in the embodiment of the present application. Next, the solution provided in the embodiment of the application is introduced in combination with specific scenarios.
[0119] See also Figure 2 , which is a scenario diagram of a session message processing method provided in an embodiment of the present application. Figure 2 The method shown may include the following S201-S206.
[0120] S201: The sending client sends a session message to be processed to the receiving client.
[0121] S202: The receiving client receives the session message to be processed.
[0122] S203-S206 are steps that both the sending client and the receiving client need to execute. The sending client can execute S203-S206 after executing S201. The receiving client can execute S203-S206 after executing S202.
[0123] S203: Acquire the session message to be processed and its own attribute data.
[0124] S204: Match the own attribute data with the condition for processing each field in the multiple fields to obtain a matching result.
[0125] S205: According to the matching result, the target content in the to-be-processed conversation message is deleted to obtain a target conversation message.
[0126] S206: Process the target conversation message (eg, display corresponding content).
[0127] For the specific implementation of S203 - S206 , please refer to the relevant description of the above embodiments, which will not be repeated here.
[0128] Exemplary Devices
[0129] Based on the method provided in the above embodiment, the embodiment of the present application further provides a device, which is described below in conjunction with the accompanying drawings.
[0130] See also Figure 3 , which is a schematic diagram of the structure of a session message processing device provided in an embodiment of the present application. The device 300 may specifically include: an acquisition unit 301, a matching unit 302, a deletion unit 303 and a processing unit 304.
[0131] The acquisition unit 301 is used to acquire the session message to be processed and the attribute data of the client, wherein the session message to be processed includes: a plurality of fields corresponding to the target object and a condition for processing each of the plurality of fields;
[0132] A matching unit 302, configured to match the attribute data of the client with a condition for processing each of the multiple fields to obtain a matching result;
[0133] A deleting unit 303 is used to delete the target content in the to-be-processed conversation message according to the matching result to obtain a target conversation message, wherein the target content includes: a condition for processing each of the multiple fields and a field in the multiple fields that does not match the attribute data;
[0134] The processing unit 304 is configured to process the target session message.
[0135] Optionally, the session message to be processed includes multiple fields corresponding to the target object and a condition for processing each of the multiple fields, including:
[0136] The session message to be processed includes: the field name of each field, the condition for processing each field, and the specific value of each field, wherein: a preset identifier is included between the field name of each field and the condition for processing the field, and the field name of each field is the same.
[0137] Optionally, the to-be-processed session message also includes index information of the target object, and the device further includes:
[0138] A determination unit is used to determine the condition for processing each of the multiple fields from the to-be-processed session message according to the index information of the target object before matching the attribute data of the client with the condition for processing each of the multiple fields.
[0139] Optionally, the index information of the target object includes:
[0140] The paths of the multiple fields corresponding to the target object in the session message to be processed.
[0141] Optionally, the index information of the target object further includes: attributes included in the condition for processing each of the multiple fields. The acquisition unit 301 is used to:
[0142] According to the attribute in the index information, the attribute value of the client corresponding to the attribute is acquired to obtain the attribute data of the client.
[0143] Optionally, the client is a sending client, and the obtaining unit 301 is used to:
[0144] A session message sent to the receiving client is obtained as the session message to be processed.
[0145] Optionally, the client is a receiving client, and the obtaining unit 301 is used to:
[0146] Receive the session message to be processed sent by the sending client.
[0147] Optionally, the attribute data of the client includes one or more of the following:
[0148] The version of the client, the type of operating system running the client, and the role of the client, wherein the role of the client includes: a sending client or a receiving client.
[0149] Since the device 300 is a device corresponding to the method provided in the above method embodiment, the specific implementation of each unit of the device 300 is based on the same concept as the above method embodiment. Therefore, for the specific implementation of each unit of the device 300, reference can be made to the description part of the above method embodiment, which will not be repeated here.
[0150] The embodiment of the present application also provides an electronic device, the electronic device comprising a processor and a memory;
[0151] The processor is used to execute the instructions stored in the memory, so that the electronic device executes the method for processing the session message provided in the above method embodiment.
[0152] An embodiment of the present application provides a computer-readable storage medium, including instructions, wherein the instructions instruct a device to execute the method for processing a session message provided in the above method embodiment.
[0153] An embodiment of the present application provides a computer program product. When the computer program product is run on a computer, the computer is enabled to execute the method for processing a session message provided in the above method embodiment.
[0154] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present application are indicated by the following claims.
[0155] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.
[0156] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application should be included in the protection scope of the present application.
Claims
1. A method for processing a session message, characterized in that: Applied to a client, the method comprises: Acquire a session message to be processed and attribute data of the client, wherein the session message to be processed includes: a plurality of fields corresponding to a target object and a condition for processing each of the plurality of fields; Matching the attribute data of the client with the condition for processing each of the multiple fields to obtain a matching result; According to the matching result, deleting the target content in the to-be-processed session message to obtain a target session message, wherein the target content includes: a condition for processing each of the multiple fields and a field in the multiple fields that does not match the attribute data; The target session message is processed.
2. The method according to claim 1, characterized in that: The session message to be processed includes multiple fields corresponding to the target object and a condition for processing each of the multiple fields, including: The session message to be processed includes: the field name of each field, the condition for processing each field, and the specific value of each field, wherein: a preset identifier is included between the field name of each field and the condition for processing the field, and the field name of each field is the same.
3. The method according to claim 1 or 2, characterized in that: The session message to be processed also includes index information of the target object. Before matching the attribute data of the client with the condition for processing each of the multiple fields, the method further includes: A condition for processing each of the multiple fields is determined from the session message to be processed according to the index information of the target object.
4. The method according to claim 3, characterized in that The index information of the target object includes: The paths of the multiple fields corresponding to the target object in the session message to be processed.
5. The method according to claim 4, characterized in that The index information of the target object further includes: the attributes included in the condition for processing each of the multiple fields, and obtaining the attribute data to be received by the client, including: According to the attribute in the index information, the attribute value of the client corresponding to the attribute is acquired to obtain the attribute data of the client.
6. The method according to claim 1, characterized in that The client is a sending client, and obtaining the session message to be processed includes: A session message sent to the receiving client is obtained as the session message to be processed.
7. The method according to claim 1, characterized in that The client is a receiving client, and the obtaining of the session message to be processed includes: Receive the session message to be processed sent by the sending client.
8. The method according to claim 1, characterized in that The client's attribute data includes one or more of the following: The version of the client, the type of operating system running the client, and the role of the client, wherein the role of the client includes: a sending client or a receiving client.
9. A session message processing device, characterized in that: Applied to a client, the device comprises: An acquisition unit, configured to acquire a session message to be processed and attribute data of the client, wherein the session message to be processed includes: a plurality of fields corresponding to a target object and a condition for processing each of the plurality of fields; A matching unit, configured to match the attribute data of the client with a condition for processing each of the multiple fields to obtain a matching result; a deleting unit, configured to delete target content in the to-be-processed session message according to the matching result, so as to obtain a target session message, wherein the target content includes: a condition for processing each of the multiple fields and fields in the multiple fields that do not match the attribute data; A processing unit is used to process the target session message.
10. An electronic device, characterized in that: The electronic device comprises a processor and a memory; The processor is configured to execute instructions stored in the memory, so that the electronic device performs the method according to any one of claims 1 to 8.
11. A computer-readable storage medium, characterized in that: The method comprises instructions for instructing a device to execute the method according to any one of claims 1 to 8.