Message data processing method, device, equipment and storage medium

By generating and sending message data containing index information, the receiving end can directly query field values, which solves the problem of format conversion required by the data receiving end and improves data transmission and storage efficiency.

CN113608889BActive Publication Date: 2024-08-23GUANGZHOU BAIGUOYUAN NETWORK TECH CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202110791561.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-07-13
Publication Date
2024-08-23
Estimated Expiration
2041-07-13

AI Technical Summary

Technical Problem

In the existing technology, because the message data generated by the data sending end follows its own defined format standard, the data receiving end needs to perform format conversion, resulting in low message data processing efficiency and inability to effectively improve data transmission efficiency.

Method used

By generating index information, including the location data and byte size of each field, merging it with the message data to generate new message data, sending the index information and field values, the receiving end queries the field values ​​based on the index information, reducing the number of fields Conversion and parsing process.

Benefits of technology

Significantly improves data transmission and storage efficiency, reduces additional field parsing processes, only needs to store index information and field values, and does not need to store fields, improving data processing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113608889B
    Figure CN113608889B
Patent Text Reader

Abstract

The embodiment of the present invention discloses a message data processing method, device, equipment and storage medium, the method comprising: obtaining first message data, the first message data comprising at least one field and a field value corresponding to the at least one field; generating index information according to the position order of each field in the first message data, a preset index length and the byte size occupied by the field value corresponding to each field, the index information comprising the position data of each field value in the first message data and the byte size occupied; merging the index information with the field value in the first message data to generate second message data, and sending the second message data. This scheme optimizes the processing mechanism of message data and improves the processing efficiency of message data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of computers, and in particular, to a message data processing method, apparatus, device and storage medium. Background Art

[0002] With the development of computer and network communication technology, data interaction between devices is becoming more and more frequent. For example, after the data sending end generates message data according to the set format standard, the message data is sent to the data receiving end, and the data receiving end parses the received message data and performs subsequent functional processing. In order to improve data transmission efficiency, the message data generated by the data sending end can be received and processed by multiple different data receiving ends at the same time.

[0003] In the prior art, since the data sending end generates message data according to the format standard defined by itself, and the data formats defined by the business systems integrated in each data receiving end are usually different, in order to process the message data sent by the data sending end, the data receiving end uses a format conversion method to convert the received message data according to the data format defined by itself. This message data processing method is inefficient and needs to be improved. Summary of the invention

[0004] The embodiments of the present invention provide a message data processing method, device, equipment and storage medium, which optimize the message data processing mechanism and improve the message data processing efficiency.

[0005] In a first aspect, an embodiment of the present invention provides a message data processing method, the method comprising:

[0006] Acquire first message data, where the first message data includes at least one field and a field value corresponding to the at least one field;

[0007] Generate index information according to the position order of each field in the first message data, the preset index length, and the byte size occupied by the field value corresponding to each field, the index information including the position data and the byte size occupied by each field value in the first message data;

[0008] The index information is combined with the field value in the first message data to generate second message data, and the second message data is sent.

[0009] In a second aspect, an embodiment of the present invention further provides another message data processing method, including:

[0010] Receive second message data, the second message data including index information and at least one field value, the index information including position data of each field value and the size of bytes occupied;

[0011] Determine the position order of the fields to be read in the message data, query the index information according to the position order, and obtain the position data of the corresponding field value and the size of the bytes occupied;

[0012] According to the position data of the field value obtained by querying and the size of the bytes occupied, the corresponding field value is read in the second message data to be determined as the field value of the field to be read.

[0013] In a third aspect, an embodiment of the present invention further provides another message data processing method, including:

[0014] receiving first message data, wherein the first message data includes at least one field and a field value corresponding to the at least one field;

[0015] Generate index information according to the position order of each field in the first message data, the preset index length, and the byte size occupied by the field value corresponding to each field, the index information including the position data and the byte size occupied by each field value in the first message data;

[0016] The index information is combined with the field value in the first message data to generate second message data.

[0017] In a fourth aspect, an embodiment of the present invention further provides a message data processing device, the device comprising:

[0018] A message data acquisition module, used to acquire first message data, where the first message data includes at least one field and a field value corresponding to the at least one field;

[0019] An index information generating module, configured to generate index information according to a position sequence of each field in the first message data, a preset index length, and a byte size occupied by a field value corresponding to each field, wherein the index information includes position data and a byte size occupied by each field value in the first message data;

[0020] An information merging module, used to merge the index information with the field value in the first message data to generate second message data;

[0021] A message data sending module is used to send the second message data.

[0022] In a fifth aspect, an embodiment of the present invention further provides a message data processing device, the device comprising:

[0023] A message data receiving module, configured to receive second message data, wherein the second message data includes index information and at least one field value, wherein the index information includes position data of each field value and the size of bytes occupied;

[0024] An index information query module is used to determine the position sequence of the fields to be read in the message data, query the index information according to the position sequence, and obtain the position data of the corresponding field value and the size of the bytes occupied;

[0025] A field value reading module is used to read the corresponding field value in the second message data according to the position data of the field value obtained by query and the size of the occupied bytes to determine it as the field value of the field to be read.

[0026] In a sixth aspect, an embodiment of the present invention further provides a message data processing device, the device comprising:

[0027] A message data receiving module, configured to receive first message data, wherein the first message data includes at least one field and a field value corresponding to the at least one field;

[0028] An index information generating module, configured to generate index information according to a position sequence of each field in the first message data, a preset index length, and a byte size occupied by a field value corresponding to each field, wherein the index information includes position data and a byte size occupied by each field value in the first message data;

[0029] An information merging module is used to merge the index information with the field value in the first message data to generate second message data.

[0030] In a seventh aspect, an embodiment of the present invention further provides a message data processing device, the device comprising:

[0031] one or more processors;

[0032] a storage device for storing one or more programs,

[0033] When the one or more programs are executed by the one or more processors, the one or more processors implement the message data processing method described in the embodiment of the present invention.

[0034] In an eighth aspect, an embodiment of the present invention further provides a storage medium storing computer executable instructions, wherein the computer executable instructions, when executed by a computer processor, are used to execute the message data processing method described in the embodiment of the present invention.

[0035] In an embodiment of the present invention, by obtaining first message data, the first message data includes at least one field and a field value corresponding to the at least one field, index information is generated according to the position order of each field in the first message data, the preset index length, and the byte size occupied by the field value corresponding to each field, wherein the index information includes the position data of each field value in the first message data and the byte size occupied, and then the index information is merged with the field value in the first message data to generate the second message data and then send it. In this scheme, the original first message data is converted and converted into message data containing index information and then sent. The processing mechanism of the message data enables the field value of the field to be directly determined by querying the index information in the subsequent parsing process of the message data, without the need for field conversion, thereby reducing the additional field parsing process. At the same time, during the data sending process, only the index information and field values ​​need to be stored, and there is no need to store the fields, which significantly improves the data transmission and storage efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] Figure 1 A flowchart of a message data processing method provided by an embodiment of the present invention;

[0037] Figure 2 A flowchart of another message data processing method provided by an embodiment of the present invention;

[0038] Figure 2a A flowchart of a method for determining index information provided by an embodiment of the present invention;

[0039] Figure 2b A schematic diagram of second message data obtained by combining index information and field values ​​provided by an embodiment of the present invention;

[0040] Figure 3 A flowchart of another message data processing method provided by an embodiment of the present invention;

[0041] Figure 3a A schematic diagram of second message data obtained by combining another index information and a field value provided by an embodiment of the present invention;

[0042] Figure 4 A flowchart of another message data processing method provided by an embodiment of the present invention;

[0043] Figure 5 A flowchart of another message data processing method provided by an embodiment of the present invention;

[0044] Figure 6 A structural block diagram of a message data processing device provided by an embodiment of the present invention;

[0045] Figure 7A structural block diagram of another message data processing device provided by an embodiment of the present invention;

[0046] Figure 8 A structural block diagram of another message data processing device provided by an embodiment of the present invention;

[0047] Fig. 9 A schematic diagram of the structure of a device provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0048] The embodiments of the present invention are further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the embodiments of the present invention, rather than to limit the embodiments of the present invention. It is also necessary to explain that, for ease of description, only parts related to the embodiments of the present invention are shown in the accompanying drawings, rather than all structures.

[0049] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.

[0050] Figure 1 A flowchart of a message data processing method provided in an embodiment of the present invention can be applied to a data sending end. The method can be executed by a computing device such as a desktop computer, a notebook, a server, a tablet computer, and a mobile phone terminal, and specifically includes the following steps:

[0051] Step S101: Acquire first message data, where the first message data includes at least one field and a field value corresponding to the at least one field.

[0052] Among them, the first message data is data that needs to be sent, such as data sent to a data receiving end so that the data receiving end can respond to and process it after receiving it. The first message data includes at least one field and a field value corresponding to each field. Exemplarily, taking the example that the message data includes two fields and corresponding field values, it can be expressed as {"amount": "2", "name": "hehe"}, where "amount" represents field 1, "name" represents field 2, the field value corresponding to field 1 "amount" is "2", and the field value corresponding to field 2 "name" is "hehe".

[0053] Step S102: Generate index information according to the position order of each field in the first message data, a preset index length, and the byte size occupied by the field value corresponding to each field.

[0054] In one embodiment, index information is added to the first message data to be sent, and the index information is used to indicate the position and size of occupied bytes of the field value corresponding to each field in the first message data.

[0055] The position order of each field may be the order corresponding to the positions of the fields recorded in sequence in the first message data. Taking the aforementioned exemplary first message data as an example, the position order corresponding to field 1 "amount" is position 1, and the position order corresponding to field 2 "name" is position 2. It should be noted that this example is the sorting order of the fields recorded in sequence from front to back in the first message data, and it can also be the reverse sorting order of the fields recorded in sequence from back to front, and the specific sorting method is not limited.

[0056] Among them, the preset index length refers to the length of the index corresponding to each field value. Exemplarily, the preset index length can be 8 bytes. Of course, the preset index length can be adaptively adjusted according to different types of first message data, such as adjusted to 4 bytes or 16 bytes, etc., and this application does not limit it. Among them, the index information includes the position data of each field value in the first message data and the size of the bytes occupied. The position data is used to represent the specific position of the field value, and the size of the occupied bytes represents the size of the bytes occupied when the field value is represented.

[0057] Among them, each field corresponds to a field value. For example, in the aforementioned example, the field value corresponding to field 1 "amount" is "2", and the field value corresponding to field 2 "name" is "hehe". Different field values ​​have different sizes of bytes occupied due to different specific contents. The more complex the field value is, the larger the bytes it occupies when representing it. For example, a number in the representation field value occupies 1 byte, an English character occupies 1 byte, and a Chinese character occupies 2 bytes.

[0058] In one embodiment, index information is generated based on the position order of each field in the first message data, the preset index length, and the byte size occupied by the field value corresponding to each field for use in the data receiving segment. The corresponding field value is directly queried based on the index information for corresponding processing.

[0059] Specifically, the method of generating index information may be: traversing the first message data, determining the total number of fields contained in the first message data, determining the total index length according to the preset index length and the total number of fields, and then determining the index information corresponding to each field value in turn according to the total index length and the position order of each field and the byte size occupied by the field value. Taking the first message data as two fields as an example, it may also be: determining the starting position of the field value corresponding to the first field according to the preset index length, determining the byte size occupied by the field value in the index information according to the byte size occupied by the field value corresponding to the first field, determining the starting position of the field value corresponding to the second field according to the starting position of the field value corresponding to the first field, the byte size occupied and the preset index length, and further, determining the byte size occupied by the field value corresponding to the second field in the index information according to the byte size occupied by the field value corresponding to the second field.

[0060] In one embodiment, the position order of each field in the first message data can be represented by marking each field in order when the first message data is generated. Taking the field {"amount": "2", "name": "hehe"} as an example, the field "amount" can be marked as sequence number 1, and the field "name" can be marked as sequence number 2. The specific implementation of the marking can be processed through Java annotation or in the form of an XML file.

[0061] Step S103: merge the index information with the field value in the first message data to generate second message data, and send the second message data.

[0062] In one embodiment, the index information corresponding to each field value of the determined first message data is merged with the field value in the first message data to generate second message data, and the second message data is sent. The specific merging method can be to merge the total index information corresponding to all field values ​​with each field value as a whole, or to merge the index information corresponding to each field value and the corresponding field value in sequence to obtain the second message data. The second message data only contains the field value and the index information, and does not need to contain the field corresponding to the field value, so as to reduce the amount of data storage, that is, the amount of data transmitted.

[0063] In one embodiment, the second message data may be directly sent to different data receiving ends, or the second message data may be sent to a message queue so that the data receiving end can obtain the second message data from the message queue.

[0064] It can be seen from the above scheme that when it is necessary to send the first message data, the index information corresponding to the field value in the first message data is determined, and the index information and the field value are combined into the second message data for sending, that is, the original first message data containing fields and field values ​​is converted into second message data containing index information and field values. The processing mechanism of this message data can be to enable the data receiving end to determine the corresponding field value according to the index information in the second message. The data receiving end does not need to convert the message field, thereby reducing the additional field parsing process. At the same time, during the data sending process, only the index information and field values ​​need to be stored, and there is no need to store the fields, which significantly improves the data transmission and storage efficiency.

[0065] Figure 2 The flowchart of another message data processing method provided by the embodiment of the present invention provides a specific solution for generating index information. Figure 2 As shown, the technical solution is as follows:

[0066] Step S201: Acquire first message data, where the first message data includes at least one field and a field value corresponding to the at least one field.

[0067] Step S202: traverse the first message data to determine the total number of fields included in the first message data, and determine the total index length according to the preset index length and the total number of fields.

[0068] In one embodiment, when determining the index information of the field value in the first message data, the first message data is traversed to determine the total number of fields contained in the first message data. Taking the first message data containing 5 fields and the preset index length of 8 bytes as an example, the corresponding total index length is the product of the total number of fields and the preset index length, that is, 40 bytes.

[0069] Step S203: determine the index information corresponding to each field value in sequence according to the total length of the index, the position sequence of each field, and the size of bytes occupied by the field value.

[0070] Specifically, step S203 may include the following steps: Figure 2a As shown, Figure 2a Flow chart of a method for determining index information provided by an embodiment of the present invention:

[0071] Step S2031: Determine the starting position of the field value corresponding to the first field according to the total length of the index.

[0072] Among them, taking the total length of the index as 40 bytes as an example, when the field value of each field is stored sequentially, the starting position corresponding to the first field is the 41st byte. That is, the starting position of the field value corresponding to the first field is one byte after the total length of the index. Of course, it should be noted that the method of determining the starting position of the field value corresponding to the first field is a merging method in which the index information is added immediately before the field value as a whole. This method of immediately adding can save data storage space. Of course, in other special cases, non-immediate addition can also be used, and there is no limitation on whether it is immediately added.

[0073] Step S2032: determine the byte size occupied by the field value in the index information according to the byte size occupied by the field value corresponding to the first field.

[0074] Among them, in addition to the starting position corresponding to each field value, the index information also includes the byte size occupied by each field value, so that after the data receiving end obtains the index information, it can read the specific field value content according to the starting position of the field value recorded in the index information and the byte size occupied by the field value.

[0075] The byte size occupied by the field value recorded in the index information is determined according to the byte size occupied by the currently read field value. For example, taking the first message data containing two fields as an example, the byte size occupied by the field value corresponding to field 1 is 7 bytes, and the byte size occupied by the field value corresponding to field 2 is 15 bytes. In one embodiment, taking the preset index length, that is, the index length corresponding to each field value is 8 bytes as an example, the first 4 bytes are used to record the starting position of the field value, and the last 4 bytes are used to record the byte size occupied by the field value.

[0076] Step S2033: determine the starting position of the field value corresponding to the second field according to the starting position of the field value corresponding to the first field and the size of bytes occupied.

[0077] In one embodiment, after determining the index information of the field value corresponding to the first field, the index information of the field value corresponding to the second field is determined accordingly, and so on until the index information of all field values ​​contained in the first message data is determined. Specifically, taking the first message data containing 5 fields and the total index length of 40 bytes as an example, in the index information of the field value corresponding to the first field, its starting position is the 41st byte and the byte size occupied is 7 bytes. For example, the starting position of the field value corresponding to the second field is 41+7, that is, 48. Similarly, the byte size occupied by the second corresponding field value is the size of the bytes occupied by the field value currently read, such as 15 bytes. That is, in the determined index information of the field value corresponding to the second field, its record starting position is 41 and the byte size occupied is 15. The index information of the field values ​​corresponding to the remaining fields is obtained by analogy.

[0078] Step S204: merge the index information with the field value in the first message data to generate second message data, and send the second message data.

[0079] In one embodiment, the index message and the field value are combined as follows: the index information as a whole is combined with the field value in the first message data. Figure 2b As shown, Figure 2b A schematic diagram of second message data obtained by combining index information and field values ​​provided by an embodiment of the present invention. Taking the first message data including two fields as an example, the second message data generated by combining the obtained index information of the field value with the field value is as follows Figure 2b shown.

[0080] It can be seen from the above scheme that when the second message data obtained by converting the first message data is processed by the data receiving end, the data receiving end does not need to convert the message field, thereby reducing the additional field parsing process. At the same time, during the data sending process, only the index information and field values ​​need to be stored, and there is no need to store the fields, which significantly improves the data transmission and storage efficiency.

[0081] Figure 3 The flowchart of another message data processing method provided by the embodiment of the present invention provides another scheme for generating index information. Figure 3 As shown, the technical solution is as follows:

[0082] Step S301: Acquire first message data, where the first message data includes at least one field and a field value corresponding to the at least one field.

[0083] Step S302: Determine the starting position of the field value corresponding to the first field according to the preset index length.

[0084] In one embodiment, taking the preset index length as 8 bytes as an example, the first 4 bytes represent the starting position of the field value, and the last 4 bytes represent the size of the bytes occupied by the field value. The starting position of the field value corresponding to the first field is the 9th byte, that is, the preset index length plus 1 byte position is the starting position of the field value.

[0085] Step S303: Determine the byte size occupied by the field value in the index information according to the byte size occupied by the field value corresponding to the first field.

[0086] Exemplarily, the byte size occupied by the field value corresponding to the first field is 7 bytes.

[0087] Step S304: determine the starting position of the field value corresponding to the second field according to the starting position of the field value corresponding to the first field, the occupied byte size, and the preset index length.

[0088] In one embodiment, after determining the index information of the field value corresponding to the first field, the index information corresponding to the second field, the third field, and finally the last field is confirmed in sequence. The starting position of the field value corresponding to the second field is taken as an example in the above example, which is the starting position of the field value corresponding to the first field, the occupied byte size, and the preset index length, that is, 9+7+8=24. Exemplarily, the byte size occupied by the field value corresponding to the second field is 15 bytes. And so on, determine the index information of the field values ​​corresponding to the remaining fields.

[0089] Step S305: Merge the index information with the field value in the first message data to generate second message data, and send the second message data.

[0090] In one embodiment, the index message and the field value are combined by combining the starting position and the occupied byte size of each field value in the index message with the corresponding field value. Figure 3a As shown, Figure 3a A schematic diagram of another second message data obtained by combining index information and field values ​​provided by an embodiment of the present invention. Taking the first message data including two fields as an example, the second message data generated by combining the obtained index information of the field value with the field value is as follows Figure 3a shown.

[0091] It can be seen from the above scheme that when the second message data obtained by converting the first message data is processed by the data receiving end, the data receiving end does not need to convert the message field, thereby reducing the additional field parsing process. At the same time, during the data sending process, only the index information and field values ​​need to be stored, and there is no need to store the fields, which significantly improves the data transmission and storage efficiency.

[0092] Figure 4 The flowchart of another message data processing method provided by the embodiment of the present invention can be applied to the data receiving end. The method can be executed by computing devices such as desktop computers, notebooks, servers, tablet computers, and mobile phone terminals. Figure 4 As shown, the technical solution is as follows:

[0093] Step S401: Receive second message data, where the second message data includes index information and at least one field value, and the index information includes position data of each field value and the size of bytes occupied.

[0094] Step S402: determine the position sequence of the fields to be read in the message data, query the index information according to the position sequence, and obtain the position data of the corresponding field value and the size of the bytes occupied.

[0095] In the prior art, in order to improve data transmission efficiency, the message data sent by the data sending end can be processed by multiple data receiving ends at the same time. However, since different data receiving ends may correspond to different business systems, there are differences in the specific representation content of the same field. For example, the order system sends a message data of {"orderAmount": "5.00"}. When processing the message data, the reconciliation system needs to convert the field "orderAmount" into the field "amount" and then perform reconciliation processing, while the message notification system needs to convert the field "orderAmount" into the field "notifyAmount" and then perform message notification. This requires additional parsing overhead.

[0096] In one embodiment, the received second message data includes index information and at least one field value, wherein the index information includes the position data of each field value and the size of the bytes occupied. When it is necessary to obtain the field value of the corresponding field, the position order of the field to be read in the message data is determined. Among them, the field to be read is the field for which the field value needs to be determined, and its position order in the message data is the position order of all fields in the message data under the fixed format standard stored in the data receiving end. Take the message data including 2 fields as an example, which are divided into "notifyAmount" and "notifyName". When it is necessary to read the field value of the "notifyName" field, it is used as the field to be read, and its corresponding position order is position 2 (taking the record order of the fields recorded in the message data as an example for identification). After determining the position order, the index information of the corresponding position is queried in the second message data based on the determined position order. It should be noted that the sequential position of each field in the second message data is consistent with the position order of the field defined by the data receiving end.

[0097] Step S403: Read the corresponding field value in the second message data according to the position data of the field value obtained by querying and the size of the occupied bytes, and determine it as the field value of the field to be read.

[0098] Among them, after determining the position order of the fields to be read, the index information of the corresponding position order is queried in the index information of the second message data, such as querying the index information of position 2, and the specific content of the corresponding field value is read according to the starting position and occupied byte size of the field value recorded in the index information to determine the field value corresponding to the field to be read.

[0099] It can be seen from the above scheme that after receiving the second message data, the field value of the field to be read is obtained by querying the index information in the serialized second message data, without the need to convert the field into different forms, thereby reducing the additional field parsing process. At the same time, during the data sending process, only the index information and field values ​​need to be stored, and there is no need to store the fields, which significantly improves data transmission and storage efficiency.

[0100] Figure 5 The flowchart of another message data processing method provided by the embodiment of the present invention can be applied to the transfer processing link of message data. The method can be executed by a computing device such as a server. Figure 5 As shown, the technical solution is as follows:

[0101] Step S501: Receive first message data, where the first message data includes at least one field and a field value corresponding to the at least one field.

[0102] Step S502: Generate index information according to the position sequence of each field in the first message data, a preset index length, and the byte size occupied by the field value corresponding to each field.

[0103] Step S503: Merge the index information with the field value in the first message data to generate second message data.

[0104] The first message data may be message data sent by the data sending end. In one embodiment, the first message data is converted into the second message data through the transit processing link of the message data. Specifically, the first message data is converted into the second message data containing the index information and the field value as described in the above example, which will not be repeated here.

[0105] Exemplarily, the received first message data may be converted in sequence and the converted second message data may be stored in the form of a message queue, so as to be acquired and processed accordingly by the data receiving end.

[0106] It can be seen from the above scheme that by converting the received original first message data into message data containing index information for consumption by the data receiving end, the processing mechanism of the message data enables the data receiving end to directly determine the field value of the field by querying the index information, without the need for field conversion, thereby reducing the additional field parsing process. At the same time, during the data sending process, only the index information and field values ​​need to be stored, without the need to store the fields, which significantly improves the data transmission and storage efficiency.

[0107] Figure 6 A structural block diagram of a message data processing device provided by an embodiment of the present invention, the device is used to perform the above Figures 1 to 3 The message data processing method provided in the embodiment has the functional modules and beneficial effects corresponding to the execution method. Figure 6 As shown, the device specifically includes: a message data acquisition module 101, an index information generation module 102, an information merging module 103 and a message data sending module 104, wherein:

[0108] The message data acquisition module 101 is used to acquire first message data, where the first message data includes at least one field and a field value corresponding to the at least one field;

[0109] An index information generating module 102, configured to generate index information according to the position sequence of each field in the first message data, a preset index length, and the byte size occupied by the field value corresponding to each field, wherein the index information includes the position data and the byte size occupied by each field value in the first message data;

[0110] An information merging module 103, configured to merge the index information with a field value in the first message data to generate second message data;

[0111] The message data sending module 104 is configured to send the second message data.

[0112] It can be seen from the above scheme that the original first message data is converted into message data containing index information and then sent. The processing mechanism of the message data enables the field value of the field to be directly determined by querying the index information in the subsequent message data parsing process, without the need for field conversion, thereby reducing additional field parsing processes. At the same time, during the data sending process, only the index information and field values ​​need to be stored, and there is no need to store the fields, which significantly improves data transmission and storage efficiency.

[0113] In a possible embodiment, the index information generating module 102 is specifically used for:

[0114] Traversing the first message data to determine the total number of fields included in the first message data, and determining the total index length according to the preset index length and the total number of fields;

[0115] The index information corresponding to each field value is determined in sequence according to the total length of the index, the position order of each field, and the byte size occupied by the field value.

[0116] In a possible embodiment, the index information generating module 102 is specifically used for:

[0117] Determine the starting position of the field value corresponding to the first field according to the total length of the index;

[0118] Determine the byte size occupied by the field value in the index information according to the byte size occupied by the field value corresponding to the first field;

[0119] The starting position of the field value corresponding to the second field is determined according to the starting position of the field value corresponding to the first field and the size of bytes occupied.

[0120] In a possible embodiment, the information merging module 103 is specifically used for:

[0121] The index information as a whole is merged with the field value in the first message data.

[0122] In a possible embodiment, the index information generating module 102 is specifically used for:

[0123] Determine the starting position of the field value corresponding to the first field according to the preset index length;

[0124] Determine the byte size occupied by the field value in the index information according to the byte size occupied by the field value corresponding to the first field;

[0125] The starting position of the field value corresponding to the second field is determined according to the starting position of the field value corresponding to the first field, the occupied byte size and the preset index length.

[0126] In a possible embodiment, the information merging module 103 is specifically used for:

[0127] The starting position and the occupied byte size of each field value in the index information are merged with the corresponding field value.

[0128] Figure 7 A structural block diagram of another message data processing device provided in an embodiment of the present invention, the device is used to perform the above Figure 4 The message data processing method provided in the embodiment has the functional modules and beneficial effects corresponding to the execution method. Figure 7As shown, the device specifically includes: a message data receiving module 201, an index information query module 202 and a field value reading module 203, wherein:

[0129] The message data receiving module 201 is used to receive second message data, where the second message data includes index information and at least one field value, where the index information includes position data of each field value and the size of bytes occupied;

[0130] The index information query module 202 is used to determine the position sequence of the fields to be read in the message data, query the index information according to the position sequence, and obtain the position data of the corresponding field value and the size of the bytes occupied;

[0131] The field value reading module 203 is used to read the corresponding field value in the second message data according to the position data of the field value obtained by querying and the size of the occupied bytes, and determine it as the field value of the field to be read.

[0132] It can be seen from the above scheme that after receiving the second message data, the field value of the field to be read is obtained by querying the index information in the serialized second message data, without the need to convert the field into different forms, thereby reducing the additional field parsing process. At the same time, during the data sending process, only the index information and field values ​​need to be stored, and there is no need to store the fields, which significantly improves data transmission and storage efficiency.

[0133] Figure 8 A structural block diagram of another message data processing device provided in an embodiment of the present invention, the device is used to perform the above Figure 5 The message data processing method provided in the embodiment has the functional modules and beneficial effects corresponding to the execution method. Figure 8 As shown, the device specifically includes: a message data receiving module 301, an index information generating module 302 and an information merging module 303, wherein:

[0134] The message data receiving module 301 is used to receive first message data, where the first message data includes at least one field and a field value corresponding to the at least one field;

[0135] An index information generating module 302, configured to generate index information according to the position sequence of each field in the first message data, a preset index length, and the byte size occupied by the field value corresponding to each field, wherein the index information includes the position data and the byte size occupied by each field value in the first message data;

[0136] The information merging module 303 is used to merge the index information with the field value in the first message data to generate second message data.

[0137] It can be seen from the above scheme that by converting the received original first message data into message data containing index information for consumption by the data receiving end, the processing mechanism of the message data enables the data receiving end to directly determine the field value of the field by querying the index information, without the need for field conversion, thereby reducing the additional field parsing process. At the same time, during the data sending process, only the index information and field values ​​need to be stored, without the need to store the fields, which significantly improves the data transmission and storage efficiency.

[0138] Fig. 9 A structural diagram of a message data processing device provided by an embodiment of the present invention, such as Fig. 9 As shown, the device includes a processor 401, a memory 402, an input device 403 and an output device 404; the number of processors 401 in the device can be one or more. Fig. 9 A processor 401 is taken as an example; the processor 401, memory 402, input device 403 and output device 404 in the device can be connected by a bus or other means. Fig. 9 The example of connecting via a bus is taken. The memory 402, as a computer-readable storage medium, can be used to store software programs, computer executable programs and modules, such as program instructions / modules corresponding to the message data processing method in the embodiment of the present invention. The processor 401 executes various functional applications and data processing of the device by running the software programs, instructions and modules stored in the memory 402, that is, implements the above-mentioned message data processing method. The input device 403 can be used to receive input digital or character information, and generate key signal input related to user settings and function control of the device. The output device 404 may include a display device such as a display screen.

[0139] An embodiment of the present invention further provides a storage medium containing computer executable instructions, and when the computer executable instructions are executed by a computer processor, they are used to execute a message data processing method described in the above embodiment.

[0140] It is worth noting that in the embodiment of the above-mentioned message data processing device, the various units and modules included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the protection scope of the embodiments of the present invention.

[0141] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the embodiments of the present invention are not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the protection scope of the embodiments of the present invention. Therefore, although the embodiments of the present invention are described in more detail through the above embodiments, the embodiments of the present invention are not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the embodiments of the present invention, and the scope of the embodiments of the present invention is determined by the scope of the appended claims.

Claims

1. A message data processing method, characterized in that: include: Acquire first message data, where the first message data includes at least one field and a field value corresponding to the at least one field; Generate index information according to the position sequence of each field in the first message data, the preset index length, and the byte size occupied by the field value corresponding to each field, including: determining the starting position of the field value corresponding to the first field according to the preset index length or the total index length, and determining the byte size occupied by the field value in the index information according to the byte size occupied by the field value corresponding to the first field, so as to generate index information of the field value corresponding to the first field, the index information including the position data and the byte size occupied by each field value in the first message data; The index information is combined with the field value in the first message data to generate second message data, and the second message data is sent.

2. The message data processing method according to claim 1, characterized in that: The generating of index information according to the position sequence of each field in the first message data, the preset index length, and the byte size occupied by the field value corresponding to each field also includes: Traversing the first message data to determine the total number of fields included in the first message data, and determining the total index length according to the preset index length and the total number of fields; The index information corresponding to each field value is determined in sequence according to the total length of the index, the position order of each field, and the byte size occupied by the field value.

3. The message data processing method according to claim 2, characterized in that: In the case where the starting position of the field value corresponding to the first field is determined according to the total length of the index, the method further includes: The starting position of the field value corresponding to the second field is determined according to the starting position of the field value corresponding to the first field and the size of bytes occupied.

4. The message data processing method according to claim 2, characterized in that: The merging of the index information with the field value in the first message data comprises: The index information as a whole is merged with the field value in the first message data.

5. The message data processing method according to claim 1, characterized in that: In the case where the starting position of the field value corresponding to the first field is determined according to the preset index length, the method further includes: The starting position of the field value corresponding to the second field is determined according to the starting position of the field value corresponding to the first field, the occupied byte size and the preset index length.

6. The message data processing method according to claim 5, characterized in that: The merging of the index information with the field value in the first message data comprises: The starting position and the occupied byte size of each field value in the index information are merged with the corresponding field value.

7. A message data processing method, characterized in that: include: Receive second message data, the second message data including index information and at least one field value, the index information including position data of each field value and the size of bytes occupied, the index information being generated in a manner including: determining a starting position of a field value corresponding to a first field according to a preset index length or a total index length, determining the size of bytes occupied by the field value in the index information according to the size of bytes occupied by the field value corresponding to the first field, so as to generate index information of the field value corresponding to the first field; Determine the position order of the fields to be read in the message data, query the index information according to the position order, and obtain the position data of the corresponding field value and the size of the bytes occupied; According to the position data of the field value obtained by querying and the size of the bytes occupied, the corresponding field value is read in the second message data to be determined as the field value of the field to be read.

8. A message data processing method, characterized in that: include: receiving first message data, wherein the first message data includes at least one field and a field value corresponding to the at least one field; Generate index information according to the position sequence of each field in the first message data, the preset index length, and the byte size occupied by the field value corresponding to each field, including: determining the starting position of the field value corresponding to the first field according to the preset index length, and determining the byte size occupied by the field value in the index information according to the byte size occupied by the field value corresponding to the first field, so as to generate index information of the field value corresponding to the first field, the index information including the position data and the byte size occupied by each field value in the first message data; The index information is combined with the field value in the first message data to generate second message data.

9. A message data processing device, characterized in that: include: A message data acquisition module, used to acquire first message data, where the first message data includes at least one field and a field value corresponding to the at least one field; An index information generating module, configured to generate index information according to the position sequence of each field in the first message data, a preset index length, and the byte size occupied by the field value corresponding to each field, including: determining the starting position of the field value corresponding to the first field according to the preset index length or the total index length, determining the byte size occupied by the field value in the index information according to the byte size occupied by the field value corresponding to the first field, so as to generate index information of the field value corresponding to the first field, the index information including the position data and the byte size occupied by each field value in the first message data; An information merging module, used to merge the index information with the field value in the first message data to generate second message data; A message data sending module is used to send the second message data.

10. A message data processing device, characterized in that: include: A message data receiving module, configured to receive second message data, wherein the second message data includes index information and at least one field value, wherein the index information includes position data of each field value and the size of bytes occupied, wherein the index information is generated by: determining a starting position of a field value corresponding to a first field according to a preset index length or a total index length, and determining the size of bytes occupied by the field value in the index information according to the size of bytes occupied by the field value corresponding to the first field, so as to generate index information of the field value corresponding to the first field; An index information query module is used to determine the position sequence of the fields to be read in the message data, query the index information according to the position sequence, and obtain the position data of the corresponding field value and the size of the bytes occupied; A field value reading module is used to read the corresponding field value in the second message data according to the position data of the field value obtained by query and the size of the occupied bytes to determine it as the field value of the field to be read.

11. A message data processing device, characterized in that: include: A message data receiving module, configured to receive first message data, wherein the first message data includes at least one field and a field value corresponding to the at least one field; An index information generating module, configured to generate index information according to the position sequence of each field in the first message data, a preset index length, and the byte size occupied by the field value corresponding to each field, including: determining the starting position of the field value corresponding to the first field according to the preset index length, determining the byte size occupied by the field value in the index information according to the byte size occupied by the field value corresponding to the first field, so as to generate index information of the field value corresponding to the first field, the index information including the position data and the byte size occupied by each field value in the first message data; An information merging module is used to merge the index information with the field value in the first message data to generate second message data.

12. A message data processing device, the device comprising: one or more processors; A storage device for storing one or more programs, when the one or more programs are executed by the one or more processors, the one or more processors implement the message data processing method according to any one of claims 1-8.

13. A storage medium storing computer executable instructions, wherein the computer executable instructions are used to execute the message data processing method according to any one of claims 1 to 8 when executed by a computer processor.

Citation Information

Patent Citations

  • Design method of separate-storage type key-value storage system

    CN103559027A

  • Method and device for realizing JSON-format data access in Oracle, equipment and storage medium

    CN108334609A

  • Data processing method, system, co-processing device and main processing device

    CN109408450A

  • A method and system for securely processing data

    CN109598137A

  • A communication text data transmission method based on a TCP protocol

    CN109818930A