Disclosure of Invention
The embodiment of the invention aims to provide a data processing method and device for an address space, so as to perform data processing on node data stored in the address space. The specific technical scheme is as follows:
in a first aspect, an embodiment of the present invention provides a data processing method for an address space, where the method includes:
receiving a data processing instruction for an address space;
judging whether the data processing instruction indicates to process all node data stored in an address space;
if yes, regenerating node data in an address space according to attribute information of the node data contained in the data processing instruction, and reloading the address space according to the generated node data, wherein the attribute information comprises: the method comprises the steps that a storage address of source data corresponding to a node represented by node data in a storage space, and a hierarchical relationship between the node represented by the node data and other nodes are: nodes represented by other node data stored in the address space;
Otherwise, according to the data processing instruction, data processing is carried out in the address space, so that partial node data in the address space are changed.
In one embodiment of the present invention, the performing data processing in the address space according to the data processing instruction, so that part of node data in the address space is changed, includes:
judging whether the data processing instruction indicates adding node data in the address space;
if yes, adding preset basic node data in the address space, and adjusting the attribute information in the added basic node data according to the attribute information of the node data contained in the data processing instruction;
otherwise, determining target node data aimed by the data processing instruction, and processing the target node data according to the processing requirement indicated by the data processing instruction.
In one embodiment of the present invention, the adding preset base node data in the address space includes:
determining a data type of source data contained in the data processing instruction;
adding preset basic node data matched with the determined data type in the address space.
In one embodiment of the present invention, the processing the target node data according to the processing requirement indicated by the data processing instruction includes:
if the data processing instruction is a node data deleting instruction, deleting the target node data from the address space;
and if the data processing instruction is a node data modification instruction, adjusting the attribute information in the target node data according to the attribute information of the node data contained in the data processing instruction.
In one embodiment of the invention, the method further comprises:
acquiring source data stored under a target address from the storage space, wherein the target address is: a storage address contained in the node data after the data processing;
and storing the acquired source data in the address space as the composition data of the node data after the data processing.
In one embodiment of the invention, the method further comprises:
receiving a source data acquisition request sent by a client, wherein the source data acquisition request carries a node data identifier;
determining first node data indicated by the node data identification according to the node data identification carried in the source data acquisition request;
And if the first node data contains source data, sending the source data contained in the first node data to the client.
In one embodiment of the invention, the method further comprises:
receiving a source data acquisition request sent by a client, wherein the source data acquisition request carries a node data identifier;
determining second node data indicated by the node data identification according to the node data identification carried in the source data acquisition request;
and acquiring the source data stored under the storage address contained in the second node data from the storage space, and transmitting the acquired source data to the client.
In a second aspect, an embodiment of the present invention provides a data processing apparatus for an address space, the apparatus including:
the instruction receiving module is used for receiving a data processing instruction aiming at the address space;
the instruction judging module is used for judging whether the data processing instruction is used for processing all node data stored in the address space;
and an address space reloading module, configured to, if the determination result of the instruction determining module is yes, regenerate node data in an address space according to attribute information of node data included in the data processing instruction, and reload the address space according to the generated node data, where the attribute information includes: the method comprises the steps that a storage address of source data corresponding to a node represented by node data in a storage space, and a hierarchical relationship between the node represented by the node data and other nodes are: nodes represented by other node data stored in the address space;
And the data processing module is used for carrying out data processing in the address space according to the data processing instruction under the condition that the judging result of the instruction judging module is negative, so that part of node data in the address space is changed.
In one embodiment of the present invention, the data processing module includes:
an instruction judging sub-module for judging whether the data processing instruction indicates adding node data in the address space;
the data adding sub-module is used for adding preset basic node data in the address space under the condition that the judging result of the instruction judging sub-module is yes, and adjusting the attribute information in the added basic node data according to the attribute information of the node data contained in the data processing instruction;
and the data processing sub-module is used for determining target node data aimed at by the data processing instruction under the condition that the judging result of the instruction judging sub-module is negative, and processing the target node data according to the processing requirement indicated by the data processing instruction.
In one embodiment of the present invention, the data adding submodule is specifically configured to:
If the judging result of the instruction judging submodule is yes, determining the data type of the source data contained in the data processing instruction;
adding preset basic node data matched with the determined data type into the address space;
and adjusting the attribute information in the added basic node data according to the attribute information of the node data contained in the data processing instruction.
In one embodiment of the present invention, the data processing sub-module is specifically configured to:
under the condition that the judging result of the instruction judging submodule is negative, determining target node data aimed at by the data processing instruction;
if the data processing instruction is a node data deleting instruction, deleting the target node data from the address space;
and if the data processing instruction is a node data modification instruction, adjusting the attribute information in the target node data according to the attribute information of the node data contained in the data processing instruction.
In one embodiment of the invention, the apparatus further comprises:
the data acquisition module is used for acquiring source data stored under a target address from the storage space, wherein the target address is: a storage address contained in the node data after the data processing;
And the data storage module is used for storing the acquired source data in the address space as the composition data of the node data after the data processing.
In one embodiment of the invention, the apparatus further comprises:
the first request receiving module is used for receiving a source data acquisition request sent by a client, wherein the source data acquisition request carries a node data identifier;
the first data determining module is used for determining first node data indicated by the node data identifier according to the node data identifier carried in the source data acquisition request;
and the data sending module is used for sending the source data contained in the first node data to the client if the source data contained in the first node data.
In one embodiment of the invention, the apparatus further comprises:
the second request receiving module is used for receiving a source data acquisition request sent by the client, wherein the source data acquisition request carries a node data identifier;
the second data determining module is used for determining second node data indicated by the node data identifier according to the node data identifier carried in the source data acquisition request;
And the source data sending module is used for acquiring the source data stored under the storage address contained in the second node data from the storage space and sending the acquired source data to the client.
In a third aspect, an embodiment of the present invention provides an electronic device, including a processor, a communication interface, a memory, and a communication bus, where the processor, the communication interface, and the memory complete communication with each other through the communication bus;
a memory for storing a computer program;
a processor for implementing the method steps of any of the first aspects when executing a program stored on a memory.
In a fourth aspect, embodiments of the present invention provide a computer-readable storage medium having a computer program stored therein, which when executed by a processor, implements the method steps of any of the first aspects.
In a fifth aspect, embodiments of the present invention also provide a computer program product comprising instructions which, when run on a computer, cause the computer to perform the method steps of any of the first aspects described above.
The embodiment of the invention has the beneficial effects that:
when the scheme provided by the embodiment of the invention is applied to data processing in the address space, a data processing instruction is received, whether the data processing instruction represents processing of all node data stored in the address space is judged, if so, the node data in the address space is regenerated according to the attribute information of the node data contained in the data processing instruction, and the address space is reloaded. Otherwise, data processing is performed in the address space, so that part of node data in the address space is changed.
From the above, the scheme provided by the embodiment of the invention can regenerate the node data in the address space and reload the address space, so that the address space is changed. The data processing may also be performed in the address space such that part of the node data in the address space is changed, thereby changing the address space. Therefore, the data processing of the node data in the address space can be realized according to the processing requirements indicated by the data processing instructions.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
Because the source data stored in the storage space in the prior art can change along with the application, in order to enable the node represented by the node data to correspond to the source data in the storage space, the embodiment of the invention provides a data processing method and device aiming at the address space.
In one embodiment of the present invention, there is provided a data processing method for an address space, the method including:
a data processing instruction for an address space is received.
And judging whether the data processing instruction indicates to process all node data stored in the address space.
If yes, regenerating node data in an address space according to attribute information of the node data contained in the data processing instruction, and reloading the address space according to the generated node data, wherein the attribute information comprises: the storage address of the source data corresponding to the node represented by the node data in the storage space, and the hierarchical relationship between the node represented by the node data and other nodes, wherein the other nodes are as follows: nodes represented by other node data stored in the address space.
Otherwise, according to the data processing instruction, data processing is performed in the address space, so that part of node data in the address space is changed.
From the above, the scheme provided by the embodiment of the invention can regenerate the node data in the address space and reload the address space, so that the address space is changed. The data processing may also be performed in the address space such that part of the node data in the address space is changed, thereby changing the address space. Therefore, the data processing of the node data in the address space can be realized according to the processing requirements indicated by the data processing instructions.
The data processing method and device for address space provided by the embodiment of the invention are explained below through specific embodiments.
Referring to fig. 1A, an embodiment of the present invention provides a flowchart of a first method for processing data for an address space, where the method may be implemented through the following steps S101 to S104.
S101: a data processing instruction for an address space is received.
The data processing instruction may be an instruction directly input by the user to the electronic device running the address space, or an instruction input by the user to the client and transmitted to the electronic device running the address space via the client.
The address space may be an OPC UA (Open Platform Communications Unified Architecture, open communication platform unified architecture) address space, which may be created by an OPC UA service.
Specifically, different node data are stored in the address space, the different node data are used for representing different nodes, each node corresponds to one kind of source data stored in the storage space, and a hierarchical relationship exists between the different nodes.
The types of the source data may be: the category to which the content represented by the source data belongs is, for example, a category of the source data representing a school is a school category, and a category of the source data representing a classroom is a classroom category.
The node data may include: the storage address, the data type, and the type of the source data corresponding to the node represented by the node data, and information for representing the hierarchical relationship between the node represented by the node data and other nodes represented by other node data in the address space. The node data stores a storage address of source data corresponding to a node represented by the node data, and the storage address corresponds to the source data one by one, so that it can be considered that a mapping relationship exists between the node data and the source data.
In addition, the node data may further include: the node name of the node represented by the node data, the node type corresponding to the data type of the source data corresponding to the node represented by the node data, and the association relationship between the node represented by the node data and the source data, wherein the association relationship comprises type conversion, mapping address, driving identification and the like of the node data and the source data.
Wherein, the data types may include: common types such as Object type and Variable type, and DA types such as DataItem type, analogItem type, twoStateDissete type, multiStateDissete type, etc.
The node type may be the same as a data type of source data corresponding to the node represented by the node data, for example, the data type of the source data is an Object type, and the node type is also an Object type.
The node type may be different from a data type of source data corresponding to a node represented by the node data, for example, the data type of the source data is a Variable type, and the node type is a DataItem type. The type conversion relationship between the data type of the source data and the node type can be represented by the type conversion of the node data and the source data, namely, the type conversion from the Variable type to the DataItem type.
As for the hierarchical relationship between nodes, in one case, the above-described hierarchical relationship may be considered to mean that there is a relationship between the source data corresponding to different nodes and the contained one. For example, the node 1 corresponds to source data of a vehicle type stored in the storage space, and the node 2 corresponds to source data of a door type stored in the storage space. Since the source data of the door type may be included in the source data of the vehicle type, the level of the node 1 may be considered higher than that of the node 2, and the node 1 may be referred to as a parent node of the node 2. The node data representing the node 2 may contain information representing that the node 1 is its parent node, which is used to represent the hierarchical relationship between the node 1 and the node 2.
In another case, the above hierarchical relationship may be considered to represent that there is a superior-inferior relationship between source data corresponding to different nodes. For example, the node 3 corresponds to the source data of the teacher kind stored in the storage space, and the node 4 corresponds to the source data of the student kind stored in the storage space. Since the teacher may be considered to be higher in level than the students, the level of node 3 may be considered to be higher than that of node 4, and node 3 may be referred to as the parent node of node 4. The node data representing the node 4 may include information representing that the node 3 is its parent, which is used to represent a hierarchical relationship between the node 3 and the node 4.
In addition, the data processing instruction is: instructions for processing node data stored in an address space.
S102: and judging whether the data processing instruction indicates to process all node data stored in the address space. If the result is that the data processing instruction indicates that all the node data stored in the address space are processed, step S103 is executed, otherwise step S104 is executed.
Specifically, the range of node data indicated by different data processing instructions and corresponding to the data processing operation performed in the address space is different. If the data processing instruction indicates that all node data stored in the address space is processed, it is equivalent to updating the entire address space. Otherwise, only a portion of the node data in the address space changes. Therefore, in both cases where the data processing instruction indicates processing of all node data stored in the address space and does not indicate processing of all node data stored in the address space, data processing for the address space needs to be performed in a different manner.
S103: and regenerating node data in an address space according to the attribute information of the node data contained in the data processing instruction, and reloading the address space according to the generated node data.
Wherein the attribute information includes: the storage address of the source data corresponding to the node represented by the node data in the storage space, and the hierarchical relationship between the node represented by the node data and other nodes.
The other nodes are as follows: nodes represented by other node data stored in the address space.
The source data corresponding to the nodes represented by the different node data are different, and the storage addresses of the different source data in the storage space are different, so that the storage addresses contained in the different node data are different. The hierarchical relationship between different nodes and other nodes is different, and information representing the hierarchical relationship between the nodes and other nodes in the node data is also different. The attribute information contained in the different node data is different.
For example, the node 5 is a parent node of the node 6, the node 5 corresponds to source data of a cell phone category, and the node 6 corresponds to source data of a cell phone screen category. The attribute information of the node 5 includes: the storage address of the source data of the mobile phone type and the information indicating that the node 6 is a child node thereof, and the attribute information of the node 6 includes: the storage address of the source data of the cell phone screen category, information indicating that the node 5 is its parent node.
In one embodiment of the present invention, preset base node data may be generated, and the attribute information in the generated base node data may be adjusted according to the attribute information of the node data included in the data processing instruction.
Specifically, the base node data is general and preset node data, and the base node data contains preset attribute information. After the basic data node is generated, the attribute information of the node data contained in the data processing instruction is used for replacing the attribute information in the generated basic node data, so that the node data indicated by the data processing instruction is obtained.
In another embodiment of the present invention, the reloading the address space according to the generated node data includes:
deleting all node data originally contained in the address space, releasing the space occupied by the address data originally contained and storing the address data, and adding the generated node data into the address space, so that the node data stored in the address space is updated.
S104: and carrying out data processing in the address space according to the data processing instruction so as to change part of node data in the address space.
Specifically, adding node data, modifying node data, deleting node data, or the like may be performed in the address space, so that part of the node data in the address space is changed.
In one embodiment of the present invention, the step S104 may be implemented through steps S104A-S104C, which are not described in detail herein.
From the above, the scheme provided by the embodiment of the invention can regenerate the node data in the address space and reload the address space, so that the address space is changed. The data processing may also be performed in the address space such that part of the node data in the address space is changed, thereby changing the address space. Therefore, the data processing of the node data in the address space can be realized according to the processing requirements indicated by the data processing instructions.
Referring to fig. 1B, a flow chart of a second method for processing data for address space according to an embodiment of the present invention, compared with the embodiment shown in fig. 1A, the above step S104 may be implemented by the following steps S104A-S104C.
S104A: and judging whether the data processing instruction indicates that node data is added in the address space. If the data processing instruction indicates that node data is added to the address space, step S104B is executed. Otherwise, step S104C is performed.
Specifically, the types of data processing operations performed in the address space indicated by different data processing instructions are different. If the data processing instruction indicates that node data is added in the address space, it indicates that non-existing node data needs to be added in the address space, otherwise, data processing needs to be performed on the node data existing in the address space. Therefore, in both cases where the data processing instruction indicates that node data is added to the address space and does not indicate that data is added to the address space, data processing for the address space needs to be performed in a different manner.
S104B: adding preset basic node data in the address space, and adjusting the attribute information in the added basic node data according to the attribute information of the node data contained in the data processing instruction.
Specifically, after adding the basic data node in the address space, the attribute information of the node data included in the data processing instruction is used to replace the attribute information in the added basic node data, so as to obtain the node data indicated by the data processing instruction.
In one embodiment of the present invention, the preset base node data may be added to the address space through the following steps a-B.
Step A: and determining the data type of the source data contained in the data processing instruction.
Specifically, the data type of the source data included in the data processing instruction may be represented by a name of the data type, for example Object, dataItem.
The data type of the source data included in the data processing instruction may be represented by a data type number, for example, object type number 1, variable type number 2, dataitem type number 3, or the like.
And (B) step (B): and adding preset basic node data matched with the determined data type into the address space.
Specifically, unlike the base node data that matches different data types, for example, the source data of the normal type only includes the source data itself, and does not include the unit of measure of the source data, for example, the source data of the normal type may be 0, 5, 6.8, or the like. The basic node data matched with the normal type does not contain the unit of measure information of the source data.
The DA-type source data includes other information such as a unit of measurement of data, a measurement range, a maximum value of data, and a minimum value of data, in addition to the data itself, for example, the unit of measurement may be a vehicle, a person, a kilogram, etc., the measurement range may be 0-100, the maximum value of data may be 2000, and the minimum value of data may be 0, etc. The basic node data matched with the DA type comprises measurement unit information, range information, upper limit information, lower limit information and the like of the source data.
Thus, generating base node data that matches the determined data type can enable the generated base node data to better match the data type of the source data.
S104C: and determining target node data aimed by the data processing instruction, and processing the target node data according to the processing requirement indicated by the data processing instruction.
In one embodiment of the present invention, the target node data may be determined according to an identification of the node data included in the data processing instruction.
The node data identifier may be: the node data identifier may be a node number of the node data, in the case where the node number is included in the node data, such as a type and a storage address of source data corresponding to the node indicated by the node data.
Specifically, the processing requirement indicated by the data processing instruction may be a processing requirement for modifying the node data, a processing requirement for deleting the node data, or the like.
In one embodiment of the present invention, the target node data may be processed through the following steps C-D.
Step C: and deleting the target node data from the address space if the data processing instruction is a node data deleting instruction.
Specifically, the target node data may be deleted directly in the address space, or may be deleted after the target node data is backed up.
In addition, after deleting the target node data in the address space, the space originally occupied by the deleted target node data for storing the target node data needs to be released.
Step D: and if the data processing instruction is a node data modification instruction, adjusting the attribute information in the target node data according to the attribute information of the node data contained in the data processing instruction.
Specifically, if the data processing instruction is a node data modification instruction, it indicates that modification of the target node data is required, so that attribute information contained in the data processing instruction may be used to replace attribute information originally contained in the target node data, thereby adjusting the attribute information in the target node data.
Therefore, through the steps C-D, the scheme provided by the embodiment of the invention can delete and modify the node data stored in the address space, thereby implementing data processing on the node data stored in the address space.
From the above, according to the scheme provided by the embodiment of the invention, not only can node data be added in the address space, but also target node data existing in the address space can be processed, so that the data processing of the node data in the address space can be realized according to the processing requirement indicated by the data processing instruction, and part of the node data in the address space is changed.
Referring to fig. 2, a flow chart of a third method for processing data for address space according to an embodiment of the present invention is provided, and compared with the embodiment shown in fig. 1A, the method further includes the following steps S105-S106.
S105: and acquiring the source data stored under the target address from the storage space.
Wherein, the target address is: and the storage address contained in the node data after the data processing.
Specifically, the storage addresses included in the node data are: the source data corresponding to the node represented by the node data is stored at the storage address in the storage space, so that the source data stored at the target address is the source data corresponding to the node represented by the node data after the data processing.
The source data may be temporary data, static data, or dynamic data.
In one embodiment of the present invention, a first data acquisition request for acquiring source data stored at the target address may be sent to the storage space, and source data fed back by the storage space may be received, so as to acquire source data stored at the target address.
S106: and storing the acquired source data in the address space as the composition data of the node data after the data processing.
The node data includes a plurality of different data, such as a storage address of source data corresponding to a node represented by the node data, a type of source data corresponding to the node represented by the node data, and the like, and each data included in the node data may be referred to as a constituent data of the node data. The obtained source data is stored in the address space as a part of the node data, corresponding to the composition data of the node data after the data processing.
Specifically, the source data may be stored in a memory, a file, a database, or the like.
In one embodiment of the present invention, the obtained source data may be stored in the address space as a part of the node data after the data processing, under the condition that the data amount of the obtained source data is smaller than the preset data amount, by being limited by the storage space size of the address space.
In view of the above, the node data may include not only a storage address of source data corresponding to a node represented by the node data, but also source data, so that the node data may directly represent the source data. The node data is processed by data, and it may be explained that source data corresponding to a node represented by the node data is changed. Therefore, after the node data is subjected to data processing, the source data stored under the target address is acquired from the storage space and stored in the address space as a part of the node data after the data processing, so that the stored source data can be consistent with the source data stored in the storage space.
In addition, since the source data stored in the storage space may be changed, in order to keep the source data contained in the node data the same as the source data stored in the storage space, steps S105 to S106 may be performed once every preset time period elapses, thereby updating the source data contained in the node data. For example, the preset time period may be 30s, 60s, or the like.
Steps S105 to S106 may be performed once every time the client acquires the source data through the address space for a preset number of times, thereby updating the source data included in the node data. For example, the preset time period may be 3 times, 10 times, or the like.
Referring to fig. 3, a flowchart of a fourth method for processing data for address space according to an embodiment of the present invention is shown, and compared with the embodiment shown in fig. 2, the method further includes the following steps S107 to S109.
S107: and receiving a source data acquisition request sent by the client.
The source data acquisition request carries a node data identifier.
Specifically, the node data identifier may be: the node data identifier may be a node number of the node data, in the case where the node number is included in the node data, such as a type and a storage address of source data corresponding to the node indicated by the node data.
S108: and determining the first node data indicated by the node data identification according to the node data identification carried in the source data acquisition request.
Specifically, different node data identifiers correspond to different node data, and according to the node data identifiers, first node data indicated by the node data identifiers can be determined in an address space.
S109: and if the first node data contains source data, sending the source data contained in the first node data to the client.
Specifically, the source data included in the first node data may be transmitted to the client through a wired or wireless network.
If the first node data does not include source data, source data stored at a storage address included in the first node data may be acquired from the storage space, and the acquired source data may be transmitted to the client, so that the client may acquire the source data.
As can be seen from the above, in the case that the source data is included in the first node data, the scheme provided by the embodiment of the present invention may directly send the source data included in the first node to the client, so that the client may obtain the requested data. And the storage address is not required to be sent to the client, so that the client acquires the source data stored under the storage address in the storage space after acquiring the storage address. Therefore, the efficiency of the client to acquire the source data is improved. In addition, the storage space of the client can not be accessed in the process of acquiring the source data, the storage space and the address space can run independently of each other, and the storage space and the client can also run independently of each other, so that the running of the storage space of the client in the process of acquiring the source data is not influenced by the client and the address space.
Referring to fig. 4, a flowchart of a fifth method for processing data for address space according to an embodiment of the present invention is shown, and compared with the embodiment shown in fig. 1A, the method further includes the following steps S110 to S112.
S110: and receiving a source data acquisition request sent by the client.
The source data acquisition request carries a node data identifier.
S111: and determining second node data indicated by the node data identification according to the node data identification carried in the source data acquisition request.
S112: and acquiring the source data stored in the storage address contained in the second node data from the storage space, and transmitting the acquired source data to the client.
Specifically, after the source data stored at the storage address included in the second node data is acquired, the source data may be further stored in the address space as component data of the node data, so that the address space may directly send the source data to the client when the client acquires the source data next time.
As can be seen from the above, under the condition that the source data corresponding to the node data is not stored in the address space, the scheme provided by the embodiment of the invention can acquire the source data stored at the storage address included in the second node data from the storage space, and send the source data to the client, so that the client can acquire the source data stored at the storage address in the storage space, and the source data acquisition process of the client is realized.
Corresponding to the foregoing data processing method for address space, referring to fig. 5A, an embodiment of the present invention further provides a schematic structural diagram of a first data processing apparatus for address space, where the apparatus includes:
an instruction receiving module 501, configured to receive a data processing instruction for an address space;
an instruction determining module 502, configured to determine whether the data processing instruction indicates processing of all node data stored in an address space;
an address space reloading module 503, configured to, if the determination result of the instruction determining module 502 is yes, regenerate node data in an address space according to attribute information of node data included in the data processing instruction, and reload the address space according to the generated node data, where the attribute information includes: the method comprises the steps that a storage address of source data corresponding to a node represented by node data in a storage space, and a hierarchical relationship between the node represented by the node data and other nodes are: nodes represented by other node data stored in the address space;
and a data processing module 504, configured to perform data processing in the address space according to the data processing instruction if the determination result of the instruction determining module 502 is negative, so that part of node data in the address space is changed.
From the above, the scheme provided by the embodiment of the invention can regenerate the node data in the address space and reload the address space, so that the address space is changed. The data processing may also be performed in the address space such that part of the node data in the address space is changed, thereby changing the address space. Therefore, the data processing of the node data in the address space can be realized according to the processing requirements indicated by the data processing instructions.
Referring to fig. 5B, a schematic structural diagram of a second address space-oriented data processing apparatus according to an embodiment of the present invention, compared with the embodiment shown in fig. 5A, the data processing module 504 includes:
an instruction determination submodule 504A for determining whether the data processing instruction indicates adding node data in the address space;
a data adding sub-module 504B, configured to add preset base node data in the address space if the instruction judging sub-module 504A judges that the instruction is yes, and adjust attribute information in the added base node data according to attribute information of node data included in the data processing instruction;
And the data processing sub-module 504C is configured to determine target node data targeted by the data processing instruction if the determination result of the instruction determining sub-module 504A is no, and process the target node data according to the processing requirement indicated by the data processing instruction.
From the above, according to the scheme provided by the embodiment of the invention, not only can node data be added in the address space, but also target node data existing in the address space can be processed, so that the data processing of the node data in the address space can be realized according to the processing requirement indicated by the data processing instruction, and part of the node data in the address space is changed.
In one embodiment of the present invention, the data adding submodule 504B is specifically configured to:
if the result of the instruction determination by the instruction determination sub-module 504A is yes, determining a data type of the source data included in the data processing instruction;
adding preset basic node data matched with the determined data type into the address space;
and adjusting the attribute information in the added basic node data according to the attribute information of the node data contained in the data processing instruction.
From the above, the scheme provided by the embodiment of the invention can generate the base node data matched with the determined data type, so that the generated base node data is better matched with the data type of the source data.
In one embodiment of the present invention, the data processing submodule 504C is specifically configured to:
if the determination result of the instruction determination sub-module 504A is no, determining target node data for which the data processing instruction is directed;
if the data processing instruction is a node data deleting instruction, deleting the target node data from the address space;
and if the data processing instruction is a node data modification instruction, adjusting the attribute information in the target node data according to the attribute information of the node data contained in the data processing instruction.
From the above, the scheme provided by the embodiment of the invention can delete and modify the node data stored in the address space, thereby realizing data processing on the node data stored in the address space.
Referring to fig. 6, a schematic structural diagram of a third data processing apparatus for address space according to an embodiment of the present invention, compared with the embodiment shown in fig. 5A, the apparatus further includes:
A data obtaining module 505, configured to obtain, from the storage space, source data stored at a target address, where the target address is: a storage address contained in the node data after the data processing;
the data storage module 506 is configured to store the acquired source data in the address space as constituent data of the node data after the data processing.
In view of the above, the node data may include not only a storage address of source data corresponding to a node represented by the node data, but also source data, so that the node data may directly represent the source data. The node data is processed by data, and it may be explained that source data corresponding to a node represented by the node data is changed. Therefore, after the node data is subjected to data processing, the source data stored under the target address is acquired from the storage space and stored in the address space as a part of the node data after the data processing, so that the stored source data can be consistent with the source data stored in the storage space.
Referring to fig. 7, a schematic structural diagram of a fourth data processing apparatus for address space according to an embodiment of the present invention, compared with the embodiment shown in fig. 6, the apparatus further includes:
A first request receiving module 507, configured to receive a source data acquisition request sent by a client, where the source data acquisition request carries a node data identifier;
a first data determining module 508, configured to determine, according to a node data identifier carried in the source data acquisition request, first node data indicated by the node data identifier;
and the data sending module 509 is configured to send, if the first node data includes source data, the source data included in the first node data to the client.
As can be seen from the above, in the case that the source data is included in the first node data, the scheme provided by the embodiment of the present invention may directly send the source data included in the first node to the client, so that the client may obtain the requested data. And the storage address is not required to be sent to the client, so that the client acquires the source data stored under the storage address in the storage space after acquiring the storage address. Therefore, the efficiency of the client to acquire the source data is improved. In addition, the storage space of the client can not be accessed in the process of acquiring the source data, the storage space and the address space can run independently of each other, and the storage space and the client can also run independently of each other, so that the running of the storage space of the client in the process of acquiring the source data is not influenced by the client and the address space.
Referring to fig. 8, a schematic structural diagram of a fifth data processing apparatus for address space according to an embodiment of the present invention, compared with the embodiment shown in fig. 5A, the apparatus further includes:
a second request receiving module 510, configured to receive a source data acquisition request sent by a client, where the source data acquisition request carries a node data identifier;
a second data determining module 511, configured to determine, according to a node data identifier carried in the source data acquisition request, second node data indicated by the node data identifier;
and a source data sending module 512, configured to obtain, from the storage space, source data stored at a storage address included in the second node data, and send the obtained source data to the client.
As can be seen from the above, under the condition that the source data corresponding to the node data is not stored in the address space, the scheme provided by the embodiment of the invention can acquire the source data stored at the storage address included in the second node data from the storage space, and send the source data to the client, so that the client can acquire the source data stored at the storage address in the storage space, and the source data acquisition process of the client is realized.
The embodiment of the present invention also provides an electronic device, as shown in fig. 9, including a processor 901, a communication interface 902, a memory 903, and a communication bus 904, where the processor 901, the communication interface 902, and the memory 903 perform communication with each other through the communication bus 904,
a memory 903 for storing a computer program;
the processor 901 is configured to implement the above-described data processing method for the address space when executing the program stored in the memory 903.
When the electronic equipment provided by the embodiment of the invention processes data aiming at the address space, the scheme provided by the embodiment of the invention can regenerate node data in the address space and reload the address space, so that the address space is changed. The data processing may also be performed in the address space such that part of the node data in the address space is changed, thereby changing the address space. Therefore, the data processing of the node data in the address space can be realized according to the processing requirements indicated by the data processing instructions.
The communication bus mentioned above for the electronic devices may be a peripheral component interconnect standard (Peripheral Component Interconnect, PCI) bus or an extended industry standard architecture (Extended Industry Standard Architecture, EISA) bus, etc. The communication bus may be classified as an address bus, a data bus, a control bus, or the like. For ease of illustration, the figures are shown with only one bold line, but not with only one bus or one type of bus.
The communication interface is used for communication between the electronic device and other devices.
The Memory may include random access Memory (Random Access Memory, RAM) or may include Non-Volatile Memory (NVM), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the aforementioned processor.
The processor may be a general-purpose processor, including a central processing unit (Central Processing Unit, CPU), a network processor (Network Processor, NP), etc.; but also digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), field programmable gate arrays (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
In a further embodiment of the present invention, a computer readable storage medium is provided, in which a computer program is stored, which computer program, when being executed by a processor, implements the steps of any of the above-mentioned data processing methods for address space.
When the data processing is performed on the address space by applying the computer program stored in the computer readable storage medium provided by the embodiment of the invention, the node data in the address space can be regenerated and the address space can be reloaded, so that the address space is changed. The data processing may also be performed in the address space such that part of the node data in the address space is changed, thereby changing the address space. Therefore, the data processing of the node data in the address space can be realized according to the processing requirements indicated by the data processing instructions.
In a further embodiment of the present invention, there is also provided a computer program product containing instructions which, when run on a computer, cause the computer to perform any of the data processing methods for address space described in the previous embodiments.
When the computer program product provided by the embodiment of the invention is executed to process data aiming at the address space, the scheme provided by the embodiment of the invention can regenerate node data in the address space and reload the address space, so that the address space is changed. The data processing may also be performed in the address space such that part of the node data in the address space is changed, thereby changing the address space. Therefore, the data processing of the node data in the address space can be realized according to the processing requirements indicated by the data processing instructions.
In the above embodiments, it may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, produces a flow or function in accordance with embodiments of the present invention, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable apparatus. The computer instructions may be stored in or transmitted from one computer-readable storage medium to another, for example, by wired (e.g., coaxial cable, optical fiber, digital Subscriber Line (DSL)), or wireless (e.g., infrared, wireless, microwave, etc.). The computer readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that contains an integration of one or more available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid State Disk (SSD)), etc.
It is noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
In this specification, each embodiment is described in a related manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments. In particular, for the apparatus, the electronic device, the computer-readable storage medium and the computer program product, the description is relatively simple, as it is substantially similar to the method embodiments, and relevant points are found in the partial description of the method embodiments.
The foregoing description is only of the preferred embodiments of the present invention and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.