CN104699692B - A kind of method and apparatus for handling data - Google Patents

A kind of method and apparatus for handling data Download PDF

Info

Publication number
CN104699692B
CN104699692B CN201310652055.6A CN201310652055A CN104699692B CN 104699692 B CN104699692 B CN 104699692B CN 201310652055 A CN201310652055 A CN 201310652055A CN 104699692 B CN104699692 B CN 104699692B
Authority
CN
China
Prior art keywords
instruction
server
block
client
longitudinal
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
CN201310652055.6A
Other languages
Chinese (zh)
Other versions
CN104699692A (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.)
Huawei Cloud Computing Technologies Co Ltd
Original Assignee
Huawei Technologies 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 Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN201310652055.6A priority Critical patent/CN104699692B/en
Priority to PCT/CN2014/086486 priority patent/WO2015081745A1/en
Publication of CN104699692A publication Critical patent/CN104699692A/en
Application granted granted Critical
Publication of CN104699692B publication Critical patent/CN104699692B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Transfer Between Computers (AREA)
  • Computer And Data Communications (AREA)

Abstract

The invention discloses a kind of method and apparatus for handling data, are related to field of computer technology, to save spatial cache.Method provided by the invention includes:Obtain the size of the memory space shared by the order parameter of the second instruction and the index point of the second instruction;Second instruction is that the latter adjacent with the first instruction instructs, and the index point of the first instruction is recorded in first longitudinal direction block;Judge whether the second instruction meets partition strategy according to the index point of the index point of the second instruction and the first instruction;When the second instruction meets partition strategy, second longitudinal direction block and Hash table corresponding with second longitudinal direction block are established;The index point of second instruction is recorded in second longitudinal direction block;The size of memory space according to shared by Hash table corresponding with second longitudinal direction block, the second order parameter instructed and the order parameter of the second instruction of index point caching of the second instruction.

Description

Method and device for processing data
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method and an apparatus for processing data.
Background
Catia is a common 3D design software that draws images primarily with the gldraawelements instruction. The glDrawElements instruction supports a list of vertex data, which contains an index pointer to the vertex data.
In the process of remotely rendering across a network to realize drawing of a 3D image, a scene that most of vertex data included in two frames of images to be drawn are the same is often encountered, and in the scene, if the two frames of images are drawn by using a gldrawbelements instruction, a server needs to repeatedly use the same vertex data in the process of rendering a first frame of image and a second frame of image, which requires that a client repeatedly sends an index pointer of the same vertex data to the server. Thus, when the data amount of the index pointer of the vertex data is large, the time for drawing the image is long.
In order to solve the above problem, in the process of drawing the first frame image, the server and the client buffer the index pointers of the same vertex data respectively, so that when drawing the second frame image, the client sends an indication message to the server when determining that the index pointer of the vertex data needed to be used for drawing the second frame image is the same as the index pointer of the locally buffered vertex data, so that the server can call the locally buffered index pointers of the same vertex data according to the indication message, and the problem of long time for drawing the image caused by repeatedly sending the index pointers of the same vertex data to the server by the client is avoided.
In the prior art, the buffering of the index pointers is generally realized by a Bitmap algorithm, because the distribution range of the index pointers is 1-232Therefore, when the index pointer is stored by using the algorithm, at least 4G of buffer space is needed. When the index pointers of the cached vertex data are scattered, a lot of cache space is wasted.
Disclosure of Invention
Embodiments of the present invention provide a method and an apparatus for processing data, which can save a cache space when index pointers of instructions in an instruction stream to be cached are relatively scattered.
In order to achieve the above purpose, the embodiment of the invention adopts the following technical scheme:
in a first aspect, a method for processing data is provided, which is applied to a client, where a cache space of the client includes a first vertical block, and an index pointer of a first instruction in a first independent instruction stream is recorded in the first vertical block; the method comprises the following steps:
acquiring the size of a storage space occupied by an instruction parameter of a second instruction and an index pointer of the second instruction; the second instruction is a subsequent instruction adjacent to the first instruction in the first independent instruction stream;
judging whether the second instruction meets a blocking strategy or not according to the index pointer of the second instruction and the index pointer of the first instruction; the blocking strategy comprises the following steps: the index pointers of two adjacent instructions in the same independent instruction stream are not continuous;
when the second instruction meets the blocking strategy, a second longitudinal block and a hash table corresponding to the second longitudinal block are established;
recording an index pointer of the second instruction in the second vertical block;
and caching the instruction parameter of the second instruction according to the hash table corresponding to the second longitudinal block, the size of the storage space occupied by the instruction parameter of the second instruction and the index pointer of the second instruction.
With reference to the first aspect, in a first possible implementation manner,
the blocking strategy specifically includes: the change amplitude of the index pointers of two adjacent instructions in the same independent instruction stream is greater than or equal to a first threshold value; the determining, according to the index pointer of the second instruction and the index pointer of the first instruction, whether the second instruction satisfies a blocking policy specifically includes:
judging whether the change amplitude of the index pointer of the second instruction relative to the index pointer of the first instruction is larger than or equal to a first threshold value or not;
or, the blocking policy specifically includes: the change rate of the index pointers of two adjacent instructions in the same independent instruction stream is greater than or equal to a second threshold value; the determining, according to the index pointer of the second instruction and the index pointer of the first instruction, whether the second instruction satisfies a blocking policy specifically includes:
and judging whether the change rate of the index pointer of the second instruction relative to the index pointer of the first instruction is larger than or equal to a second threshold value.
With reference to the first aspect, in a second possible implementation manner, after the establishing a second vertical block and a hash table corresponding to the second vertical block, the method further includes:
sending a first indication message to a server, wherein the first indication message is used for indicating the server to record the second instruction in the second longitudinal block; enabling the server to establish the second longitudinal block and a hash table corresponding to the second longitudinal block according to the first indication message, and recording an index pointer of the second instruction in the second longitudinal block;
the first indication message further includes a size of a storage space occupied by an instruction parameter of the second instruction, and after the caching of the instruction parameter of the second instruction according to the hash table corresponding to the second vertical block, the size of the storage space occupied by the instruction parameter of the second instruction, and the index pointer of the second instruction, the method further includes:
sending a second indication message to the server, wherein the second indication message is used for indicating the server to cache the instruction parameter of the second instruction according to the first indication message; and enabling the server to cache the instruction parameters of the second instruction according to the hash table corresponding to the second longitudinal block, the size of the storage space occupied by the instruction parameters of the second instruction and the index pointer of the second instruction.
With reference to the first aspect, in a third possible implementation manner, the first vertical block corresponds to a hash table, and the method further includes:
when the second instruction does not meet the blocking policy, recording an index pointer of the second instruction in the first longitudinal block;
and updating the hash table corresponding to the first longitudinal block according to the index pointer of the second instruction.
With reference to the third possible implementation manner of the first aspect, in a fourth possible implementation manner, after the updating, according to the index pointer of the second instruction, the hash table corresponding to the first vertical block, the method further includes:
sending a third indication message to the server, where the third indication message is used to indicate the server to record an index pointer of the second instruction in the first vertical block; and enabling the server to record the index pointer of the second instruction in the first longitudinal block according to the third indication message, and updating the hash table corresponding to the first longitudinal block according to the index pointer of the second instruction.
With reference to the first aspect, in a fifth possible implementation manner, after the establishing a second vertical block and a hash table corresponding to the second vertical block, the method further includes:
and connecting the first longitudinal block and the second longitudinal block through a linked list structure.
With reference to the fifth possible implementation manner of the first aspect, in a sixth possible implementation manner, the method further includes:
sending a fourth indication message to the server, where the fourth indication message is used to indicate the server to establish a connection relationship between the first vertical block and the second vertical block; and enabling the server to connect the first longitudinal block and the second longitudinal block through a linked list structure according to the fourth indication message.
With reference to the fifth possible implementation manner of the first aspect, in a seventh possible implementation manner, when the client has established a connection relationship between the vertical blocks, after caching the instruction parameter of the second instruction according to the hash table corresponding to the second vertical block, the size of the storage space occupied by the instruction parameter of the second instruction, and the index pointer of the second instruction, the method further includes:
and when the second instruction is obtained again, sequentially searching the longitudinal blocks recording the index pointer of the second instruction in the first longitudinal block group from the longitudinal block recording the index pointer of the previous instruction of the second instruction according to the connection relation between the longitudinal blocks, wherein the first longitudinal block group is formed by the longitudinal blocks recording the index pointers of the instructions in the first independent instruction stream. With reference to the seventh possible implementation manner of the first aspect, in an eighth possible implementation manner, the server has established a connection relationship between the vertical blocks; the method further comprises the following steps:
sending a fifth indication message to the server, where the fifth indication message includes information of a longitudinal block recording an index pointer of the second instruction, and the fifth indication message is used to indicate the server to obtain a cached instruction parameter of the second instruction; and the server side acquires a hash table corresponding to the longitudinal block recording the index pointer of the second instruction according to the connection relation between the longitudinal blocks and the information of the longitudinal block recording the index pointer of the second instruction, and acquires the cached instruction parameter of the second instruction according to the hash table corresponding to the longitudinal block recording the index pointer of the second instruction and the index pointer of the second instruction.
With reference to the fifth possible implementation manner of the first aspect, in a ninth possible implementation manner, the first instruction is a first instruction in the first independent instruction stream, and an index pointer of the first instruction is recorded in a first horizontal block, and the method further includes:
acquiring an index pointer of a first instruction in a second independent instruction stream, wherein the second independent instruction stream is a next independent instruction stream adjacent to the first independent instruction stream;
establishing a second transverse block;
recording an index pointer for a first instruction in the second independent instruction stream in the second horizontal block;
connecting the second transverse block with the first transverse block through a linked list structure;
and connecting the second transverse block with one longitudinal block in a second longitudinal block group through a linked list structure, wherein the second longitudinal block group is formed by longitudinal blocks recording index pointers of instructions in the second independent instruction stream.
With reference to the ninth possible implementation manner of the first aspect, in a tenth possible implementation manner, the method further includes:
sending a sixth indication message to the server, where the sixth indication message is used to indicate the server to establish the second transverse block for the second independent instruction stream; enabling the server to establish the second transverse block according to the sixth indication message, recording an index pointer of a first instruction in the second independent instruction stream in the second transverse block, and connecting the second transverse block with the first transverse block through a linked list structure; and connecting the second transverse block with a first longitudinal block in a longitudinal block group through a linked list structure, wherein the longitudinal block group is formed by longitudinal blocks recording index pointers of instructions in the second independent instruction stream.
With reference to the ninth possible implementation manner of the first aspect, in an eleventh possible implementation manner, in a case that the client has established a connection relationship between a horizontal block and a horizontal block, and a connection relationship between a horizontal block and a vertical block group, the method further includes:
when the first instruction in the second independent instruction stream is obtained again, searching and determining the transverse block for recording the index pointer of the first instruction in the second independent instruction stream according to the connection relation between the transverse blocks; and searching and recording the longitudinal block of the index pointer of the first instruction in the second independent instruction stream according to the connection relation between the transverse block and the longitudinal block group.
In a second aspect, a method for processing data is provided, which is applied to a server, where a cache space of the server includes a first vertical block, and an index pointer of a first instruction in a first independent instruction stream is recorded in the first vertical block; the method comprises the following steps:
receiving a first indication message sent by a client, wherein the first indication message is used for indicating the server to record the second instruction in a second longitudinal block;
establishing the second longitudinal block and a hash table corresponding to the second longitudinal block according to the first indication message, and recording an index pointer of the second instruction in the second longitudinal block;
the first indication message further includes a size of a storage space occupied by an instruction parameter of the second instruction, the method further comprising:
receiving a second indication message sent by the client, wherein the second indication message is used for indicating the server to cache the instruction parameter of the second instruction according to the first indication message;
and caching the instruction parameter of the second instruction according to the hash table corresponding to the second longitudinal block, the size of the storage space occupied by the instruction parameter of the second instruction and the index pointer of the second instruction.
With reference to the second aspect, in a first possible implementation manner, the method further includes:
receiving a third indication message sent by the client, where the third indication message is used to indicate the server to record an index pointer of the second instruction in the first vertical block;
recording an index pointer of the second instruction in the first vertical block according to the third indication message;
and updating the hash table corresponding to the first longitudinal block according to the index pointer of the second instruction.
With reference to the second aspect, in a second possible implementation manner, the method further includes:
receiving a fourth indication message sent by the client, where the fourth indication message is used to indicate the server to establish a connection relationship between the first vertical block and the second vertical block;
and connecting the first longitudinal block and the second longitudinal block through a linked list structure according to the fourth indication message.
With reference to the second possible implementation manner of the second aspect, in a third possible implementation manner, the server has already established a connection relationship between the vertical blocks; the method further comprises the following steps:
receiving a fifth indication message sent by the client, where the fifth indication message includes information of a longitudinal block recording an index pointer of the second instruction, and the fifth indication message is used to indicate the server to obtain a cached instruction parameter of the second instruction;
acquiring a hash table corresponding to the longitudinal block recording the index pointer of the second instruction according to the connection relation between the longitudinal blocks and the information of the longitudinal block recording the index pointer of the second instruction;
and acquiring the cached instruction parameters of the second instruction according to the hash table corresponding to the longitudinal block for recording the index pointer of the second instruction and the index pointer of the second instruction.
With reference to the second aspect, in a fourth possible implementation manner, the first instruction is a first instruction in the first independent instruction stream, and the method further includes:
receiving a sixth indication message sent by the client, where the sixth indication message is used to indicate the server to establish the second transverse block for the second independent instruction stream;
establishing the second horizontal block according to the sixth indication message;
recording an index pointer for a first instruction in the second independent instruction stream in the second horizontal block;
connecting the second transverse block with the first transverse block through a linked list structure;
and connecting the second transverse block with a first longitudinal block in a longitudinal block group through a linked list structure, wherein the longitudinal block group is formed by longitudinal blocks recording index pointers of instructions in the second independent instruction stream.
In a third aspect, a client is provided, where a cache space of the client includes a first vertical block, and an index pointer of a first instruction in a first independent instruction stream is recorded in the first vertical block; the client comprises:
the obtaining unit is used for obtaining the size of a storage space occupied by an instruction parameter of a second instruction and an index pointer of the second instruction; the second instruction is a subsequent instruction adjacent to the first instruction in the first independent instruction stream;
the judging unit is used for judging whether the second instruction meets a blocking strategy or not according to the index pointer of the second instruction and the index pointer of the first instruction; the blocking strategy comprises the following steps: the index pointers of two adjacent instructions in the same independent instruction stream are not continuous;
the establishing unit is used for establishing a second longitudinal block and a hash table corresponding to the second longitudinal block when the second instruction meets the blocking strategy;
a recording unit, configured to record an index pointer of the second instruction in the second vertical block;
and the cache unit is used for caching the instruction parameter of the second instruction according to the hash table corresponding to the second longitudinal block, the size of the storage space occupied by the instruction parameter of the second instruction and the index pointer of the second instruction.
With reference to the third aspect, in a first possible implementation manner,
the blocking strategy specifically includes: the change amplitude of the index pointers of two adjacent instructions in the same independent instruction stream is greater than or equal to a first threshold value; the judging unit is specifically configured to judge whether a variation amplitude of the index pointer of the second instruction with respect to the index pointer of the first instruction is greater than or equal to a first threshold;
or, the blocking policy specifically includes: the change rate of the index pointers of two adjacent instructions in the same independent instruction stream is greater than or equal to a second threshold value; the determining unit is specifically configured to determine whether a rate of change of the index pointer of the second instruction with respect to the index pointer of the first instruction is greater than or equal to a second threshold.
With reference to the third aspect, in a second possible implementation manner, the client further includes:
a sending unit, configured to send a first indication message to a server, where the first indication message is used to indicate the server to record the second instruction in the second vertical block; enabling the server to establish the second longitudinal block and a hash table corresponding to the second longitudinal block according to the first indication message, and recording an index pointer of the second instruction in the second longitudinal block;
the first indication message further includes a size of a storage space occupied by an instruction parameter of the second instruction, and the sending unit is further configured to send a second indication message to the server, where the second indication message is used to indicate the server to cache the instruction parameter of the second instruction according to the first indication message; and enabling the server to cache the instruction parameters of the second instruction according to the hash table corresponding to the second longitudinal block, the size of the storage space occupied by the instruction parameters of the second instruction and the index pointer of the second instruction.
With reference to the third aspect, in a third possible implementation manner, the first vertical block corresponds to a hash table;
the recording unit is further configured to record an index pointer of the second instruction in the first vertical block when the second instruction does not satisfy the blocking policy;
the client further comprises:
and the updating unit is used for updating the hash table corresponding to the first longitudinal block according to the index pointer of the second instruction.
With reference to the third possible implementation manner of the third aspect, in a fourth possible implementation manner, the sending unit is further configured to send a third indication message to the server, where the third indication message is used to indicate the server to record an index pointer of the second instruction in the first vertical block; and enabling the server to record the index pointer of the second instruction in the first longitudinal block according to the third indication message, and updating the hash table corresponding to the first longitudinal block according to the index pointer of the second instruction.
With reference to the third aspect, in a fifth possible implementation manner, the client further includes:
and the connecting unit is used for connecting the first longitudinal block and the second longitudinal block through a linked list structure.
With reference to the fifth possible implementation manner of the third aspect, in a sixth possible implementation manner, the sending unit is further configured to send a fourth indication message to the server, where the fourth indication message is used to indicate the server to establish a connection relationship between the first vertical block and the second vertical block; and enabling the server to connect the first longitudinal block and the second longitudinal block through a linked list structure according to the fourth indication message.
With reference to the fifth possible implementation manner of the third aspect, in a seventh possible implementation manner, the client further includes:
and when the second instruction is obtained again, sequentially searching the longitudinal blocks recording the index pointer of the second instruction in the first longitudinal block group according to the connection relationship between the longitudinal blocks, starting from the longitudinal block recording the index pointer of the previous instruction of the second instruction, wherein the first longitudinal block group is formed by the longitudinal blocks recording the index pointers of the instructions in the first independent instruction stream.
With reference to the seventh possible implementation manner of the third aspect, in an eighth possible implementation manner, the server has established a connection relationship between the vertical blocks;
the sending unit is further configured to send a fifth indication message to the server, where the fifth indication message includes information of a longitudinal block recording an index pointer of the second instruction, and the fifth indication message is used to indicate the server to obtain a cached instruction parameter of the second instruction; and the server side acquires a hash table corresponding to the longitudinal block recording the index pointer of the second instruction according to the connection relation between the longitudinal blocks and the information of the longitudinal block recording the index pointer of the second instruction, and acquires the cached instruction parameter of the second instruction according to the hash table corresponding to the longitudinal block recording the index pointer of the second instruction and the index pointer of the second instruction.
With reference to the fifth possible implementation manner of the third aspect, in a ninth possible implementation manner, the first instruction is a first instruction in the first independent instruction stream, and an index pointer of the first instruction is recorded in a first horizontal block;
the obtaining unit is further configured to obtain an index pointer of a first instruction in a second independent instruction stream, where the second independent instruction stream is a next independent instruction stream adjacent to the first independent instruction stream;
the establishing unit is further configured to establish a second horizontal block;
the recording unit is further configured to record an index pointer of a first instruction in the second independent instruction stream in the second horizontal block;
the connecting unit is further configured to connect the second horizontal block and the first horizontal block through a linked list structure; and connecting the second transverse block with one longitudinal block in a second longitudinal block group through a linked list structure, wherein the second longitudinal block group is formed by longitudinal blocks recording index pointers of instructions in the second independent instruction stream.
With reference to the ninth possible implementation manner of the third aspect, in a tenth possible implementation manner, the sending unit is further configured to send a sixth indication message to the server, where the sixth indication message is used to indicate the server to establish the second horizontal block for the second independent instruction stream; enabling the server to establish the second transverse block according to the sixth indication message, recording an index pointer of a first instruction in the second independent instruction stream in the second transverse block, and connecting the second transverse block with the first transverse block through a linked list structure; and connecting the second transverse block with a first longitudinal block in a longitudinal block group through a linked list structure, wherein the longitudinal block group is formed by longitudinal blocks recording index pointers of instructions in the second independent instruction stream.
With reference to the ninth possible implementation manner of the third aspect, in an eleventh possible implementation manner, the client already establishes a connection relationship between a horizontal block and a horizontal block, and a connection relationship between a horizontal block and a vertical block group, and the client further includes:
the searching unit is used for searching and determining the transverse block for recording the index pointer of the first instruction in the second independent instruction stream according to the connection relation between the transverse blocks when the first instruction in the second independent instruction stream is obtained again; and searching and recording the longitudinal block of the index pointer of the first instruction in the second independent instruction stream according to the connection relation between the transverse block and the longitudinal block group.
In a fourth aspect, a server is provided, where a cache space of the server includes a first vertical block, and an index pointer of a first instruction in a first independent instruction stream is recorded in the first vertical block; the server side comprises:
a receiving unit, configured to receive a first indication message sent by a client, where the first indication message is used to indicate the server to record the second instruction in a second vertical block;
the establishing unit is used for establishing the second longitudinal block and a hash table corresponding to the second longitudinal block according to the first indication message;
a recording unit, configured to record an index pointer of the second instruction in the second vertical block;
the first indication message further comprises the size of the storage space occupied by the instruction parameter of the second instruction; the receiving unit is further configured to receive a second indication message sent by the client, where the second indication message is used to indicate the server to cache an instruction parameter of the second instruction according to the first indication message;
the server side further comprises:
and the cache unit is used for caching the instruction parameter of the second instruction according to the hash table corresponding to the second longitudinal block, the size of the storage space occupied by the instruction parameter of the second instruction and the index pointer of the second instruction.
With reference to the fourth aspect, in a first possible implementation manner,
the receiving unit is further configured to receive a third indication message sent by the client, where the third indication message is used to instruct the server to record an index pointer of the second instruction in the first vertical block;
the recording unit is further configured to record an index pointer of the second instruction in the first vertical block according to the third indication message;
the server side further comprises:
and the updating unit is used for updating the hash table corresponding to the first longitudinal block according to the index pointer of the second instruction.
With reference to the fourth aspect, in a second possible implementation manner,
the receiving unit is further configured to receive a fourth indication message sent by the client, where the fourth indication message is used to indicate the server to establish a connection relationship between the first vertical block and the second vertical block;
the server side further comprises:
and the connecting unit is used for connecting the first longitudinal block and the second longitudinal block through a linked list structure according to the fourth indication message.
With reference to the second possible implementation manner of the fourth aspect, in a third possible implementation manner, the server has already established a connection relationship between the vertical blocks;
the receiving unit is further configured to receive a fifth indication message sent by the client, where the fifth indication message includes information of a longitudinal block recording an index pointer of the second instruction, and the fifth indication message is used to indicate the server to obtain a cached instruction parameter of the second instruction;
the server side further comprises:
the acquisition unit is used for acquiring a hash table corresponding to the longitudinal block recording the index pointer of the second instruction according to the connection relation between the longitudinal blocks and the information of the longitudinal block recording the index pointer of the second instruction; and acquiring the cached instruction parameters of the second instruction according to the hash table corresponding to the longitudinal block for recording the index pointer of the second instruction and the index pointer of the second instruction.
With reference to the fourth aspect, in a fourth possible implementation manner, the first instruction is a first instruction in the first independent instruction stream;
the receiving unit is further configured to receive a sixth indication message sent by the client, where the sixth indication message is used to indicate the server to establish the second horizontal block for the second independent instruction stream;
the establishing unit is further configured to establish the second horizontal block according to the sixth indication message;
the recording unit is further configured to record an index pointer of a first instruction in the second independent instruction stream in the second horizontal block;
the connecting unit is further configured to connect the second horizontal block and the first horizontal block through a linked list structure; and connecting the second transverse block with a first longitudinal block in a longitudinal block group through a linked list structure, wherein the longitudinal block group is formed by longitudinal blocks recording index pointers of instructions in the second independent instruction stream.
In the method and apparatus for processing data provided in the embodiment of the present invention, a cache space of a client includes a first vertical block in which an index pointer of a first instruction is recorded, when an index pointer of a second instruction is not continuous with an index pointer of the first instruction, a second vertical block and a hash table corresponding to the second vertical block are established, and the index pointer of the second instruction is recorded in the second vertical block; the second instruction and the first instruction are two instructions in the same independent instruction stream, and the second instruction is a next instruction adjacent to the first instruction; and caching the instruction parameter of the second instruction according to at least the hash table corresponding to the second longitudinal block. According to the scheme, two discontinuous index pointers in the same independent instruction stream are respectively recorded in different longitudinal blocks, and an independent hash table is established for each longitudinal block, so that when the instruction parameters of the instructions are cached, the index pointers between the two discontinuous index pointers do not need to be cached, and therefore when the index pointers of the instructions in the instruction stream to be cached are relatively dispersed, the caching space of the cached index pointers can be saved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other drawings can be obtained according to these drawings without creative efforts.
Fig. 1 is a schematic flow chart illustrating a method for processing data according to an embodiment of the present invention;
FIG. 2 is a flow chart illustrating another method for processing data according to an embodiment of the present invention;
FIG. 3 is a flow chart illustrating another method for processing data according to an embodiment of the present invention;
FIG. 4 is a flow chart illustrating another method for processing data according to an embodiment of the present invention;
FIG. 5 is a block diagram illustrating an instruction parameter of a cache instruction according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of a client according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of another client according to an embodiment of the present invention;
fig. 8 is a schematic structural diagram of another client according to an embodiment of the present invention;
fig. 9 is a schematic structural diagram of a server according to an embodiment of the present invention;
fig. 10 is a schematic structural diagram of another server according to an embodiment of the present invention;
fig. 11 is a schematic structural diagram of another server according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
To facilitate understanding of the embodiments of the present invention, a few elements introduced in the embodiments of the present invention will be described first:
(1) a first independent instruction stream: may be any independent instruction stream.
(2) A second independent instruction stream: when the first independent instruction stream and the second independent instruction stream are discussed simultaneously, the second independent instruction stream is a next independent instruction stream adjacent to the first independent instruction stream; when the second independent instruction stream is discussed separately, the second independent instruction stream may be any independent instruction stream.
(3) A first instruction: may be any instruction in the first independent instruction stream.
(4) A second instruction: when the first instruction and the second instruction are discussed simultaneously, the second instruction is a next instruction adjacent to the first instruction in the first independent instruction stream; when the second instruction is discussed separately, the second instruction may be any instruction in the first independent instruction stream other than the first instruction.
(5) Longitudinal block: the vertical block is a part of the buffer space.
Index pointers of one or more instructions in the same independent instruction stream can be recorded in each longitudinal block; generally, a client/server may record index pointers of one or more instructions by recording an index pointer interval in a vertical block, where the index pointer interval refers to an interval formed by a maximum index pointer and a minimum index pointer that need to be recorded in the vertical block. In the examples of the present invention, the recording method is described as an example.
Each vertical block may correspond to an independent hash table, and generally, the number of index pointers in the index pointer interval recorded in the vertical block is equal to the number of keys (keys) of the hash table corresponding to the vertical block. When the index pointer interval recorded in the vertical block is updated, the hash table corresponding to the vertical block needs to be updated accordingly.
(6) Longitudinal block group: a set of one or more vertical blocks.
The index pointers recorded in the vertical blocks in the same vertical block group are the index pointers of the instructions in the same independent instruction stream.
(7) Transverse block: a horizontal block is a portion of the cache space.
Each horizontal block can record an index pointer of the first instruction of an independent instruction stream; each transverse block corresponds to a longitudinal block group.
It should be noted that, in the embodiment of the present invention, the content recorded in the cache space is divided into a "horizontal block" and a "vertical block" and the cache space for caching the instruction data according to the difference between the content recorded in the cache space. That is, the "horizontal block" and the "vertical block" represent only cache spaces whose usages are different, and these cache spaces do not have a concept of direction.
The following exemplarily describes the characteristics of the independent instruction stream received by the client in the embodiment of the present invention:
generally, a client obtains a plurality of different independent instruction streams for multiple times or obtains one same independent instruction stream for multiple times under a certain trigger condition; wherein obtaining multiple different independent instruction streams multiple times may be described as: multiple times, a same independent instruction stream group is obtained, and each instruction stream group comprises multiple different independent instruction streams. The embodiment of the present invention does not limit the specific content of the trigger condition.
In a scenario where multiple different independent instruction streams are obtained, the order of the obtained instruction streams may be described as: independent instruction stream 1, independent instruction stream 2, independent instruction stream 3, independent instruction stream 1, independent instruction stream 2, independent instruction stream 3 …. In addition, it can also be described as: the instruction flow control device comprises an independent instruction flow group 1, an independent instruction flow group 1 and an independent instruction flow group 1 …, wherein the independent instruction flow group 1 comprises an independent instruction flow 1, an independent instruction flow 2 and an independent instruction flow 3.
Obtaining one and the same independent instruction stream multiple times can be described as: independent instruction stream 1, independent instruction stream 1 and independent instruction stream 1 … are obtained in sequence.
It should be noted that the embodiment of the present invention can be applied to the two scenarios listed above, and is particularly applicable to the two scenarios where the index pointers of the instructions in the independent instruction streams have the feature of "global scatter and local aggregation". Of course, other scenarios may be used, not listed here. The embodiments of the present invention are described by taking the application to the above two scenarios as examples.
Example one
Referring to fig. 1, a method for processing data provided in an embodiment of the present invention is applied to a client, where a cache space of the client includes a first vertical block, and an index pointer of a first instruction in a first independent instruction stream is recorded in the first vertical block; the method comprises the following steps:
101: acquiring the size of a storage space occupied by an instruction parameter of a second instruction and an index pointer of the second instruction; the second instruction is a subsequent instruction in the first independent instruction stream that is adjacent to the first instruction.
For example, the method provided by the embodiment of the present invention may be applied to a scene in which a GPU (graphics processing unit) virtualization technology is used to implement remote rendering, and specifically may be applied to a process of caching vertex instruction parameters in the scene.
In this scenario, an independent instruction stream group obtained by the client may be as shown in table 1:
TABLE 1
Independent instruction stream 1 Independent instruction stream 2 Independent instruction stream 3
glVertexPointer(p) glVertexPointer(q) glVertexPointer(r)
glDrawElements(p1) glDrawElements(q1) glDrawElements(r1)
glDrawElements(p2) glDrawElements(q2) glDrawElements(r2)
glDrawElements(p3) glDrawElements(q3) glDrawElements(r3)
…… …… ……
The first instruction and the second instruction may be gldrawwelements instructions.
102: judging whether the second instruction meets a blocking strategy or not according to the index pointer of the second instruction and the index pointer of the first instruction; the blocking strategy comprises the following steps: the index pointers of two adjacent instructions in the same independent instruction stream are not consecutive.
Illustratively, when the second instruction satisfies the blocking policy, the index pointer of the second instruction needs to be recorded in a new longitudinal block; when the second instruction does not satisfy the blocking policy, the index pointer of the second instruction and the index pointer of the previous instruction (first instruction) adjacent thereto may be recorded in the same longitudinal block (first longitudinal block).
The embodiment of the present invention does not limit the number of index pointers recordable in one vertical block, and the specific number is related to a specific blocking policy. The specific blocking policy may include, but is not limited to, the following implementation manners:
mode 1: the blocking strategy specifically includes: the change amplitude of the index pointers of two adjacent instructions in the same independent instruction stream is larger than or equal to a first threshold value. In this manner, step 102 may specifically be: and judging whether the change amplitude of the index pointer of the second instruction relative to the index pointer of the first instruction is larger than or equal to a first threshold value.
Mode 2: the blocking strategy specifically includes: the rate of change of the index pointers of two adjacent instructions in the same independent instruction stream is greater than or equal to a second threshold. In this manner, step 102 may specifically be: and judging whether the change rate of the index pointer of the second instruction relative to the index pointer of the first instruction is larger than or equal to a second threshold value.
Illustratively, the first threshold and the second threshold are not both 0, and the specific values of the first threshold and the second threshold are not limited in the embodiment of the present invention. For example, the determination may be made based on a distribution of index pointers for instructions in the first independent instruction stream, or may be made empirically.
103: and when the second instruction meets the blocking strategy, establishing a second longitudinal block and a hash table corresponding to the second longitudinal block.
Illustratively, establishing the second vertical block specifically includes: and taking a part of cache space of the client as a second vertical block. The hash table corresponding to the second vertical block established in step 103 is generally an initialized hash table, that is, the keys in the hash table are all 0.
Optionally, the first vertical block corresponds to a hash table, and when the second instruction does not satisfy the blocking policy, the method may further include:
A) recording an index pointer of the second instruction in the first vertical block;
B) and updating the hash table corresponding to the first longitudinal block according to the index pointer of the second instruction.
Illustratively, after step B), the method may further comprise: C) and caching the instruction parameter of the second instruction according to the updated hash table corresponding to the first longitudinal block, the size of the storage space occupied by the instruction parameter of the second instruction and the index pointer of the second instruction. The method specifically comprises the following steps:
C1) caching the instruction parameter of the second instruction in a cache space which is the same as the size of the storage space occupied by the instruction parameter of the second instruction; C2) acquiring the offset of the index pointer of the second instruction relative to the minimum index pointer recorded in the first longitudinal block; C3) assigning the index pointer of the second instruction to a pointer at a position pointed by the offset in the updated hash table corresponding to the first longitudinal block; C4) and establishing a corresponding relation between the address of the cache space for caching the instruction parameter of the second instruction and the assigned pointer.
104: recording an index pointer of the second instruction in the second vertical block.
105: and caching the instruction parameter of the second instruction according to the hash table corresponding to the second longitudinal block, the size of the storage space occupied by the instruction parameter of the second instruction and the index pointer of the second instruction.
Illustratively, the instruction parameter of the second instruction contains an index pointer of the second instruction. The specific implementation method of step 105 may refer to steps C1) -C4), which are not described herein.
It should be noted that the client may execute step 101-105 when obtaining the second instruction; step 101 and step 104 may also be performed when the second instruction is obtained, and step 105 may be performed when the second instruction is obtained again. Generally, the client executes step 101-104 when obtaining the second instruction for the first time, and executes step 105 when obtaining the second instruction for the second time, which is described with the scenario as an example in the following specific embodiment. In addition, the step 101-104 may be referred to as a learning process of the index pointer of the second instruction by the client, and the step 105 may be referred to as a caching process of the instruction parameter of the second instruction by the client.
Further, in practical application, the client and the server cache the instruction parameters of the instruction according to the same caching method, so that when the client obtains the instruction again, the client does not need to send the instruction parameters of the instruction to the server, and only needs to locally obtain the position information of the index pointer of the instruction (specifically, information of a longitudinal block recording the index pointer of the instruction), and send the position information to the server, so that the server can locally obtain the cached instruction parameters of the instruction according to the position information. In this way, bandwidth resources may be saved. The following describes a specific implementation of the practical application in the following aspects:
in a first aspect, in order to enable a client to obtain location information of an index pointer of a locally cached instruction, a connection relationship between longitudinal blocks needs to be established, specifically:
after step 103, the method may further comprise:
and the client connects the first vertical block and the second vertical block through a linked list structure.
It should be noted that, in order to enable the client to traverse all the vertical blocks in a vertical block group, in a specific implementation, the first vertical block and the last vertical block in a vertical block group may also be connected by a linked list structure.
In a second aspect, based on the first aspect, when the client has established a connection relationship between the vertical blocks, the client obtains location information of an index pointer of a locally cached instruction, and specifically may include:
and when the second instruction is obtained again, sequentially searching the longitudinal blocks recording the index pointer of the second instruction in the first longitudinal block group from the longitudinal block recording the index pointer of the previous instruction of the second instruction according to the connection relation between the longitudinal blocks, wherein the first longitudinal block group is formed by the longitudinal blocks recording the index pointers of the instructions in the first independent instruction stream.
In order to shorten the time for the client to find the location information of the index pointer of the locally cached instruction, a horizontal block may be established for each independent instruction stream when the client obtains the first instruction of the independent instruction stream, and the location information of the index pointer of the locally cached instruction is quickly obtained by jumping between different horizontal blocks, specifically:
the first instruction is a first instruction in the first independent instruction stream, an index pointer of the first instruction is recorded in a first horizontal block, and the method further comprises:
acquiring an index pointer of a first instruction in a second independent instruction stream, wherein the second independent instruction stream is a next independent instruction stream adjacent to the first independent instruction stream;
establishing a second transverse block;
recording an index pointer for a first instruction in the second independent instruction stream in the second horizontal block;
connecting the second transverse block with the first transverse block through a linked list structure;
and connecting the second transverse block with one longitudinal block in a second longitudinal block group through a linked list structure, wherein the second longitudinal block group is formed by longitudinal blocks recording index pointers of instructions in the second independent instruction stream.
Illustratively, establishing the second horizontal block specifically includes: and taking part of the cache space of the client as a second horizontal block. And connecting the second transverse block with the first transverse block through a linked list structure, namely specifically realizing the establishment of the connection relationship between the transverse blocks. And connecting the second transverse block with the first longitudinal block in the longitudinal block group through a linked list structure, namely specifically realizing the establishment of the connection relationship between the transverse blocks and the longitudinal block group. Connecting the second horizontal block with a vertical block in the second vertical block group through a linked list structure, generally: and connecting the second transverse block with a longitudinal block, which is used for recording an index pointer of the first instruction of the second independent instruction stream, in the second longitudinal block group through a linked list structure.
In a fourth aspect, based on the third aspect, in a case that the client has established a connection relationship between the horizontal block and the horizontal block, and between the horizontal block and the vertical block group, the client obtains location information of an index pointer of a locally cached instruction, and specifically may include:
when the first instruction in the second independent instruction stream is obtained again, searching and determining the transverse block for recording the index pointer of the first instruction in the second independent instruction stream according to the connection relation between the transverse blocks; and searching and recording the longitudinal block of the index pointer of the first instruction in the second independent instruction stream according to the connection relation between the transverse block and the longitudinal block group.
In a fifth aspect, in order to enable the server to cache the instruction parameters of the instruction according to the same caching method as the client, the method further includes:
(1) after step 103, sending a first indication message to a server, where the first indication message is used to instruct the server to record the second instruction in the second vertical block; and enabling the server to establish the second longitudinal block and a hash table corresponding to the second longitudinal block according to the first indication message, and recording an index pointer of the second instruction in the second longitudinal block.
(2) The first indication message further includes the size of the storage space occupied by the instruction parameter of the second instruction, and after step 105, a second indication message is sent to the server, where the second indication message is used to indicate that the server caches the instruction parameter of the second instruction according to the first indication message; and enabling the server to cache the instruction parameters of the second instruction according to the hash table corresponding to the second longitudinal block, the size of the storage space occupied by the instruction parameters of the second instruction and the index pointer of the second instruction.
It should be noted that, in a specific implementation, when the client executes step 101 and step 105 when obtaining the second instruction, the first indication message and the second indication message may be sent simultaneously, or may be combined into the same message.
Optionally, after step B), sending a third indication message to the server, where the third indication message is used to indicate the server to record the index pointer of the second instruction in the first vertical block; and enabling the server to record the index pointer of the second instruction in the first longitudinal block according to the third indication message, and updating the hash table corresponding to the first longitudinal block according to the index pointer of the second instruction.
(3) After the client connects the first vertical block and the second vertical block through a linked list structure, sending a fourth indication message to the server, where the fourth indication message is used to indicate the server to establish a connection relationship between the first vertical block and the second vertical block; and enabling the server to connect the first longitudinal block and the second longitudinal block through a linked list structure according to the fourth indication message.
(4) Sending a sixth indication message to the server, where the sixth indication message is used to indicate the server to establish the second transverse block for the second independent instruction stream; enabling the server to establish the second transverse block according to the sixth indication message, recording an index pointer of a first instruction in the second independent instruction stream in the second transverse block, and connecting the second transverse block with the first transverse block through a linked list structure; and connecting the second transverse block with a first longitudinal block in a longitudinal block group through a linked list structure, wherein the longitudinal block group is formed by longitudinal blocks recording index pointers of instructions in the second independent instruction stream.
In a sixth aspect, in order to enable the server to obtain the cached instruction parameter of the instruction locally according to the location information of the index pointer recording the cached instruction, the method may further include:
(5) sending a fifth indication message to the server, where the fifth indication message includes information of a longitudinal block recording an index pointer of the second instruction, and the fifth indication message is used to indicate the server to obtain a cached instruction parameter of the second instruction; and the server side acquires a hash table corresponding to the longitudinal block recording the index pointer of the second instruction according to the connection relation between the longitudinal blocks and the information of the longitudinal block recording the index pointer of the second instruction, and acquires the cached instruction parameter of the second instruction according to the hash table corresponding to the longitudinal block recording the index pointer of the second instruction and the index pointer of the second instruction.
In the method for processing data provided in the embodiment of the present invention, a cache space of a client includes a first vertical block in which an index pointer of a first instruction is recorded, and when an index pointer of a second instruction is not continuous with an index pointer of the first instruction, a second vertical block and a hash table corresponding to the second vertical block are established, and the index pointer of the second instruction is recorded in the second vertical block; the second instruction and the first instruction are two instructions in the same independent instruction stream, and the second instruction is a next instruction adjacent to the first instruction; and caching the instruction parameter of the second instruction according to at least the hash table corresponding to the second longitudinal block. According to the scheme, two discontinuous index pointers in the same independent instruction stream are respectively recorded in different longitudinal blocks, and an independent hash table is established for each longitudinal block, so that when the instruction parameters of the instructions are cached, the index pointers between the two discontinuous index pointers do not need to be cached, and therefore when the index pointers of the instructions in the instruction stream to be cached are relatively dispersed, the caching space of the cached index pointers can be saved.
Example two
Referring to fig. 2, a method for processing data provided in the embodiment of the present invention is applied to a server, where a cache space of the server includes a first vertical block, and an index pointer of a first instruction in a first independent instruction stream is recorded in the first vertical block; the method comprises the following steps:
201: and receiving a first indication message sent by a client, wherein the first indication message is used for indicating the server to record the second instruction in a second longitudinal block.
For example, the relevant explanations and examples in this embodiment may refer to the relevant parts of embodiment one and embodiment three.
202: and establishing the second longitudinal block and a hash table corresponding to the second longitudinal block according to the first indication message, and recording an index pointer of the second instruction in the second longitudinal block.
The first indication message further includes a size of a storage space occupied by an instruction parameter of the second instruction, the method further comprising:
203: and receiving a second indication message sent by the client, wherein the second indication message is used for indicating the server to cache the instruction parameter of the second instruction according to the first indication message.
204: and caching the instruction parameter of the second instruction according to the hash table corresponding to the second longitudinal block, the size of the storage space occupied by the instruction parameter of the second instruction and the index pointer of the second instruction.
It should be noted that, steps 201 and 202 may be referred to as a learning process of the index pointer of the second instruction by the server, and steps 203 and 204 may be referred to as a caching process of the instruction parameter of the second instruction by the server.
Optionally, the method further includes:
receiving a third indication message sent by the client, where the third indication message is used to indicate the server to record an index pointer of the second instruction in the first vertical block;
recording an index pointer of the second instruction in the first vertical block according to the third indication message;
and updating the hash table corresponding to the first longitudinal block according to the index pointer of the second instruction.
Optionally, the method further includes:
receiving a fourth indication message sent by the client, where the fourth indication message is used to indicate the server to establish a connection relationship between the first vertical block and the second vertical block;
and connecting the first longitudinal block and the second longitudinal block through a linked list structure according to the fourth indication message.
Optionally, the server has established a connection relationship between the longitudinal blocks; the method further comprises the following steps:
receiving a fifth indication message sent by the client, where the fifth indication message includes information of a longitudinal block recording an index pointer of the second instruction, and the fifth indication message is used to indicate the server to obtain a cached instruction parameter of the second instruction;
acquiring a hash table corresponding to the longitudinal block recording the index pointer of the second instruction according to the connection relation between the longitudinal blocks and the information of the longitudinal block recording the index pointer of the second instruction;
and acquiring the cached instruction parameters of the second instruction according to the hash table corresponding to the longitudinal block for recording the index pointer of the second instruction and the index pointer of the second instruction.
Optionally, the first instruction is a first instruction in the first independent instruction stream, and the method further includes:
receiving a sixth indication message sent by the client, where the sixth indication message is used to indicate the server to establish the second transverse block for the second independent instruction stream;
establishing the second horizontal block according to the sixth indication message;
recording an index pointer for a first instruction in the second independent instruction stream in the second horizontal block;
connecting the second transverse block with the first transverse block through a linked list structure;
and connecting the second transverse block with a first longitudinal block in a longitudinal block group through a linked list structure, wherein the longitudinal block group is formed by longitudinal blocks recording index pointers of instructions in the second independent instruction stream.
In the method for processing data provided in the embodiment of the present invention, a cache space of a server includes a first vertical block in which an index pointer of a first instruction is recorded, and when receiving an indication first indication message sent by a client and used to indicate the server to record an index pointer of a second instruction in a second vertical block, a second vertical block and a hash table corresponding to the second vertical block are established, and the index pointer of the second instruction is recorded in the second vertical block; the second instruction and the first instruction are two instructions in the same independent instruction stream, and the second instruction is a next instruction adjacent to the first instruction; when a second indication message which is sent by the client and used for indicating the indication parameter of the second instruction is cached according to the first indication message is received, the instruction parameter of the second instruction is cached according to at least the hash table corresponding to the second longitudinal block. According to the scheme, two discontinuous index pointers in the same independent instruction stream are respectively recorded in different longitudinal blocks, and an independent hash table is established for each longitudinal block, so that when the instruction parameters of the instructions are cached, the index pointers between the two discontinuous index pointers do not need to be cached, and therefore when the index pointers of the instructions in the instruction stream to be cached are relatively dispersed, the caching space of the cached index pointers can be saved.
EXAMPLE III
In this embodiment, a scenario in which a client obtains a plurality of different independent instruction streams for multiple times is taken as an example, a method for processing data when obtaining one instruction each time is described, and a method for processing data when obtaining one instruction for the 1 st time and a non-1 st time is described respectively. Wherein the instruction may be any instruction in any independent instruction stream in the independent instruction stream group.
The client end obtains an instruction for the 1 st time
When the client obtains an instruction 1 time, the client and the server do not learn the index pointer of the instruction yet. In this case, the client and the server mainly complete learning of the index pointer of the instruction, as shown in fig. 3, specifically including:
301: the client acquires an index pointer of an instruction.
It should be noted that, in the specific implementation, step 301 further includes: the size of the memory space occupied by the instruction parameters of the instruction is obtained. The size of the storage space occupied by the instruction parameter of the instruction is used when the client caches the instruction parameter of the instruction (after the client obtains the instruction 2 nd time).
302: it is determined whether the instruction is the first instruction in an independent instruction stream.
If yes, go to step 303; if not, go to step 305.
303: establishing an i +1 th transverse block; recording an index pointer of the instruction in the (i + 1) th horizontal block; establishing a first longitudinal block in the (i + 1) th longitudinal block group and a hash table corresponding to the longitudinal block; recording an index pointer of the instruction in a first longitudinal block in the (i + 1) th longitudinal block group in the form of an index pointer interval; connecting the (i + 1) th transverse block with the first longitudinal block in the (i + 1) th longitudinal block group through a linked list structure; and connecting the (i + 1) th transverse block with the ith transverse block through a linked list structure.
Wherein, i is used for representing the number of the horizontal blocks established by the client, i is more than or equal to 0, and i is an integer. The (i + 1) th transverse block corresponds to the (i + 1) th longitudinal block group.
When the instruction is an instruction in the first independent instruction stream of the independent instruction stream group, i =0, that is, no horizontal block has been established in the cache space of the client before step 301 is executed. In this case, the client may not perform "connect the (i + 1) th horizontal block with the ith horizontal block through a linked list structure".
When the instruction is an instruction in another independent instruction stream in the independent instruction stream group, i > 0. In this case, the client can execute all the operations in step 303, and fig. 3 illustrates this case as an example.
In addition, in the specific implementation, the execution order of the plurality of actions in step 303 is not limited in the embodiment of the present invention.
For example, assuming that the index pointer of the instruction is 100, it can be recorded in the (i + 1) th horizontal block: 100, respectively; recording in the first vertical block in the (i + 1) th vertical block group: [100, 100 ]; the number of the keywords of the established hash table corresponding to the vertical block is 1, and the keyword is 0.
304: an indication message is sent to the server, so that the server executes step 303.
For example, the indication message in step 306 may include the sixth indication message (for indicating the server to establish the (i + 1) th horizontal block) in the second embodiment.
After step 304 is performed, it is ended.
305: it is determined whether a change in magnitude of the index pointer of the instruction relative to an index pointer of an instruction preceding the instruction is greater than or equal to a first threshold.
If yes, go to step 306; if not, go to step 308.
Illustratively, the first threshold may be 10000.
306: establishing a j +1 th longitudinal block, and recording an index pointer of the instruction in the j +1 th longitudinal block in the form of an index pointer interval; and connecting the (j + 1) th longitudinal block with the (j) th longitudinal block through a linked list structure.
Wherein j is the number of the established vertical blocks in the vertical block group corresponding to the independent instruction stream containing the instruction, j is more than or equal to 1, and j is an integer.
Optionally, in specific implementation, the method may further include: when the number of the longitudinal blocks contained in the longitudinal block group corresponding to a certain transverse block exceeds a certain threshold, no longitudinal block is established for the independent instruction stream corresponding to the longitudinal block group, and the instruction parameter of the instruction is directly sent to the server. The specific value of the threshold is not limited in the embodiment of the present invention. This situation is illustrated: the index pointers of the instructions in the independent instruction stream are too scattered to be suitable for buffering the instruction parameters of the instructions, and therefore, the learning process of the index pointers is not required to be executed.
307: and sending an indication message to the server, so that the server executes step 306.
Illustratively, the indication message in this step 307 includes the first indication message (used to instruct the server to record the index pointer of the instruction in the j +1 th vertical block) and the fourth indication message (used to instruct the server to establish the connection relationship between the j +1 th vertical block and the j th vertical block) in the second embodiment. It should be noted that, in the specific implementation, step 307 further includes: and sending the size of the storage space occupied by the instruction parameter of the instruction to the server, wherein the size of the storage space occupied by the instruction parameter of the instruction is used when the server caches the instruction parameter of the instruction (after the client obtains the instruction 2 nd time).
After step 307 is performed, the process ends.
308: and recording the index pointer of the instruction in the jth longitudinal block, and updating the hash table corresponding to the jth longitudinal block.
Illustratively, the index pointer of the instruction is recorded in the jth vertical block, specifically: and updating the index pointer interval recorded in the jth longitudinal block so that the index pointer of the instruction is contained in the index pointer interval recorded in the jth longitudinal block.
For example, before step 308 is executed, the index pointer interval recorded in the jth vertical block is: [0,1999], it is understood that the number of keys in the hash table corresponding to the jth vertical block at this time is 2000. Assuming that the index pointer of the instruction is 2001, after step 308 is executed, the index pointer interval recorded in the jth vertical block is updated as follows: [0,2001], the number of keys in the hash table corresponding to the jth vertical block is 2002; assuming that the index pointer of the instruction is 2000, after step 308 is executed, the index pointer interval recorded in the jth vertical block is updated as follows: [0,2000], the number of keys in the hash table corresponding to the jth vertical block is 2001.
309: an indication message is sent to the server, so that the server executes step 308.
Illustratively, the indication message in step 309 includes the third indication message in embodiment two (for instructing the server to record the index pointer of the instruction in the jth vertical block).
After step 309 is performed, it is ended.
It should be noted that, after the steps shown in fig. 3 are executed for each instruction in the independent instruction stream group, the client and the server complete learning of the index pointer of each instruction in the independent instruction stream group, which specifically includes: acquiring an index pointer of any instruction in the independent instruction stream group and the size of a storage space occupied by an instruction parameter of any instruction, and establishing a connection relation among longitudinal blocks for recording the index pointer of the instruction in the independent instruction stream group, a hash table corresponding to each longitudinal block and the longitudinal blocks in the longitudinal block group; and establishing the connection relationship among the horizontal blocks, the horizontal blocks and the vertical block groups and the connection relationship among the horizontal blocks corresponding to each independent instruction stream in the independent instruction stream group.
The client end obtains an instruction for the nth time, n is more than or equal to 2 and is an integer
When the client obtains an instruction 2 times, the client and the server already complete the learning of the index pointer of each instruction in the independent instruction stream group, and in this case, the client and the server mainly complete the caching of the instruction parameter of the instruction. When the client obtains an instruction for the 3 rd time or more, the client and the server already complete the caching of the instruction parameters of each instruction in the independent instruction stream group, and in this case, the client mainly obtains the position information of the index pointer of the instruction (specifically, the information of the longitudinal block of the index pointer of the instruction) and sends the position information to the server, so that the server locally obtains the cached instruction parameters of the instruction according to the position information. As shown in fig. 4, the method includes:
401: the client obtains an instruction.
402: it is determined whether the instruction is the first instruction in an independent instruction stream.
If yes, go to step 403; if not, go to step 406.
403: and judging whether the index pointer of the instruction is recorded in the p-th horizontal block.
If yes, go to step 404; if not, go to step 405.
Wherein when the instruction is a first instruction in a first independent instruction stream in the group of independent instruction streams, p = 1; when the instruction is the first instruction in other independent instruction streams in the independent instruction stream group, the pth horizontal block refers to the horizontal block corresponding to the previous independent instruction stream adjacent to the independent instruction stream.
404: and taking the p-th transverse block as the current transverse block and taking the longitudinal block connected with the current transverse block as the current longitudinal block.
After step 404 is performed, step 409 is performed.
405: p is added by 1.
After step 405, return to step 403.
Illustratively, step 403 and 405 are embodied as finding the current horizontal block through the connection relationship between the horizontal blocks. In step 404, the vertical block connected to the current horizontal block is used as the current vertical block, which is specifically embodied as obtaining the current vertical block through the connection relationship between the horizontal block and the vertical block group.
Generally, if step 403 is no, then a step 405 is executed once to find the current vertical block.
406: and judging whether the index pointer of the instruction is in the index pointer interval of the q-th longitudinal block record.
Wherein, the qth vertical block is a vertical block for recording the index pointer of the previous instruction adjacent to the instruction, q is more than or equal to 1, and q is an integer.
If yes, go to step 407; if not, go to step 408.
Optionally, in specific implementation, the following scenarios may exist: the index pointer of the instruction does not exist in each longitudinal block. In this case, an embodiment of the present invention provides an optional processing scheme: and directly sending the instruction parameters of the instruction to the server without caching the instruction parameters.
407: and taking the q-th vertical block as the current vertical block.
After step 407 is performed, step 409 is performed.
408: q is self-added by 1.
After step 408 is performed, step 406 is returned to.
Illustratively, the step 406 and 408 are embodied as searching the current vertical block through the connection relationship between the vertical blocks.
409: and acquiring a hash table corresponding to the current longitudinal block and the offset of the index pointer of the instruction relative to the minimum index pointer recorded in the current longitudinal block.
410: and judging whether the pointer of the offset at the position pointed by the hash table corresponding to the current vertical block is a null pointer or not.
If yes, go to step 411; if not, go to step 413.
If so, indicating that the instruction parameter of the instruction is not cached, namely the instruction is an instruction obtained by the client at the 2 nd time; if not, the instruction parameter of the instruction is cached, that is, the instruction is an instruction obtained by the client at the 3 rd time or more than the 3 rd time.
411: the index pointer for the instruction is cached. The method specifically comprises the following steps:
caching the instruction parameter of the instruction in a cache space with the same size as the storage space occupied by the instruction parameter of the instruction; assigning the index pointer of the instruction to the pointer of the offset at the position pointed by the hash table corresponding to the current longitudinal block; and establishing a corresponding relation between the address of the cache space for caching the instruction parameter of the instruction and the assigned pointer.
When the hash table corresponding to the current longitudinal block, the size of the storage space occupied by the instruction and the index pointer of the instruction are obtained by the client for the 1 st time, the index pointer of the instruction is obtained after learning.
412: an indication message is sent to the server, so that the server performs step 411.
Illustratively, the indication message in step 412 includes the second indication message (instruction parameter for instructing the server to cache an instruction) in the second embodiment
After step 412 is performed, the process ends.
413: and sending an indication message to the server, so that the server acquires the hash table corresponding to the current longitudinal block according to the connection relation between the longitudinal blocks and the information of the current longitudinal block, and acquires the cached instruction parameter of the instruction according to the hash table corresponding to the current longitudinal block and the index pointer of the instruction.
Illustratively, the indication message in step 413 includes the fifth indication message (instruction parameter for instructing the server to obtain a cached instruction) in the second embodiment. The information of the current vertical block may be an index interval recorded in the vertical block, or position information where the vertical block is located (specifically, a number of a horizontal block corresponding to the vertical block group including the vertical block and a number of the vertical block in the vertical block group), and the like.
After step 413 is performed, the process ends.
As shown in fig. 5, the structural diagram of the instruction parameters of the cache instruction is shown, where the index section recorded in the vertical block pointed by the shaded portion is [ p101, p200], the keys of the hash table corresponding to the vertical block are pointers p101-p200, and the pointer is p130 pointing to the instruction parameters of the cache.
In the method for processing data provided by the embodiment of the invention, when the client acquires each instruction in the independent instruction stream group for the 1 st time, the index pointers of the instructions are recorded in different longitudinal blocks, and an independent hash table is established for each longitudinal block; when one of the instructions is obtained again, the longitudinal block recording the index pointer of the instruction is searched, and the instruction parameter of the instruction is cached according to the hash table corresponding to the index pointer recording the instruction. Therefore, when the instruction parameters of the instructions are cached, only the index pointers recorded in the longitudinal blocks need to be cached, and therefore when the index pointers of the instructions in the instruction stream to be cached are scattered, the caching space for caching the index pointers can be saved. In addition, the longitudinal blocks recording the index pointers of one instruction can be quickly found by establishing the connection relationship among the longitudinal blocks recording the index pointers of the instructions in the same independent instruction stream, establishing the transverse blocks for each independent instruction stream, establishing the connection relationship among the transverse blocks and the connection relationship among the transverse blocks, so that the system performance is improved.
Example four
As shown in fig. 6, for a client according to an embodiment of the present invention to execute the method for processing data according to the first embodiment, a cache space of the client includes a first vertical block, and an index pointer of a first instruction in a first independent instruction stream is recorded in the first vertical block; the client further comprises:
an obtaining unit 61, configured to obtain a size of a storage space occupied by an instruction parameter of a second instruction and an index pointer of the second instruction; the second instruction is a subsequent instruction adjacent to the first instruction in the first independent instruction stream;
a judging unit 62, configured to judge whether the second instruction satisfies a blocking policy according to an index pointer of the second instruction and an index pointer of the first instruction; the blocking strategy comprises the following steps: the index pointers of two adjacent instructions in the same independent instruction stream are not continuous;
an establishing unit 63, configured to establish a second vertical block and a hash table corresponding to the second vertical block when the second instruction satisfies the blocking policy;
a recording unit 64, configured to record the index pointer of the second instruction in the second vertical block;
the cache unit 65 is configured to cache the instruction parameter of the second instruction according to the hash table corresponding to the second vertical block, the size of the storage space occupied by the instruction parameter of the second instruction, and the index pointer of the second instruction.
Optionally, the blocking policy specifically includes: the change amplitude of the index pointers of two adjacent instructions in the same independent instruction stream is greater than or equal to a first threshold value; the determining unit 62 is specifically configured to determine whether a variation width of the index pointer of the second instruction with respect to the index pointer of the first instruction is greater than or equal to a first threshold;
or, the blocking policy specifically includes: the change rate of the index pointers of two adjacent instructions in the same independent instruction stream is greater than or equal to a second threshold value; the determining unit 62 is specifically configured to determine whether a change rate of the index pointer of the second instruction with respect to the index pointer of the first instruction is greater than or equal to a second threshold.
Optionally, as shown in fig. 7, the client further includes:
a sending unit 66, configured to send a first indication message to a server, where the first indication message is used to instruct the server to record the second instruction in the second vertical block; enabling the server to establish the second longitudinal block and a hash table corresponding to the second longitudinal block according to the first indication message, and recording an index pointer of the second instruction in the second longitudinal block;
the first indication message further includes a size of a storage space occupied by an instruction parameter of the second instruction, and the sending unit 66 is further configured to send a second indication message to the server, where the second indication message is used to indicate the server to cache the instruction parameter of the second instruction according to the first indication message; and enabling the server to cache the instruction parameters of the second instruction according to the hash table corresponding to the second longitudinal block, the size of the storage space occupied by the instruction parameters of the second instruction and the index pointer of the second instruction.
Optionally, the first vertical block corresponds to a hash table;
the recording unit 64 is further configured to record an index pointer of the second instruction in the first vertical block when the second instruction does not satisfy the blocking policy;
as shown in fig. 7, the client further includes:
an updating unit 67, configured to update the hash table corresponding to the first vertical block according to the index pointer of the second instruction.
Optionally, the sending unit 66 is further configured to send a third indication message to the server, where the third indication message is used to instruct the server to record the index pointer of the second instruction in the first vertical block; and enabling the server to record the index pointer of the second instruction in the first longitudinal block according to the third indication message, and updating the hash table corresponding to the first longitudinal block according to the index pointer of the second instruction.
Optionally, as shown in fig. 7, the client further includes:
a connecting unit 68, configured to connect the first vertical block and the second vertical block through a linked list structure.
Optionally, the sending unit 66 is further configured to send a fourth indication message to the server, where the fourth indication message is used to indicate that the server establishes a connection relationship between the first vertical block and the second vertical block; and enabling the server to connect the first longitudinal block and the second longitudinal block through a linked list structure according to the fourth indication message.
Optionally, as shown in fig. 7, the client further includes:
a searching unit 69, configured to, when obtaining the second instruction again, sequentially search, starting from a vertical block that records an index pointer of a previous instruction of the second instruction, the vertical block that records the index pointer of the second instruction in a first vertical block group according to a connection relationship between the vertical blocks, where the first vertical block group is formed by the vertical blocks that record the index pointers of the instructions in the first independent instruction stream.
Optionally, the server has established a connection relationship between the longitudinal blocks;
the sending unit 66 is further configured to send a fifth indication message to the server, where the fifth indication message includes information of a longitudinal block recording an index pointer of the second instruction, and the fifth indication message is used to indicate that the server acquires a cached instruction parameter of the second instruction; and the server side acquires a hash table corresponding to the longitudinal block recording the index pointer of the second instruction according to the connection relation between the longitudinal blocks and the information of the longitudinal block recording the index pointer of the second instruction, and acquires the cached instruction parameter of the second instruction according to the hash table corresponding to the longitudinal block recording the index pointer of the second instruction and the index pointer of the second instruction.
Optionally, the first instruction is a first instruction in the first independent instruction stream, and an index pointer of the first instruction is recorded in a first horizontal block;
the obtaining unit 61 is further configured to obtain an index pointer of a first instruction in a second independent instruction stream, where the second independent instruction stream is a next independent instruction stream adjacent to the first independent instruction stream;
the establishing unit 63 is further configured to establish a second transverse block;
the recording unit 64 is further configured to record an index pointer of a first instruction in the second independent instruction stream in the second horizontal block;
the connecting unit 68 is further configured to connect the second horizontal block and the first horizontal block through a linked list structure; and connecting the second transverse block with one longitudinal block in a second longitudinal block group through a linked list structure, wherein the second longitudinal block group is formed by longitudinal blocks recording index pointers of instructions in the second independent instruction stream.
Optionally, the sending unit 66 is further configured to send a sixth indication message to the server, where the sixth indication message is used to indicate the server to establish the second horizontal block for the second independent instruction stream; enabling the server to establish the second transverse block according to the sixth indication message, recording an index pointer of a first instruction in the second independent instruction stream in the second transverse block, and connecting the second transverse block with the first transverse block through a linked list structure; and connecting the second transverse block with a first longitudinal block in a longitudinal block group through a linked list structure, wherein the longitudinal block group is formed by longitudinal blocks recording index pointers of instructions in the second independent instruction stream.
Optionally, the client has established a connection relationship between the horizontal block and the horizontal block, and a connection relationship between the horizontal block and the vertical block group;
the searching unit 69 is further configured to, when obtaining the first instruction in the second independent instruction stream again, search and determine a horizontal block recording an index pointer of the first instruction in the second independent instruction stream according to a connection relationship between the horizontal block and the horizontal block; and searching and recording the longitudinal block of the index pointer of the first instruction in the second independent instruction stream according to the connection relation between the transverse block and the longitudinal block group.
In the client provided by the embodiment of the present invention, the cache space of the client includes the first longitudinal block of the index pointer recorded with the first instruction, and when the index pointer of the second instruction is not continuous with the index pointer of the first instruction, the second longitudinal block and the hash table corresponding to the second longitudinal block are established, and the index pointer of the second instruction is recorded in the second longitudinal block; the second instruction and the first instruction are two instructions in the same independent instruction stream, and the second instruction is a next instruction adjacent to the first instruction; and caching the instruction parameter of the second instruction according to at least the hash table corresponding to the second longitudinal block. According to the scheme, two discontinuous index pointers in the same independent instruction stream are respectively recorded in different longitudinal blocks, and an independent hash table is established for each longitudinal block, so that when the instruction parameters of the instructions are cached, the index pointers between the two discontinuous index pointers do not need to be cached, and therefore when the index pointers of the instructions in the instruction stream to be cached are relatively dispersed, the caching space of the cached index pointers can be saved.
EXAMPLE five
As shown in fig. 8, for a client according to an embodiment of the present invention to execute the method for processing data according to the first embodiment, a cache space of the client includes a first vertical block, and an index pointer of a first instruction in a first independent instruction stream is recorded in the first vertical block; the method comprises the following steps: a processor 81 and a memory 82, wherein,
a processor 81 for performing the following actions:
acquiring the size of a storage space occupied by an instruction parameter of a second instruction and an index pointer of the second instruction; the second instruction is a subsequent instruction adjacent to the first instruction in the first independent instruction stream;
judging whether the second instruction meets a blocking strategy or not according to the index pointer of the second instruction and the index pointer of the first instruction; the blocking strategy comprises the following steps: the index pointers of two adjacent instructions in the same independent instruction stream are not continuous;
when the second instruction meets the blocking strategy, a second longitudinal block and a hash table corresponding to the second longitudinal block are established;
recording an index pointer of the second instruction in the second vertical block;
the memory 82 is used to perform the following actions:
and caching the instruction parameter of the second instruction according to the hash table corresponding to the second longitudinal block, the size of the storage space occupied by the instruction parameter of the second instruction and the index pointer of the second instruction.
Optionally, the blocking policy specifically includes: the change amplitude of the index pointers of two adjacent instructions in the same independent instruction stream is greater than or equal to a first threshold value; the processor 81 is specifically configured to determine whether a variation width of the index pointer of the second instruction with respect to the index pointer of the first instruction is greater than or equal to a first threshold;
or, the blocking policy specifically includes: the change rate of the index pointers of two adjacent instructions in the same independent instruction stream is greater than or equal to a second threshold value; the processor 81 is specifically configured to determine whether a rate of change of the index pointer of the second instruction with respect to the index pointer of the first instruction is greater than or equal to a second threshold.
Optionally, the client may further include:
a transmitter 83, configured to send a first indication message to a server, where the first indication message is used to instruct the server to record the second instruction in the second vertical block; enabling the server to establish the second longitudinal block and a hash table corresponding to the second longitudinal block according to the first indication message, and recording an index pointer of the second instruction in the second longitudinal block;
the first indication message further includes a size of a storage space occupied by an instruction parameter of the second instruction, and the transmitter 83 is further configured to transmit a second indication message to the server, where the second indication message is used to indicate the server to cache the instruction parameter of the second instruction according to the first indication message; and enabling the server to cache the instruction parameters of the second instruction according to the hash table corresponding to the second longitudinal block, the size of the storage space occupied by the instruction parameters of the second instruction and the index pointer of the second instruction.
Optionally, the first vertical block corresponds to a hash table, and the processor 81 is further configured to perform the following actions:
when the second instruction does not meet the blocking policy, recording an index pointer of the second instruction in the first longitudinal block;
and updating the hash table corresponding to the first longitudinal block according to the index pointer of the second instruction.
Optionally, the transmitter 83 is further configured to transmit a third indication message to the server, where the third indication message is used to instruct the server to record the index pointer of the second instruction in the first vertical block; and enabling the server to record the index pointer of the second instruction in the first longitudinal block according to the third indication message, and updating the hash table corresponding to the first longitudinal block according to the index pointer of the second instruction.
Optionally, the processor 81 is further configured to connect the first vertical block and the second vertical block through a linked list structure.
Optionally, the sender 83 is further configured to send a fourth indication message to the server, where the fourth indication message is used to indicate that the server establishes a connection relationship between the first vertical block and the second vertical block; and enabling the server to connect the first longitudinal block and the second longitudinal block through a linked list structure according to the fourth indication message.
Optionally, under the condition that the client has established the connection relationship between the longitudinal blocks, the processor 81 is further configured to, when obtaining the second instruction again, sequentially search, from the longitudinal block recording the index pointer of the previous instruction of the second instruction, the longitudinal block recording the index pointer of the second instruction in the first longitudinal block group according to the connection relationship between the longitudinal blocks, where the first longitudinal block group is formed by the longitudinal blocks recording the index pointers of the instructions in the first independent instruction stream.
Optionally, the server has established a connection relationship between the longitudinal blocks;
the sender 83 is further configured to send a fifth indication message to the server, where the fifth indication message includes information of a longitudinal block recording an index pointer of the second instruction, and the fifth indication message is used to indicate that the server acquires an instruction parameter of the cached second instruction; and the server side acquires a hash table corresponding to the longitudinal block recording the index pointer of the second instruction according to the connection relation between the longitudinal blocks and the information of the longitudinal block recording the index pointer of the second instruction, and acquires the cached instruction parameter of the second instruction according to the hash table corresponding to the longitudinal block recording the index pointer of the second instruction and the index pointer of the second instruction.
Optionally, the first instruction is a first instruction in the first independent instruction stream, and an index pointer of the first instruction is recorded in a first horizontal block; processor 81 is also configured to perform the following actions:
acquiring an index pointer of a first instruction in a second independent instruction stream, wherein the second independent instruction stream is a next independent instruction stream adjacent to the first independent instruction stream;
establishing a second transverse block;
recording an index pointer for a first instruction in the second independent instruction stream in the second horizontal block;
connecting the second transverse block with the first transverse block through a linked list structure;
and connecting the second transverse block with one longitudinal block in a second longitudinal block group through a linked list structure, wherein the second longitudinal block group is formed by longitudinal blocks recording index pointers of instructions in the second independent instruction stream.
Optionally, the transmitter 83 is further configured to send a sixth indication message to the server, where the sixth indication message is used to instruct the server to establish the second horizontal block for the second independent instruction stream; enabling the server to establish the second transverse block according to the sixth indication message, recording an index pointer of a first instruction in the second independent instruction stream in the second transverse block, and connecting the second transverse block with the first transverse block through a linked list structure; and connecting the second transverse block with a first longitudinal block in a longitudinal block group through a linked list structure, wherein the longitudinal block group is formed by longitudinal blocks recording index pointers of instructions in the second independent instruction stream.
Optionally, the client has established a connection relationship between the horizontal block and the horizontal block, and a connection relationship between the horizontal block and the vertical block group;
the processor 81 is further configured to, when obtaining the first instruction in the second independent instruction stream again, find and determine a horizontal block recording an index pointer of the first instruction in the second independent instruction stream according to a connection relationship between the horizontal block and the horizontal block; and searching and recording the longitudinal block of the index pointer of the first instruction in the second independent instruction stream according to the connection relation between the transverse block and the longitudinal block group.
In the client provided by the embodiment of the present invention, the cache space of the client includes the first longitudinal block of the index pointer recorded with the first instruction, and when the index pointer of the second instruction is not continuous with the index pointer of the first instruction, the second longitudinal block and the hash table corresponding to the second longitudinal block are established, and the index pointer of the second instruction is recorded in the second longitudinal block; the second instruction and the first instruction are two instructions in the same independent instruction stream, and the second instruction is a next instruction adjacent to the first instruction; and caching the instruction parameter of the second instruction according to at least the hash table corresponding to the second longitudinal block. According to the scheme, two discontinuous index pointers in the same independent instruction stream are respectively recorded in different longitudinal blocks, and an independent hash table is established for each longitudinal block, so that when the instruction parameters of the instructions are cached, the index pointers between the two discontinuous index pointers do not need to be cached, and therefore when the index pointers of the instructions in the instruction stream to be cached are relatively dispersed, the caching space of the cached index pointers can be saved.
EXAMPLE six
As shown in fig. 9, for a server according to an embodiment of the present invention, to execute the method for processing data according to the second embodiment, a cache space of the server includes a first vertical block, and an index pointer of a first instruction in a first independent instruction stream is recorded in the first vertical block; the server side comprises:
a receiving unit 91, configured to receive a first indication message sent by a client, where the first indication message is used to instruct the server to record the second instruction in a second vertical block;
an establishing unit 92, configured to establish the second vertical block and a hash table corresponding to the second vertical block according to the first indication message;
a recording unit 93, configured to record an index pointer of the second instruction in the second vertical block;
the first indication message further comprises the size of the storage space occupied by the instruction parameter of the second instruction; the receiving unit 91 is further configured to receive a second indication message sent by the client, where the second indication message is used to indicate the server to cache an instruction parameter of the second instruction according to the first indication message;
the server side further comprises:
the cache unit 94 is configured to cache the instruction parameter of the second instruction according to the hash table corresponding to the second vertical block, the size of the storage space occupied by the instruction parameter of the second instruction, and the index pointer of the second instruction.
Optionally, the receiving unit 91 is further configured to receive a third indication message sent by the client, where the third indication message is used to instruct the server to record an index pointer of the second instruction in the first vertical block;
the recording unit 93 is further configured to record an index pointer of the second instruction in the first vertical block according to the third indication message;
as shown in fig. 10, the server further includes:
an updating unit 95, configured to update the hash table corresponding to the first vertical block according to the index pointer of the second instruction.
Optionally, the receiving unit 91 is further configured to receive a fourth indication message sent by the client, where the fourth indication message is used to indicate the server to establish a connection relationship between the first vertical block and the second vertical block;
as shown in fig. 10, the server further includes:
a connecting unit 96, configured to connect the first vertical block and the second vertical block through a linked list structure according to the fourth indication message.
Optionally, the server has established a connection relationship between the longitudinal blocks;
the receiving unit 91 is further configured to receive a fifth indication message sent by the client, where the fifth indication message includes information of a longitudinal block recording an index pointer of the second instruction, and the fifth indication message is used to indicate the server to obtain a cached instruction parameter of the second instruction;
as shown in fig. 10, the server further includes:
an obtaining unit 97, configured to obtain, according to a connection relationship between longitudinal blocks and information of a longitudinal block in which the index pointer of the second instruction is recorded, a hash table corresponding to the longitudinal block in which the index pointer of the second instruction is recorded; and acquiring the cached instruction parameters of the second instruction according to the hash table corresponding to the longitudinal block for recording the index pointer of the second instruction and the index pointer of the second instruction.
Optionally, the first instruction is a first instruction in the first independent instruction stream;
the receiving unit 91 is further configured to receive a sixth indication message sent by the client, where the sixth indication message is used to instruct the server to establish the second horizontal block for the second independent instruction stream;
the establishing unit 92 is further configured to establish the second horizontal block according to the sixth indication message;
the recording unit 93 is further configured to record an index pointer of a first instruction in the second independent instruction stream in the second horizontal block;
the connecting unit 96 is further configured to connect the second horizontal block and the first horizontal block through a linked list structure; and connecting the second transverse block with a first longitudinal block in a longitudinal block group through a linked list structure, wherein the longitudinal block group is formed by longitudinal blocks recording index pointers of instructions in the second independent instruction stream.
In the server provided in the embodiment of the present invention, a cache space of the server includes a first vertical block in which an index pointer of a first instruction is recorded, and when receiving an indication first indication message sent by a client and used to indicate the server to record an index pointer of a second instruction in a second vertical block, a second vertical block and a hash table corresponding to the second vertical block are established, and the index pointer of the second instruction is recorded in the second vertical block; the second instruction and the first instruction are two instructions in the same independent instruction stream, and the second instruction is a next instruction adjacent to the first instruction; when a second indication message which is sent by the client and used for indicating the indication parameter of the second instruction is cached according to the first indication message is received, the instruction parameter of the second instruction is cached according to at least the hash table corresponding to the second longitudinal block. According to the scheme, two discontinuous index pointers in the same independent instruction stream are respectively recorded in different longitudinal blocks, and an independent hash table is established for each longitudinal block, so that when the instruction parameters of the instructions are cached, the index pointers between the two discontinuous index pointers do not need to be cached, and therefore when the index pointers of the instructions in the instruction stream to be cached are relatively dispersed, the caching space of the cached index pointers can be saved.
EXAMPLE seven
As shown in fig. 11, for a server according to an embodiment of the present invention to execute the method for processing data according to the second embodiment, a cache space of the server includes a first vertical block, and an index pointer of a first instruction in a first independent instruction stream is recorded in the first vertical block; the method comprises the following steps: a receiver 11A, a processor 11B, a memory 11C; wherein,
a receiver 11A, configured to receive a first indication message sent by a client, where the first indication message is used to instruct the server to record the second instruction in a second vertical block;
the processor 11B is configured to establish the second vertical block and a hash table corresponding to the second vertical block according to the first indication message, and record an index pointer of the second instruction in the second vertical block;
the first indication message further comprises the size of the storage space occupied by the instruction parameter of the second instruction;
the receiver 11A is further configured to receive a second indication message sent by the client, where the second indication message is used to indicate the server to cache an instruction parameter of the second instruction according to the first indication message;
and the memory 11C is configured to cache the instruction parameter of the second instruction according to the hash table corresponding to the second vertical block, the size of the storage space occupied by the instruction parameter of the second instruction, and the index pointer of the second instruction.
Optionally, the receiver 11A is further configured to receive a third indication message sent by the client, where the third indication message is used to instruct the server to record an index pointer of the second instruction in the first vertical block;
the processor 11B is further configured to record an index pointer of the second instruction in the first vertical block according to the third indication message; and updating the hash table corresponding to the first longitudinal block according to the index pointer of the second instruction.
Optionally, the receiver 11A is further configured to receive a fourth indication message sent by the client, where the fourth indication message is used to indicate the server to establish a connection relationship between the first vertical block and the second vertical block;
the processor 11B is further configured to connect the first vertical block and the second vertical block through a linked list structure according to the fourth indication message.
Optionally, the server has established a connection relationship between the longitudinal blocks;
the receiver 11A is further configured to receive a fifth instruction message sent by the client, where the fifth instruction message includes information of a longitudinal block recording an index pointer of the second instruction, and the fifth instruction message is used to instruct the server to obtain a cached instruction parameter of the second instruction;
the processor 11B is further configured to obtain, according to the connection relationship between the longitudinal blocks and the information of the longitudinal block in which the index pointer of the second instruction is recorded, a hash table corresponding to the longitudinal block in which the index pointer of the second instruction is recorded; and acquiring the cached instruction parameters of the second instruction according to the hash table corresponding to the longitudinal block for recording the index pointer of the second instruction and the index pointer of the second instruction.
Optionally, the first instruction is a first instruction in the first independent instruction stream;
the receiver 11A is further configured to receive a sixth indication message sent by the client, where the sixth indication message is used to instruct the server to establish the second horizontal block for the second independent instruction stream;
the processor 11B is further configured to establish the second horizontal block according to the sixth indication message; recording an index pointer for a first instruction in the second independent instruction stream in the second horizontal block; connecting the second transverse block with the first transverse block through a linked list structure; and connecting the second transverse block with a first longitudinal block in a longitudinal block group through a linked list structure, wherein the longitudinal block group is formed by longitudinal blocks recording index pointers of instructions in the second independent instruction stream.
In the server provided in the embodiment of the present invention, a cache space of the server includes a first vertical block in which an index pointer of a first instruction is recorded, and when receiving an indication first indication message sent by a client and used to indicate the server to record an index pointer of a second instruction in a second vertical block, a second vertical block and a hash table corresponding to the second vertical block are established, and the index pointer of the second instruction is recorded in the second vertical block; the second instruction and the first instruction are two instructions in the same independent instruction stream, and the second instruction is a next instruction adjacent to the first instruction; when a second indication message which is sent by the client and used for indicating the indication parameter of the second instruction is cached according to the first indication message is received, the instruction parameter of the second instruction is cached according to at least the hash table corresponding to the second longitudinal block. According to the scheme, two discontinuous index pointers in the same independent instruction stream are respectively recorded in different longitudinal blocks, and an independent hash table is established for each longitudinal block, so that when the instruction parameters of the instructions are cached, the index pointers between the two discontinuous index pointers do not need to be cached, and therefore when the index pointers of the instructions in the instruction stream to be cached are relatively dispersed, the caching space of the cached index pointers can be saved.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may be physically included alone, or two or more units may be integrated into one unit. The integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional unit.
The integrated unit implemented in the form of a software functional unit may be stored in a computer readable storage medium. The software functional unit is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute some steps of the methods according to the embodiments of the present invention. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a ROM (Read-Only Memory), a RAM (Random Access Memory), a magnetic disk, or an optical disk.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (34)

1. A method for processing data is characterized in that the method is applied to the field of 3D modeling, a cache space of a client comprises a first longitudinal block of the client, an index pointer of a first instruction in a first independent instruction stream is recorded in the first longitudinal block of the client, and the first longitudinal block of the client is a part of the cache space in the client; the method comprises the following steps:
the client acquires the size of a storage space occupied by an instruction parameter of a second instruction and an index pointer of the second instruction; the second instruction is a subsequent instruction adjacent to the first instruction in the first independent instruction stream;
the client judges whether the second instruction meets a blocking strategy or not according to the index pointer of the second instruction and the index pointer of the first instruction; the blocking strategy comprises the following steps: the index pointers of two adjacent instructions in the same independent instruction stream are not continuous;
when the second instruction meets the blocking strategy, the client establishes a second longitudinal block of the client and a hash table corresponding to the second longitudinal block of the client, wherein the second longitudinal block of the client is another part of cache space which is different from the first longitudinal block of the client on the client;
the client records the index pointer of the second instruction in a second longitudinal block of the client;
and caching the instruction parameter of the second instruction by the client according to a hash table corresponding to a second longitudinal block of the client, the size of the storage space occupied by the instruction parameter of the second instruction and an index pointer of the second instruction.
2. The method of claim 1,
the blocking strategy specifically includes: the change amplitude of the index pointers of two adjacent instructions in the same independent instruction stream is greater than or equal to a first threshold value; the determining, according to the index pointer of the second instruction and the index pointer of the first instruction, whether the second instruction satisfies a blocking policy specifically includes:
judging whether the change amplitude of the index pointer of the second instruction relative to the index pointer of the first instruction is larger than or equal to a first threshold value or not;
or, the blocking policy specifically includes: the change rate of the index pointers of two adjacent instructions in the same independent instruction stream is greater than or equal to a second threshold value; the determining, according to the index pointer of the second instruction and the index pointer of the first instruction, whether the second instruction satisfies a blocking policy specifically includes:
and judging whether the change rate of the index pointer of the second instruction relative to the index pointer of the first instruction is larger than or equal to a second threshold value.
3. The method of claim 1, wherein after the establishing the second vertical chunk of the client and the hash table corresponding to the second vertical chunk of the client, the method further comprises:
sending a first indication message to a server, wherein the first indication message is used for indicating the server to record the second instruction in a second longitudinal block of the server; enabling the server to establish a second longitudinal block of the server and a hash table corresponding to the second longitudinal block of the server according to the first indication message, and recording an index pointer of the second instruction in the second longitudinal block of the server; the second vertical block of the server is a part of cache space in the server;
the first indication message further includes a size of a storage space occupied by an instruction parameter of the second instruction, and after the caching of the instruction parameter of the second instruction according to the hash table corresponding to the second vertical block of the server, the size of the storage space occupied by the instruction parameter of the second instruction, and the index pointer of the second instruction, the method further includes:
sending a second indication message to the server, wherein the second indication message is used for indicating the server to cache the instruction parameter of the second instruction according to the first indication message; and enabling the server to cache the instruction parameters of the second instruction according to a hash table corresponding to a second longitudinal block of the server, the size of the storage space occupied by the instruction parameters of the second instruction and the index pointer of the second instruction.
4. The method of claim 1, wherein the first vertical block of the client corresponds to a hash table, and wherein the method further comprises:
when the second instruction does not meet the blocking policy, the client records an index pointer of the second instruction in a first longitudinal block of the client;
and the client updates the hash table corresponding to the first longitudinal block of the client according to the index pointer of the second instruction.
5. The method according to claim 4, wherein after the client updates the hash table corresponding to the first vertical block according to the index pointer of the second instruction, the method further comprises:
sending a third indication message to the server, where the third indication message is used to indicate the server to record the index pointer of the second instruction in the first vertical block of the server; enabling the server to record the index pointer of the second instruction in the first longitudinal block of the server according to the third indication message, and updating a hash table corresponding to the first longitudinal block of the server according to the index pointer of the second instruction; the first vertical block of the server is a part of the cache space in the server.
6. The method of claim 5, wherein after the client establishes the second vertical chunk of the client and the hash table corresponding to the second vertical chunk of the client, the method further comprises:
and the client connects the first vertical block of the client with the second vertical block of the client through a linked list structure.
7. The method of claim 6, further comprising:
sending a fourth indication message to the server, where the fourth indication message is used to indicate that the server establishes a connection relationship between the first vertical block of the server and the second vertical block of the server; and enabling the server to connect the first longitudinal block of the server with the second longitudinal block of the server through a linked list structure according to the fourth indication message.
8. The method according to claim 6, wherein in a case where the client has established a connection relationship between the vertical blocks of the client, after the caching of the instruction parameter of the second instruction according to the hash table corresponding to the second vertical block of the client, the size of the storage space occupied by the instruction parameter of the second instruction, and the index pointer of the second instruction, the method further comprises:
and when the second instruction is obtained again, sequentially searching the longitudinal blocks recording the index pointer of the second instruction in the first longitudinal block group of the client according to the connection relation between the longitudinal blocks of the client from the longitudinal block recording the index pointer of the previous instruction of the second instruction, wherein the first longitudinal block group of the client is formed by the longitudinal blocks recording the index pointer of the instruction in the first independent instruction stream.
9. The method according to claim 8, wherein the server has established a connection relationship between the vertical blocks of the server; the method further comprises the following steps:
sending a fifth indication message to the server, where the fifth indication message includes information of a longitudinal block recording an index pointer of the second instruction, and the fifth indication message is used to indicate the server to obtain a cached instruction parameter of the second instruction; and the server side acquires a hash table corresponding to the longitudinal block recording the index pointer of the second instruction according to the connection relation between the longitudinal blocks of the server side and the information of the longitudinal block recording the index pointer of the second instruction, and acquires the cached instruction parameter of the second instruction according to the hash table corresponding to the longitudinal block recording the index pointer of the second instruction and the index pointer of the second instruction.
10. The method of claim 6, the first instruction being a first instruction in the first independent instruction stream, an index pointer of the first instruction being recorded in a first horizontal block of a client, the first horizontal block of the client being a portion of cache space in the client, the method further comprising:
the client acquires an index pointer of a first instruction in a second independent instruction stream, wherein the second independent instruction stream is a next independent instruction stream adjacent to the first independent instruction stream;
the client establishes a second horizontal block of the client, wherein the second horizontal block of the client is another part of cache space on the client, which is different from the first horizontal block of the client;
the client records an index pointer of a first instruction in the second independent instruction stream in the second horizontal block;
the client connects the second transverse block of the client with the first transverse block of the client through a linked list structure;
and the client connects the second transverse block of the client with one longitudinal block in the second longitudinal block group of the client through a linked list structure, and the second longitudinal block group of the client is formed by longitudinal blocks of index pointers for recording instructions in the second independent instruction stream.
11. The method of claim 10, further comprising:
sending a sixth indication message to the server, where the sixth indication message is used to indicate the server to establish a second transverse block of the server for the second independent instruction stream; enabling the server to establish a second transverse block of the server according to the sixth indication message, recording an index pointer of a first instruction in the second independent instruction stream in the second transverse block of the server, and connecting the second transverse block of the server with the first transverse block of the server through a linked list structure; connecting a second transverse block of the server with a first longitudinal block in a longitudinal block group of the server through a linked list structure, wherein the longitudinal block group of the server is formed by longitudinal blocks recording index pointers of instructions in the second independent instruction stream; the first horizontal block of the server and the second horizontal block of the server are respectively a part of cache space in the server.
12. The method of claim 10, wherein in a case that the client has established a connection relationship between the horizontal blocks and the horizontal blocks, and a connection relationship between the horizontal blocks and the vertical block groups, the method further comprises:
when the first instruction in the second independent instruction stream is obtained again, searching and determining the transverse block for recording the index pointer of the first instruction in the second independent instruction stream according to the connection relation between the transverse blocks; and searching and recording the longitudinal block of the index pointer of the first instruction in the second independent instruction stream according to the connection relation between the transverse block and the longitudinal block group.
13. A method for processing data is characterized in that the method is applied to the field of 3D modeling, a cache space of a server comprises a first longitudinal block of the server, an index pointer of a first instruction in a first independent instruction stream is recorded in the first longitudinal block of the server, and the first longitudinal block of the server is a part of the cache space in the server; the method comprises the following steps:
the server receives a first indication message sent by a client, wherein the first indication message is used for indicating the server to record a second instruction in a second longitudinal block of the server, the second instruction is a subsequent instruction adjacent to the first instruction in the first independent instruction stream, and the second longitudinal block of the server is another part of cache space of the first longitudinal block which is different from the server on the server;
the server establishes a second longitudinal block of the server and a hash table corresponding to the second longitudinal block of the server according to the first indication message, and records an index pointer of the second instruction in the second longitudinal block of the server;
the first indication message further includes a size of a storage space occupied by an instruction parameter of the second instruction, the method further comprising:
the server receives a second indication message sent by the client, wherein the second indication message is used for indicating the server to cache the instruction parameter of the second instruction according to the first indication message;
and caching the instruction parameters of the second instruction by the server according to a hash table corresponding to a second longitudinal block of the server, the size of the storage space occupied by the instruction parameters of the second instruction and an index pointer of the second instruction.
14. The method of claim 13, further comprising:
receiving a third indication message sent by the client, where the third indication message is used to indicate the server to record an index pointer of the second instruction in a first vertical block of the server;
recording an index pointer of the second instruction in a first longitudinal block of the server according to the third indication message;
and updating the hash table corresponding to the first longitudinal block of the server according to the index pointer of the second instruction.
15. The method of claim 13, further comprising:
receiving a fourth indication message sent by the client, where the fourth indication message is used to indicate the server to establish a connection relationship between the first vertical block of the server and the second vertical block of the server;
and connecting the first longitudinal block of the server with the second longitudinal block of the server through a linked list structure according to the fourth indication message.
16. The method according to claim 15, wherein the server has established a connection relationship between the vertical blocks of the server; the method further comprises the following steps:
receiving a fifth indication message sent by the client, where the fifth indication message includes information of a longitudinal block recording an index pointer of the second instruction, and the fifth indication message is used to indicate the server to obtain a cached instruction parameter of the second instruction;
acquiring a hash table corresponding to the longitudinal block recording the index pointer of the second instruction according to the connection relation between the longitudinal blocks of the server and the information of the longitudinal block recording the index pointer of the second instruction;
and acquiring the cached instruction parameters of the second instruction according to the hash table corresponding to the longitudinal block for recording the index pointer of the second instruction and the index pointer of the second instruction.
17. The method of claim 13, wherein the first instruction is a first instruction in the first independent instruction stream, the method further comprising:
receiving a sixth indication message sent by the client, where the sixth indication message is used to indicate that the server establishes a second transverse block of the server for a second independent instruction stream, and the second independent instruction stream is a subsequent independent instruction stream adjacent to the first independent instruction stream;
establishing a second transverse block of the server according to the sixth indication message;
recording an index pointer of a first instruction in the second independent instruction stream in a second transverse block of the server;
connecting the second transverse block of the server with the first transverse block of the server through a linked list structure;
connecting a second transverse block of the server with a first longitudinal block in a longitudinal block group of the server through a linked list structure, wherein the longitudinal block group of the server is formed by longitudinal blocks recording index pointers of instructions in the second independent instruction stream; the first horizontal block of the server and the second horizontal block of the server are respectively a part of cache space in the server.
18. The client side is characterized by being applied to the field of 3D modeling, wherein a cache space of the client side comprises a first longitudinal block of the client side, an index pointer of a first instruction in a first independent instruction stream is recorded in the first longitudinal block of the client side, and the first longitudinal block of the client side is a part of the cache space in the client side; the client comprises:
the obtaining unit is used for obtaining the size of a storage space occupied by an instruction parameter of a second instruction and an index pointer of the second instruction; the second instruction is a subsequent instruction adjacent to the first instruction in the first independent instruction stream;
the judging unit is used for judging whether the second instruction meets a blocking strategy or not according to the index pointer of the second instruction and the index pointer of the first instruction; the blocking strategy comprises the following steps: the index pointers of two adjacent instructions in the same independent instruction stream are not continuous;
the establishing unit is used for establishing a second longitudinal block of the client and a hash table corresponding to the second longitudinal block of the client when the second instruction meets the blocking strategy, wherein the second longitudinal block of the client is another part of cache space which is different from the first longitudinal block of the client on the client;
a recording unit, configured to record an index pointer of the second instruction in a second vertical block of the client;
and the caching unit is used for caching the instruction parameters of the second instruction according to a hash table corresponding to a second longitudinal block of the client, the size of the storage space occupied by the instruction parameters of the second instruction and an index pointer of the second instruction.
19. The client of claim 18,
the blocking strategy specifically includes: the change amplitude of the index pointers of two adjacent instructions in the same independent instruction stream is greater than or equal to a first threshold value; the judging unit is specifically configured to judge whether a variation amplitude of the index pointer of the second instruction with respect to the index pointer of the first instruction is greater than or equal to a first threshold;
or, the blocking policy specifically includes: the change rate of the index pointers of two adjacent instructions in the same independent instruction stream is greater than or equal to a second threshold value; the determining unit is specifically configured to determine whether a rate of change of the index pointer of the second instruction with respect to the index pointer of the first instruction is greater than or equal to a second threshold.
20. The client of claim 18, further comprising:
a sending unit, configured to send a first indication message to a server, where the first indication message is used to indicate the server to record the second instruction in a second longitudinal block of the server; enabling the server to establish a second longitudinal block of the server and a hash table corresponding to the second longitudinal block of the server according to the first indication message, and recording an index pointer of the second instruction in the second longitudinal block of the server; the second vertical block of the server is a part of cache space in the server;
the first indication message further includes a size of a storage space occupied by an instruction parameter of the second instruction, and the sending unit is further configured to send a second indication message to the server, where the second indication message is used to indicate the server to cache the instruction parameter of the second instruction according to the first indication message; and enabling the server to cache the instruction parameters of the second instruction according to a hash table corresponding to a second longitudinal block of the server, the size of the storage space occupied by the instruction parameters of the second instruction and the index pointer of the second instruction.
21. The client of claim 18, wherein the first vertical block of the client corresponds to a hash table;
the recording unit is further configured to record an index pointer of the second instruction in a first vertical block of the client when the second instruction does not satisfy the blocking policy;
the client further comprises:
and the updating unit is used for updating the hash table corresponding to the first longitudinal block of the client according to the index pointer of the second instruction.
22. The client of claim 21,
the sending unit is further configured to send a third indication message to the server, where the third indication message is used to indicate the server to record the index pointer of the second instruction in the first vertical block of the server; enabling the server to record the index pointer of the second instruction in the first longitudinal block of the server according to the third indication message, and updating a hash table corresponding to the first longitudinal block of the server according to the index pointer of the second instruction; the first vertical block of the server is a part of the cache space in the server.
23. The client of claim 22, further comprising:
and the connecting unit is used for connecting the first vertical block of the client with the second vertical block of the client through a linked list structure.
24. The client of claim 23,
the sending unit is further configured to send a fourth indication message to the server, where the fourth indication message is used to indicate the server to establish a connection relationship between the first vertical block of the server and the second vertical block of the server; and enabling the server to connect the first longitudinal block of the server with the second longitudinal block of the server through a linked list structure according to the fourth indication message.
25. The client of claim 23, further comprising:
and when the second instruction is obtained again, sequentially searching the longitudinal blocks recording the index pointer of the second instruction in the first longitudinal block group of the client according to the connection relationship between the longitudinal blocks of the client from the longitudinal block recording the index pointer of the previous instruction of the second instruction, wherein the first longitudinal block group is formed by the longitudinal blocks recording the index pointer of the instruction in the first independent instruction stream.
26. The client according to claim 25, wherein the server has established a connection relationship between the vertical blocks of the server;
the sending unit is further configured to send a fifth indication message to the server, where the fifth indication message includes information of a longitudinal block recording an index pointer of the second instruction, and the fifth indication message is used to indicate the server to obtain a cached instruction parameter of the second instruction; and the server side acquires a hash table corresponding to the longitudinal block recording the index pointer of the second instruction according to the connection relation between the longitudinal blocks of the server side and the information of the longitudinal block recording the index pointer of the second instruction, and acquires the cached instruction parameter of the second instruction according to the hash table corresponding to the longitudinal block recording the index pointer of the second instruction and the index pointer of the second instruction.
27. The client of claim 23, wherein the first instruction is a first instruction in the first independent instruction stream, and an index pointer of the first instruction is recorded in a first horizontal block of the client, and the first horizontal block of the client is a part of a cache space in the client;
the obtaining unit is further configured to obtain an index pointer of a first instruction in a second independent instruction stream, where the second independent instruction stream is a next independent instruction stream adjacent to the first independent instruction stream;
the establishing unit is further configured to establish a second horizontal block of the client, where the second horizontal block of the client is another part of the cache space on the client different from the first horizontal block of the client;
the recording unit is further configured to record an index pointer of a first instruction in the second independent instruction stream in the second horizontal block;
the connection unit is further configured to connect the second horizontal block of the client with the first horizontal block of the client through a linked list structure; and connecting the second transverse block of the client with one longitudinal block in a second longitudinal block group of the client through a linked list structure, wherein the second longitudinal block group of the client is formed by longitudinal blocks recording index pointers of instructions in the second independent instruction stream.
28. The client of claim 27,
the sending unit is further configured to send a sixth indication message to the server, where the sixth indication message is used to indicate the server to establish a second horizontal block of the server for the second independent instruction stream; enabling the server to establish a second transverse block of the server according to the sixth indication message, recording an index pointer of a first instruction in the second independent instruction stream in the second transverse block of the server, and connecting the second transverse block of the server with the first transverse block of the server through a linked list structure; connecting a second transverse block of the server with a first longitudinal block in a longitudinal block group of the server through a linked list structure, wherein the longitudinal block group of the server is formed by longitudinal blocks recording index pointers of instructions in the second independent instruction stream; the first horizontal block of the server and the second horizontal block of the server are respectively a part of cache space in the server.
29. The client of claim 27, wherein the client has established a connection relationship between horizontal blocks and horizontal blocks, and a connection relationship between horizontal blocks and vertical block groups, and wherein the client further comprises:
the searching unit is used for searching and determining the transverse block for recording the index pointer of the first instruction in the second independent instruction stream according to the connection relation between the transverse blocks when the first instruction in the second independent instruction stream is obtained again; and searching and recording the longitudinal block of the index pointer of the first instruction in the second independent instruction stream according to the connection relation between the transverse block and the longitudinal block group.
30. A server, wherein a cache space of the server includes a first vertical block of the server, an index pointer of a first instruction in a first independent instruction stream is recorded in the first vertical block of the server, and the first vertical block of the server is a part of the cache space in the server; the server side comprises:
a receiving unit, configured to receive a first indication message sent by a client, where the first indication message is used to indicate that a second instruction is recorded in a second longitudinal block of a server by the server, the second instruction is a subsequent instruction in the first independent instruction stream, where the subsequent instruction is adjacent to the first instruction, and the second longitudinal block of the server is another part of a cache space of the first longitudinal block, where the second longitudinal block is different from the server, on the server;
the establishing unit is used for establishing a second longitudinal block of the server and a hash table corresponding to the second longitudinal block of the server according to the first indication message;
the recording unit is used for recording the index pointer of the second instruction in a second longitudinal block of the server;
the first indication message further comprises the size of the storage space occupied by the instruction parameter of the second instruction; the receiving unit is further configured to receive a second indication message sent by the client, where the second indication message is used to indicate the server to cache an instruction parameter of the second instruction according to the first indication message;
the server side further comprises:
and the caching unit is used for caching the instruction parameters of the second instruction according to a hash table corresponding to a second longitudinal block of the server, the size of the storage space occupied by the instruction parameters of the second instruction and the index pointer of the second instruction.
31. The server according to claim 30,
the receiving unit is further configured to receive a third indication message sent by the client, where the third indication message is used to indicate the server to record an index pointer of the second instruction in a first vertical block of the server;
the recording unit is further configured to record an index pointer of the second instruction in a first vertical block of the server according to the third indication message;
the server side further comprises:
and the updating unit is used for updating the hash table corresponding to the first longitudinal block of the server according to the index pointer of the second instruction.
32. The server according to claim 30,
the receiving unit is further configured to receive a fourth indication message sent by the client, where the fourth indication message is used to indicate the server to establish a connection relationship between the first vertical block of the server and the second vertical block of the server;
the server side further comprises:
and the connection unit is used for connecting the first longitudinal block of the server with the second longitudinal block of the server through a linked list structure according to the fourth indication message.
33. The server according to claim 32, wherein the server has established a connection relationship between the vertical blocks of the server;
the receiving unit is further configured to receive a fifth indication message sent by the client, where the fifth indication message includes information of a longitudinal block recording an index pointer of the second instruction, and the fifth indication message is used to indicate the server to obtain a cached instruction parameter of the second instruction;
the server side further comprises:
the acquisition unit is used for acquiring a hash table corresponding to the longitudinal block recording the index pointer of the second instruction according to the connection relation between the longitudinal blocks of the server and the information of the longitudinal block recording the index pointer of the second instruction; and acquiring the cached instruction parameters of the second instruction according to the hash table corresponding to the longitudinal block for recording the index pointer of the second instruction and the index pointer of the second instruction.
34. The server according to claim 32, wherein the first instruction is a first instruction in the first independent instruction stream;
the receiving unit is further configured to receive a sixth indication message sent by the client, where the sixth indication message is used to indicate that the server establishes a second transverse block of the server for a second independent instruction stream, and the second independent instruction stream is a next independent instruction stream adjacent to the first independent instruction stream;
the establishing unit is further configured to establish a second horizontal block of the server according to the sixth indication message;
the recording unit is further configured to record an index pointer of a first instruction in the second independent instruction stream in a second horizontal block of the server;
the connecting unit is further used for connecting the second transverse block of the server with the first transverse block of the server through a linked list structure; connecting a second transverse block of the server with a first longitudinal block in a longitudinal block group of the server through a linked list structure, wherein the longitudinal block group of the server is formed by longitudinal blocks recording index pointers of instructions in the second independent instruction stream; the first horizontal block of the server and the second horizontal block of the server are respectively a part of cache space in the server.
CN201310652055.6A 2013-12-04 2013-12-04 A kind of method and apparatus for handling data Active CN104699692B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201310652055.6A CN104699692B (en) 2013-12-04 2013-12-04 A kind of method and apparatus for handling data
PCT/CN2014/086486 WO2015081745A1 (en) 2013-12-04 2014-09-15 Method and apparatus for processing data

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310652055.6A CN104699692B (en) 2013-12-04 2013-12-04 A kind of method and apparatus for handling data

Publications (2)

Publication Number Publication Date
CN104699692A CN104699692A (en) 2015-06-10
CN104699692B true CN104699692B (en) 2018-06-15

Family

ID=53272844

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310652055.6A Active CN104699692B (en) 2013-12-04 2013-12-04 A kind of method and apparatus for handling data

Country Status (2)

Country Link
CN (1) CN104699692B (en)
WO (1) WO2015081745A1 (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6075540A (en) * 1998-03-05 2000-06-13 Microsoft Corporation Storage of appearance attributes in association with wedges in a mesh data model for computer graphics
US7027972B1 (en) * 2001-01-24 2006-04-11 Ati Technologies, Inc. System for collecting and analyzing graphics data and method thereof
CN101430792A (en) * 2008-12-04 2009-05-13 中山大学 Gradual indication method facing interactive movable three-dimension graphics
CN102750725A (en) * 2012-06-05 2012-10-24 南京安讯网络服务有限公司 Accelerated terrain rendering method based on graphics processor
CN102902848A (en) * 2012-09-18 2013-01-30 大连理工大学 Three-dimensional visualization simulation method directed at boundary element analysis

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001325298A (en) * 2000-05-15 2001-11-22 Jeol Ltd Control data structure and retrieval method using the same
US7162716B2 (en) * 2001-06-08 2007-01-09 Nvidia Corporation Software emulator for optimizing application-programmable vertex processing
US7917492B2 (en) * 2007-09-21 2011-03-29 Limelight Networks, Inc. Method and subsystem for information acquisition and aggregation to facilitate ontology and language-model generation within a content-search-service system
CN101968795B (en) * 2010-09-03 2012-05-09 清华大学 Cache method for file system with changeable data block length
CN102129473B (en) * 2011-04-19 2016-09-14 北京思特奇信息技术股份有限公司 A kind of method for searching static data
CN102289466B (en) * 2011-07-21 2013-11-13 东北大学 K-nearest neighbor searching method based on regional coverage

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6075540A (en) * 1998-03-05 2000-06-13 Microsoft Corporation Storage of appearance attributes in association with wedges in a mesh data model for computer graphics
US7027972B1 (en) * 2001-01-24 2006-04-11 Ati Technologies, Inc. System for collecting and analyzing graphics data and method thereof
CN101430792A (en) * 2008-12-04 2009-05-13 中山大学 Gradual indication method facing interactive movable three-dimension graphics
CN102750725A (en) * 2012-06-05 2012-10-24 南京安讯网络服务有限公司 Accelerated terrain rendering method based on graphics processor
CN102902848A (en) * 2012-09-18 2013-01-30 大连理工大学 Three-dimensional visualization simulation method directed at boundary element analysis

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
"基于GPU的大规模地形场景实时渲染";程甜甜 等;《苏州大学学报(工科版)》;20080630;第28卷(第3期);全文 *
"基于三角形索引顶点数据结构的三维地形绘制算法";陈孝威 等;《贵州大学学报(自然科学版)》;20081130;第25卷(第6期);全文 *
"基于顶点索引的三维建模与可视化方法研究";陈密密;《影像技术》;20110228(第2期);全文 *
"瓦片块四叉树动态地形层次细节算法";张豫南 等;《兵工学报》;20111130;第32卷(第11期);全文 *

Also Published As

Publication number Publication date
WO2015081745A1 (en) 2015-06-11
CN104699692A (en) 2015-06-10

Similar Documents

Publication Publication Date Title
CN105138678B (en) A kind of reading, distribution method and the reading of map tile data, dissemination system
US7537523B2 (en) Dynamic player groups for interest management in multi-character virtual environments
US8947431B2 (en) Method and system for providing scene data of virtual world
US10298970B2 (en) Image transmission method and apparatus
US9569742B2 (en) Reducing costs related to use of networks based on pricing heterogeneity
CN105224255B (en) A kind of storage file management method and device
KR102147356B1 (en) Cache memory system and operating method for the same
CN105635196A (en) Method and system of file data obtaining, and application server
DE112018002568T5 (en) Method, systems and apparatus for reducing memory latency when retrieving pixel cores
CN106330788B (en) Message fragment transmission method and device
US10972296B2 (en) Messaging to enforce operation serialization for consistency of a distributed data structure
CN104598168A (en) Data recovery method and object storage equipment
CN108334460A (en) data cache method and device
CN102129663B (en) Processing method for image with unaligned reading address and width and circuit structure
CN104699692B (en) A kind of method and apparatus for handling data
CN111049750B (en) Message forwarding method, system and equipment
JP2019128837A (en) Server device, information collecting system, and program
CN102780780B (en) Method, equipment and system for data processing in cloud computing mode
CN112614210A (en) Engineering drawing display method, system and related device
CN105610921B (en) Correcting and eleting codes archiving method based on data buffer storage under a kind of cluster
CN113590666B (en) Data caching method, system, equipment and computer medium in AI cluster
CN104735097A (en) Information collecting method and system
KR102157591B1 (en) Apparatus for Spatial Query in Big Data Environment and Computer-Readable Recording Medium with Program therefor
CN107943519B (en) A kind of time series data random ordering operation processing method and device
CN105912477A (en) Directory reading method, device and system

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20220217

Address after: 550025 Huawei cloud data center, jiaoxinggong Road, Qianzhong Avenue, Gui'an New District, Guiyang City, Guizhou Province

Patentee after: Huawei Cloud Computing Technologies Co.,Ltd.

Address before: 518129 Bantian HUAWEI headquarters office building, Longgang District, Guangdong, Shenzhen

Patentee before: HUAWEI TECHNOLOGIES Co.,Ltd.

TR01 Transfer of patent right