Data processing method and device, equipment, storage medium and program product
By performing binary conversion of data elements and processing in segments with preset number of translation bits, the high storage space occupation and low transmission efficiency problems caused by redundancy 0 in binary strings are solved, and more efficient data storage and transmission are achieved.
Patent Information
- Application Number
- CN202311524388.0
- 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 prior art, when transmitting signaling including an array of elements, the high-bit part of the binary string contains a large amount of redundant zeros, resulting in large storage space occupancy and low transmission efficiency.
By performing binary conversion on data elements, a binary string is obtained, and the valid string is segmented with the preset number of translation bits to obtain the segmented string as compressed data.
It reduces the space usage of storage element arrays and improves the network transmission efficiency of transmission element arrays.
Smart Images

Figure CN120017207A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of computer technology, and in particular to a data processing method, apparatus, device, storage medium, and program product. Background Art
[0002] With the development of computer technology, efficient data processing has received more and more attention. For example, in the process of voice transmission, it is necessary not only to eliminate noise interference as much as possible, but also to compress the occupancy of voice data as much as possible and reduce the data transmission bandwidth.
[0003] In the related art, when transmitting signaling including an element array, the data elements are usually converted into binary strings that can be analyzed by a machine, and then the converted binary strings are transmitted to the receiving device when transmitting the signaling, so that the receiving device can know the signaling information based on the binary string.
[0004] The above binary string is fixed-length data, and the high-order part usually contains a large number of redundant 0s. Not only is the space occupied by the cached binary string large, but the efficiency of transmitting the binary string is also low, making it difficult for the receiving device to quickly and accurately know the information of the transmission signaling. Summary of the invention
[0005] The embodiments of the present application provide a data processing method, device, equipment, storage medium and program product, which can avoid the problem of redundant high-order data occupying data in the character storage process by means of targeted analysis of valid character strings, which is not only conducive to reducing the space occupied by the storage element array, but also conducive to improving the network transmission efficiency of the transmission element array. The technical solution is as follows.
[0006] In one aspect, a data processing method is provided, the method comprising:
[0007] receiving a data processing instruction, wherein the data processing instruction includes an element array, the element array includes data elements, and the data processing instruction is used to instruct processing of data represented by the element array;
[0008] Based on the data type corresponding to the data element, perform binary conversion on the data element to obtain a binary string, wherein the data type corresponding to the data element corresponds to the first bit number during binary conversion;
[0009] Segmenting the valid character string in the binary character string with a preset number of translation bits to obtain at least one segmented character string as compressed data of the element array, wherein the valid character string is a set of characters located at valid bits, and the preset number of translation bits is less than the first number of bits;
[0010] Based on the data processing instruction, data processing is performed on the at least one segmented character string.
[0011] In another aspect, a data processing device is provided, the device comprising:
[0012] An instruction receiving module, used for receiving a data processing instruction, wherein the data processing instruction includes an element array, the element array includes data elements, and the data processing instruction is used for instructing to process the data represented by the element array;
[0013] A binary conversion module, used for performing binary conversion on the data element based on the data type corresponding to the data element to obtain a binary string, wherein the data type corresponding to the data element corresponds to a first bit number during binary conversion;
[0014] A segmentation processing module, used for segmenting a valid character string in the binary character string with a preset number of translation bits to obtain at least one segmented character string as compressed data of the element array, wherein the valid character string is a set of characters located at valid bits, and the preset number of translation bits is less than the first number of bits;
[0015] A data processing module is used to perform data processing on the at least one segmented character string based on the data processing instruction.
[0016] On the other hand, a computer device is provided, comprising a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement a data processing method as described in any of the above-mentioned embodiments of the present application.
[0017] On the other hand, a computer-readable storage medium is provided, in which at least one instruction, at least one program, a code set or an instruction set is stored, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by a processor to implement a data processing method as described in any of the above-mentioned embodiments of the present application.
[0018] On the other hand, a computer program product or a computer program is provided, the computer program product or the computer program includes computer instructions, the computer instructions are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the data processing method described in any of the above embodiments.
[0019] The beneficial effects brought by the technical solution provided by the embodiment of the present application include at least:
[0020] When processing the data elements in the element array based on the data processing instruction, the data elements are converted into binary according to the data type corresponding to the data elements to obtain a binary string, and the valid string in the binary string is segmented with a preset number of translation bits to obtain at least one segmented string. Since the valid string is a collection of characters located at the valid bit, it is possible to avoid the problem of data occupation by redundant high-bit data in the character storage process with the help of targeted analysis of the valid string; in addition, by means of the segmentation process, the characters in the valid string are segmented and summarized, which can further realize the overall management of the characters, and at least one segmented string is used as the compressed data of the element array, so that a more efficient data processing process can be performed on at least one segmented string based on the data processing instruction, which is not only conducive to reducing the space occupied by the storage element array, but also conducive to improving the network transmission efficiency of the transmission element array. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0022] Figure 1 It is a schematic diagram of an implementation environment provided by an exemplary embodiment of the present application;
[0023] Figure 2 is a flow chart of a data processing method provided by an exemplary embodiment of the present application;
[0024] Figure 3 It is a schematic diagram of obtaining at least one segmented string through segmentation processing based on an element array provided by an exemplary embodiment of the present application;
[0025] Figure 4 is a flow chart of a data processing method provided by another exemplary embodiment of the present application;
[0026] Figure 5 It is a schematic diagram of obtaining at least one segmented string based on an element array through segmentation processing and character mark addition process provided by an exemplary embodiment of the present application;
[0027] Figure 6 It is a schematic diagram of obtaining at least one segmented string based on an element array through segmentation processing, filling processing and character mark addition process provided by an exemplary embodiment of the present application;
[0028] Figure 7is a flow chart of a data processing method provided by another exemplary embodiment of the present application;
[0029] Figure 8 is a flow chart of a data processing method provided by another exemplary embodiment of the present application;
[0030] Fig. 9 is a judgment flow chart of a data processing method provided by an exemplary embodiment of the present application;
[0031] Fig.10 is a schematic diagram of a method for performing data processing on an element array provided by an exemplary embodiment of the present application;
[0032] Fig.11 is a schematic diagram of a game interface provided by an exemplary embodiment of the present application;
[0033] Fig.12 is a schematic diagram of a game entry interface provided by an exemplary embodiment of the present application;
[0034] Fig.13 is a structural block diagram of a data processing device provided by an exemplary embodiment of the present application;
[0035] Fig.14 It is a structural block diagram of a server provided by an exemplary embodiment of the present application. DETAILED DESCRIPTION
[0036] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.
[0037] In the related art, when transmitting signaling including an element array, the data elements are usually converted into a binary string that can be analyzed by a machine, and then the converted binary string is transmitted to the receiving device when transmitting the signaling, so that the receiving device can know the signaling information based on the binary string. The above binary string is fixed-length data, and the high-order part usually contains a large number of redundant 0s. Not only is the space occupied by the cache binary string large, but the efficiency of transmitting the binary string is also low, making it difficult for the receiving device to quickly and accurately know the information of the transmitted signaling.
[0038] In an embodiment of the present application, a data processing method is provided, which can avoid the problem of redundant high-order data occupying data in the character storage process by means of targeted analysis of valid character strings, which is not only conducive to reducing the space occupied by the storage element array, but also conducive to improving the network transmission efficiency of the transmission element array. The data processing method can be applied to a variety of data processing scenarios such as audio data processing scenarios, video stream processing scenarios, social media data processing scenarios, and medical data processing scenarios, and the embodiments of the present application are not limited to this.
[0039] It should be noted that the information (including but not limited to user device information, user personal information, etc.), data (including but not limited to data used for analysis, stored data, displayed data, etc.) and signals involved in this application are all authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards in the relevant regions. For example, the data processing instructions, element arrays, data elements and other contents involved in this application are all obtained with full authorization.
[0040] Secondly, the implementation environment involved in the embodiments of the present application is described. The data processing method provided in the embodiments of the present application can be implemented by a terminal alone, or by a server, or by a terminal and a server through data interaction, which is not limited in the embodiments of the present application. Optionally, the data processing method is described by taking the interaction between a terminal and a server as an example.
[0041] For illustration, please refer to Figure 1 The implementation environment involves a terminal 110 and a server 120 , and the terminal 110 and the server 120 are connected via a communication network 130 .
[0042] In some embodiments, the server 120 receives a data processing instruction. The data processing instruction includes an element array, the element array includes data elements, and the data processing instruction is used to instruct processing of data represented by the element array. Schematically, the data processing instruction is used to instruct compression processing of data represented by the element array.
[0043] In some embodiments, the server 120 performs binary conversion on the data element based on the data type corresponding to the data element to obtain a binary string.
[0044] The data type corresponding to the data element corresponds to the first bit number during binary conversion.
[0045] In some embodiments, the server 120 performs segmentation processing on the valid character string in the binary character string with a preset number of translation bits to obtain at least one segmented character string as compressed data of the element array.
[0046] The valid character string is a set of characters located on the valid bit. Schematically, the valid bit represents the bit storing valid information, so the valid character string is a character string composed of at least one character stored on the valid bit, and the number of characters in the valid character string is the preset number of translation bits.
[0047] The preset number of translation bits is smaller than the first number of bits. In an illustrative manner, the preset number of translation bits is set smaller than the first number of bits when binary conversion is performed based on the data type, so as to achieve the purpose of segmenting the valid character string in the binary character string by the preset number of translation bits.
[0048] In some embodiments, after obtaining at least one segmented string after compressing the element array, the server 120 performs data processing on the at least one segmented string based on the data processing instruction, for example: compressing and storing the at least one segmented string to save the data occupancy of the element array; or sending the at least one segmented string to the terminal 110 through the communication network 130. During the data transmission process, based on the fact that at least one segmented string is effectively compressed, the data transmission efficiency is improved and the data transmission volume is greatly reduced.
[0049] It is worth noting that the above-mentioned terminals include but are not limited to mobile terminals such as mobile phones, tablet computers, portable laptops, intelligent voice interaction devices, smart home appliances, vehicle-mounted terminals, and can also be implemented as desktop computers, etc.; the above-mentioned servers can be independent physical servers, or they can be server clusters or distributed systems composed of multiple physical servers, or they can be cloud servers that provide basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDN), as well as big data and artificial intelligence platforms.
[0050] Among them, cloud technology refers to a hosting technology that unifies hardware, application programs, networks and other resources within a wide area network or local area network to achieve data computing, storage, processing and sharing. Cloud technology is a general term for network technology, information technology, integration technology, management platform technology, application technology, etc. based on the cloud computing business model. It can form a resource pool that can be used on demand and is flexible and convenient.
[0051] In some embodiments, the above server can also be implemented as a node in a blockchain system.
[0052] In combination with the above-mentioned noun introduction and application scenarios, the data processing method provided by the present application is described, and the method is applied to a server as an example. Figure 2 As shown, the method includes the following steps 210 to 240.
[0053] Step 210, receiving a data processing instruction.
[0054] The data processing instruction includes an element array; the element array includes data elements.
[0055] Optionally, the data processing instruction is expressed by an element array. Schematically, the data processing instruction includes multiple instruction fields, each instruction field is represented by at least one data element, and the data elements corresponding to the multiple instruction fields are combined to obtain an element array. That is, the element array includes multiple data elements.
[0056] Optionally, the data processing instruction includes multiple instruction fields, some of which are represented by at least one data element, and the data elements corresponding to the partial instruction fields are integrated to obtain an element array. That is, the data processing instruction includes an element array composed of multiple data elements.
[0057] The data processing instruction is used to instruct the processing of the data represented by the element array.
[0058] Illustratively, the data processing instruction is an instruction sent by other devices and received by the server; or, the data processing instruction is an instruction generated by the server itself, etc. Based on the data processing instruction, the data elements in the element array represented by the data processing instruction are processed.
[0059] Optionally, the data processing instruction is implemented as audio signaling, which is a signaling transmitted on an audio path. A data processing instruction in the form of audio signaling is received, the audio signaling includes an element array representing audio information, and the element array includes multiple data elements, each data element carries part of the audio information, etc.
[0060] For example: the element array is implemented as [100, 102, 110, 120], which includes 4 data elements: 100, 102, 110 and 120.
[0061] Step 220, based on the data type corresponding to the data element, perform binary conversion on the data element to obtain a binary string.
[0062] The data type corresponding to the data element corresponds to the first bit number during binary conversion.
[0063] Illustratively, different data types correspond to different bit numbers, that is, the bit number represented by the data type corresponding to the data element is called the first bit number.
[0064] Optionally, the data elements in the element array are pre-defined with the same data type, and after receiving the data processing instruction, the data type corresponding to the data element is determined, and the data type is used to determine the number of conversion bits when performing binary conversion on the data element.
[0065] Schematically, the number of bits corresponding to the data type byte (byte) is 8, which means that when the data type corresponding to the data element is determined to be byte, the data element is converted into an 8-bit binary string; the number of bits corresponding to the data type short integer (short) is 8, which means that when the data type corresponding to the data element is determined to be short, the data element is converted into a 16-bit binary string; the number of bits corresponding to the data type integer (integer, int) is 32, which means that when the data type corresponding to the data element is determined to be int, the data element is converted into a 32-bit binary string; the number of bits corresponding to the data type long integer (long) is 64, which means that when the data type corresponding to the data element is determined to be long, the data element is converted into a 64-bit binary string, etc.
[0066] For example: taking the data element 100 in the element array [100, 102, 110, 120] as an example, it is known that the data type corresponding to the data element is int, which means converting the data element into 32-bit binary form, and the binary string corresponding to the data element 100 is: 00000000 00000000 00000000 01100100.
[0067] Optionally, when the element array includes multiple data elements, binary conversion is performed based on the multiple data elements respectively to obtain binary strings corresponding to the multiple data elements respectively.
[0068] Step 230 , segmenting the valid character string in the binary character string with a preset number of translation bits to obtain at least one segmented character string as compressed data of the element array.
[0069] Among them, the valid character string is the set of characters located in the valid positions.
[0070] Schematically, a valid bit is a bit that stores valid information, and a character located at a valid bit is called a valid bit character, and a valid character string is determined by combining multiple valid bit characters. Optionally, based on one character occupying one bit, the bit can also be called a character position, that is, a valid bit is a character position (or character bit) that stores valid information, etc.
[0071] In an optional embodiment, character recognition is performed on the binary character string to obtain a valid character string consisting of at least one valid bit character.
[0072] Illustratively, character recognition is used to determine at least one valid character in a binary string, and the at least one valid character is used to represent data information of a data element.
[0073] Optionally, when performing character recognition on a binary string, all characters of the binary string are recognized in a preset recognition order to determine at least one valid character therefrom. For example, all characters in the binary string are recognized in a recognition order from right to left to extract at least one valid character therefrom; or all characters in the binary string are recognized in a recognition order from left to right to extract at least one valid character therefrom.
[0074] In some embodiments, valid digit identification is performed on the binary string to determine at least one valid digit in the binary string.
[0075] Indicatively, a valid bit is a bit used to store a valid bit character. Based on the distribution rule of characters in a binary string, it is determined that multiple characters therein are stored according to the characteristics of storage from low to high, that is, corresponding data information is stored sequentially from right to left.
[0076] Optionally, valid bit identification is performed on the binary string, and the last character bit of the second value in the recognition order from right to left is determined as the first character bit, and the first character bit and the character bit after the first character bit are used as at least one valid bit in the binary string; or, valid bit identification is performed on the binary string, and the first character bit of the second value in the recognition order from left to right is determined as the second character bit, and the second character bit and the character bit after the second character bit are used as at least one valid bit in the binary string.
[0077] The second value is used to represent the numerical value "1" in binary form.
[0078] For example, the binary string is: 00000000 00000000 00000000 01100100. When valid bit recognition is performed on the binary string, the last character bit with a value of 1 in the recognition order from right to left is determined as the first character bit, that is, the first character bit is the 7th character bit from right to left. In addition, the first character position and the character positions after the first character position are taken as at least one valid position in the binary string, that is, the at least one valid position is the first 7 character positions from right to left.
[0079] Alternatively, the binary string is: 00000000 00000000 00000000 01100100. When valid bits are identified in the binary string, the first character bit with a value of 1 in the identification order from left to right is determined as the second character bit, that is, the second character bit is the 26th character bit from left to right; in addition, the second character bit and the character bits after the second character bit are regarded as at least one valid bit in the binary string, that is, at least one valid bit is the last 7 character bits from left to right.
[0080] For example, if the data element 255 is a byte, the binary string corresponding to the data element 255 is 11111111. When valid bits are identified in the binary string, the last character bit with a value of 1 in the identification order from right to left is determined as the first character bit, that is, the first character bit is the 8th character bit from right to left. In addition, the first character position and the character positions after the first character position are used as at least one valid position in the binary string, that is, at least one valid position is a total of 8 character positions from right to left. Similarly, the valid positions for the data types int and short are also determined in the above manner, which will not be repeated here.
[0081] Optionally, valid bits are identified for the binary string, and in response to the absence of a character bit with the second value in the binary string, the first character bit from right to left is used as a valid character bit. That is, if all the character bits in the binary string are the character bits with the first value, the first character bit from right to left is used as a valid character bit.
[0082] For example, taking data element 0 as an example, if the data type corresponding to the data element is int, the binary string corresponding to data element 0 is: 00000000 00000000 00000000 00000000. The binary string is traversed to identify the valid bits of the binary string. If it is determined that there is no character bit with the second value "1" in the binary string, the first character bit from right to left is Similarly, the valid bits for the data types byte and short are also determined in the above manner, which will not be described in detail here.
[0083] In some embodiments, according to the order of characters in the binary string, characters located at at least one valid position are obtained to obtain a valid string.
[0084] Illustratively, after binary conversion is performed on known data elements to obtain a binary string, a plurality of characters in the binary string have a fixed character arrangement order, that is, the character positions at which the plurality of characters are respectively located are deterministic.
[0085] After determining that at least one valid bit is obtained, the character located at the at least one valid bit is determined as a valid bit character. For example, the first 7 character positions of the valid bits of the binary string 00000000 00000000 00000000 01100100 from right to left, then the valid bit characters corresponding to the first 7 valid bits from right to left are: 0, 0, 1, 0, 0, 1, 1.
[0086] At least one valid character is combined based on the character arrangement order to obtain a valid character string, that is, without destroying the data information expressed by each valid character in the binary character string, the valid characters are combined to obtain a valid character string representing the valid data information.
[0087] For example: in the binary string 00000000 00000000 00000000 01100100, the valid characters corresponding to the first 7 valid bits from right to left are: 0, 0, 1, 0, 0, 1, 1; by combining the 7 valid characters in the order of character arrangement, the valid string obtained is: 1100100.
[0088] Similarly, in the above binary string 11111111, there are 8 valid bits from right to left, and the corresponding valid bit characters are: 1, 1, 1, 1, 1, 1, 1, 1; by combining the 8 valid bit characters according to the character arrangement order, the valid string obtained is: 11111111.
[0089] Similarly, in the above binary string 00000000 00000000 00000000 00000000, there is 1 valid bit from right to left, and the valid bit character at this valid bit is 0, so the valid string is 0.
[0090] In some embodiments, the valid character string is segmented according to a preset number of translation bits to obtain at least one segmented character string.
[0091] Indicatively, the preset number of translation bits is a pre-set value. For example, the preset number of translation bits is a numerical form selected arbitrarily such as 6, 4, 12, etc. The preset number of translation bits represents the number of character bits required for segmentation processing. For example, if the preset number of translation bits is 6, it means that the valid character string is segmented according to 6 character bits.
[0092] The preset translation bit quantity is smaller than the first bit quantity.
[0093] Illustratively, in order to perform segment processing based on a preset number of translation bits, the preset number of translation bits is set to be smaller than the first number of bits corresponding to the data type.
[0094] Optionally, after obtaining a valid character string, the valid character string is segmented by a preset number of translation bits to obtain at least one segmented character string after segmentation, wherein the number of characters in the segmented character string is the preset number of translation bits.
[0095] Illustratively, if the preset number of translation bits is less than the number of valid bits in the valid string, multiple segmented strings will be obtained after the valid string is segmented based on the preset translation bit data; or, if the preset number of translation bits is equal to the number of valid bits in the valid string, one segmented string will be obtained after the valid string is segmented based on the preset translation bit data; or, if the preset number of translation bits is greater than the number of valid bits in the valid string, one segmented string will be obtained after the valid string is segmented based on the preset translation bit data.
[0096] like Figure 3 As shown, it is a schematic diagram of obtaining at least one segmented string through segmentation processing based on an element array.
[0097] The element array 310 is implemented as [100 102 110 120], and each data element in the element array 310 is binary-encoded. Taking the binary encoding of the data element 100 as an example, the binary string 320 corresponding to the data element 100 is implemented as 00000000 00000000 00000000 01100100; the valid binary is 1100100; then the binary string 320 is segmented according to the preset translation bit number 6, and two segmented strings are obtained, namely, segmented string 1 and segmented string 100100.
[0098] Similarly, if the valid character string 11111111 corresponding to the binary character string 11111111 is segmented with the preset number of translation bits 6, two segmented character strings are obtained, namely segmented character string 11 and segmented character string 111111; or, the character string whose number of characters after segmentation does not meet the preset number of translation bits is padded with the first value, to obtain segmented character string 000011 and segmented character string 111111, etc.
[0099] Similarly, if the valid character string 0 corresponding to the binary character string 00000000 000000000000000000000000 is segmented with the preset translation bit number 6, a segmented character string of 0 is obtained; or, the character string whose number of characters after segmentation does not meet the preset translation bit number is padded with the first value to obtain a segmented character string 000000, etc.
[0100] The above content explains the data elements with boundary values and any data elements with intermediate values. Other data elements are operated in accordance with the above content and will not be repeated here.
[0101] At least one segmented string is used as compressed data of the element array.
[0102] Illustratively, the segmented string is the content obtained after segmenting the valid string in the binary string. Therefore, the effective string can reduce the occupancy of redundant information in the binary string. The segmented processing can also avoid the problem of increased compression difficulty caused by the large length of the effective string, thereby achieving the purpose of effectively compressing each data element in the element array, so that based on at least one segmented string corresponding to each data element, compressed data after data compression of the element array can be obtained.
[0103] Optionally, at least one segmented string is directly used as compressed data corresponding to the element array; or, based on the string position of at least one segmented string in the valid string, compressed data corresponding to the element array is obtained through at least one segmented character, etc.
[0104] Step 240: Perform data processing on at least one segmented character string based on the data processing instruction.
[0105] Optionally, data processing is implemented as at least one of the following situations: (1) data storage; (2) data transmission; (3) data processing; (4) data transformation; (5) data grouping; (6) data retrieval; (7) data sorting, etc.
[0106] Illustratively, if the data processing instruction is implemented as an instruction for data storage, after obtaining at least one segmented string, at least one segmented string is stored on the local end; or, if the data processing instruction is implemented as an instruction for data transmission, after obtaining at least one segmented string, at least one segmented string is transmitted to a designated device, etc.
[0107] It is worth noting that the above are merely illustrative examples and are not limited to the embodiments of the present application.
[0108] In summary, when processing the data elements in the element array based on the data processing instruction, the data elements are converted into binary according to the data type corresponding to the data elements to obtain a binary string, and the valid character string in the binary string is segmented with a preset number of translation bits to obtain at least one segmented character string. Since the valid character string is a collection of characters located at the valid bit, it is possible to avoid the problem of data occupation by redundant high-bit data in the character storage process with the help of targeted analysis of the valid character string; in addition, the characters in the valid character string are segmented and summarized with the help of the segmentation process, so as to further realize the overall management of the characters, and use at least one segmented character string as the compressed data of the element array, which is not only conducive to reducing the space occupied by the storage element array, but also conducive to improving the network transmission efficiency of the transmission element array.
[0109] In an optional embodiment, in the process of obtaining the segmented character string, the valid character string in the binary character string is first segmented by a preset number of translation bits to obtain a translated character string, and then character marks are added to the translated character string based on the character string position of the translated character string in the valid character string, thereby obtaining at least one segmented character string used as compressed data. Schematically, as Figure 4 As shown above Figure 2 The illustrated embodiment may also be implemented as steps 410 to 450 as follows; step 230 may also be implemented as steps 430 to 440 as follows.
[0110] Step 410, receiving a data processing instruction.
[0111] The data processing instruction includes an element array, the element array includes data elements, and the data processing instruction is used to instruct processing of the data represented by the element array.
[0112] Optionally, the data processing instruction is implemented as audio signaling, which is a signaling transmitted on an audio path. A data processing instruction in the form of audio signaling is received, the audio signaling includes an element array representing audio information, and the element array includes multiple data elements, each data element carries part of the audio information, etc.
[0113] Illustratively, the purpose of receiving the data processing instruction is to compress the data processing instruction to reduce the occupied content of the element array in the data processing instruction.
[0114] Step 420, based on the data type corresponding to the data element, perform binary conversion on the data element to obtain a binary string.
[0115] The data type corresponding to the data element corresponds to the first bit number during binary conversion.
[0116] Optionally, the element array includes multiple data elements, and the multiple data elements in the same element array belong to the same data type. The data type is used to limit the data stored in the string and the storage space occupied by the string.
[0117] Data types can be roughly divided into two categories: basic data types and reference data types. Basic data types include numeric types, character types, and Boolean types; numeric types include integer types and floating-point types. Taking the data type corresponding to the data element as an integer type as an example, after determining the data element, determine whether the data element belongs to the byte type, short type, int type, or long type in the integer type, thereby achieving the purpose of determining the data type of the data element.
[0118] Optionally, the operator "typeof" is used to determine the data type of the data element, such as: typing "typeof+data element" returns the data type of the data element, etc.
[0119] In an optional embodiment, based on the data types corresponding to the data elements, binary conversion is performed on multiple data elements respectively to obtain multiple binary character strings.
[0120] Illustratively, based on the data type corresponding to the data element, the number of bits corresponding to binary conversion can be determined, and the number of bits corresponding to the data type is used as the first number of bits.
[0121] For example: if the data type corresponding to the data element is byte type, the number of first bits after binary conversion is determined to be 32 bits; if the data type corresponding to the data element is short type, the number of first bits after binary conversion is determined to be 16 bits, etc.
[0122] Optionally, binary conversion is performed on the multiple data elements respectively, so as to obtain binary character strings corresponding to the multiple data elements respectively. That is, the obtained multiple binary character strings correspond to the multiple data elements one by one.
[0123] Step 430 , segmenting the valid character string in the binary character string with a preset number of translation bits to obtain at least one translation character string.
[0124] Illustratively, the preset number of translation bits is a preset value, and the preset number of translation bits is smaller than the first number of bits.
[0125] Among them, the valid character string is the set of characters located in the valid positions.
[0126] In some embodiments, valid bits are identified on the binary string to determine at least one valid bit in the binary string; and characters located at at least one valid bit are obtained according to the order of character arrangement in the binary string to obtain a valid string.
[0127] Illustratively, according to the valid bit characters stored in the valid bit and the character arrangement order, multiple valid bit characters are combined to obtain a valid character string.
[0128] In an optional embodiment, the valid character string is segmented according to a preset translation direction and with a preset number of translation bits to obtain at least one translated character string.
[0129] Illustratively, the preset translation direction is a pre-set translation direction, such as translation from right to left; or translation from left to right, etc.
[0130] The translated character string is used to represent the segmentation result obtained after segmenting the valid character string based on the preset translated bit value.
[0131] In an illustrative manner, based on the distribution rule of characters in a binary string, it is determined that multiple characters in a binary string are stored in accordance with the characteristic of being stored from low bits to high bits, that is, characters are generated and stored in sequence from right to left.
[0132] Optionally, based on the distribution characteristics of characters in the binary string, the same right-to-left direction is used as a preset translation direction, and the valid string is segmented by a preset number of translation bits.
[0133] Illustratively, translation is used to indicate the processing method used when processing characters of a binary string; the preset translation direction is used to indicate the processing direction used when performing the translation process. Optionally, the translation process includes the above-mentioned segmentation process of the binary string. The translation process may also include the addition process, modification process, etc. of the binary string, which are not limited here.
[0134] In some embodiments, the valid character string may be segmented according to a preset translation direction from left to right and with a preset number of translation bits to obtain at least one translated character string.
[0135] Optionally, after determining a valid character string in a binary character string, the valid character string is segmented by a preset number of translation bits to achieve a purpose of efficient translation of the valid character string with a low data volume.
[0136] In some embodiments, in response to the number of valid bits corresponding to the valid character string being greater than the preset number of translation bits, the valid character string is segmented at least once with the preset number of translation bits to obtain a plurality of segmentation results.
[0137] Illustratively, the number of valid bits is used to represent the number of stored valid bits, and the valid bits are used to store characters containing valid information. Optionally, if the number of valid bits corresponding to the valid string is greater than the preset number of translated bits, when the valid string is segmented with the preset number of translated bits, multiple segmentation results will be obtained.
[0138] Optionally, according to a preset translation direction from right to left, the valid character string is segmented at least once with a preset number of translation bits to obtain multiple segmentation results; or, according to a preset translation direction from left to right, the valid character string is segmented at least once with a preset number of translation bits to obtain multiple segmentation results, etc.
[0139] Schematically, the example of segmentation processing according to the preset translation direction from right to left is used to illustrate. If the valid string has been determined to be "1100100", the preset number of translation bits is 6, and the preset number of translation bits 6 is greater than the valid number of bits 7, then when the valid string is segmented based on the preset number of translation bits, multiple segmentation results will be obtained, that is, two segmentation results, namely "100100" and "1".
[0140] In some embodiments, in response to the first segmentation result including valid bit characters and the number of characters does not reach the preset translation bit number, the first segmentation result is padded with a first value to obtain a plurality of translation character strings.
[0141] Illustratively, the first segmentation result is a segmentation result among multiple segmentation results, the segmentation result includes at least one character, and the at least one character includes at least one valid bit character; the first segmentation result represents a segmentation result that includes valid bit characters but the number of characters does not reach the preset translation bit number.
[0142] Optionally, the first numerical value is used to represent a numerical value “0”; when it is determined that the first segment result does not reach a preset number of translation bits, the first segment result is padded with the numerical value “0”.
[0143] For example: in the two segmentation results after segmenting the valid character string "1100100", "100100" includes valid bit characters and the number of characters has reached the preset number of translation bits; "1" includes valid bit characters but the number of characters does not reach the preset number of translation bits, then "1" is regarded as the first segmentation result, and the first segmentation result is padded with the first value "0".
[0144] Indicatively, when the first segmentation result is padded, the padded process is performed according to the preset translation direction used during the segmentation process. For example, based on the preset translation direction used during the segmentation process being from right to left, when the first segmentation result "1" is padded, the first value "0" is padded to the first character in the first segmentation result, and the segmentation result after the first segmentation result is padded is "000001".
[0145] The above segmentation result "100100" and the segmentation result after padding "000001" are used as multiple translated character strings obtained after segmenting the valid character string.
[0146] It is worth noting that the above are merely illustrative examples and are not limited to the embodiments of the present application.
[0147] In an optional embodiment, the binary string is segmented according to a preset number of translation bits to obtain a plurality of candidate segmentation results.
[0148] Illustratively, after determining the preset number of translation bits, the binary string is segmented according to the preset number of translation bits, and the result after segmentation is called a candidate segmentation result; based on the fact that the preset number of translation bits is less than the first bit number when converted into a binary string, multiple candidate segmentation results will be obtained after segmentation processing.
[0149] Optionally, the binary string is segmented according to a translation direction from right to left by a preset number of translation bits to obtain a plurality of candidate segmentation results.
[0150] For example: the binary string is "00000000 00000000 00000000 01100100", and the preset number of translation bits is 6. According to the translation direction from right to left, the binary string is segmented by the preset number of translation bits 6, and multiple candidate segmentation results are obtained, namely "100100", "000001", "000000", "000000", "000000" and "00".
[0151] It is worth noting that the above are merely illustrative examples and are not limited to the embodiments of the present application.
[0152] Step 440 , based on the string position of the translated string in the valid string, a character mark is added to the translated string to obtain a segmented string corresponding to at least one translated string.
[0153] Illustratively, after determining the valid string and the translated string, the string position of the translated string relative to the valid string is determined. Optionally, the string position can be determined by the relative relationship between the translated string and other translated strings.
[0154] In an optional embodiment, based on the string position of the translated string in the valid string, a preset number of markers is added to the translated string as character markers to obtain segmented strings corresponding to at least one translated string.
[0155] Indicatively, the preset mark number is a pre-set mark number, which is obtained after the translated string is segmented into a binary string, so the valid characters in the translated string are "0" and "1"; the value "0" or the value "1" is selected as the preset identification number to mark the translated string.
[0156] Optionally, a preset incrementing method is used to implement the incrementing process of the preset number of marks. Schematically, the preset number of marks is placed before the translated string; or, the preset number of marks is placed after the translated string, etc. The incrementing method is not limited here.
[0157] In some embodiments, when adding a preset number of markers as character markers in the translated string, different preset numbers of markers are added as character markers according to different string positions where the translated string is located in the valid string.
[0158] In an optional embodiment, a position analysis is performed on at least one translated string based on the translation direction, and in response to the presence of other translated strings after the first translated string, a first numerical value is added to the first translated string as a character marker to obtain a segmented string corresponding to the first translated string.
[0159] Illustratively, the first numerical value is used as a character mark to indicate that the first translated character string is located at the beginning or middle position of the valid character string, wherein the first translated character string is any one of the at least one translated character string.
[0160] For example: the binary string is "10100100". According to the translation direction from right to left, the binary string is segmented with a preset number of translation bits 4 to obtain translation strings "0100" and "1010" respectively; if the first translation string is "0100", based on the translation direction, it is determined that there are other translation strings "1010" after the first translation string, then the first numerical value is selected as the character mark for the first translation string "0100".
[0161] Optionally, the first numerical value is a numerical value “0.” When the first numerical value is added as a character marker for the first translated character string, the first numerical value is added as a character marker before the first translated character string.
[0162] Illustratively, when adding the first value to the first translated string "0100", the first value "0" is added before the first character position of the first translated string to obtain a segmented string "00100" corresponding to the first translated string "0100".
[0163] In some embodiments, the above content can also be summarized as: in response to the existence of n translated strings, and the first translated string among the n translated strings is the n-1th translated string obtained according to the translation direction from right to left, a first numerical value is added to the translated string as a character marker to obtain segmented strings corresponding to the first n-1 translated strings respectively.
[0164] Wherein, n is a positive integer greater than 1.
[0165] In an optional embodiment, a position analysis is performed on at least one translated string based on the translation direction, and in response to the second translated string being the last translated string in the at least one translated string, a second numerical value is added to the second translated string as a character marker to obtain a segmented string corresponding to the second translated string.
[0166] Illustratively, the second numerical value is used as a character mark to indicate that the second translated character string is located at the end position of the valid character string.
[0167] For example: the binary string is "10100100", and according to the translation direction from right to left, the binary string is segmented with a preset number of translation bits 4 to obtain translation strings "0100" and "1010" respectively; if the second translation string is "1010", it is determined based on the translation direction that there is no other translation string after the second translation string, that is, the second translation string is the last translation string in at least one string, then the second numerical value is selected to be added to the second translation string "1010" as a character marker.
[0168] Optionally, the second numerical value is a numerical value “1.” When the second numerical value is added as a character marker to the second translated character string, the second numerical value is added as a character marker before the second translated character string.
[0169] Illustratively, when adding the second value to the second translated string "1010", the second value "1" is added before the first character position of the second translated string to obtain a segmented string "11010" corresponding to the second translated string "1010".
[0170] In some embodiments, the above content can also be summarized as: in response to the existence of n translated strings, and the second translated string among the n translated strings is the nth translated string obtained according to the right-to-left translation direction, a second numerical value is added to the translated string as a character marker to obtain a segmented string corresponding to the nth translated string.
[0171] Optionally, in response to the existence of a segmentation character, a second numerical value is added to the translated string as a character marker to obtain a translated string corresponding to the segmentation character.
[0172] Illustratively, when at least one translated string is implemented as a translated string, there is no process for determining the relative position between other translated strings and the translated string. A second numerical value is added to the translated string as a character marker to obtain a segmented string corresponding to the segmented character. The segmented string can also be regarded as a segmented string corresponding to the data element.
[0173] It is worth noting that when the first numerical value and the second numerical value are used as character marks, the numerical value "0" can be used as the first numerical value, and the numerical value "1" can also be used as the first numerical value. Accordingly, when the numerical value "0" is used as the first numerical value, the numerical value "1" is the second numerical value, and when the numerical value "1" is used as the first numerical value, the numerical value "0" is used as the first numerical value, and so on. There is no limitation here.
[0174] The segmented character string is used to decipher the data elements in the element array.
[0175] Schematically, in the process of obtaining the segmented character string, there is a process of determining the valid bits of the data element, obtaining the valid character string, segmenting the valid character string to obtain the translated character string, and adding corresponding character tags to the translated character string. This process can not only discard the redundant invalid bit characters, but also comprehensively divide the valid character string according to the preset number of translated characters, and express different translated character strings differently with different character tags, which has a certain encryption effect while retaining the data information, so as to obtain the translated character string after the data element is translated.
[0176] Optionally, the translation process is an overview of the process of determining valid bits, obtaining valid character strings, segmenting to obtain translated character strings, and adding corresponding character tags to the translated character strings. The detailed implementation of this process is not limited here.
[0177] like Figure 5 As shown, it is a schematic diagram of obtaining at least one segmented string based on an element array through segmentation processing and character mark addition process.
[0178] Among them, the element array 510 is implemented as [100 102 110 120], and each data element in the element array 510 is binary-encoded. Taking the binary encoding of the data element 100 as an example, the binary string 520 corresponding to the data element 100 is implemented as 00000000 00000000 00000000 01100100; wherein the valid binary is 1100100; after segmenting the binary string 520, two translated strings are obtained, namely, the translated string 1 and the translated string 100100; and then, character marks are added according to the string positions of the translated strings, and two segmented strings are obtained, namely, the segmented string 11 and the segmented string 0100100. Similarly, the above operations are performed on other data elements, which will not be repeated here.
[0179] like Figure 6 As shown, it is a schematic diagram of obtaining at least one segmented character string based on an element array through segmentation processing, filling processing and character mark addition process.
[0180] Among them, the element array 610 is implemented as [100 102 110 120], and each data element in the element array 610 is binary-encoded. Taking the binary encoding of the data element 100 as an example, the binary string 620 corresponding to the data element 100 is implemented as 00000000 00000000 00000000 01100100; wherein the valid binary is 1100100; then the binary string 620 is segmented and filled to obtain two translated strings, namely, the translated string 000001 and the translated string 100100; then, character marks are added according to the string positions of the translated strings to obtain two segmented strings, namely, the segmented string 1000001 and the segmented string 0100100. Similarly, the above operations are performed on other data elements, which will not be repeated here.
[0181] That is, a translation string with a preset number of translation bits may be obtained through segmentation and padding, or a translation string with a different number of characters may be obtained without padding, which is not limited here.
[0182] In an optional embodiment, at least one segmented string is used as compressed data corresponding to the element array.
[0183] Illustratively, by performing segmentation processing and identifier addition processes on a binary string corresponding to a data element, at least one segmented string corresponding to the data element can be obtained.
[0184] Optionally, when the element array includes a data element, the at least one segmented character string is used as compressed data corresponding to the element array.
[0185] Optionally, when the element array includes multiple data elements, at least one segmented string corresponding to the multiple data elements is determined, and the at least one segmented string corresponding to the multiple data elements is used together as compressed data corresponding to the element array.
[0186] Step 450: Perform data processing on at least one segmented character string based on the data processing instruction.
[0187] Illustratively, data processing can be implemented in a variety of processing modes such as data transmission, data storage, and data sorting; based on the processing mode represented by the data processing instruction, corresponding data processing is performed on at least one segmented character string.
[0188] It is worth noting that the above are merely illustrative examples and are not limited to the embodiments of the present application.
[0189] To summarize, based on the fact that a valid character string is a collection of characters located at valid positions, it is possible to avoid the problem of data occupation by redundant high-order data in the character storage process with the help of targeted analysis of the valid character string; in addition, the characters in the valid character string are segmented and summarized with the help of the segmentation process, so as to further realize the overall management of the characters, and use at least one segmented character string as the compressed data for the element array, which is not only conducive to reducing the space occupied by the storage element array, but also conducive to improving the network transmission efficiency of the transmission element array.
[0190] In the embodiment of the present application, a method of adding character marks to the translated string obtained by segmentation processing is introduced to obtain a segmented string with a certain encryption effect. After the translated string is obtained by segmentation processing, different character marks are added to the translated string according to the string position of the translated string in the valid string. If it is determined according to the translation direction that there are other translated strings after the translated string, a first value is added as a character mark, and if it is determined according to the translation direction that the translated string is the last translated string, a second value different from the first value is added as a character mark; based on the addition process, it is beneficial to enable at least one segmented string to perform an appropriate encryption process on the valid string through the character mark without destroying the meaning of the valid string, and in the case of knowing the preset number of translation bits, the first value and the second value, the position of the segmented string relative to the valid string can be reversely deciphered, which not only simplifies the amount of data in the processing process through segmentation processing, but also improves the encryption effect of the segmented string, which is beneficial to more secure transmission of compressed data represented by the segmented string.
[0191] In an optional embodiment, the element array includes multiple data elements. When obtaining a binary string, firstly, a difference array is obtained according to the difference between two adjacent data elements in the multiple data elements, and then the difference elements in the difference array are converted into binary to obtain the binary string. Schematically, as Figure 7 As shown, the above step 220 can also be implemented as the following steps 720 to 730; Figure 2 The illustrated embodiment may also be implemented as the following steps 710 to 750 .
[0192] Step 710, receiving a data processing instruction.
[0193] The data processing instruction includes an element array, the element array includes data elements, and the data processing instruction is used to instruct processing of the data represented by the element array.
[0194] In some embodiments, the data processing instruction is used not only to instruct processing of element array representation data, but also to instruct generation of a data transmission instruction including compressed data.
[0195] Illustratively, the element array in the data processing instruction is compressed to obtain compressed data, and the compressed data is used to replace the element array to generate a data transmission instruction that compresses the data processing instruction, and the data transmission instruction is used to send it to other devices; alternatively, the data transmission instruction is used to send the compressed data to other devices, etc.
[0196] In some embodiments, the data processing instruction is used not only to instruct processing of element array representation data, but also to instruct generation of data storage instructions including compressed data.
[0197] Illustratively, the element array in the data processing instruction is compressed to obtain compressed data, and the element array is replaced by the compressed data to generate a data storage instruction after compressing the data processing instruction, and the data storage instruction is used to store the compressed data on the local end, etc.
[0198] It is worth noting that the above are merely illustrative examples and are not limited to the embodiments of the present application.
[0199] Step 720: Obtain a difference array based on the difference between two adjacent data elements in the plurality of data elements.
[0200] Indicatively, after determining a plurality of data elements in the element array, the difference between two adjacent data elements in the plurality of data elements is analyzed, and the plurality of differences are combined to obtain a difference array.
[0201] The difference array includes a plurality of difference elements, and the plurality of difference elements correspond one-to-one to the plurality of data elements; the first difference element is the first data element among the plurality of data elements.
[0202] Indicatively, in the element array, the first data element remains unchanged during the difference calculation process, and the difference between the first data element and the second data element is used as the difference element corresponding to the second data element; similarly, the difference between the second data element and the third data element is used as the difference element corresponding to the third data element, etc. That is, the difference between the mth data element and the m+1th data element is used as the difference element corresponding to the m+1th data element, where m is a positive integer.
[0203] For example: the element array is [100, 102, 110, 120], keep the first data element 100 unchanged, determine the difference 2 between the first data element 100 and the second data element 102, as the difference element corresponding to the second data element; similarly, determine the difference elements corresponding to the other two data elements respectively, and obtain the difference array [100, 2, 8, 10].
[0204] The plurality of difference elements are respectively used as elements for performing binary conversion to obtain a binary character string.
[0205] Illustratively, when performing binary conversion, multiple difference elements obtained after performing difference conversion on data elements based on the element array are used as analysis objects, thereby performing binary conversion on the multiple difference elements, and the conversion results are used as binary strings for subsequent analysis.
[0206] In an optional embodiment, a designated data element among the multiple data elements is used as a reference element, and the difference between the other data elements and the designated reference element is determined to obtain a difference array.
[0207] The data differences corresponding to the other data elements are used as the difference elements corresponding to the other data elements in the difference array.
[0208] In an illustrative manner, the first data element is used as an example for explanation, and the first data element is used as a reference to determine the difference between other data elements and the first data element. For example, the element array is [100, 102, 110, 120], the first data element is 100, the difference between the second data element 102 and the first data element 100 is determined, and the difference element 2 corresponding to the second data element is obtained; in addition, the difference between the third data element 110 and the first data element 100 is determined, and the difference element 10 corresponding to the third data element is obtained; the difference between the fourth data element 120 and the first data element 100 is determined, and the difference element 20 corresponding to the fourth data element is obtained. The difference array obtained based on the above process is [100, 2, 10, 20], etc.
[0209] It is worth noting that the above are merely illustrative examples and are not limited to the embodiments of the present application.
[0210] Step 730 , based on the data types corresponding to the data elements, binary conversion is performed on the difference elements corresponding to the plurality of data elements, to obtain binary character strings corresponding to the plurality of difference elements.
[0211] Illustratively, when obtaining the corresponding binary string for a data element, based on the fact that multiple data elements respectively correspond to a difference element in the difference array, the multiple difference elements in the difference array are respectively converted into binary according to the data type corresponding to the data element, thereby obtaining binary strings corresponding to the multiple difference elements respectively.
[0212] That is, there is a one-to-one correspondence between multiple binary strings and multiple difference elements, and there is a one-to-one correspondence between multiple difference elements and multiple data elements. Therefore, there is also a one-to-one correspondence between multiple binary strings and multiple data elements.
[0213] For example: the difference array corresponding to the element array [100, 102, 110, 120] is [100, 2, 8, 10]. If the data type of the data elements in the element array is int, then based on this data type, the multiple difference elements in the difference array are converted into 32-bit binary strings respectively. For example, the binary string corresponding to difference element 100 (the first difference element is the first data element) is: 00000000 0000000000000000 01100100; the binary string corresponding to difference element 2 is: 00000000 000000000000000 00000010; the binary string corresponding to difference element 8 is: 00000000 0000000000000000 00001000; the binary string corresponding to difference element 10 is: 0000000000000000000000000 00001010. That is, the binary strings corresponding to the four difference elements are obtained.
[0214] It is worth noting that the element values and element order of multiple data elements in the element array contain the data information represented by the element array, and different element values and / or different element orders may represent different meanings. The multiple data elements in the above element array are arranged in ascending order for illustrative purposes only. Based on the differences in the data information represented by the element array, the multiple data elements may also be arranged in descending order or randomly, which is not limited here.
[0215] Illustratively, when the element array is implemented in a descending order or random arrangement, the corresponding difference array may include negative values. When binary conversion is performed on multiple difference elements, it includes a binary conversion process for difference elements implemented as positive values, and also includes a binary conversion process for difference elements implemented as negative values.
[0216] Optionally, when performing binary conversion on negative values, the following operation rules are used. First, the absolute value of the negative value is obtained; then, according to the data type corresponding to the data element, the absolute value is converted into binary, and the absolute value string representing the original code is obtained as a valid string for subsequent segmentation processing. Among them, the symbol information representing the negative value is used as the information contained in generating at least one segmented string, and the content of processing the negative value to obtain the corresponding segmented string will be supplemented in the subsequent content.
[0217] For example, if the difference array is implemented as [100, -102, 20], when performing binary conversion on the negative value -102, first obtain the absolute value of -102, 102; then, perform binary conversion on the absolute value 102 according to the data type corresponding to the data element to obtain the absolute value string representing the original code. If the data type is byte, the absolute value string represented by 8 bits is obtained by binary conversion, that is, 1100110. The absolute value string 1100110 is used as a valid string for subsequent segmentation processing of the negative value -102.
[0218] Step 740 , segmenting the valid character string in the binary character string with a preset number of translation bits to obtain at least one segmented character string as compressed data of the element array.
[0219] Illustratively, the preset number of translation bits is a preset value; the preset number of translation bits is less than the first number of bits; the first number of bits is the number of bits of a binary string obtained after binary conversion of the data element.
[0220] Among them, the valid character string is the set of characters located in the valid positions.
[0221] Illustratively, binary strings corresponding to multiple difference arrays are obtained based on the difference array, that is, multiple binary strings are obtained based on the difference array. When valid strings in the binary string are segmented according to a preset number of translation bits, the valid strings corresponding to multiple binary strings according to the preset number of translation bits are segmented.
[0222] In some embodiments, valid strings corresponding to multiple binary strings are determined to obtain multiple valid strings, each valid string is taken as an analysis object, and each valid string is segmented to obtain at least one segmented string corresponding to each binary string.
[0223] Optionally, valid bits are identified for multiple binary strings respectively to determine at least one valid bit corresponding to each of the multiple binary strings; characters located at at least one valid bit are obtained according to the order of character arrangement in the binary string to obtain valid strings corresponding to each of the multiple binary strings.
[0224] For example: for the above difference array [100, 2, 8, 10], four binary strings are determined, and valid bits are identified for each of the four binary strings to obtain valid strings corresponding to the four binary strings. Among them, the valid string corresponding to the binary string of difference element 100 is "1100100"; the valid string corresponding to the binary string of difference element 2 is "10"; the valid string corresponding to the binary string of difference element 8 is "1000"; and the valid string corresponding to the binary string of difference element 10 is "1010".
[0225] In some embodiments, multiple valid character strings are segmented according to a preset number of translation bits, and each valid character string corresponds to at least one segmented character string.
[0226] At least one segment string is used as compressed data of the element array.
[0227] Illustratively, if each valid character string corresponds to at least one segmented character string, when obtaining compressed data corresponding to the element array, multiple segmented character strings corresponding to multiple valid characters are combined as compressed data of the element array.
[0228] In an optional embodiment, based on the existence of valid characters in the multiple candidate segmentation results, the multiple candidate segmentation results are screened to obtain at least one segmentation string including valid characters.
[0229] Among them, the valid bit character is used to represent the character stored in the valid bit; the valid bit is the character bit that stores valid information.
[0230] Illustratively, the existence of valid characters includes one of the following two forms: (1) valid characters exist in the candidate segmentation results; (2) valid characters do not exist in the candidate segmentation results.
[0231] Since valid bit characters are characters stored in valid bits, the existence of valid bit characters can also be determined based on the overlap between at least one valid bit and the character bits respectively occupied by multiple candidate segmentation results, which is not limited here.
[0232] In some embodiments, candidate segmentation results with valid characters are used as segmentation strings, and at least one segmentation string is obtained after screening multiple candidate segmentation results.
[0233] Illustratively, the multiple candidate segmentation results are "100100", "000001", "000000", "000000", "000000" and "00", among which the candidate segmentation result "100100" and the candidate segmentation result "000001" are candidate segmentation results with valid bit characters. Therefore, the candidate segmentation result "100100" and the candidate segmentation result "000001" are taken as segmentation strings, that is, two segmentation strings are obtained.
[0234] In some embodiments, in response to the presence of valid bit characters in the first candidate segmentation result and the number of characters not reaching the preset number of translation bits, the first candidate segmentation result is padded with the first value to obtain a segmentation string corresponding to the first candidate segmentation result.
[0235] Illustratively, the first candidate segmentation result is one of the multiple candidate segmentation results, and the candidate segmentation result includes at least one character; the first candidate segmentation result represents a candidate segmentation result that includes valid bit characters but the number of characters therein does not reach the preset translation bit number.
[0236] Optionally, the first numerical value is used to represent the numerical value "0"; when it is determined that the first candidate segmentation result includes valid bit characters but the number of characters therein does not reach a preset translation bit number, the first candidate segmentation result is padded with the numerical value "0" according to the translation direction followed during segmentation processing.
[0237] For example, the binary string is "10100100". According to the translation direction from right to left, the binary string is segmented with a preset translation bit number of 5, and the multiple candidate segmentation results obtained are "00100" and "101" respectively; the candidate segmentation result "101" includes valid bit characters but the number of characters therein does not reach the preset translation bit number. According to the translation direction from right to left, the candidate segmentation result "101" is padded with a first value "0" so that the number of characters in the padded candidate segmentation result is the preset translation bit number, and the padded candidate segmentation result is "00101". Based on the above content, it is determined that the segmented strings corresponding to the binary string "10100100" include "00100" and "00101".
[0238] It is worth noting that the above are merely illustrative examples and are not limited to the embodiments of the present application.
[0239] In an optional embodiment, based on the existence of valid characters in the multiple candidate segmentation results, the multiple candidate segmentation results are screened to obtain at least one translated character string including valid characters.
[0240] Since valid bit characters are characters stored in valid bits, the existence of valid bit characters can also be determined based on the overlap between at least one valid bit and the character bits respectively occupied by multiple candidate segmentation results, which is not limited here.
[0241] In some embodiments, candidate segmentation results with valid characters are used as translation strings, and at least one translation string is obtained after screening multiple candidate segmentation results.
[0242] In some embodiments, in response to the presence of valid bit characters in the first candidate segmentation result and the number of characters not reaching the preset translation bit number, the first candidate segmentation result is padded with the first value to obtain a translation string corresponding to the first candidate segmentation result.
[0243] In an optional embodiment, based on the string position of the translated string in the valid string, a character marker is added to the translated string to obtain segmented strings corresponding to at least one translated string.
[0244] The segmented character string is used to decipher the data elements in the element array.
[0245] In an optional embodiment, when the difference array includes a negative value, after obtaining the absolute value string corresponding to the negative value as a valid string for segmentation processing, at least one segmentation string is generated based on the sign information representing the negative value.
[0246] In some embodiments, in response to the valid character string being an absolute value character string corresponding to a negative value, the absolute value character string is segmented according to a preset number of translation bits to obtain at least one candidate segmented character string.
[0247] The candidate segmented character string is used to represent the segmentation result after the absolute value character string is segmented.
[0248] For example: for the above-mentioned absolute value string 1100110, based on the fact that the valid string that needs to be segmented is the absolute value string corresponding to the negative value -102, the absolute value string 1100110 is segmented with a preset translation direction (such as: from right to left) and a preset number of translation bits (such as: 6), and two candidate segmented strings are obtained, namely candidate segmented string 100110 and candidate segmented string 000001.
[0249] In some embodiments, based on the sign information represented by the negative value, a preset character bit in the first candidate segmented character string is requisitioned as a sign bit to obtain a sign character string.
[0250] The first candidate segmented string is the last candidate segmented string determined from at least two candidate segmented strings based on a preset translation direction. For example, based on the preset translation direction from right to left when segmenting the absolute value string 1100110, the first candidate segmented string is the candidate segmented string 000001.
[0251] In an illustrative manner, the preset character bit is the last character bit determined from the first candidate segmented string based on the preset translation direction; the sign bit is used as a character bit representing the symbol information; the preset character bit is requisitioned as the sign bit, and is used to represent the symbol information corresponding to the negative value represented by the preset character bit. That is: the symbol information corresponding to the negative value is represented by the preset character bit in the first candidate segmented string, and a symbol string is obtained. Among them, the symbol string is a string representing the symbol information.
[0252] Optionally, based on the sign information represented by the negative value, the character at the preset character position in the first candidate segmented character string is adjusted to a second value to obtain a sign string. The second value is used to represent the sign information corresponding to the negative value. That is, by using the second value as the character value at the sign position, a negative value can be represented; similarly, by using the first value as the character value at the sign position, a positive number can be represented, which is not limited here.
[0253] For example: for the first candidate segmented string 000001, based on the preset translation direction from right to left, the preset character position is determined to be the character position where the first "0" is located from left to right. Taking the second value "1" as an example, the character on the preset character position is adjusted to 1, and the symbol string 100001 is obtained.
[0254] In some embodiments, the symbol string and other candidate segmented strings among the at least one candidate segmented string except the first candidate segmented string are taken as the at least one segmented string.
[0255] Schematically, in addition to taking the symbol string obtained by adjusting the first candidate segmented string based on the symbol information represented by the negative value as a segmented string, other candidate segmented strings other than the first candidate segmented string in at least one candidate segmented string are also determined, so that the other candidate segmented strings are also taken as segmented strings to obtain at least one segmented string.
[0256] For example, two candidate segmented strings are obtained, namely, candidate segmented string 100110 and candidate segmented string 000001. After adjusting candidate segmented string 000001, symbol string 100001 is obtained. Symbol string 100001 and candidate segmented string 100110 are taken as two segmented strings.
[0257] In some embodiments, based on the string position of the first candidate segmented string in the valid string, character tags are added to the symbol string to obtain a segmented string corresponding to the symbol string; based on the string positions of other candidate segmented strings in the valid string, character tags are added to other candidate segmented strings to obtain segmented strings corresponding to the other candidate segmented strings respectively, and at least one segmented string is obtained.
[0258] Schematically, at least one candidate segmented string is obtained after segmenting a valid string, and the first candidate segmented string is the last candidate segmented string determined based on a preset translation direction in at least one candidate segmented string, and the second value is added as a character marker to the symbol string corresponding to the first candidate segmented string to obtain a segmented string corresponding to the symbol string; in addition, other candidate segmented strings are non-last candidate segmented strings in at least one candidate segmented string, and the first value is added as a character marker to each of the other candidate segmented strings to obtain segmented strings corresponding to the other candidate segmented strings.
[0259] For example: based on the candidate segmented string 100110 and the candidate segmented string 000001, determine the symbol string 100001 and the candidate segmented string 100110 after adjusting the first candidate segmented string 000001; if the first value is "0" and the second value is "1", and the position of the added character mark is before the string, then the second value is added as the character mark to the symbol string 100001, and the segmented string 1100001 corresponding to the symbol string 100001 is obtained, wherein the first "1" counted from left to right is the added second value, and the second "1" counted from left to right represents the sign information of the negative value; the first value is added as the character mark to the candidate segmented string 100110, and the segmented string 0100110 corresponding to the candidate segmented string 100110 is obtained, wherein the first "0" counted from left to right is the added first value. That is, two segmented character strings are obtained, namely, segmented character string 1100001 and segmented character string 0100110.
[0260] It is worth noting that the above are merely illustrative examples and are not limited to the embodiments of the present application.
[0261] Step 750: Perform data processing on at least one segmented character string based on the data processing instruction.
[0262] Illustratively, data processing can be implemented in a variety of processing modes such as data transmission, data storage, and data sorting; based on the processing mode represented by the data processing instruction, corresponding data processing is performed on at least one segmented character string.
[0263] It is worth noting that the above are merely illustrative examples and are not limited to the embodiments of the present application.
[0264] To summarize, based on the fact that a valid character string is a collection of characters located at valid positions, it is possible to avoid the problem of data occupation by redundant high-order data in the character storage process with the help of targeted analysis of the valid character string; in addition, the characters in the valid character string are segmented and summarized with the help of the segmentation process, so as to further realize the overall management of the characters, and use at least one segmented character string as the compressed data for the element array, which is not only conducive to reducing the space occupied by the storage element array, but also conducive to improving the network transmission efficiency of the transmission element array.
[0265] In the embodiment of the present application, it is introduced that a difference array corresponding to an element array is obtained according to the difference between two adjacent data elements in a plurality of data elements, and then the binary string content is obtained by binary conversion according to the difference elements therein. Through the difference extraction process, the data occupied when expressing data elements can be further simplified, and the numerical changes between a plurality of data elements are integrated, and a binary string occupying fewer bits is obtained by means of a difference element with a smaller numerical value, which not only simplifies the process when obtaining a plurality of binary strings, but also makes the binary string occupy a smaller data space, and then when the binary string represented by the difference element is segmented, at least one segmented string with a better compression effect can be obtained, and the binary volume occupied by the element array is optimized under the condition that the expressiveness of the element array remains unchanged.
[0266] In an optional embodiment, the above data processing method is executed by a first device, the first device is communicatively connected to a second device, and the first device is used to compress the element array; after obtaining the compressed data, the first device can store the compressed data by itself to reduce the amount of stored data; or send the compressed data to the second device to reduce the data bandwidth occupied when transmitting the element array to the second device, thereby improving the transmission efficiency. Schematically, when the data processing instruction is implemented as an instruction in the form of transmission, based on the data processing instruction, when the first device needs to send at least one segmented string to the second device, such as Figure 8 As shown above Figure 2 The illustrated step 240 may also be implemented as step 810 as follows.
[0267] Step 810: Send at least one segmented character string to a second device that is communicatively connected to the first device.
[0268] In some embodiments, after the first device processes the data elements in the element array using the first translation strategy, at least one segmented string is obtained as compressed data to be sent to the second device.
[0269] Illustratively, the first translation strategy includes: performing binary conversion on data elements, extracting valid strings from binary strings, and segmenting the valid strings. After processing based on the first translation strategy, at least one segmented string is obtained as compressed data to be sent to the second device.
[0270] Optionally, after the first device processes the data elements in the element array using the second translation strategy, at least one segmented character string is obtained as compressed data to be sent to the second device.
[0271] Illustratively, the second translation strategy includes: performing binary conversion on the data element, extracting a valid string from the binary string, segmenting the valid string, and adding character marks to the translated string. After processing based on the second translation strategy, at least one segmented string is obtained as compressed data to be sent to the second device.
[0272] Optionally, after the first device processes the data elements in the element array using the third translation strategy, at least one segmented character string is obtained as compressed data to be sent to the second device.
[0273] Illustratively, the third translation strategy includes: performing difference extraction on data elements in the element array to obtain a difference array including a plurality of difference elements, performing binary conversion on the difference elements, extracting a valid string from the binary string, and performing segmentation processing on the valid string. After processing based on the third translation strategy, at least one segmented string is obtained as compressed data to be sent to the second device.
[0274] Optionally, after the first device processes the data elements in the element array using the fourth translation strategy, at least one segmented character string is obtained as compressed data to be sent to the second device.
[0275] Illustratively, the fourth translation strategy includes: performing difference extraction on the data elements in the element array to obtain a difference array including a plurality of difference elements, performing binary conversion on the difference elements, extracting a valid string from the binary string, performing segmentation processing on the valid string, and adding character marks to the translated string. After processing based on the fourth translation strategy, at least one segmented string is obtained as compressed data to be sent to the second device.
[0276] It is worth noting that the above-mentioned first translation strategy to the fourth translation strategy are merely illustrative examples, and the related contents involved in them, such as performing difference extraction on the data elements in the element array to obtain a difference array including multiple difference elements, performing binary conversion on the difference elements, extracting valid character strings from binary strings, performing segmentation processing on the valid character strings, adding character marks to the translated character strings, etc., are all described in detail in the above-mentioned embodiments and will not be repeated here.
[0277] Optionally, the data processing instruction indicates that compressed data is sent to the second device after the element array is compressed. Then, after the first device obtains the compressed data, the compressed data is sent to the second device.
[0278] Optionally, the data processing instruction indicates that after compressing the element array therein, a data transmission instruction including compressed data is obtained, and the data transmission instruction is sent to the second device; after the first device obtains the compressed data, a data transmission instruction including compressed data is generated and sent to the second device to achieve the purpose of sending compressed data, etc.
[0279] In some embodiments, the second device is used to decode at least one segmented string to obtain an element array.
[0280] Illustratively, the second device receives at least one segmented string sent by the first device; or, the second device receives a data transmission instruction including compressed data (at least one segmented string) sent by the first device.
[0281] In an optional embodiment, a mutual translation protocol is stored between the first device and the second device.
[0282] The mutual translation protocol is used to assist the first device to obtain at least one segmented string and assist the second device to decipher and obtain an element array. That is, based on the mutual translation protocol, the second device can decipher at least one segmented string after the first device performs translation processing to obtain an element array represented by the at least one segmented string.
[0283] Optionally, the mutual translation protocol is a protocol content pre-agreed between the first device and the second device. The first device can translate the data elements in the element array based on the mutual translation protocol (such as adopting any one of the above-mentioned first translation strategy, second translation strategy, third translation strategy and fourth translation strategy) to obtain at least one segmented character string that needs to be sent to the second device; based on the translation strategy adopted by the first device when performing the translation process, the second device adopts a decryption strategy corresponding to the translation strategy to decrypt at least one segmented character string, so as to determine at least one element array represented by segmented characters; similarly, the second device can also translate the data elements in the element array based on the mutual translation protocol to obtain at least one segmented character string that needs to be sent to the second device; based on the translation strategy adopted by the second device when performing the translation process, the first device adopts a decryption strategy corresponding to the translation strategy to decrypt at least one segmented character string, so as to determine at least one element array represented by segmented characters, etc.
[0284] Illustratively, the first device and the second device are deployed with an inter-translation protocol, and the inter-translation protocol represents at least one of the above four translation strategies. If the first device translates the data elements in the element array using the first translation strategy, the second device decrypts at least one segmented string using the first decryption strategy that has a decryption relationship with the first translation strategy.
[0285] The decryption relationship is used to indicate that the content translated by the translation strategy can be decrypted by the decryption strategy.
[0286] For example: the first translation strategy includes: performing binary conversion on data elements, extracting valid strings from binary strings, and segmenting the valid strings; in the first decryption strategy that has a decryption relationship with the first translation strategy, firstly, a valid string can be obtained by aggregating at least one segmented string after segmentation, and then, based on the data type corresponding to the data element, the invalid bit characters of the valid string are restored to obtain a binary string, and then the data element is obtained through base conversion (such as decimal conversion, etc.).
[0287] Alternatively, the second translation strategy includes: performing binary conversion on the data element, extracting a valid character string from the binary character string, performing segmentation processing on the valid character string, and adding character marks to the translated character string; in the second decryption strategy that has a decryption relationship with the second translation strategy, firstly, at least one segmented character string and the added character mark can be integrated to restore and summarize the valid character string, and then, based on the data type corresponding to the data element, the invalid bit characters of the valid character string are restored to obtain a binary character string, and then the data element is obtained through base conversion (such as decimal conversion, etc.).
[0288] Alternatively, the third translation strategy includes: performing difference extraction on the data elements in the element array to obtain a difference array including multiple difference elements, performing binary conversion on the difference elements, extracting a valid character string from the binary character string, and segmenting the valid character string; in the third decryption strategy that has a decryption relationship with the third translation strategy, first, a valid character string can be obtained by aggregating at least one segmented character string after segmentation, and then, based on the data type corresponding to the data element, the invalid bit characters of the valid character string are restored to obtain a binary character string, and then the difference elements are obtained by base conversion, and finally, reverse difference restoration is performed according to the difference extraction method used in the difference extraction to obtain data elements corresponding to the multiple difference elements, etc.
[0289] Alternatively, the fourth translation strategy includes: performing difference extraction on the data elements in the element array to obtain a difference array including multiple difference elements, performing binary conversion on the difference elements, extracting a valid character string from the binary character string, segmenting the valid character string, and adding character marks to the translated character string; in the fourth decryption strategy that has a decryption relationship with the fourth translation strategy, firstly, at least one segmented character string and the added character mark can be integrated to restore and summarize the valid character string, and then based on the data type corresponding to the data element, the invalid bit characters of the valid character string are restored to obtain a binary character string, and then the difference elements are obtained by base conversion, and finally, reverse difference restoration is performed according to the difference extraction method used in the difference extraction to obtain data elements corresponding to the multiple difference elements, etc.
[0290] Illustratively, the mutual translation protocol includes at least one of the four decryption strategies mentioned above in addition to at least one of the four translation strategies mentioned above. The second device adopts a decryption strategy corresponding to the translation strategy among the four decryption strategies mentioned above, and performs decryption analysis on at least one segmented string to know the data information in the element array in a safer way. It can also effectively avoid the problem of other devices decrypting at least one segmented string through the agreement of the mutual translation protocol, thereby further improving security.
[0291] It is worth noting that the above are merely illustrative examples and are not limited to the embodiments of the present application.
[0292] In some embodiments, when at least one segmented string is sent to a second device as compressed data, the at least one segmented string can be aggregated and sent to the second device; a part of the segmented string can be sent to the second device first, and then another part of the segmented string can be sent to the second device (i.e., sent in batches); each segmented string can be sent to the second device as soon as it is obtained (if there are character marks, the sending order and combination can be inferred by inverse), etc., which is not limited here.
[0293] To summarize, based on the fact that a valid character string is a collection of characters located at valid positions, it is possible to avoid the problem of data occupation by redundant high-order data in the character storage process with the help of targeted analysis of the valid character string; in addition, the characters in the valid character string are segmented and summarized with the help of the segmentation process, so as to further realize the overall management of the characters, and use at least one segmented character string as the compressed data for the element array, which is not only conducive to reducing the space occupied by the storage element array, but also conducive to improving the network transmission efficiency of the transmission element array.
[0294] In the embodiment of the present application, the process of performing the above-mentioned data processing method and data transmission based on the pre-agreed mutual translation protocol between the first device and the second device is introduced. Taking the first device as the sender as an example, any one of the four translation strategies represented by the data processing method is adopted based on the mutual translation protocol to obtain at least one segmented string for compressing the element array, and then at least one segmented string representing the compressed data is sent to the second device as the receiver; the second device can restore at least one segmented string based on the mutual translation protocol and the mutual translation strategy corresponding to the translation strategy, and know the element array represented by at least one segmented string, thereby further reducing the data occupation while improving the security of data transmission between the first device and the second device and improving the reliability of device communication.
[0295] In an optional embodiment, the above data processing method is called "a signaling serialization design based on variable length and difference", such as Fig. 9 As shown, the method can be implemented as the following steps 910 to 950.
[0296] Step 910: Obtain original signaling.
[0297] Signaling refers to control instructions in a communication system and is a general term for structures used to transmit messages between two services. Original signaling is signaling before data processing. Optionally, the purpose of obtaining original signaling is to compress the original signaling to avoid problems such as low signaling transmission efficiency caused by redundant information.
[0298] Optionally, the original signaling is implemented as the above-mentioned data processing instruction, which includes an element array; or, the original signaling is implemented as the above-mentioned element array, etc.
[0299] Schematically, the original signaling is composed of multiple instruction fields, each instruction field is represented by at least one data element, and the data elements corresponding to the multiple instruction fields are combined to obtain an element array.
[0300] Step 920, determine whether the data element in the original signaling is of the target value type.
[0301] Illustratively, after obtaining the original signaling, it is determined whether the data element therein is of the target numerical type, that is, it is determined whether the data type corresponding to the data element is a predetermined target numerical type.
[0302] Optionally, the target value type is a pre-selected data type, such as an integer, including int, short, long and byte. If it is determined that the data type corresponding to the data element is an integer, the data element in the original signaling is determined to be the target value type.
[0303] Illustratively, if the data element in the original signaling is of the target value type, execute the following steps 931 to 932; if the data element in the original signaling is not of the target value type, execute the following step 940.
[0304] Step 931, performing difference calculation on adjacent data elements.
[0305] The difference refers to storing only the starting value for consecutive values, and storing only the difference between the value and the previous value for subsequent values. Schematically, the difference calculation is performed on an element array including multiple data elements, that is, determining the difference between two adjacent data elements in the element array.
[0306] Optionally, difference calculation is performed on adjacent data elements to obtain difference elements corresponding to a plurality of data elements, wherein the first difference element is the first data element.
[0307] In some embodiments, the following description is made by taking an int type field in the original signaling as an example.
[0308] After serialization, the contents of the int element array [100 102 110 120] in memory are implemented as follows.
[0309] [00000000 00000000 00000000 01100100,
[0310] 00000000 00000000 00000000 01100110,
[0311] 00000000 00000000 00000000 01101110, 00000000 00000000 00000000 01111000]
[0313] Among them, the element array occupies a total of 16 bytes of memory (each byte occupies eight bits / character bits) and 64 binary bits (each binary bit represents one bit).
[0314] Optionally, based on the problem of occupying a large number of bytes, the element array can be firstly subjected to difference calculation to reduce the numerical values of the data elements other than the first data element in the element array, that is, to reduce the number of binary bits required to represent the numerical value.
[0315] Based on the difference calculation of the element array [100 102 110 120], the difference array is realized as [100 2810], which includes 4 difference elements. For example, taking difference element 2 as an example, there is a corresponding relationship between this difference element and data element 102. The binary form of difference element 2 is 10, occupying 2 bits; the binary form of data element 102 is 1100110, occupying 7 bits. It is obvious that the number of binary bits occupied by the difference element is significantly reduced.
[0316] Step 932, convert the value into variable length.
[0317] Schematically, programming languages usually use fixed bytes to store different data types, and variable length means that the storage length of a data type is not fixed. Variable length is opposite to fixed length. Fixed length data is usually implemented as int type data, short type data, etc., in which a large number of redundant high-bit 0s are stored in binary, and the transmission and serialization efficiency is low.
[0318] Among them, serialization refers to converting logically structured data into continuous binary content for transmission.
[0319] Optionally, variable-length processing is performed on fixed-length data, and in the process of obtaining a shorter character string through variable-length processing, the process is performed in a translation manner.
[0320] In some embodiments, the difference array after difference processing is translated, and the translation rules are as follows: the valid binary bits are segmented from right to left, and each 6-digit binary bit is a group, and 0 is added if it is less than a group.
[0321] Among them, the valid binary bit represents the valid bit, and the character stored in the valid bit can be called the valid bit character. A valid character string is obtained by combining multiple valid bit characters; the valid character string is segmented according to the translation direction from right to left; wherein 6 is used to represent the preset number of translation bits, thereby obtaining multiple segmented character strings based on the segmentation processing.
[0322] Indicative, such as Fig.10 As shown, it is a schematic diagram for obtaining segmented strings.
[0323] The element array 1010 is implemented as [100 102 110 120], and the difference array 1020 obtained after difference processing of the element array 1010 is implemented as [100 2 8 10]. The acquisition of a segmented character string for the difference element 100 in the difference array 1020 is taken as an example for description.
[0324] The 32-bit binary form of the difference element 100 (i.e., binary string 1030) is implemented as 0000000000000000 00000000 01100100; wherein the valid binary is 1100100 (valid string is 1100100), the length is 7 bits, and the valid string can be segmented based on the preset number of translation bits 6, and can also be filled based on the fact that the preset number of translation bits is not met after segmentation, thereby obtaining two groups of translation strings 1040. The first group of translation strings is 100100, and the second group of translation strings is 000001, and the grouping is performed from right to left.
[0325] In some embodiments, a mark bit is used to indicate whether the current translation string is the last set of binary representation segments of the value, wherein the mark bit is a binary character used for marking, and does not indicate the content of the value, that is, the above-mentioned character mark.
[0326] Indicatively, different values of the marker bits represent different meanings, such as: a marker bit with a value of 1 represents the end, that is, the group is the last binary representation segment; a marker bit with a value of 0 indicates that the group is still within the representation range of the current value. Based on this rule, it is determined that after processing the first group 100100 with the marker bit, 0100100 is obtained; it is determined that after processing the second group 000001 with the marker bit, 1000001 is obtained, that is, two segmented character strings 1050 are obtained, and the two segmented character strings 1050 can be represented from right to left, that is, the comprehensive representation is: The two segmented strings 1050 can also be represented from left to right, that is, the comprehensive representation is:
[0327] Among them, the underlined part is the binary representation of the data element, and the bold part is the mark bit.
[0328] Optionally, based on the mark bit rule, after knowing 0100100 1000001 and the preset number of translation bits, a valid character string can be restored, and then it is known that the data element after decryption is 100.
[0329] From the above content, it can be seen that after translation, only 14 bits are needed to represent the binary content of data element 100. Compared with the 32 bits occupied when storing fixed-length data before, the size of the binary after serialization is greatly reduced.
[0330] In some embodiments, the combined difference array and translation processing can further reduce the volume of the binary content after serialization, that is, obtain at least one segmented string after compression processing to represent the compressed data.
[0331] Indicatively, the content of the second element 102 in the data element [100 102 110 120] after the above translation process is obtained: The size is 14 bits; however, if the difference processing and translation processing are combined, only the difference element 2 needs to be analyzed, so that the receiving end (such as the second device mentioned above) can convert it into 102 through the inverse operation. Among them, the content after the translation of 2 is 1000010, with a total length of 7 bits, which is larger than the original 102. The volume is 14 bits, which is further compressed by half.
[0332] Here, since the receiving end is a device that receives and deciphers data elements from the transmitting end (such as the first device mentioned above) for performing translation processing, there is a mutual translation relationship between the transmitting end and the receiving end for performing translation and deciphering.
[0333] It is worth noting that the above are merely illustrative examples and are not limited to the embodiments of the present application.
[0334] Step 940, normal serialization logic.
[0335] Indicatively, if the data element in the original signaling is not of the target value type, the element array is serialized and combined using a fixed-length data transmission method.
[0336] Step 950, execute the sending process.
[0337] In schematic form, based on a numerical variable-length translation process or a common serialization logic process, compressed data is obtained after compressing the element array in the original signaling, such as at least one segmented string mentioned above, etc. Based on the compression process, the space occupied by the original signaling is also effectively reduced, that is, the compressed original signaling is obtained.
[0338] Optionally, the compressed original signaling is sent to the receiving end; or, the compressed data is sent to the receiving end, etc., which is not limited here.
[0339] In some embodiments, the data processing method provided in the embodiments of the present application can be applied to the background service of game voice (Game, Voice, GVoice). For example, when two devices communicate with each other, such as terminal-to-terminal communication, terminal-to-server communication, server-to-server communication, etc.
[0340] Indicative, such as Fig.11 As shown, it is a schematic diagram of the game interface, which includes a main virtual object 1110 controlled by the player. The player can publish game voice during the game, and the game voice can be compressed and processed by the above-mentioned data processing method.
[0341] Indicative, such as Fig.12As shown, it is a schematic diagram of the game entry interface, which includes a large number of master virtual objects 1210, master virtual objects 1220, etc. controlled by players respectively. Players can also publish game voices such as team voices or square voices during the game waiting process. The game voices can be compressed and processed by the above-mentioned data processing method, which is not limited here.
[0342] Among them, by translating the original signaling into variable length according to the above process in advance, the binary volume after serialization is saved, the bandwidth is optimized and the input / output (IO) throughput pressure of the server is also reduced.
[0343] It is worth noting that the above are merely illustrative examples and are not limited to the embodiments of the present application.
[0344] To summarize, based on the fact that a valid character string is a collection of characters located at valid positions, it is possible to avoid the problem of data occupation by redundant high-order data in the character storage process with the help of targeted analysis of the valid character string; in addition, the characters in the valid character string are segmented and summarized with the help of the segmentation process, so as to further realize the overall management of the characters, and use at least one segmented character string as the compressed data for the element array, which is not only conducive to reducing the space occupied by the storage element array, but also conducive to improving the network transmission efficiency of the transmission element array.
[0345] In the embodiments of the present application, a novel privatized numerical translation method is introduced, in which fixed-length numerical values are represented by variable-length binary strings, and continuous numerical values are stored by differences, so as to further reduce the serialized expression, and correspondingly reduce the volume of the transmitted binary signaling, thereby greatly saving the signaling flow rate in the data transmission service process, and can greatly improve the transmission efficiency and IO throughput while ensuring the serialization efficiency, and at the same time greatly save the bandwidth generated by the signaling.
[0346] Fig.13 is a structural block diagram of a data processing device provided by an exemplary embodiment of the present application, such as Fig.13 As shown, the device includes the following parts:
[0347] The instruction receiving module 1310 is used to receive a data processing instruction, wherein the data processing instruction includes an element array, the element array includes data elements, and the data processing instruction is used to instruct to process the data represented by the element array;
[0348] A binary conversion module 1320, configured to perform binary conversion on the data element based on the data type corresponding to the data element to obtain a binary string, wherein the data type corresponding to the data element corresponds to the first bit number during binary conversion;
[0349] A segmentation processing module 1330 is used to segment the valid character string in the binary character string according to a preset number of translation bits to obtain at least one segmented character string as compressed data of the element array, wherein the valid character string is a set of characters located at valid bits, and the preset number of translation bits is less than the first number of bits;
[0350] The data processing module 1340 is configured to perform data processing on the at least one segmented character string based on the data processing instruction.
[0351] In an optional embodiment, the segmentation processing module 1330 is also used to perform character recognition on the binary string to obtain the valid string composed of at least one valid bit character, and the valid bit character is a character located on the valid bit; according to the preset translation direction, the valid string is segmented with the preset translation bit number to obtain the at least one segmented string.
[0352] In an optional embodiment, the segmentation processing module 1330 is also used to, in response to the number of valid bits corresponding to the valid character string being greater than the preset number of translation bits, perform at least one segmentation process on the valid character string according to the translation direction from right to left with the preset number of translation bits to obtain multiple segmentation results; in response to the first segmentation result including the valid bit characters and the number of characters does not reach the preset number of translation bits, pad the first segmentation result with a first value to obtain multiple segmented character strings.
[0353] In an optional embodiment, the segmentation processing module 1330 is also used to identify valid bits of the binary string to determine at least one valid bit in the binary string; and obtain the characters located at the at least one valid bit according to the character arrangement order in the binary string to obtain the valid string.
[0354] In an optional embodiment, the segmentation processing module 1330 is also used to segment the valid character string in the binary character string with the preset number of translation bits to obtain at least one translation character string, and the translation character string is used to represent the segmentation result obtained after segmenting the valid character string based on the preset translation bit value; based on the string position of the translation character string in the valid character string, character marks are added to the translation character string to obtain the segmented character strings corresponding to the at least one translation character string, and the segmented character strings are used to decipher the data elements in the element array; and at least one segmented character string is used as the compressed data corresponding to the element array.
[0355] In an optional embodiment, the segmentation processing module 1330 is further used to perform position analysis on the at least one translated string based on a preset translation direction, and in response to the presence of other translated strings after the first translated string, add a first numerical value as the character marker to the first translated string to obtain the segmented string corresponding to the first translated string; or, in response to the second translated string being the last translated string in the at least one translated string, add a second numerical value as the character marker to the second translated string to obtain the segmented string corresponding to the second translated string.
[0356] In an optional embodiment, the element array consists of a plurality of data elements;
[0357] The base conversion module 1320 is also used to obtain a difference array based on the difference between two adjacent data elements in the multiple data elements, wherein the difference array includes multiple difference elements, and the multiple difference elements correspond one-to-one to the multiple data elements; wherein the first difference element is the first data element in the multiple data elements, and the multiple difference elements are respectively used as elements for performing binary conversion to obtain the binary string.
[0358] In an optional embodiment, the base conversion module 1320 is further used to perform binary conversion on the difference elements corresponding to the multiple data elements respectively based on the data types corresponding to the data elements, so as to obtain the binary strings corresponding to the multiple difference elements respectively.
[0359] In an optional embodiment, the segmentation processing module 1330 is also used to segment the binary string according to the preset number of translation bits to obtain multiple candidate segmentation results; based on the existence of valid bit characters in the multiple candidate segmentation results, the multiple candidate segmentation results are screened to obtain the at least one segmented string including the valid bit characters, and the valid bit characters are characters located on the valid bits.
[0360] In an optional embodiment, the segmentation processing module 1330 is further configured to use the candidate segmentation results having the valid bit characters as the segmentation character string, and obtain the at least one segmentation character string after screening the multiple candidate segmentation results.
[0361] In an optional embodiment, the apparatus is deployed on a first device;
[0362] The data processing module 1340 is also used to send the at least one segmented string to a second device that is communicatively connected to the first device, and the second device is used to decode to obtain the element array; wherein an inter-translation protocol is agreed upon between the first device and the second device, and the inter-translation protocol is used to assist the first device to obtain the at least one segmented string, and assist the second device to decipher to obtain the element array.
[0363] To summarize, based on the fact that a valid character string is a collection of characters located at valid positions, it is possible to avoid the problem of data occupation by redundant high-order data in the character storage process with the help of targeted analysis of the valid character string; in addition, the characters in the valid character string are segmented and summarized with the help of the segmentation process, so as to further realize the overall management of the characters, and use at least one segmented character string as the compressed data for the element array, which is not only conducive to reducing the space occupied by the storage element array, but also conducive to improving the network transmission efficiency of the transmission element array.
[0364] It should be noted that the data processing device provided in the above embodiment is only illustrated by the division of the above functional modules. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the data processing device provided in the above embodiment and the data processing method embodiment belong to the same concept. The specific implementation process is detailed in the method embodiment and will not be repeated here.
[0365] Fig.14 The schematic diagram of the structure of a server provided by an exemplary embodiment of the present application is shown. The server 1400 includes a central processing unit (CPU) 1401, a system memory 1404 including a random access memory (RAM) 1402 and a read-only memory (ROM) 1403, and a system bus 1405 connecting the system memory 1404 and the central processing unit 1401. The server 1400 also includes a mass storage device 1406 for storing an operating system 1413, an application program 1414, and other program modules 1415.
[0366] The mass storage device 1406 is connected to the central processing unit 1401 through a mass storage controller (not shown) connected to the system bus 1405. The mass storage device 1406 and its associated computer readable media provide non-volatile storage for the server 1400. That is, the mass storage device 1406 may include a computer readable medium (not shown) such as a hard disk or a compact disc read only memory (CD-ROM) drive.
[0367] Without loss of generality, computer readable media may include computer storage media and communication media. Computer storage media include volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information such as computer readable instructions, data structures, program modules or other data. The above-mentioned system memory 1404 and mass storage device 1406 can be collectively referred to as memory.
[0368] According to various embodiments of the present application, the server 1400 can also be connected to a remote computer on the network through a network such as the Internet. That is, the server 1400 can be connected to the network 1412 through the network interface unit 1411 connected to the system bus 1405, or the network interface unit 1411 can be used to connect to other types of networks or remote computer systems (not shown).
[0369] The above-mentioned memory also includes one or more programs, and the one or more programs are stored in the memory and configured to be executed by the CPU.
[0370] An embodiment of the present application also provides a computer device, which includes a processor and a memory, in which at least one instruction, at least one program, a code set or an instruction set is stored, and the at least one instruction, at least one program, a code set or an instruction set is loaded and executed by the processor to implement the data processing methods provided by the above-mentioned method embodiments.
[0371] An embodiment of the present application also provides a computer-readable storage medium, on which is stored at least one instruction, at least one program, code set or instruction set, and the at least one instruction, at least one program, code set or instruction set is loaded and executed by a processor to implement the data processing methods provided by the above-mentioned method embodiments.
[0372] The embodiments of the present application also provide a computer program product or a computer program, which includes a computer instruction stored in a computer-readable storage medium. The processor of the computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes the data processing method described in any of the above embodiments.
[0373] The above description is only an optional 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 shall be included in the protection scope of the present application.
Claims
1. A data processing method, characterized in that: The method comprises: receiving a data processing instruction, wherein the data processing instruction includes an element array, the element array includes data elements, and the data processing instruction is used to instruct processing of data represented by the element array; Based on the data type corresponding to the data element, perform binary conversion on the data element to obtain a binary string, wherein the data type corresponding to the data element corresponds to the first bit number during binary conversion; Segmenting the valid character string in the binary character string with a preset number of translation bits to obtain at least one segmented character string as compressed data of the element array, wherein the valid character string is a set of characters located at valid bits, and the preset number of translation bits is less than the first number of bits; Based on the data processing instruction, data processing is performed on the at least one segmented character string.
2. The method according to claim 1, characterized in that The segmenting of the valid character string in the binary character string with the preset number of translation bits to obtain at least one segmented character string includes: Performing character recognition on the binary character string to obtain the valid character string consisting of at least one valid bit character, where the valid bit character is a character located at the valid bit; According to a preset translation direction, the valid character string is segmented with the preset number of translation bits to obtain the at least one segmented character string.
3. The method according to claim 2, characterized in that The step of segmenting the valid character string according to the preset translation direction and the preset number of translation bits to obtain the at least one segmented character string includes: In response to the number of valid bits corresponding to the valid character string being greater than the preset number of translation bits, segmenting the valid character string at least once according to the preset translation direction from right to left with the preset number of translation bits to obtain a plurality of segmentation results; In response to the first segmentation result including the valid bit characters and the number of characters does not reach the preset number of translation bits, the first segmentation result is padded with a first value to obtain a plurality of segment character strings.
4. The method according to claim 2, characterized in that: The performing character recognition on the binary character string to obtain the valid character string consisting of at least one valid bit character comprises: Performing valid bit identification on the binary string to determine at least one valid bit in the binary string; According to the character arrangement order in the binary character string, characters located at the at least one valid position are obtained to obtain the valid character string.
5. The method according to any one of claims 1 to 4, characterized in that: The segmenting of the valid character string in the binary character string with the preset number of translation bits to obtain at least one segmented character string includes: Segmenting the valid character string in the binary character string with the preset number of translation bits to obtain at least one translation character string, wherein the translation character string is used to represent the segmentation result obtained after segmenting the valid character string based on the preset translation bit value; Based on the string position of the translated string in the valid string, a character mark is added to the translated string to obtain the segmented strings respectively corresponding to the at least one translated string, wherein the segmented strings are used to decipher the data elements in the element array; At least one segmented character string is used as the compressed data corresponding to the element array.
6. The method according to claim 5, characterized in that The adding of character marks in the translated string based on the string position of the translated string in the valid string to obtain the segmented strings respectively corresponding to the at least one translated string includes: Performing position analysis on the at least one translated string based on a preset translation direction, and in response to the presence of other translated strings after the first translated string, adding a first numerical value as the character marker to the first translated string to obtain the segmented string corresponding to the first translated string; or In response to the second translated string being the last translated string of the at least one translated string, a second numerical value is added to the second translated string as the character marker to obtain the segmented string corresponding to the second translated string.
7. The method according to any one of claims 1 to 4, characterized in that: The element array consists of a plurality of data elements; The method further comprises: Based on the difference between two adjacent data elements in the plurality of data elements, a difference array is obtained, wherein the difference array includes a plurality of difference elements, and the plurality of difference elements correspond one to one to the plurality of data elements; The first difference element is the first data element among the multiple data elements, and the multiple difference elements are elements used for binary conversion to obtain the binary string.
8. The method according to claim 7, characterized in that The step of performing binary conversion on the data element based on the data type corresponding to the data element to obtain a binary string includes: Based on the data types corresponding to the data elements, binary conversion is performed on the difference elements respectively corresponding to the multiple data elements to obtain the binary character strings respectively corresponding to the multiple difference elements.
9. The method according to claim 1, characterized in that: The segmenting of the valid character string in the binary character string with the preset number of translation bits to obtain at least one segmented character string includes: Segmenting the binary string according to the preset number of translation bits to obtain a plurality of candidate segmentation results; Based on the existence of valid position characters in the multiple candidate segmentation results, the multiple candidate segmentation results are screened to obtain the at least one segmentation string including the valid position characters, where the valid position characters are characters located at the valid positions.
10. The method according to claim 9, characterized in that The screening of the plurality of candidate segmentation results based on the presence of valid characters in the plurality of candidate segmentation results to obtain the at least one segmentation string including the valid characters comprises: The candidate segmentation results having the valid characters are used as the segmentation character string, and the at least one segmentation character string is obtained after the plurality of candidate segmentation results are screened.
11. The method according to any one of claims 1 to 4, characterized in that: The method is performed by a first device; The step of performing data processing on the at least one segmented character string based on the data processing instruction comprises: Based on the data processing instruction, the at least one segmented string is sent to a second device in communication with the first device, and the second device is used to decode to obtain the element array; There is an inter-translation protocol agreed upon between the first device and the second device, and the inter-translation protocol is used to assist the first device to obtain the at least one segmented string and assist the second device to decipher and obtain the element array.
12. A data processing device, characterized in that: The device comprises: An instruction receiving module, used for receiving a data processing instruction, wherein the data processing instruction includes an element array, the element array includes data elements, and the data processing instruction is used for instructing to process the data represented by the element array; A binary conversion module, used for performing binary conversion on the data element based on the data type corresponding to the data element to obtain a binary string, wherein the data type corresponding to the data element corresponds to the first bit number during binary conversion; A segmentation processing module, used for segmenting a valid character string in the binary character string with a preset number of translation bits to obtain at least one segmented character string as compressed data of the element array, wherein the valid character string is a set of characters located at valid bits, and the preset number of translation bits is less than the first number of bits; A data processing module is used to perform data processing on the at least one segmented character string based on the data processing instruction.
13. A computer device, characterized in that: The computer device includes a processor and a memory, wherein the memory stores at least one program, and the at least one program is loaded and executed by the processor to implement the data processing method according to any one of claims 1 to 11.
14. A computer-readable storage medium, characterized in that: The storage medium stores at least one program, and the at least one program is loaded and executed by the processor to implement the data processing method according to any one of claims 1 to 11.
15. A computer program product, characterized in that It comprises computer instructions, which, when executed by a processor, implement the data processing method according to any one of claims 1 to 11.