CN108829831B - Data processing method and device, hardware device and chip - Google Patents

Data processing method and device, hardware device and chip Download PDF

Info

Publication number
CN108829831B
CN108829831B CN201810623996.XA CN201810623996A CN108829831B CN 108829831 B CN108829831 B CN 108829831B CN 201810623996 A CN201810623996 A CN 201810623996A CN 108829831 B CN108829831 B CN 108829831B
Authority
CN
China
Prior art keywords
data
layer
data structure
pure
reading
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201810623996.XA
Other languages
Chinese (zh)
Other versions
CN108829831A (en
Inventor
鲁勇
刘海平
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Intengine Technology Co Ltd
Original Assignee
Beijing Intengine Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Intengine Technology Co Ltd filed Critical Beijing Intengine Technology Co Ltd
Priority to CN201810623996.XA priority Critical patent/CN108829831B/en
Publication of CN108829831A publication Critical patent/CN108829831A/en
Application granted granted Critical
Publication of CN108829831B publication Critical patent/CN108829831B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Semiconductor Memories (AREA)

Abstract

The invention discloses a data processing method, a data processing device, a hardware device and a chip, wherein the structure of a target storage multidimensional array obtained by the method is simple, and complex and redundant information such as an added identifier, a separator and the like does not exist in each element of the multidimensional array in the structure of the target storage multidimensional array, so that the efficiency of the method for storing the multidimensional array in the prior art is improved to a certain extent.

Description

Data processing method and device, hardware device and chip
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a data processing method, an apparatus, a hardware apparatus, and a chip.
Background
In the prior art, when a multidimensional array to be stored is stored as a target multidimensional array, a plurality of complex and redundant information such as identifiers, separators, description fields, etc. are generally added between elements of the multidimensional array to be stored, so as to form the target multidimensional array to be stored, and the target multidimensional array is stored. This results in a low efficiency of the prior art method for storing multidimensional arrays, because of the numerous complex and redundant information such as identifiers, separators, description fields, etc. to be added between the elements of the multidimensional arrays to be stored.
Disclosure of Invention
The invention aims to provide a data processing method, a data processing device, a hardware device and a chip, which are used for solving the problem of low efficiency of the method for storing a multidimensional array in the prior art.
In order to achieve the purpose, the technical scheme of the invention is as follows:
the invention provides a data processing method, which comprises the following steps:
acquiring a multidimensional array to be stored;
acquiring the number N of data layers, wherein N is not less than 2;
determining a first data structure as a data structure of layer 1 data, wherein the first data structure comprises a first part and a second part, the first part is arranged in front of the second part, the second part comprises the multi-dimensional array to be stored, the first part comprises identification information, the identification information comprises the type of data included in the second part, the length of data of a pure data structure, and the amount of data of the first data structure included in the second part;
if N is 2, determining the multidimensional array to be stored in the pure data structure as data of a layer 2, wherein the data of the pure data structure is data in a character string format;
nesting the layer-2 data in a second part of the layer-1 data to obtain a target storage multidimensional array;
if N is greater than 2, responding to a determination instruction of a user, and determining data of the 2 nd to N th layers, wherein the structure of any layer of data in the 2 nd to N-1 th layers of data is the data of at least one first data structure, or the data of at least one first data structure and the data of a pure data structure, and the structure of the data of the N th layer is the pure data structure;
acquiring the nesting position of each layer of data in the data of the 2 nd to the N th layers, wherein the nesting position of each layer of data refers to a second part in at least one first data structure in the data of the upper layer of the layer of data;
and nesting each layer of data in the data of the 2 nd to the N th layers in a corresponding nesting position to obtain the target storage multidimensional array, wherein the data in the target storage multidimensional array is the multidimensional array to be stored.
Further, after obtaining the target storage multidimensional array, the method further includes:
if the layer 1 data does not include data of a pure data structure, and the layer 1 data includes at least one data of the first data structure, reading the data of the at least one first data structure included in the layer 1 data;
if the layer 1 data comprises data of a pure data structure and the layer 1 data does not comprise at least one data of the first data structure, reading the data of the pure data structure in the layer 1 data;
if the layer 1 data comprises data of a pure data structure and the layer 1 data comprises at least one data of the first data structure, reading the data of the pure data structure in the layer 1 data;
and after the data of the pure data structure included in the layer 1 data is read, reading the data of at least one first data structure included in the layer 1 data.
Further, reading the data of the pure data structure included in the layer 1 data specifically includes:
reading any element in the data of the pure data structure included in the layer 1 data;
subtracting 1 from the length of the data of the pure data structure included in the layer 1 data;
if the current layer 1 data does not comprise the data of the pure data structure, determining that the data of the pure data structure in the layer 1 data is completely read;
if the current layer 1 data comprises data of a pure data structure, reading any element in the data of the current layer 1 data comprising the pure data structure;
subtracting 1 from the length of the data of the pure data structure included in the current layer 1 data;
if the current layer 1 data comprises data of a pure data structure, executing an operation of reading any element in the data of the current layer 1 data comprising the pure data structure;
and if the current layer 1 data does not comprise the data of the pure data structure, determining that the data of the pure data structure in the layer 1 data is completely read.
Further, reading data of at least one first data structure included in the layer 1 data specifically includes:
reading data of any one first data structure included in the layer 1 data;
subtracting 1 from the number of data of any of the first data structures included in the layer 1 data;
if the current layer 1 data does not include the data of the first data structure, determining that the reading of at least one piece of data of the first data structure included in the layer 1 data is finished;
if the current layer 1 data comprises the data of the first data structure, reading the data of any first data structure in the data of the first data structure in the current layer 1 data;
subtracting 1 from the number of data of any one of the first data structures included in the current layer 1 data;
if the current layer 1 data comprises the data of the first data structure, executing an operation of reading the data of any one first data structure in the data of the first data structure in the current layer 1 data;
and if the current layer 1 data does not comprise the data of the first data structure, determining that the reading of at least one piece of data of the first data structure in the layer 1 data is finished.
Further, reading data of any one of the first data structures included in the layer 1 data specifically includes:
if the data of the first data structure does not comprise the data of a pure data structure, and the data of the first data structure comprises at least one data of the first data structure, reading at least one data of the first data structure contained in the data of the first data structure;
if the data of the first data structure comprises the data of a pure data structure, and the data of the first data structure does not comprise at least one data of the first data structure, reading the data of the pure data structure contained in the data of the first data structure;
if the data of the first data structure comprises the data of a pure data structure and the data of the first data structure comprises at least one data of the first data structure, reading the data of the pure data structure contained in the data of the first data structure;
after the data of the pure data structure included in the data of the first data structure is read, reading the data of at least one first data structure included in the data of the first data structure.
Further, reading the data of the pure data structure included in the data of the first data structure specifically includes:
reading any element in the data of the pure data structure included in the data of the first data structure;
subtracting 1 from the length of the data of the pure data structure included in the data of the first data structure;
if the current data of the first data structure does not comprise the data of the pure data structure, determining that the data of the pure data structure contained in the data of the first data structure is completely read;
if the data of the current first data structure comprises the data of the pure data structure, reading any element in the data of the current first data structure comprising the data of the pure data structure;
subtracting 1 from the length of the data of the pure data structure included in the data of the current first data structure;
if the data of the current first data structure comprises the data of the pure data structure, executing an operation of reading any element in the data of the current first data structure comprising the data of the pure data structure;
and if the data of the current first data structure does not comprise the data of the pure data structure, determining that the data of the pure data structure included in the data of the first data structure is completely read.
Further, reading at least one data of the first data structure included in the data of the first data structure specifically includes:
reading any data of the first data structure included in the data of the first data structure;
subtracting 1 from the number of data of any one of the first data structures included in the data of the first data structure;
if the data of the first data structure does not comprise the data of the first data structure, determining that the reading of the data of at least one first data structure in the layer 1 data is finished;
if the data of the current first data structure comprises the data of the first data structure, reading the data of any one first data structure in the data of the current first data structure;
subtracting 1 from the number of data of any one first data structure included in the data of the current first data structure;
if the data of the current first data structure comprises the data of the first data structure, executing an operation of reading the data of any one first data structure in the data of the current first data structure;
if the data of the current first data structure comprises the data of the first data structure, executing an operation of reading the data of any one first data structure in the data of the current first data structure;
and if the data of the current first data structure does not comprise the data of the first data structure, determining that the reading of at least one data of the first data structure in the data of the first data structure is finished.
The present invention provides a data processing apparatus, the apparatus comprising:
the acquisition module is used for acquiring the multidimensional array to be stored;
the acquiring module is further configured to acquire a data layer number N, where N is not less than 2;
a determining module, configured to determine a first data structure as a data structure of layer 1 data, where the first data structure includes a first portion and a second portion, the first portion is arranged in front of the second portion, the second portion includes the multidimensional array to be stored, the first portion includes identification information, and the identification information includes a type of data included in the second portion, a length of data of a pure data structure, and a number of data of the first data structure included in the second portion;
the determining module is further configured to determine the multidimensional array to be stored in the pure data structure as data of a layer 2 if N is 2, where the data of the pure data structure is data in a string format;
the nesting module is used for nesting the layer 2 data in a second part of the layer 1 data to obtain a target storage multidimensional array;
the determining module is further configured to determine, in response to a determination instruction of a user, data of layers 2 to N if N >2, where a structure of any layer of data of the layers 2 to N-1 is data of at least one of the first data structures, or data of at least one of the first data structures and data of one pure data structure, and a structure of the layer N is a pure data structure;
the acquiring module is further configured to acquire a nesting position of each layer of data in the layer of data from 2 nd to N th, where the nesting position of each layer of data refers to a second part in at least one first data structure in the previous layer of data of the layer of data;
the nesting module is further configured to nest each layer of data in the layers 2 to N at a corresponding nesting position to obtain the target storage multidimensional array, where data in the target storage multidimensional array is the multidimensional array to be stored.
The present invention also provides a data processing hardware device, comprising:
a memory for storing non-transitory computer readable instructions; and
a processor, configured to execute the computer readable instructions, so that the computer readable instructions, when executed by the processor, implement the data processing method of any of the foregoing implementations.
The present invention also provides a storage medium for storing non-transitory computer-readable instructions which, when executed by a computer, cause the computer to perform the data processing method of any of the above-described implementations.
The invention also provides a chip for executing the data processing method of any one of the above implementation modes.
The invention has the following advantages:
in the invention, a first data structure is determined as a data structure of layer 1 data by obtaining a multidimensional array to be stored, wherein N is not less than 2, the first data structure comprises a first part and a second part, the first part is arranged in front of the second part, the second part comprises the multidimensional array to be stored, the first part comprises identification information, the identification information comprises the type of data included in the second part, the length of data of a pure data structure, and the number of data of the first data structure included in the second part, if N is 2, the multidimensional array to be stored of the pure data structure is determined as layer 2 data, wherein the data of the pure data structure is data in a character string format, and the layer 2 data is nested in the second part of the layer 1 data, obtaining a target storage multidimensional array, if N is more than 2, determining the data of the 2 nd to N th layers in response to a determination instruction of a user, wherein the structure of any layer data in the layer data from 2 to N-1 is the data of at least one first data structure, or at least one data of the first data structure and one data of a pure data structure, wherein the structure of the Nth layer of data is a pure data structure, the nesting position of each layer of data in the 2 nd to the N th layers of data is obtained, and nesting each layer of data in the 2 nd to N layer of data at a corresponding nesting position to obtain the target storage multidimensional array, wherein the nesting position of each layer of data refers to a second part in at least one first data structure in the last layer of data of the layer of data, and the data in the target storage multidimensional array is the multidimensional array to be stored. And the data in the target storage multidimensional array is the multidimensional array to be stored. Because the structure of the target storage multidimensional array is simple, complex and redundant information such as an added identifier, a separator and the like does not exist in each element of the multidimensional array in the structure of the target storage multidimensional array, and the efficiency of the method for storing the multidimensional array in the prior art is improved to a certain extent.
Drawings
FIG. 1 is a schematic flow chart of a data processing method according to the present invention;
FIG. 2 is a schematic structural diagram of a two-layer data target storage multidimensional array according to the present invention;
FIG. 3 is a schematic structural diagram of another two-level data target storage multidimensional array provided by the present invention;
FIG. 4 is a schematic structural diagram of another two-level data target storage multidimensional array provided by the present invention;
FIG. 5 is a flowchart illustrating a method for resolving a multidimensional array of a target storage according to the present invention;
FIG. 6 is a schematic structural diagram of a data processing apparatus according to the present invention;
fig. 7 is a schematic structural diagram of an analysis apparatus provided in the present invention.
Detailed Description
The following examples are intended to illustrate the invention but are not intended to limit the scope of the invention.
Example 1
In embodiment 1 of the present invention, an execution main body may be, but is not limited to, a user terminal such as a mobile phone, a tablet Computer, or a Personal Computer (PC), or an Application (APP) running on the user terminal, or may also be a device such as a server.
The flow diagram of the method can be seen in fig. 1, and the method comprises the following steps:
and S101, acquiring a multidimensional array to be stored.
S102, acquiring the number N of data layers, wherein N is not less than 2.
N input by a user or N sent by other clients can be received.
S103, determining a first data structure as a data structure of layer 1 data, wherein the first data structure comprises a first part and a second part, the first part is arranged in front of the second part, the second part comprises the multi-dimensional array to be stored, the first part comprises identification information, and the identification information comprises the type of data included in the second part, the length of data of a pure data structure, and the number of data of the first data structure included in the second part.
And S104, if N is 2, determining the multidimensional array to be stored in the pure data structure as the data of the layer 2.
The data of the pure data structure may be data of any structure except the first data structure, such as integer or floating point numbers.
S105, nesting the layer 2 data in the second part of the layer 1 data to obtain the target storage multidimensional array.
S106, if N is greater than 2, responding to a determination instruction of a user, and determining data of the data 2 to the data of the data 2 to the data of the data N-1, wherein the structure of the data 2 to the data of the data N-1 is the data of at least one first data structure, or the data of the at least one first data structure and the.
The user's specific instruction may include the data structure and content of each layer of data. The user specification command may be a command generated by specifying data input by the user, or may be a command transmitted from another client.
S107, acquiring the nesting position of each layer of data in the 2 nd to N layer of data, wherein the nesting position of each layer of data refers to a second part in at least one first data structure in the previous layer of data of the layer of data.
S107 can be executed in response to a user position determination instruction, where the user position determination instruction includes a nesting position of each layer of data in the 2 nd to N th layers of data. The instruction may be generated by the client as a result of the user inputting preset information in the client, or may be sent by another client.
And S108, nesting each layer of data in the data from the 2 nd to the N th layers at a corresponding nesting position to obtain a target storage multi-dimensional array, wherein the data in the target storage multi-dimensional array is the multi-dimensional array to be stored.
The format of the identification information included in the first part may be a preset data format, for example, the preset data format may be: the preset data format may be in other formats and may be set according to actual requirements. In addition, the scale of the identification information included in the first part may be any scale, and the data length of the identification information included in the first part may be any length, which is not limited in any way in embodiment 1 of the present invention.
It should be noted that, if each layer of data in the layer 2 to layer N-1 data includes at least one data of the first data structure and at least one data of the pure data structure, the data of the at least one pure data structure may be arranged in front of the data of the at least one first data structure.
To make the reader aware of what the structure of the target storage multidimensional array comprising at least two layers of data is, the following is exemplified:
for example, referring to FIG. 2, FIG. 2 is a schematic diagram of a structure of a target storage multidimensional array comprising two layers of data. The data in the first row of rectangles is layer 1 data, the data in the second row of rectangles is layer two data, and the layer two data is nested in the data body of the layer 1 data, wherein the data body is equivalent to the second part mentioned above, and the data header is equivalent to the first part mentioned above. One header + data body in the second layer data may be referred to as a data unit. The first header + body in the second layer data is data unit 0, the second header + body in the second layer data is data unit 1, and the third header + body in the second layer data is data unit 2.
For another example, referring to fig. 3, fig. 3 is a schematic diagram of a structure of a target storage multidimensional array comprising two layers of data. The data in the first row of rectangles is layer 1 data, the data in the second row of rectangles is layer two data, and the layer two data is nested in the data body of the layer 1 data.
A header of the first layer data, i.e. a first part of a first data structure in layer 1 data; the data volume is a second portion of the first data structure in layer 1 data. 2, 2, 3, is data in a pure data structure in second layer data, [0C0], is a first part in a first data structure in second layer data, X (0, 0, 0), X (0, 1, 0), X (1, 0, 0), … …, X (1, 1, 2), is a second part in the first data structure in second layer data.
The first portion [031] in the first data structure in layer 1 data is hexadecimal data, 12 bits. [031] In the above description, 0 represents that the type of data in the data volume is 0, and what type of data 0 represents may be defined in advance and may be set according to actual conditions. 3 indicates the length of the data in the pure data structure, how long the length of the data represented by 3 can be specified in advance, 1 indicates the number of the first data structures, and how many the number represented by 1 can be specified in advance. Here, 3 may represent that the length of data is 3 and 1 represents the number of 1.
Data 2, 2, 3 of the pure data structure in the second layer data, indicates that the size of the multidimensional array to be stored is 2 x 3. The first part [0C0] in the first data structure in the second layer data is hexadecimal data, and in [0C0], the first 0 represents the type of data in the data volume to be 0, wherein, what type of data the 0 represents can be defined in advance, and can be set according to actual situations. C represents the length of data in a pure data structure, and how long the length of data represented by C can be specified in advance, and the second 0 represents the number of first data structures, and how many the number represented by 1 can be specified in advance. Here, C may represent that the length of data is 12 and 0 represents the number of 0.
For another example, referring to fig. 4, fig. 4 is a schematic diagram of a structure of a target storage multidimensional array comprising two layers of data. The data in the first row of rectangles is layer 1 data, the data in the second row of rectangles is layer two data, and the layer two data is nested in the data body of the layer 1 data. [003] Is a first portion of a first data structure in layer 1 data; the data volume is a second portion of the first data structure in layer 1 data.
The first [040] is a first portion in a first data structure in second layer data, [ X (0, 0, 0), X (0, 1, 0), X (1, 0, 0), X (1, 1, 0) ] is a second portion in the first data structure. The second [040] is a first portion in a second first data structure in second layer data, [ X (0, 0, 1), X (0, 1, 1), X (1, 0, 1), X (1, 1, 1) ] is a second portion in the first data structure. The third [040] is a first portion in a third first data structure in second layer data, [ X (0, 0, 2), X (0, 1, 2), X (1, 0, 2), X (1, 1, 2) ] is a second portion in the first data structure.
The first part of the first data structure in layer 1 data is hexadecimal data, 12 bits. [003] The first 0 indicates that the type of data in the data volume is 0, and it can be defined in advance what type of data 0 represents, and can be set according to actual conditions. Second 0, which represents the length of the data of the pure data structure, it can be previously defined how long the length of the data represented by 0 is, and 3 represents the number of the first data structure, and it can be previously defined what the number represented by 3 is. Here, 0 may represent that the length of data is 0 and 3 represents that the number is 3.
The first part in the first data structure in the second layer data is hexadecimal data, [040] the first 0 indicates that the type of data in the data volume is 0, and it can be specified in advance what type of data the 0 represents, and it can be set according to actual circumstances. 4 indicates the length of the data of the pure data structure, and how long the length of the data represented by 4 can be previously defined, and the second 0 indicates the number of the first data structure, and how many the number represented by 0 can be previously defined. Here, C may represent that the length of data is 12 and 0 represents the number of 0.
FIG. 4 shows a target storage multi-dimensional array comprising two layers of data, which is a 4 x 3 size multi-dimensional array. The first part of embodiment 1 of the present invention is simpler and less complex.
In one implementation scenario, after obtaining the target storage multidimensional array, the following operations may be further performed:
if the data of the pure data structure is not included in the layer 1 data and the layer 1 data includes the data of at least one first data structure, reading the data of at least one first data structure included in the layer 1 data;
if the layer 1 data comprises data of a pure data structure and the layer 1 data does not comprise at least one data of a first data structure, reading the data of the pure data structure in the layer 1 data;
if the layer 1 data comprises data of a pure data structure and the layer 1 data comprises at least one data of a first data structure, reading the data of the pure data structure in the layer 1 data;
after reading the data of the pure data structure included in the layer 1 data, reading the data of at least one first data structure included in the layer 1 data.
In an implementation scenario, data of a pure data structure included in the layer 1 data is read, and the specific implementation manner is as follows:
reading any element in the data of the pure data structure in the layer 1 data;
subtracting 1 from the length of the data of the pure data structure included in the layer 1 data;
if the current layer 1 data does not comprise the data of the pure data structure, determining that the data of the pure data structure in the layer 1 data is completely read;
if the current layer 1 data comprises data of a pure data structure, reading any element in the current layer 1 data comprising the data of the pure data structure;
subtracting 1 from the length of the data of the pure data structure included in the current layer 1 data;
if the current layer 1 data comprises the data of the pure data structure, executing an operation of reading any element in the data of the current layer 1 data comprising the pure data structure;
and if the current layer 1 data does not comprise the data of the pure data structure, determining that the data of the pure data structure in the layer 1 data is completely read.
In an implementation scenario, data of at least one first data structure included in the layer 1 data is read, and the specific implementation manner is as follows:
reading data of any first data structure included in the layer 1 data;
subtracting 1 from the number of data of any first data structure included in the layer 1 data;
if the current layer 1 data does not include the data of the first data structure, determining that the reading of the data of at least one first data structure included in the layer 1 data is finished;
if the current layer 1 data comprises data of a first data structure, reading the data of any first data structure in the data of the first data structure in the current layer 1 data;
subtracting 1 from the number of data of any first data structure included in the current layer 1 data;
if the current layer 1 data comprises the data of the first data structure, executing an operation of reading the data of any first data structure in the data of the first data structure in the current layer 1 data;
and if the current layer 1 data does not comprise the data of the first data structure, determining that the reading of the data of at least one first data structure in the layer 1 data is finished.
In an implementation scenario, reading data of any first data structure included in the layer 1 data, specifically, the implementation manner is as follows:
if the data of the first data structure does not comprise the data of the pure data structure, and the data of the first data structure comprises at least one data of the first data structure, reading the data of the at least one first data structure contained in the data of the first data structure;
if the data of the first data structure comprises the data of a pure data structure, and the data of the first data structure does not comprise at least one data of the first data structure, reading the data of the pure data structure contained in the data of the first data structure;
if the data of the first data structure comprises the data of a pure data structure and the data of the first data structure comprises at least one data of the first data structure, reading the data of the pure data structure contained in the data of the first data structure;
after reading the data of the pure data structure included in the data of the first data structure, reading the data of at least one first data structure included in the data of the first data structure.
In an implementation scenario, the data of the pure data structure included in the data of the first data structure is read, and the specific implementation manner is as follows:
reading any element in the data of the pure data structure included in the data of the first data structure;
subtracting 1 from the length of the data of the pure data structure included in the data of the first data structure;
if the current data of the first data structure does not comprise the data of the pure data structure, determining that the data of the pure data structure contained in the data of the first data structure is completely read;
if the data of the current first data structure comprises the data of the pure data structure, reading any element in the data of the current first data structure comprising the data of the pure data structure;
subtracting 1 from the length of the data of the pure data structure included in the data of the first data structure;
if the data of the current first data structure comprises the data of the pure data structure, executing an operation of reading any element in the data of the current first data structure comprising the data of the pure data structure;
and if the data of the first data structure does not comprise the data of the pure data structure currently, determining that the data of the pure data structure included in the data of the first data structure is completely read.
In an implementation scenario, reading data of at least one first data structure included in the data of the first data structure, specifically implemented as follows:
reading any data of the first data structure included in the data of the first data structure;
subtracting 1 from the number of data of any one of the first data structures included in the data of the first data structure;
if the data of the first data structure does not comprise the data of the first data structure, determining that the data of at least one first data structure in the layer 1 data is completely read;
if the data of the current first data structure comprises the data of the first data structure, reading the data of any one first data structure in the data of the first data structure contained in the data of the current first data structure;
subtracting 1 from the number of data of any one first data structure included in the data of the current first data structure;
if the data of the current first data structure comprises the data of the first data structure, executing an operation of reading the data of any one first data structure in the data of the first data structure contained in the data of the current first data structure;
if the data of the current first data structure comprises the data of the first data structure, executing an operation of reading the data of any one first data structure in the data of the first data structure contained in the data of the current first data structure;
and if the data of the first data structure does not comprise the data of the first data structure currently, determining that the reading of at least one piece of data of the first data structure in the data of the first data structure is finished.
Example 2
An embodiment 2 of the present invention provides a data processing method for analyzing a target storage multidimensional array, including:
s201, analyzing the identification information of the first part in the current layer 1 data.
S202, judging whether the length of the data of the pure data structure in the current layer 1 data is greater than 0 according to the identification information.
If the length of the data of the pure data structure in the current layer 1 data is judged to be larger than 0, S203 is executed, otherwise, S206 is executed.
S203, reading out one element in the data of the pure data structure in the current layer 1 data.
And S204, subtracting 1 from the length of the data of the pure data structure in the current layer 1 data.
S205, judging whether the length of the data of the pure data structure in the current layer 1 data is larger than 0.
If the length of the data of the pure data structure in the current layer 1 data is judged to be not more than 0, S206 is executed; otherwise, S203 is executed.
S206, judging whether the number of the data of the first data structure in the current layer 1 data is more than 0 according to the identification information.
If the number of the data of the first data structure in the current layer 1 data is judged to be more than 0, executing S207; otherwise, the process is ended.
S207, reading data of any first data structure in the current layer 1 data.
The process of reading each layer of data in any of the first data structures in the current layer 1 data is similar to the process of reading the second portion of the layer 1 data.
Specifically, the identification information of the first part in the data of any one of the current first data structures is analyzed, according to the identification information, whether the length of the data of the pure data structure in the data of any one of the current first data structures is greater than 0 is judged, if it is judged that the length of the data of the pure data structure in the data of any one of the current first data structures is not greater than 0, according to the identification information, whether the number of the data of any one of the current first data structures is greater than 0 is judged, if it is judged that the number of the data of any one of the current first data structures is not greater than 0, S206 is executed, otherwise, the data of the first data structure included in the data of any one of the current first data structures is read. If the length of the data of the pure data structure in the data of any one of the first data structures is judged to be larger than 0, reading one element in the data of the pure data structure in the data of any one of the first data structures, subtracting 1 from the length of the data of the pure data structure in the data of any one of the first data structures, judging whether the length of the data of the pure data structure in the data of any one of the first data structures is larger than 0, if the length of the data of the pure data structure in the data of any one of the first data structures is judged to be larger than 0, executing an operation of reading one element in the data of the pure data structure in any one of the first data structures, otherwise, judging whether the number of the data of any one of the first data structures is larger than 0 according to the identification information, if the number of the data of any one of the first data structures is judged to be not larger than 0, and S206 is executed, otherwise, the data of the first data structure included in the data of any one first data structure is read.
For the operation of reading the data of the first data structure included in the data of the first data structure in each layer of data, reference may be made to the above specific implementation manner of reading the data of any first data structure in the current layer 1 data, but the current layer 1 data is replaced by each layer of data, and details are not described later.
And S208, subtracting 1 from the data of the first data structure in the current layer 1 data.
S209, judging whether the number of the data of the first data structure in the current layer 1 data is more than 0.
If the number of the data of the first data structure in the current layer 1 data is judged to be more than 0, executing S207; otherwise, the process is ended.
It should be noted that, as long as the first part of the layer 1 data is acquired, the execution main body in embodiment 1 of the present invention is triggered to execute S201 to S209, and the target storage multidimensional array may be analyzed without any other intervention.
For example, referring to FIG. 5, FIG. 5 is a flow chart illustrating a method for resolving a target storage multidimensional array, the method performing the following operations:
1. the data head analyzes to obtain the length of the data of the pure data structure in the layer 1 data and the number of the data of the first data structure, 2, the data is read until the length of the data of the pure data structure is 0, the data is read in the first data structure, 3, the process of reading the data of the first data structure is similar to the process of reading the data head and the data body in the layer 1 data, after one time, the number of the data of the first data structure is subtracted by 1, 4, and when the number of the data of the first data structure in the layer 1 data is 0, all reading is finished.
Example 3
Embodiment 3 of the present invention further provides a data processing apparatus, a schematic structural diagram of which can be seen in fig. 6, the data processing apparatus including:
the obtaining module 21 is configured to obtain a multidimensional array to be stored.
The obtaining module 21 is further configured to obtain a number N of data layers, where N is not less than 2;
a determining module 22, configured to determine a first data structure as a data structure of layer 1 data, where the first data structure includes a first portion and a second portion, the first portion is arranged in front of the second portion, the second portion includes the multidimensional array to be stored, the first portion includes identification information, and the identification information includes a type of data included in the second portion, a length of data of a pure data structure, and a number of data of the first data structure included in the second portion.
The determining module 22 is further configured to determine the multidimensional array to be stored in the pure data structure as the layer 2 data if N is 2.
And the nesting module 23 is configured to nest the layer 2 data in the second part of the layer 1 data to obtain the target storage multidimensional array.
The determining module 22 is further configured to determine, if N >2, data of layers 2 to N in response to a determination instruction of a user, where a structure of any layer of data of the layers 2 to N-1 is data of at least one first data structure, or data of at least one first data structure and data of one pure data structure, and a structure of the layer N is a pure data structure.
The obtaining module 21 is further configured to obtain a nesting position of each layer of data in the layer data from 2 nd to N th, where the nesting position of each layer of data refers to a second portion in at least one first data structure in the layer data above the layer of data.
The nesting module 23 is further configured to nest each layer of data in the layers 2 to N at a corresponding nesting position to obtain a target storage multidimensional array, where data in the target storage multidimensional array is a multidimensional array to be stored.
Embodiment 3 of the present invention further provides a data processing hardware device, where the hardware device includes:
a memory for storing non-transitory computer readable instructions; and
a processor for executing the computer readable instructions, so that the computer readable instructions, when executed by the processor, implement the data processing method for implementing any of the implementations mentioned in embodiments 1 and 2.
Embodiment 3 of the present invention also provides a storage medium for storing non-transitory computer-readable instructions, which, when executed by a computer, cause the computer to execute the data processing method according to any one of the implementation manners described in embodiments 1 and 2.
Embodiment 3 of the present invention also provides a chip, where the chip is configured to execute the data processing method according to any one of the implementation manners mentioned in embodiments 1 and 2.
In embodiment 3 of the present invention, there is further provided an analysis apparatus, a schematic structural diagram of which is shown in fig. 7, including: count unit, data reading unit, data head analysis unit, wherein:
1) when the counting unit is in an initial state, the lengths of all the data in the pure data structure and the number of the data in the first data structure are both 0, and at this time, the data reading unit is controlled to read in the data head through 3 in fig. 7;
2) the data reading unit sends the data head to the data head analysis unit through the data head 1;
3) according to the header information, the header parsing unit sends the data length and the number of data of the first data structure to the counting unit through 2 in fig. 7;
4) according to the difference of the data layer number N, N groups of counters are correspondingly arranged in the counting unit to record the data length and the number of data of the first data structure;
5) the counting unit controls the data reading unit to read in all data through the 3 control data reading unit in fig. 7, and returns to the initialization state;
6) returning to the operation of the step 1) until the data code stream is finished.
In the invention, a first data structure is determined as a data structure of layer 1 data by obtaining a multidimensional array to be stored, wherein N is not less than 2, the first data structure comprises a first part and a second part, the first part is arranged in front of the second part, the second part comprises the multidimensional array to be stored, the first part comprises identification information, the identification information comprises the type of data included in the second part, the length of data of a pure data structure and the number of data of the first data structure included in the second part, if N is greater than 2, the layer 2 to N data is determined in response to a determination instruction of a user, wherein the structure of any layer data in the layer 2 to N-1 data is the data of at least one first data structure, or the data of at least one first data structure and the data of one pure data structure are adopted by the data of the Nth layer, the structure of the data of the Nth layer is a pure data structure, the nesting position of each layer of data in the data of the 2 nd to the Nth layer is obtained, wherein the nesting position of each layer of data refers to the second part in at least one first data structure in the data of the last layer of the data of the layer, each layer of data in the data of the 2 nd to the Nth layer is nested at the corresponding nesting position, and a target storage multidimensional array is obtained, wherein the data in the target storage multidimensional array is the multidimensional array to be stored. And the data in the target storage multidimensional array is the multidimensional array to be stored. Because the structure of the target storage multidimensional array is simple, complex and redundant information such as an added identifier, a separator and the like does not exist in each element of the multidimensional array in the structure of the target storage multidimensional array, and the efficiency of the method for storing the multidimensional array in the prior art is improved to a certain extent.
In addition, in the prior art, when the multidimensional array of the target storage is analyzed, complex and redundant information such as identifiers and separators added to elements of the multidimensional array in the structure of the target storage multidimensional array needs to be removed, and then the multidimensional array to be stored can be analyzed, so that the process is complicated and the efficiency is low.
Moreover, as long as the first part of the layer 1 data is acquired, the data processing method provided by the invention is triggered to analyze the target storage multidimensional array, other intervention is not needed, and the efficiency is high.
The technical features mentioned in examples 1 to 3 can be freely combined, and the present invention is not limited to this.
Although the invention has been described in detail above with reference to a general description and specific examples, it will be apparent to one skilled in the art that modifications or improvements may be made thereto based on the invention. Accordingly, such modifications and improvements are intended to be within the scope of the invention as claimed.

Claims (10)

1. A method of data processing, the method comprising:
acquiring a multidimensional array to be stored;
acquiring the number N of data layers, wherein N is not less than 2;
determining a first data structure as a data structure of layer 1 data, wherein the first data structure comprises a first part and a second part, the first part is arranged in front of the second part, the second part comprises the multi-dimensional array to be stored, the first part comprises identification information, the identification information comprises the type of data included in the second part, the length of data of a pure data structure, and the amount of data of the first data structure included in the second part;
if N is 2, determining the multidimensional array to be stored in the pure data structure as the data of the layer 2;
nesting the layer-2 data in a second part of the layer-1 data to obtain a target storage multidimensional array;
if N is greater than 2, responding to a determination instruction of a user, and determining data of the 2 nd to N th layers, wherein the structure of any layer of data in the 2 nd to N-1 th layers of data is the data of at least one first data structure, or the data of at least one first data structure and the data of a pure data structure, and the structure of the data of the N th layer is the pure data structure;
acquiring the nesting position of each layer of data in the data of the 2 nd to the N th layers, wherein the nesting position of each layer of data refers to a second part in at least one first data structure in the data of the upper layer of the layer of data;
and nesting each layer of data in the data of the 2 nd to the N th layers in a corresponding nesting position to obtain the target storage multidimensional array, wherein the data in the target storage multidimensional array is the multidimensional array to be stored.
2. The method of claim 1, wherein after obtaining the target storage multidimensional array, the method further comprises:
if the layer 1 data does not include data of a pure data structure, and the layer 1 data includes at least one data of the first data structure, reading the data of the at least one first data structure included in the layer 1 data;
if the layer 1 data comprises data of a pure data structure and the layer 1 data does not comprise at least one data of the first data structure, reading the data of the pure data structure in the layer 1 data;
if the layer 1 data comprises data of a pure data structure and the layer 1 data comprises at least one data of the first data structure, reading the data of the pure data structure in the layer 1 data;
and after the data of the pure data structure included in the layer 1 data is read, reading the data of at least one first data structure included in the layer 1 data.
3. The method according to claim 2, wherein reading the data of the pure data structure included in the layer 1 data specifically includes:
reading any element in the data of the pure data structure included in the layer 1 data;
subtracting 1 from the length of the data of the pure data structure included in the layer 1 data;
if the current layer 1 data does not comprise the data of the pure data structure, determining that the data of the pure data structure in the layer 1 data is completely read;
if the current layer 1 data comprises data of a pure data structure, reading any element in the data of the current layer 1 data comprising the pure data structure;
subtracting 1 from the length of the data of the pure data structure included in the current layer 1 data;
if the current layer 1 data comprises data of a pure data structure, executing an operation of reading any element in the data of the current layer 1 data comprising the pure data structure;
and if the current layer 1 data does not comprise the data of the pure data structure, determining that the data of the pure data structure in the layer 1 data is completely read.
4. The method according to claim 2, wherein reading data of at least one of the first data structures included in the layer 1 data specifically includes:
reading data of any one first data structure included in the layer 1 data;
subtracting 1 from the number of data of any of the first data structures included in the layer 1 data;
if the current layer 1 data does not include the data of the first data structure, determining that the reading of at least one piece of data of the first data structure included in the layer 1 data is finished;
if the current layer 1 data comprises the data of the first data structure, reading the data of any first data structure in the data of the first data structure in the current layer 1 data;
subtracting 1 from the number of data of any one of the first data structures included in the current layer 1 data;
if the current layer 1 data comprises the data of the first data structure, executing an operation of reading the data of any one first data structure in the data of the first data structure in the current layer 1 data;
and if the current layer 1 data does not comprise the data of the first data structure, determining that the reading of at least one piece of data of the first data structure in the layer 1 data is finished.
5. The method according to claim 4, wherein reading data of any of the first data structures included in the layer 1 data specifically includes:
if the data of the first data structure does not comprise the data of a pure data structure, and the data of the first data structure comprises at least one data of the first data structure, reading at least one data of the first data structure contained in the data of the first data structure;
if the data of the first data structure comprises the data of a pure data structure, and the data of the first data structure does not comprise at least one data of the first data structure, reading the data of the pure data structure contained in the data of the first data structure;
if the data of the first data structure comprises the data of a pure data structure and the data of the first data structure comprises at least one data of the first data structure, reading the data of the pure data structure contained in the data of the first data structure;
after the data of the pure data structure included in the data of the first data structure is read, reading the data of at least one first data structure included in the data of the first data structure.
6. The method of claim 5, wherein reading the data of the pure data structure included in the data of the first data structure comprises:
reading any element in the data of the pure data structure included in the data of the first data structure;
subtracting 1 from the length of the data of the pure data structure included in the data of the first data structure;
if the current data of the first data structure does not comprise the data of the pure data structure, determining that the data of the pure data structure contained in the data of the first data structure is completely read;
if the data of the current first data structure comprises the data of the pure data structure, reading any element in the data of the current first data structure comprising the data of the pure data structure;
subtracting 1 from the length of the data of the pure data structure included in the data of the current first data structure;
if the data of the current first data structure comprises the data of the pure data structure, executing an operation of reading any element in the data of the current first data structure comprising the data of the pure data structure;
and if the data of the current first data structure does not comprise the data of the pure data structure, determining that the data of the pure data structure included in the data of the first data structure is completely read.
7. The method according to claim 5, wherein reading data of at least one of the first data structures included in the data of the first data structure specifically comprises:
reading any data of the first data structure included in the data of the first data structure;
subtracting 1 from the number of data of any one of the first data structures included in the data of the first data structure;
if the data of the first data structure does not comprise the data of the first data structure, determining that the reading of the data of at least one first data structure in the layer 1 data is finished;
if the data of the current first data structure comprises the data of the first data structure, reading the data of any one first data structure in the data of the current first data structure;
subtracting 1 from the number of data of any one first data structure included in the data of the current first data structure;
if the data of the current first data structure comprises the data of the first data structure, executing an operation of reading the data of any one first data structure in the data of the current first data structure;
if the data of the current first data structure comprises the data of the first data structure, executing an operation of reading the data of any one first data structure in the data of the current first data structure;
and if the data of the current first data structure does not comprise the data of the first data structure, determining that the reading of at least one data of the first data structure in the data of the first data structure is finished.
8. A data processing apparatus, characterized in that the apparatus comprises:
the acquisition module is used for acquiring the multidimensional array to be stored;
the acquiring module is further configured to acquire a data layer number N, where N is not less than 2;
a determining module, configured to determine a first data structure as a data structure of layer 1 data, where the first data structure includes a first portion and a second portion, the first portion is arranged in front of the second portion, the second portion includes the multidimensional array to be stored, the first portion includes identification information, and the identification information includes a type of data included in the second portion, a length of data of a pure data structure, and a number of data of the first data structure included in the second portion;
the determining module is further configured to determine the multidimensional array to be stored in the pure data structure as the layer 2 data if N is 2;
the nesting module is used for nesting the layer 2 data in a second part of the layer 1 data to obtain a target storage multidimensional array;
the determining module is further configured to determine, in response to a determination instruction of a user, data of layers 2 to N if N >2, where a structure of any layer of data of the layers 2 to N-1 is data of at least one of the first data structures, or data of at least one of the first data structures and data of one pure data structure, and a structure of the layer N is a pure data structure;
the acquiring module is further configured to acquire a nesting position of each layer of data in the layer of data from 2 nd to N th, where the nesting position of each layer of data refers to a second part in at least one first data structure in the previous layer of data of the layer of data;
the nesting module is further configured to nest each layer of data in the layers 2 to N at a corresponding nesting position to obtain the target storage multidimensional array, where data in the target storage multidimensional array is the multidimensional array to be stored.
9. A data processing hardware apparatus, characterized in that the hardware apparatus comprises:
a memory for storing non-transitory computer readable instructions; and
a processor for executing the computer readable instructions such that the computer readable instructions, when executed by the processor, implement the data processing method of any one of claims 1 to 7.
10. A chip for carrying out the data processing method of any one of claims 1 to 7.
CN201810623996.XA 2018-06-15 2018-06-15 Data processing method and device, hardware device and chip Active CN108829831B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810623996.XA CN108829831B (en) 2018-06-15 2018-06-15 Data processing method and device, hardware device and chip

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810623996.XA CN108829831B (en) 2018-06-15 2018-06-15 Data processing method and device, hardware device and chip

Publications (2)

Publication Number Publication Date
CN108829831A CN108829831A (en) 2018-11-16
CN108829831B true CN108829831B (en) 2020-12-18

Family

ID=64141388

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810623996.XA Active CN108829831B (en) 2018-06-15 2018-06-15 Data processing method and device, hardware device and chip

Country Status (1)

Country Link
CN (1) CN108829831B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6957215B2 (en) * 2001-12-10 2005-10-18 Hywire Ltd. Multi-dimensional associative search engine
CN102982103A (en) * 2012-11-06 2013-03-20 东南大学 On-line analytical processing (OLAP) massive multidimensional data dimension storage method
CN105224532A (en) * 2014-05-28 2016-01-06 腾讯科技(深圳)有限公司 Data processing method and device
CN107656876A (en) * 2017-10-19 2018-02-02 浪潮金融信息技术有限公司 Date storage method and device, computer-readable recording medium, terminal

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10552393B2 (en) * 2015-10-23 2020-02-04 Oracle International Corporation System and method for use of a dynamic flow in a multidimensional database environment

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6957215B2 (en) * 2001-12-10 2005-10-18 Hywire Ltd. Multi-dimensional associative search engine
CN102982103A (en) * 2012-11-06 2013-03-20 东南大学 On-line analytical processing (OLAP) massive multidimensional data dimension storage method
CN105224532A (en) * 2014-05-28 2016-01-06 腾讯科技(深圳)有限公司 Data processing method and device
CN107656876A (en) * 2017-10-19 2018-02-02 浪潮金融信息技术有限公司 Date storage method and device, computer-readable recording medium, terminal

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
空间数据立方体的多维数据组织及存储;邹逸江;《地理与地理信息科学》;20060930;第26-30页 *

Also Published As

Publication number Publication date
CN108829831A (en) 2018-11-16

Similar Documents

Publication Publication Date Title
CN110209652B (en) Data table migration method, device, computer equipment and storage medium
CN109542889B (en) Stream data column storage method, device, equipment and storage medium
US8990792B2 (en) Method for constructing dynamic call graph of application
CN110209348B (en) Data storage method and device, electronic equipment and storage medium
US9747385B2 (en) Compression of cascading style sheet files
CN110321410B (en) Log extraction method and device, storage medium and electronic equipment
CN107689984B (en) Message pushing method and device, computer equipment and storage medium
CN110275703B (en) Method and device for assigning key value to data, computer equipment and storage medium
CN109656474B (en) Data storage method and device, computer equipment and storage medium
CN104182519A (en) File scanning method and device
CN112650529B (en) System and method for configurable generation of mobile terminal APP codes
CN108829831B (en) Data processing method and device, hardware device and chip
CN107169057B (en) Method and device for detecting repeated pictures
CN113377998A (en) Data loading method and device, electronic equipment and storage medium
CN111767161A (en) Remote calling depth recognition method and device, computer equipment and readable storage medium
CN109684207B (en) Method and device for packaging operation sequence, electronic equipment and storage medium
CN113157212B (en) Flash storage method and device, intelligent wearable device and storage medium
CN107977381B (en) Data configuration method, index management method, related device and computing equipment
CN113850265A (en) PDF document analysis method and device, electronic equipment and storage medium
CN107544090B (en) Seismic data analyzing and storing method based on MapReduce
CN112217896A (en) JSON message conversion method and related device
EP3942405A1 (en) Aliasing entities in recorded code
CN106649720B (en) Data processing method and server
CN115080026B (en) Plug-in control integration method and system based on low codes
CN111046012B (en) Method and device for extracting inspection log, storage medium and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant