WO2016187805A1 - 一种数据处理方法及装置 - Google Patents

一种数据处理方法及装置 Download PDF

Info

Publication number
WO2016187805A1
WO2016187805A1 PCT/CN2015/079811 CN2015079811W WO2016187805A1 WO 2016187805 A1 WO2016187805 A1 WO 2016187805A1 CN 2015079811 W CN2015079811 W CN 2015079811W WO 2016187805 A1 WO2016187805 A1 WO 2016187805A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
copy
consistency
original data
original
Prior art date
Application number
PCT/CN2015/079811
Other languages
English (en)
French (fr)
Inventor
林学练
马帅
陈瑞
Original Assignee
华为技术有限公司
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 华为技术有限公司 filed Critical 华为技术有限公司
Priority to PCT/CN2015/079811 priority Critical patent/WO2016187805A1/zh
Publication of WO2016187805A1 publication Critical patent/WO2016187805A1/zh

Links

Images

Classifications

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

Definitions

  • the present invention relates to the field of communications technologies, and in particular, to a data processing method and apparatus.
  • the data "copy mechanism" is also used to save a piece of data into multiple copies.
  • the M2M node N1 has a data resource D1.
  • the M2M system saves a copy D1' of D1 on another node Ni, so that the application or user can access any copy (D1 or D1') to read. data.
  • a client close to Ni can read data D1' directly from Ni without reading data from N1.
  • the data copying technique reduces the load on the N1 node and improves the access performance to the data D1.
  • the status (content) of different data copies is the same. For example, in the above example, is the content of D1 and D1' the same?
  • oneM2M Since the oneM2M architecture is a general-purpose infrastructure, different applications may run on oneM2M, and they have different data consistency for data resources (ie, original resource) and copies of data resources (ie, Announced Resource). Requirements, some applications require strong consistency, some can accept weak consistency; some require synchronization in a short period of time, and some can accept long-term synchronization. Therefore, oneM2M needs to define multiple data consistency models. And the implementation mechanism of these consistency models. However, various data consistency models are not defined in the prior art, nor are the implementation mechanisms of the above consistency models provided.
  • the embodiment of the invention provides a data processing method and device, which can determine the consistency requirement of the data processing according to the consistency requirements of the application itself, can improve the accuracy of the data read by the application, and ensure the consistency of the data.
  • a first aspect of the embodiments of the present invention provides a data processing method, which may include:
  • the local public service entity Hosting CSE receives a management request of the data copy of the original data sent by the application entity AE or the public service entity CSE;
  • the Hosting CSE determines the consistency requirement of the data copy management according to the identifier information of the data consistency carried in the management request of the data copy;
  • the Hosting CSE sets the data attribute of the original data according to the consistency requirement, and processes the copy data of the original data according to the data management manner corresponding to the consistency requirement;
  • the Hosting CSE sends the identification information of the copy data of the original data or the identification information of the data consistency to the remote public service entity Remote CSE.
  • the management request of the data copy of the original data includes: creating a data copy of the original data, deleting the data copy of the original data, and modifying a resource attribute of the data copy of the original data Management request for at least one copy of the data;
  • the identifier information of the data consistency is a preset attribute value of data consistency of the original data.
  • the consistency requirement of the data copy management includes: at least one of strict consistency, final consistency, and no consistency;
  • the strict consistency is: the resource attribute included in the original data is consistent with the resource attribute included in the copy data of the original data at any time;
  • the final consistency is: the resource attribute included in the original data is consistent with the resource attribute included in the copy data of the original data at a final moment;
  • the non-conformity is: the resource attribute included in the original data is the same as or different from the resource attribute included in the copy data of the original data.
  • the Hosting CSE determines that the data copy management is consistent according to the identifier information of the data consistency carried in the management request of the data copy.
  • Sexual requirements including:
  • the Hosting CSE determines whether the preset attribute value of the data consistency of the original data carried in the management request of the data copy is a first attribute value
  • the preset attribute value of the data consistency of the original data is the first attribute value, determining that the consistency requirement of the data copy management is non-conformance
  • the preset attribute value of the data consistency of the original data is not the second attribute value, it is determined that the consistency requirement of the data copy management is strict consistency.
  • the management request of the data copy of the original data is to create a data copy of the original data
  • Processing the copy data of the original data according to the data management manner corresponding to the consistency requirement including:
  • the copy data of the original data is created according to a data processing manner of Blocking or Non-blocking;
  • the copy data of the original data is created according to the management request message in the data processing manner of Blocking or Non-blocking;
  • the management request of the data copy of the original data is to delete the data copy of the original data
  • Processing the copy data of the original data according to the data management manner corresponding to the consistency requirement including:
  • the copy data of the original data is deleted according to a data processing manner of Blocking or Non-blocking;
  • the consistency requirement is final consistency, setting a version number of the copy data of the original data to a latest version number, and adding the latest version number to the management request message, according to the management request report Copying the copy data of the original data in the data processing manner of Blocking or Non-blocking;
  • the copy data of the original data is deleted according to the data processing method of Blocking.
  • the management request of the data copy of the original data is a resource attribute of modifying a data copy of the original data
  • Processing the copy data of the original data according to the data management manner corresponding to the consistency requirement including:
  • the specified attribute value of the copy data of the original data is updated according to a data processing manner of Blocking or Non-blocking;
  • the consistency requirement is final consistency
  • setting the version number of the modified copy data of the original data to the latest version number, and the latest version number of the copy data, the specified attribute value, and the The identification information of the final consistency is added to the management request message, and the specified attribute value of the copy data of the original data is modified according to the data processing manner of Blocking or Non-blocking according to the management request message;
  • the strict consistency identification information is added to the management request message, and the copy data of the original data is modified according to the management request message in a data processing manner of Blocking.
  • the specified attribute is the specified attribute.
  • the Hosting CSE the identification information of the replica data of the original data, Or the identification information of the data consistency is sent to the remote public service entity Remote CSE, including:
  • the Hosting CSE sends the management request message of the replica data to the Remote CSE, where the management request message carries the identifier information of the copy data of the original data, or the identifier information of the data consistency.
  • a second aspect of the embodiments of the present invention provides a data processing method, which may include:
  • the remote public service entity Remote CSE receives the management request of the data copy of the original data sent by the local public service entity Hosting CSE, where the management request carries the data consistency identification information of the data copy management;
  • the Remote CSE processes the second copy data according to the management manner to obtain target copy data of the original data that meets the consistency requirement.
  • the management request of the data copy of the original data includes: creating a data copy of the original data, deleting the data copy of the original data, and modifying a resource attribute of the data copy of the original data Management request for at least one copy of the data;
  • the identifier information of the data consistency is a preset attribute value of data consistency of the original data.
  • the consistency requirement of the data copy management includes: at least one of strict consistency, final consistency, and no consistency;
  • the strict consistency is: the resource attribute included in the original data is consistent with the resource attribute included in the copy data of the original data at any time;
  • the final consistency is: the resource attribute included in the original data is consistent with the resource attribute included in the copy data of the original data at a final moment;
  • the non-conformity is: the resource attribute included in the original data is the same as or different from the resource attribute included in the copy data of the original data.
  • the remote CSE determines the consistency requirement of the data copy management according to the identifier information of the data consistency, including:
  • the preset attribute value of the data consistency of the original data is the first attribute value, determining that the consistency requirement of the data copy management is non-conformance
  • the preset attribute value of the data consistency of the original data is not the second attribute value, it is determined that the consistency requirement of the data copy management is strict consistency.
  • the management request of the data copy of the original data is to create a data copy of the original data
  • the consistency requirement is the final consistency, determining whether the second copy data of the original data exists in the Remote CSE, and if the determination result is yes, according to the original data carried in the management request
  • the latest version number of the first copy data determines whether the second copy data is the latest version, and if the second copy data is not the latest version, determining that the second copy data is managed by creating the first copy data
  • the consistency requirement is strict consistency, determining that the second copy data of the original data is managed by creating a target corresponding to the latest version number of the first copy data of the original data carried in the management request Copy data.
  • the management request of the data copy of the original data is to delete the data copy of the original data
  • the consistency requirement is the final consistency
  • determining that the second copy data of the original data is managed is to delete the second copy data.
  • the management request of the data copy of the original data is a resource attribute of modifying a data copy of the original data
  • the consistency requirement is the final consistency
  • the attribute value modifies a specified attribute value of the second copy data
  • determining that the second copy data of the original data is managed is to modify a specified attribute value of the second copy data according to an attribute value of the first copy data.
  • a third aspect of the embodiments of the present invention provides a data processing apparatus, which may include:
  • a receiving module configured to receive a management request of a data copy of the original data sent by the application entity AE or the public service entity CSE;
  • a determining module configured to determine, according to the data consistency identifier information carried in the management request of the data copy received by the receiving module, a consistency requirement of data copy management
  • a processing module configured to set data attributes of the original data according to the consistency requirement determined by the determining module, and process the original data according to a data management manner corresponding to the consistency requirement Copy data;
  • a sending module configured to send the identifier information of the replica data of the original data processed by the processing module, or the identifier information of the data consistency received by the receiving module to the remote public service entity Remote CSE.
  • the management request of the data copy of the original data includes: creating a data copy of the original data, deleting the data copy of the original data, and modifying a resource attribute of the data copy of the original data Management request for at least one copy of the data;
  • the identifier information of the data consistency is a preset attribute value of data consistency of the original data.
  • the consistency requirement of the data copy management includes: at least one of strict consistency, final consistency, and no consistency;
  • the strict consistency is: the resource attribute included in the original data is consistent with the resource attribute included in the copy data of the original data at any time;
  • the final consistency is: the resource attribute included in the original data is consistent with the resource attribute included in the copy data of the original data at a final moment;
  • the non-conformity is: the resource attribute included in the original data is the same as or different from the resource attribute included in the copy data of the original data.
  • the determining module is specifically configured to:
  • the preset attribute value of the data consistency of the original data is the first attribute value, determining that the consistency requirement of the data copy management is non-conformance
  • the preset attribute value of the data consistency of the original data is not the second attribute value, it is determined that the consistency requirement of the data copy management is strict consistency.
  • the management request of the data copy of the original data is to create a copy of the data of the original data
  • the processing module is specifically configured to:
  • the copy data of the original data is created according to a data processing manner of Blocking or Non-blocking;
  • the determining module determines that the consistency requirement is final consistency, setting a version number of the created copy data of the original data to a latest version number, and the latest version number and the final consistency
  • the identification information is added to the management request message, and the copy data of the original data is created according to the data processing manner of Blocking or Non-blocking according to the management request message;
  • the determining module determines that the consistency requirement is strict consistency
  • the strict consistency identification information is added to the management request message, and the management request message is created according to the Blocking data processing manner according to the management request message. A copy of the original data.
  • the management request of the data copy of the original data is to delete the data copy of the original data
  • the processing module is specifically configured to:
  • the determining module determines that the consistency requirement is non-conformity, deleting the copy data of the original data according to a data processing manner of Blocking or Non-blocking;
  • the determining module determines that the consistency requirement is final consistency, setting a version number of the copy data of the original data to a latest version number, and adding the latest version number to the management request message, according to The management request message deletes the copy data of the original data in a data processing manner of Blocking or Non-blocking;
  • the copy data of the original data is deleted according to a data processing manner of Blocking.
  • the management request of the data copy of the original data is a resource attribute of modifying a data copy of the original data
  • the processing module is specifically configured to:
  • the determining module determines that the consistency requirement is non-conformity, updating the specified attribute value of the copy data of the original data according to a data processing manner of Blocking or Non-blocking;
  • the determining module determines that the consistency requirement is final consistency, setting the version number of the modified copy data of the original data to the latest version number, and the latest version number of the copy data, The identification information of the specified attribute value and the final consistency is added to the management request message. Determining, according to the management request message, a specified attribute value of the copy data of the original data in a data processing manner of Blocking or Non-blocking;
  • the determining module determines that the consistency requirement is strict consistency, adding the strict consistency identification information to the management request message, and modifying the management request message according to the data processing manner of Blocking.
  • the specified attribute of the copy data of the original data is strict consistency, adding the strict consistency identification information to the management request message, and modifying the management request message according to the data processing manner of Blocking.
  • the sending module is specifically configured to:
  • the management request message of the copy data where the management request message carries the identification information of the copy data of the original data, or the identification information of the data consistency.
  • a fourth aspect of the embodiments of the present invention provides a terminal device, which may include:
  • a receiving module configured to receive a management request of a data copy of the original data sent by the local public service entity Hosting CSE, where the management request carries the data consistency identification information of the data copy management;
  • a determining module configured to determine, according to the identifier information of the data consistency received by the receiving module, a consistency requirement of the data copy management
  • the determining module is further configured to determine, according to the consistency requirement, or the identifier information of the first copy data of the original data carried in the management request, the first data of the original data stored in the Remote CSE The management method of the second copy data;
  • a processing module configured to process the second copy data according to the management manner determined by the determining module to obtain target copy data of the original data that meets the consistency requirement.
  • the management request of the data copy of the original data includes: creating a data copy of the original data, deleting the data copy of the original data, and modifying a resource attribute of the data copy of the original data Management request for at least one copy of the data;
  • the identifier information of the data consistency is a preset attribute value of data consistency of the original data.
  • the consistency requirement of the data copy management includes: at least one of strict consistency, final consistency, and no consistency;
  • the strict consistency is: a resource attribute included in the original data, and the original The resource attributes contained in the copy data of the data are consistent at any time;
  • the final consistency is: the resource attribute included in the original data is consistent with the resource attribute included in the copy data of the original data at a final moment;
  • the non-conformity is: the resource attribute included in the original data is the same as or different from the resource attribute included in the copy data of the original data.
  • the determining module is specifically configured to:
  • the preset attribute value of the data consistency of the original data is the first attribute value, determining that the consistency requirement of the data copy management is non-conformance
  • the preset attribute value of the data consistency of the original data is not the second attribute value, it is determined that the consistency requirement of the data copy management is strict consistency.
  • the management request of the data copy of the original data is to create a data copy of the original data
  • the determining module is specifically configured to:
  • the consistency requirement is the final consistency, determining whether the second copy data of the original data exists in the Remote CSE, and if the determination result is yes, according to the original data carried in the management request
  • the latest version number of the first copy data determines whether the second copy data is the latest version, and if the second copy data is not the latest version, determining that the second copy data is managed by creating the first copy data
  • the consistency requirement is strict consistency, determining that the second copy data of the original data is managed by creating a target corresponding to the latest version number of the first copy data of the original data carried in the management request Copy data.
  • the management request of the data copy of the original data is to delete the data copy of the original data
  • the determining module is specifically configured to:
  • the consistency requirement is the final consistency
  • determining that the second copy data of the original data is managed is to delete the second copy data.
  • the management request of the data copy of the original data is a resource attribute of modifying a data copy of the original data
  • the determining module is specifically configured to:
  • the consistency requirement is the final consistency
  • the attribute value modifies a specified attribute value of the second copy data
  • determining that the second copy data of the original data is managed is to modify a specified attribute value of the second copy data according to an attribute value of the first copy data.
  • a fifth aspect of the embodiments of the present invention provides a public service entity, which may include:
  • Memory transmitter, receiver, and processor
  • the memory is configured to store program code
  • the transmitter, the receiver, and the processor are configured to invoke the program code stored in the memory, and perform the following operations:
  • the receiver is configured to receive a management request of a data copy of the original data sent by the application entity AE or the public service entity CSE;
  • the processor is configured to determine, according to the data consistency identifier information carried in the management request of the data copy received by the receiver, a consistency requirement of data copy management;
  • the processor is further configured to set data attributes of the original data according to the consistency requirement, and process the copy data of the original data according to a data management manner corresponding to the consistency requirement;
  • the transmitter is configured to send identifier information of the replica data of the original data processed by the processor, or identifier information of the data consistency received by the receiver, to a remote public service entity Remote CSE.
  • the management request of the data copy of the original data includes: creating a data copy of the original data, deleting the data copy of the original data, and modifying a resource attribute of the data copy of the original data Management request for at least one copy of the data;
  • the identifier information of the data consistency is a preset attribute value of data consistency of the original data.
  • the consistency requirement of the data copy management includes: at least one of strict consistency, final consistency, and no consistency;
  • the strict consistency is: the resource attribute included in the original data is consistent with the resource attribute included in the copy data of the original data at any time;
  • the final consistency is: the resource attribute included in the original data is consistent with the resource attribute included in the copy data of the original data at a final moment;
  • the non-conformity is: the resource attribute included in the original data is the same as or different from the resource attribute included in the copy data of the original data.
  • the processor is specifically configured to:
  • the preset attribute value of the data consistency of the original data is the first attribute value, determining that the consistency requirement of the data copy management is non-conformance
  • the preset attribute value of the data consistency of the original data is not the second attribute value, it is determined that the consistency requirement of the data copy management is strict consistency.
  • the management request of the data copy of the original data is to create a data copy of the original data
  • the processor is specifically configured to:
  • the copy data of the original data is created according to a data processing manner of Blocking or Non-blocking;
  • the copy data of the original data is created according to the management request message in the data processing manner of Blocking or Non-blocking;
  • the management request of the data copy of the original data is to delete the data copy of the original data
  • the processor is specifically configured to:
  • the copy data of the original data is deleted according to a data processing manner of Blocking or Non-blocking;
  • the consistency requirement is final consistency, setting a version number of the copy data of the original data to a latest version number, and adding the latest version number to the management request message, according to the management request report Copying the copy data of the original data in the data processing manner of Blocking or Non-blocking;
  • the copy data of the original data is deleted according to the data processing method of Blocking.
  • the management request of the data copy of the original data is a resource attribute that modifies the data copy of the original data
  • the processor is specifically configured to:
  • the specified attribute value of the copy data of the original data is updated according to a data processing manner of Blocking or Non-blocking;
  • the consistency requirement is final consistency
  • setting the version number of the modified copy data of the original data to the latest version number, and the latest version number of the copy data, the specified attribute value, and the The identification information of the final consistency is added to the management request message, and the specified attribute value of the copy data of the original data is modified according to the data processing manner of Blocking or Non-blocking according to the management request message;
  • the strict consistency identification information is added to the management request message, and the copy data of the original data is modified according to the management request message in a data processing manner of Blocking.
  • the specified attribute is the specified attribute.
  • the transmitter is specifically configured to:
  • the management request message of the copy data where the management request message carries the identification information of the copy data of the original data, or the identification information of the data consistency.
  • a sixth aspect of the embodiments of the present invention provides a public service entity, which may include:
  • the memory is configured to store program code
  • the receiver and the processor are configured to invoke the program code stored in the memory, and perform the following operations:
  • the receiver is configured to receive a management request of a data copy of the original data sent by the local public service entity Hosting CSE, where the management request carries identifier information of data consistency managed by the data copy;
  • the processor is configured to determine, according to the identifier information of the data consistency, a consistency requirement of the data copy management;
  • the processor is further configured to determine, according to the consistency requirement, or the identifier information of the first copy data of the original data carried in the management request, the content stored in the Remote CSE The management of the second copy of the original data;
  • the processor is further configured to process the second copy data according to the management manner to obtain target copy data of the original data that meets the consistency requirement.
  • the management request of the data copy of the original data includes: creating a data copy of the original data, deleting the data copy of the original data, and modifying a resource attribute of the data copy of the original data Management request for at least one copy of the data;
  • the identifier information of the data consistency is a preset attribute value of data consistency of the original data.
  • the consistency requirement of the data copy management includes: at least one of strict consistency, final consistency, and no consistency. ;
  • the strict consistency is: the resource attribute included in the original data is consistent with the resource attribute included in the copy data of the original data at any time;
  • the final consistency is: the resource attribute included in the original data is consistent with the resource attribute included in the copy data of the original data at a final moment;
  • the non-conformity is: the resource attribute included in the original data is the same as or different from the resource attribute included in the copy data of the original data.
  • the processor is specifically configured to:
  • the preset attribute value of the data consistency of the original data is the first attribute value, determining that the consistency requirement of the data copy management is non-conformance
  • the preset attribute value of the data consistency of the original data is not the second attribute value, it is determined that the consistency requirement of the data copy management is strict consistency.
  • the management request of the data copy of the original data is to create a data copy of the original data
  • the processor is specifically configured to:
  • the consistency requirement is the final consistency, determining whether the second copy data of the original data exists in the Remote CSE, and if the determination result is yes, according to the original data carried in the management request
  • the latest version number of the first copy data determines whether the second copy data is the latest version, and if the second copy data is not the latest version, determining that the second copy data is managed by creating the first copy data
  • the consistency requirement is strict consistency, determining that the second copy data of the original data is managed by creating a target corresponding to the latest version number of the first copy data of the original data carried in the management request Copy data.
  • the management request of the data copy of the original data is to delete the data copy of the original data
  • the processor is specifically configured to:
  • the consistency requirement is the final consistency
  • determining that the second copy data of the original data is managed is to delete the second copy data.
  • the management request of the data copy of the original data is a resource attribute of modifying a data copy of the original data
  • the processor is specifically configured to:
  • the consistency requirement is final consistency, determining whether the second copy data of the original data exists in the Remote CSE, and if the determination result is yes, according to the management request Determining, by the latest version number of the first copy data of the original data, whether the second copy data is the latest version, and determining that the second copy data is managed according to the method if the second copy data is not the latest version An attribute value of the first copy data modifies a specified attribute value of the second copy data;
  • determining that the second copy data of the original data is managed is to modify a specified attribute value of the second copy data according to an attribute value of the first copy data.
  • a seventh aspect of the embodiments of the present invention provides a data processing system, which may include: the first public service entity provided by the fifth aspect of the embodiment of the present invention, and the second public service provided by the sixth aspect of the embodiment of the present invention. entity.
  • the Hosting CSE may receive a management request for the data copy of the original data sent by the AE or the CSE, and determine the consistency requirement of the data copy management according to the identification information of the data consistency carried in the management request. .
  • Hosting CSE can also set the data attributes of the original data according to the consistency requirements of the above data copy management, and process the copy data of the original data according to the data management method corresponding to the consistency requirement.
  • the Hosting CSE may also send the identification information of the copy data of the original data or the identification information of the above data consistency to the Remote CSE.
  • the embodiment of the invention can determine the consistency requirement of the data processing according to the consistency requirements of the application itself, can improve the accuracy of the data read by the application, and ensure the consistency of the data.
  • FIG. 1 is a schematic diagram of data distribution of a distributed system in the prior art
  • FIG. 2 is a schematic diagram of an attribute of original data according to an embodiment of the present invention.
  • FIG. 3 is a schematic diagram of attributes of announced data (data copies) of original data according to an embodiment of the present invention
  • FIG. 4 is a diagram showing an example of a data copy mechanism according to an embodiment of the present invention.
  • FIG. 5 is a schematic diagram of an error of a data copy update according to an embodiment of the present invention.
  • FIG. 6 is a schematic diagram of a model for strict consistency of data according to an embodiment of the present invention.
  • FIG. 7 is a schematic diagram of a model for strict final consistency of data according to an embodiment of the present invention.
  • FIG. 8 is a schematic diagram of another attribute of original data according to an embodiment of the present disclosure.
  • FIG. 9 is a schematic flowchart diagram of a first embodiment of a data processing method according to an embodiment of the present invention.
  • FIG. 10 is a schematic diagram of steps of creating an Announced Resource by a Hosting CSE in a data processing method according to an embodiment of the present invention.
  • 10a is a schematic flowchart of a method for creating an Announced Resource by a Hosting CSE in a data processing method according to an embodiment of the present invention
  • FIG. 11 is a schematic diagram of steps of a Hosting CSE deleting an Announced Resource in a data processing method according to an embodiment of the present invention.
  • 11a is a schematic flowchart of a Hosting CSE deleting an Announced Resource in a data processing method according to an embodiment of the present invention
  • FIG. 12 is a schematic diagram showing the steps of a Hosting CSE modifying an attribute value of an Announced Resource in a data processing method according to an embodiment of the present invention
  • FIG. 12 is a schematic flowchart of a Hosting CSE modifying an attribute value of an Announced Resource in a data processing method according to an embodiment of the present invention
  • FIG. 13 is a schematic flowchart diagram of a second embodiment of a data processing method according to an embodiment of the present invention.
  • FIG. 14 is a schematic diagram of steps of creating an Announced Resource by a Remote CSE in a data processing method according to an embodiment of the present invention
  • 14a is a schematic flowchart of creating an Announced Resource by a Remote CSE in a data processing method according to an embodiment of the present invention
  • 15 is a schematic diagram of steps of deleting a Announced Resource by a Remote CSE in a data processing method according to an embodiment of the present invention
  • 15a is a schematic flowchart of deleting a Announced Resource by a Remote CSE in a data processing method according to an embodiment of the present invention
  • FIG. 16 is a schematic diagram showing the steps of modifying the attribute value of the Announced Resource by the Remote CSE in the data processing method according to the embodiment of the present invention.
  • FIG. 16 is a schematic flowchart of a Hosting CSE modifying an attribute value of an Announced Resource in a data processing method according to an embodiment of the present invention
  • FIG. 17 is a schematic diagram of interaction of a Blocking execution manner according to an embodiment of the present invention.
  • FIG. 18 is a schematic diagram of interaction of a Non-Blocking execution manner according to an embodiment of the present invention.
  • FIG. 19 is a schematic diagram of a scenario distribution of a scenario 1 of a data processing method according to an embodiment of the present disclosure
  • FIG. 20 is a schematic flowchart of data processing in application scenario 2 of a data processing method according to an embodiment of the present disclosure
  • FIG. 21 is a schematic structural diagram of a first embodiment of a data processing apparatus according to an embodiment of the present disclosure.
  • FIG. 22 is a schematic structural diagram of a second embodiment of a data processing apparatus according to an embodiment of the present disclosure.
  • FIG. 23 is a schematic structural diagram of a first embodiment of a public service entity according to an embodiment of the present disclosure.
  • FIG. 24 is a schematic structural diagram of a second embodiment of a public service entity according to an embodiment of the present disclosure.
  • FIG. 25 is a schematic structural diagram of an embodiment of a data processing system according to an embodiment of the present invention.
  • the technical problem required by the data processing method and apparatus described in the embodiments of the present invention is the consistency problem caused by the data copy in the M2M.
  • the system or user may have different requirements for consistency. For example, some applications require "high” consistency between replicas, while others may require “weak” between replicas. Consistent.
  • the present invention also provides a guarantee method for different consistency.
  • the data processing method and device described in the embodiments of the present invention are implemented based on the oneM2M existing resource model.
  • the existing resource model of oneM2M that is, the related data copy, will be briefly introduced.
  • the oneM2M standard is a combination of machine-to-machine communication (M2M) and the Internet of Things (Thing of Internet).
  • the Common Service Entity represents a series of instances of Common Service Function (CSF), each of which has a corresponding resource representation and implementation.
  • the CSE is uniquely identified by the CSE identifier (Identity, ID), and can be divided into a local CSE and a remote CSE by geographic location.
  • a resource on a CSE (herein called Original Resource, as shown in Figure 2) can be announced as a resource that allows a copy, a copy of which is called Announced. Resource (as shown in Figure 3).
  • the general properties of Original Resource are announcedTo, annotatedAttribute, resourceID, parentID, accessControlPolicyIDs, expirationTime, stateTag
  • the general properties of the Announced Resource are link (link), resourceID, parentID, accessControlPolicyIDs, expirationTime, stateTag.
  • Original Resource has two important attributes for representing the copy information: one is the announceTo attribute, and the attribute type is List, where each item is the ID or URI of the remote CSE, and these remote CSEs store the copy of the Original Resource. Announced Resource; the second is the announcedAttribute attribute, which is a List, where each item represents which attribute of the Original Resource needs to be announced.
  • An important attribute under Announced Resource is used to express the reference relationship between copies, that is, the Link attribute, which holds the Uniform Resource Identifier (URI) pointing to the Original Resource.
  • URI Uniform Resource Identifier
  • CSE0 is a general service entity that stores Original Resource
  • CSE1 and CSE2 are general service entities that store Announced Resource.
  • the announceTo attribute in the Original Resource indicates that the resource needs to be announced to the remote CSE with the addresses URI1 and URI2.
  • the Announced Resource resource contains the Link attribute.
  • the attribute content is the URI address of the Original Resource resource under CSE0.
  • OneM2M uses the Master-Slaves method, in which the Original Resource is the Master and the Announced Resource is the Slave, which are distributed on different CSE nodes.
  • the Master receives the create or modify request, triggers subsequent creation or modification actions, and is responsible for synchronizing the creation or modification to the Slaves. in particular:
  • Creating and deleting a copy Modifying the AnnounceTo attribute of the Original Resource will trigger the creation and deletion of the Announced Resource resource (ie, the copy); the specific creation and deletion process is performed by the Master node where the Original Resource is located;
  • Modify data (attribute): The modification of the attribute content of the Original Resource is announced, which will trigger the modification of the corresponding attribute of the Announced Resource.
  • the specific synchronization process is performed by the Master node where the Original Resource is located.
  • the existing oneM2M copy management and consistency technology has technical flaws: First, the extent of data consistency between Original Resource and Announced Resource (ie, which consistency model is used) is not specified; second, for Original Resource When and how to modify the Announced Resource (that is, the executive protection mechanism) is not fully explained.
  • Figure 5 is an example of data inconsistency, describing a situation in which data is inconsistent due to data updates.
  • the users u1 and u2 respectively modify the Original Resource in CSE0 twice, where the user u1 modifies the Attribute1 value to s1, and then the user u2 modifies the Attribute1 value to s2.
  • the result of the user u2 modification will be The result of the modification of the user u1 is covered, that is, Attribute1 is the value s2.
  • oneM2M does not give a synchronization method, such as how to ensure the order of modification between different copies is consistent, how to avoid old data overwriting new data, and so on. Therefore, it is highly probable that the modification order received by CSE1 is u1 and then u2, so the result of u2 modification will cover the result of user u1 modification, that is, Attribute1 is the value s2; and the order received by CSE2 is u1 after u1, so u1 The result of the modification will override the result of the user u2 modification, that is, the Attribute1 value is s1. As a result, the data status of CSE0, CSE1, and CSE2 is inconsistent, causing some users to read the wrong content.
  • OneM2M fails to provide a conformance specification and does not provide differentiated consistency services to applications or users.
  • the scenarios are divided according to the strength and performance of the restrictions:
  • Scenario 1 The content between the copies must be strictly consistent, that is, any modification of the data will be applied to all copies of the data at the same time, and all copies will be consistent at any time;
  • Scenario 2 The order in which each copy is modified must be consistent, that is, as long as all copies are modified in a certain order (ie, all copy modifications are the same for the application or user), the operation of each copy They are all implemented in the order specified by the copy and the results should be accepted;
  • Scenario 3 It is acceptable to have a period of inconsistency between the contents of the copy, but in the end it must be consistent, that is, the real-time consistency is not emphasized, but the consistency between the copies is guaranteed only under certain conditions. Sex
  • Scenario 4 Inconsistent content between replicas is acceptable, that is, there is no consistency requirement, and the data of all replicas can be inconsistent.
  • Strict consistency is the most restrictive model, but implementing such a model in a distributed copy is too expensive, so it is limited in practical systems; the final consistency relaxes the requirements for data consistency and improves system containment communication.
  • the existing oneM2M standard ignores the cost of system performance and implementation models, so it is necessary to define conformance specifications to meet the needs of different applications or users.
  • the embodiment of the present invention firstly describes a method for describing data consistency, and the specific description manner is as follows:
  • the present invention uses the stateTag attribute of the Resource to represent the overall version of the Resource, and adds the attribute consistency to the Original Resource resource to indicate the consistency convention.
  • the properties of the modified Original Resource are shown in Figure 8.
  • Consistency is an enumerated type whose meaning is defined as follows:
  • Consistency is an optional parameter. If the parameter does not exist, the default value is 0. After the consistency attribute is created, it can be assigned by Hosting CSE and AE, and cannot be modified afterwards. For each attribute that is announced, record its latest version (serial number). Among them, the above consistency can be determined by the user. The AE sends the attribute value of the consistency to the Hosting CSE through the message transmission.
  • the Hosting CSE is the resource entity where the Original Resource is located.
  • FIG. 9 is a schematic flowchart diagram of a first embodiment of a data processing method according to an embodiment of the present invention.
  • the data processing method described in the embodiment of the present invention includes the following steps:
  • the local public service entity Hosting CSE receives a management request of a data copy of the original data sent by the application entity AE or the public service entity CSE.
  • the executor of the data processing method described in the embodiment of the present invention may have the Hosting CSE described in the embodiment of the present invention.
  • the Hosting CSE may first receive a management request for a data copy of the original data sent by the AE or the CSE, where the original data is the Original Resource described in the embodiment of the present invention, and the copy data of the original data is The Announced Resource described in the embodiment of the present invention is not described here.
  • the management request of the data copy of the original data described in the embodiment of the present invention includes: creating at least one of a data copy of the original data, deleting a data copy of the original data, and modifying a resource attribute of the data copy of the original data.
  • the management request of the data copy that is, the creation of the Announced Resource, the deletion of the Announced Resource, and the modification of the resource attribute content of the Announced Resource.
  • Management process of copy data of the above raw data There are three participants, AE/CSE, Hosting CSE and Remote CSE. Depending on the consistency requirements, Hosting CSE and Remote CSE need to have corresponding execution steps and interaction processes.
  • the interaction process can be either blocking or non-blocking. Each interaction mode has specific packets and execution logic.
  • the embodiment of the present invention first describes the steps, interaction processes, and the like performed by the Hosting CSE as an execution subject.
  • the identifier information of the data consistency described in the embodiment of the present invention is a preset attribute value of the data consistency of the original data, that is, the attribute consistency added under the Original Resource resource described in the embodiment of the present invention.
  • Property value The value of the attribute of the consistency may include a first attribute value (for example, 0), a second attribute value (for example, 1), or a third attribute value (for example, 2), and the corresponding data consistency requirement may be referred to the foregoing FIG. The description is not repeated here.
  • the Hosting CSE determines the consistency requirement of the data copy management according to the identifier information of the data consistency carried in the management request of the data copy.
  • the Hosting CSE may determine the consistency requirement of the data copy management according to the identification information of the data consistency carried by the management request of the received data copy. Specifically, the Hosting CSE may determine the consistency requirement of the data copy management according to the attribute value of the attribute consistency added under the above Original Resource resource. In a specific implementation, the Hosting CSE may determine whether the preset attribute value of the data consistency of the original data carried in the management request of the data copy is the first attribute value. If the preset attribute value of the data consistency of the original data is the first attribute value, it is determined that the consistency requirement of the data copy management is non-conformance.
  • the preset attribute value of the data consistency of the original data is not the first attribute value, it is determined whether the preset attribute value of the data consistency of the original data is the second attribute value. If the preset attribute value of the data consistency of the original data is the second attribute value, it is determined that the consistency requirement of the data copy management is final consistency; if the preset attribute value of the data consistency of the original data is not the second attribute value ( For example, if the preset attribute value is the third attribute value), it is determined that the consistency requirement of the data copy management is strict consistency.
  • the attribute value of the attribute consistency added under the Original Resource resource is 0, it can be determined that the consistency requirement of the data copy management is non-conformity; when the attribute value of the attribute consistency added under the Original Resource resource is 1, It can be determined that the consistency requirement of data copy management is final consistency; when the attribute value of the attribute consistency added under the Original Resource resource is 2, it can be determined that the consistency requirement of the data copy management is strict consistency.
  • the strict consistency described above is: the resource attribute included in the original data, and the original number The resource attributes contained in the replica data are consistent at any time;
  • the final consistency is: the resource attributes contained in the original data are consistent with the resource attributes contained in the copy data of the original data at the final moment;
  • the property is: the resource attribute contained in the original data is the same as or different from the resource attribute contained in the copy data of the original data, that is, the resource attribute of the original data and the copy thereof may be the same or different, and is not specifically limited.
  • the Hosting CSE sets data attributes of the original data according to the consistency requirement, and processes the copy data of the original data according to a data management manner corresponding to the consistency requirement.
  • the data attribute of the original data may be set according to the foregoing consistency requirement, and the original data is processed according to the data management manner corresponding to the consistency requirement.
  • the data attributes of the original data may be set or modified according to the above-mentioned non-coherent data management manner, and then the non-conformity may be obtained according to the foregoing.
  • the corresponding data management method is required to create a data copy of the original data, delete the data copy of the original data, and modify the resource attribute of the data copy of the original data.
  • the data attributes of the original data may be set or modified according to the data management manner corresponding to the final consistency described above, and then may be corresponding according to the final consistency requirement.
  • the data management method creates a copy of the data of the original data, deletes the data copy of the original data, and modifies the resource attributes of the data copy of the original data.
  • the data attributes of the original data may be set or modified according to the data management manner corresponding to the strict consistency described above, and then may be corresponding according to the strict consistency requirement.
  • the data management method creates a copy of the data of the original data, deletes the data copy of the original data, and modifies the resource attributes of the data copy of the original data.
  • the Hosting CSE sends the identifier information of the replica data of the original data or the identifier information of the data consistency to the remote public service entity Remote CSE.
  • the identification information of the copy data of the original data or the identification information of the data consistency may be sent to the Remote.
  • the Hosting CSE may send the identification information of the data copy or the management information of the data copy to the Remote CSE or The identity information of the data consistency is sent to the Remote CSE, triggering the Remote CSE to create an Announced Resource, or deleting the Announced Resource, or modifying the resource attribute of the Announced Resource.
  • the Hosting CSE may receive a management request for the data copy of the original data sent by the AE or the CSE, and determine the consistency requirement of the data copy management according to the identification information of the data consistency carried in the management request. .
  • Hosting CSE can also set the data attributes of the original data according to the consistency requirements of the above data copy management, and process the copy data of the original data according to the data management method corresponding to the consistency requirement.
  • the Hosting CSE may also send the identification information of the copy data of the original data or the identification information of the above data consistency to the Remote CSE.
  • the embodiment of the invention can determine the consistency requirement of the data processing according to the consistency requirements of the application itself, can improve the accuracy of the data read by the application, and ensure the consistency of the data.
  • the Hosting CSE determines the consistency requirement of the data copy management according to the identifier information of the data consistency carried in the management request of the data copy.
  • the Hosting CSE modifies data attributes of the original data according to the consistency requirement, and creates replica data of the original data according to a data management manner corresponding to the consistency requirement.
  • the Hosting CSE can receive a request from the user and determine the attribute value of the consistency. If the attribute value of the consistency attribute is the first attribute value (for example, 0), it may be determined that the consistency requirement is non-conformity; if the attribute value of the consistency attribute is the second attribute value (for example, 1), the consistency may be determined. The requirement is final consistency; if the attribute value of the above consistency is the third attribute value (for example, 2), it can be determined that the above consistency requirement is strict consistency. If the consistency requirement is non-conformity, the copy data of the original data is created according to the data processing manner of Blocking or Non-blocking.
  • the version number of the created copy data of the original data is set to the latest version number, and the latest version number and the final consistency identification information are added to the management request message, according to Manage the message to create a copy of the original data in Blocking or Non-blocking data processing.
  • the consistency requirement is strict consistency
  • the strict consistency identification information is added to the management request message, and the management request message is used according to the management request message. Blocking's data processing creates a copy of the original data.
  • the Hosting CSE receives the request from the user and determines the value of the consistency.
  • the Hosting CSE can modify the Announced attribute value of the Original Resource according to the consistency requirement of the data copy management, and create an Announced Resource, which can ensure the data consistency of the Original Resource and the Announced Resource, and enhance the accuracy of the data read by the user.
  • the Hosting CSE determines the consistency requirement of the data copy management according to the identifier information of the data consistency carried in the management request of the data copy.
  • the Hosting CSE sets the data attribute of the original data according to the consistency requirement, and deletes the copy data of the original data according to a data management manner corresponding to the consistency requirement.
  • the Hosting CSE can receive a request from the user and determine the attribute value of the consistency. If the attribute value of the consistency attribute is the first attribute value (for example, 0), it may be determined that the consistency requirement is non-conformity; if the attribute value of the consistency attribute is the second attribute value (for example, 1), the consistency may be determined. The requirement is final consistency; if the attribute value of the above consistency is the third attribute value (for example, 2), it can be determined that the above consistency requirement is strict consistency.
  • the copy data of the original data is deleted according to the data processing method of Blocking or Non-blocking; if the consistency requirement is final consistency, the version number of the copy data of the original data is set to The latest version number, and the latest version number is added to the management request message, and the copy data of the original data is deleted according to the management request message by Blocking or Non-blocking data processing; if the above consistency requirement is strict consistency, then The copy data of the original data is deleted according to the data processing method of Blocking.
  • the Hosting CSE receives the request and determines the value of the consistency.
  • c.Hosting CSE in the form of blocking or non-blocking deletes the Announced Resource, and the message contains the latest resource version number
  • a.Hosting CSE modifies the value of the announceTo attribute of the Original Resource
  • the Hosting CSE can modify the announceTo attribute value of the Original Resource according to the consistency requirement of the data copy management, and delete the Announced Resource to ensure the data consistency of the Original Resource and the Announced Resource, and enhance the accuracy of the data read by the user.
  • the Hosting CSE determines the consistency requirement of the data copy management according to the identifier information of the data consistency carried in the management request of the data copy.
  • the Hosting CSE sets a data attribute of the original data according to the consistency requirement, and modifies a resource attribute of the copy data of the original data according to a data management manner corresponding to the consistency requirement.
  • the Hosting CSE can receive a request from the user and determine the attribute value of the consistency. If the attribute value of the consistency attribute is the first attribute value (for example, 0), it may be determined that the consistency requirement is non-conformity; if the attribute value of the consistency attribute is the second attribute value (for example, 1), the consistency may be determined. The requirement is final consistency; if the attribute value of the above consistency is the third attribute value (for example, 2), it can be determined that the above consistency requirement is strict consistency.
  • the specified attribute value of the copy data of the original data is updated according to the data processing method of Blocking or Non-blocking; if the consistency requirement is final consistency, the modified original data is The version number of the replica data is set to the latest version number, and the latest version number of the replica data, the specified attribute value, and the final consistency identification information are added to the management request message, and the management request message is Blocking or Non-blocking according to the management request message.
  • the data processing mode modifies the specified attribute value of the copy data of the original data; if the consistency requirement is strict consistency, the strict consistency identification information is added to the management request message, and the management request message is processed by Blocking data. The way to modify the specified properties of the copy data of the original data.
  • the Hosting CSE receives the request and determines the value of the consistency (default is 0);
  • Hosting CSE (blocking or non-blocking) modifies the corresponding attribute value of the Announced Resource, and the message includes the latest version number of the resource, the latest version number of the attribute, and the consistency attribute value;
  • a.Hosting CSE modifies the attribute value of the Original Resource
  • the Hosting CSE can modify the attribute value of the Announced Resource according to the consistency requirement of the data copy management, which ensures the data consistency of the Original Resource and the Announced Resource, and enhances the accuracy of the data read by the user.
  • FIG. 13 is a schematic flowchart diagram of a second embodiment of a data processing method according to an embodiment of the present invention.
  • the data processing method described in the embodiment of the present invention includes the following steps:
  • the remote public service entity Remote CSE receives a management request of a data copy of the original data sent by the local public service entity Hosting CSE, where the management request carries the data consistency identification information of the data copy management.
  • the execution body of the data processing method described in the embodiment of the present invention may have the Remote CSE described in the embodiment of the present invention, and the following is specifically described by using the Remote CSE as an execution subject.
  • the Remote CSE may first receive a management request for a data copy of the original data sent by the Hosting CSE, where the original data is the Original Resource described in the embodiment of the present invention, and the original data is duplicated.
  • the Announced Resource described in the embodiment of the present invention is not described here.
  • the method described in the embodiment of the present invention The management request of the data copy of the original data includes: creating a data copy of the original data, deleting the data copy of the original data, and modifying a management request of at least one of the resource attributes of the data copy of the original data, that is, creating an Announced Resource, deleting Announced Resource and modify the contents of resource attributes.
  • the management process of the above-mentioned copy data of the original data has three participants, namely AE/CSE, Hosting CSE and Remote CSE.
  • Hosting CSE and Remote CSE need to have corresponding execution steps and interaction processes.
  • the interaction process can be either blocking or non-blocking.
  • Each interaction mode has specific packets and execution logic.
  • the embodiment of the present invention will describe the steps, interaction processes, and the like performed by the Remote CSE as an execution subject.
  • the identifier information of the data consistency described in the embodiment of the present invention is a preset attribute value of the data consistency of the original data, that is, the attribute consistency added under the Original Resource resource described in the embodiment of the present invention.
  • the attribute value of the consistency may include a first attribute value (for example, 0), a second attribute value (for example, 1), or a third attribute value (for example, 2), and the corresponding data consistency requirement may be referred to the foregoing description. This will not be repeated here.
  • the Remote CSE determines the consistency requirement of the data copy management according to the identifier information of the data consistency.
  • the Remote CSE may determine the consistency requirement of the data copy management according to the identification information of the data consistency carried by the management request of the received data copy. Specifically, the Remote CSE may determine the consistency requirement of the data copy management according to the attribute value of the attribute consistency added under the above Original Resource resource. In a specific implementation, the remote CSE may determine whether the preset attribute value of the data consistency of the original data carried in the management request of the data copy is the first attribute value. If the preset attribute value of the data consistency of the original data is the first attribute value, it is determined that the consistency requirement of the data copy management is non-conformance.
  • the preset attribute value of the data consistency of the original data is not the first attribute value, it is determined whether the preset attribute value of the data consistency of the original data is the second attribute value. If the preset attribute value of the data consistency of the original data is the second attribute value, determining that the consistency requirement of the data copy management is final consistency; if the preset attribute value of the data consistency of the original data is not the second attribute value, Then determine the consistency requirements of data copy management is strictly consistent. For example, when the attribute value of the attribute consistency added under the Original Resource resource is 0, the Remote CSE can determine that the consistency requirement of the data copy management is non-conformance; when the attribute value of the attribute consistency added under the Original Resource resource is 1. , Remote CSE can determine the consistency of data copy management The requirement is final consistency; when the attribute value of the attribute consistency added under the Original Resource resource is 2, the Remote CSE can determine that the consistency requirement of the data copy management is strict consistency.
  • the strict consistency is as follows: the resource attribute included in the original data is consistent with the resource attribute included in the copy data of the original data at any time; the final consistency is: the resource attribute included in the original data, The resource attributes contained in the copy data of the original data are consistent at the final moment; the above non-conformity is: the resource attribute contained in the original data is the same as or different from the resource attribute contained in the copy data of the original data, that is, there is no original data.
  • the resource attributes of the copy and its copy may be the same or different, and are not specifically limited.
  • the Remote CSE determines, according to the consistency requirement, or the identifier information of the first copy data of the original data carried in the management request, a second copy of the original data stored in the Remote CSE. How data is managed.
  • the Remote CSE processes the second copy data according to the management manner to obtain target copy data of the original data that meets the consistency requirement.
  • the Remote CSE may be determined according to the foregoing consistency requirement or the identification information of the first copy data of the original data carried in the foregoing management request.
  • the stored second copy data of the original data is managed, and the second copy data can be processed according to the management manner.
  • the first copy data of the original data is the copy data created by the Hosting CSE
  • the second copy data of the original data is the copy data stored in the Remote CSE.
  • the remote CSE determines that the consistency requirement of the data copy management is non-conformity
  • the data management manner corresponding to the non-conformity may be determined, and then the data attributes of the original data are set or modified according to the foregoing management manner, and The data copy of the original data is created according to the data management manner corresponding to the non-conformity requirement, the data copy of the original data is deleted, and the resource attribute of the data copy of the original data is modified.
  • the data management mode corresponding to the final consistency may be determined, and the data attributes of the original data are set or modified according to the foregoing management manner, according to the above final Consistency requires a corresponding data management method to create a copy of the data of the original data, delete the data copy of the original data, and modify the resource attributes of the data copy of the original data.
  • the data management manner corresponding to the strict consistency may be determined, and the data attributes of the original data are set or modified according to the foregoing management manner, and the data copy of the original data is created according to the data management manner corresponding to the strict consistency requirement, and the original data is deleted.
  • a copy of the data and a resource attribute that modifies the data copy of the original data may be determined, and the data attributes of the original data are set or modified according to the foregoing management manner, and the data copy of the original data is created according to the data management manner corresponding to the strict consistency requirement, and the original data is deleted.
  • the Remote CSE can receive the management request of the data copy of the original data sent by the Hosting CSE, and determine the consistency requirement of the data copy management according to the identification information of the data consistency carried in the management request.
  • the remote CSE may also determine the consistency requirement of the data copy management according to the foregoing data consistency identification information, and determine the storage stored in the Remote CSE according to the foregoing consistency requirement or the identification information of the first copy data of the original data carried in the management request.
  • the second copy data of the original data is managed, and the Remote CSE can also process the second copy data according to the foregoing management manner.
  • the embodiment of the present invention can determine the consistency requirement of creating, deleting, or modifying attribute of the replica data according to the consistency requirement of the data copy management carried in the management request sent by the Hosting CSE, thereby improving the accuracy of the data read by the application and ensuring the data. Consistency.
  • the Remote CSE determines the consistency requirement of the data copy management according to the identifier information of the data consistency.
  • the Remote CSE determines, according to the consistency requirement, or the identifier information of the first copy data of the original data carried in the management request, a second copy of the original data stored in the Remote CSE.
  • the manner in which the data is managed, and the second copy data is created according to the management manner.
  • the Remote CSE can receive the request of the Hosting CSE and determine the attribute value of the consistency. If the attribute value of the consistency is the first attribute value (for example, 0), the Remote CSE may determine that the consistency requirement is non-conformity; if the attribute value of the consistency is the second attribute value (for example, 1), the Remote CSE may The above consistency requirement is determined to be final consistency; if the attribute value of the above consistency is the third attribute value (for example, 2), the Remote CSE can determine that the consistency requirement is strictly consistent.
  • the attribute value of the consistency is the first attribute value (for example, 0)
  • the Remote CSE may determine that the consistency requirement is non-conformity
  • the attribute value of the consistency is the second attribute value (for example, 1)
  • the Remote CSE may The above consistency requirement is determined to be final consistency
  • the attribute value of the above consistency is the third attribute value (for example, 2), the Remote CSE can determine that the consistency requirement is strictly consistent.
  • the Remote CSE determines that the second copy data of the original data is managed by creating the target copy data of the original data;
  • the consistency requirement is final consistency, and the Remote CSE determines whether the second copy data of the original data exists in the Remote CSE. If the judgment result is yes, the Remote CSE is based on the first copy data of the original data carried in the management request.
  • the latest version number determines whether the second copy data is the latest version, and if the second copy data is not the latest version, the second copy data is determined to be managed by creating the target copy data corresponding to the latest version number of the first copy data;
  • the requirement is strict consistency, and the Remote CSE determines that the second copy data of the original data is managed by creating the target copy data corresponding to the latest version number of the first copy data of the original data carried in the management request.
  • the Remote CSE receives the request from the Hosting CSE and determines the value of the consistency (default is 0);
  • Remote CSE can create Announced Resource according to the consistency requirements of data copy management, which ensures the data consistency of Original Resource and Announced Resource and enhances the accuracy of data read by users.
  • the Remote CSE determines the consistency requirement of the data copy management according to the identifier information of the data consistency.
  • the Remote CSE determines, according to the consistency requirement, or the identifier information of the first copy data of the original data carried in the management request, the stored in the Remote CSE. And managing the second copy data of the original data, and deleting the second copy data according to the management manner.
  • the Remote CSE can receive the request of the Hosting CSE and determine the attribute value of the consistency. If the attribute value of the consistency is the first attribute value (for example, 0), the Remote CSE may determine that the consistency requirement is non-conformity; if the attribute value of the consistency is the second attribute value (for example, 1), the Remote CSE may The above consistency requirement is determined to be final consistency; if the attribute value of the above consistency is the third attribute value (for example, 2), the Remote CSE can determine that the consistency requirement is strictly consistent.
  • the attribute value of the consistency is the first attribute value (for example, 0)
  • the Remote CSE may determine that the consistency requirement is non-conformity
  • the attribute value of the consistency is the second attribute value (for example, 1)
  • the Remote CSE may The above consistency requirement is determined to be final consistency
  • the attribute value of the above consistency is the third attribute value (for example, 2), the Remote CSE can determine that the consistency requirement is strictly consistent.
  • the Remote CSE determines that the second copy data of the original data is managed by deleting the second copy data; if the consistency requirement is final consistency, the Remote CSE determines whether the remote CSE exists.
  • the second copy data of the original data if the determination result is yes, determining whether the second copy data is the latest version according to the latest version number of the first copy data of the original data carried in the management request, if the second copy data is not The latest version determines that the second copy data is managed by deleting the second copy data; if the consistency requirement is strict consistency, the Remote CSE determines that the second copy data of the original data is managed by deleting the second copy data. .
  • the Remote CSE receives the request from the Hosting CSE, and determines the value of the message and the local resource consistency (default is 0);
  • A1 If the version of the request message is the same as or newer than the local version, delete the copy;
  • Remote CSE can remove Announced Resource according to the consistency requirement of data copy management, ensuring data consistency between Original Resource and Announced Resource, and enhancing user reading. The accuracy of the data.
  • the Remote CSE determines the consistency requirement of the data copy management according to the identifier information of the data consistency.
  • the Remote CSE determines, according to the consistency requirement, or the identifier information of the first copy data of the original data carried in the management request, a second copy of the original data stored in the Remote CSE.
  • the Remote CSE can receive the request of the Hosting CSE and determine the attribute value of the consistency. If the attribute value of the consistency is the first attribute value (for example, 0), the Remote CSE may determine that the consistency requirement is non-conformity; if the attribute value of the consistency is the second attribute value (for example, 1), the Remote CSE may The above consistency requirement is determined to be final consistency; if the attribute value of the above consistency is the third attribute value (for example, 2), the Remote CSE can determine that the consistency requirement is strictly consistent.
  • the attribute value of the consistency is the first attribute value (for example, 0)
  • the Remote CSE may determine that the consistency requirement is non-conformity
  • the attribute value of the consistency is the second attribute value (for example, 1)
  • the Remote CSE may The above consistency requirement is determined to be final consistency
  • the attribute value of the above consistency is the third attribute value (for example, 2), the Remote CSE can determine that the consistency requirement is strictly consistent.
  • the Remote CSE determines that the second copy data of the original data is managed by modifying the specified attribute value of the second copy data of the original data; if the above consistency requirement is final consistency, Remote CSE Determining whether the second copy data of the original data exists in the Remote CSE. If the determination result is yes, determining whether the second copy data is the latest version according to the latest version number of the first copy data of the original data carried in the management request.
  • the second copy data is not the latest version, determining that the second copy data is managed by modifying the specified attribute value of the second copy data according to the attribute value of the first copy data; if the consistency requirement is strict consistency, the Remote CSE is The second copy data of the original data is determined to be managed by modifying the specified attribute value of the second copy data according to the attribute value of the first copy data.
  • the Remote CSE receives the request from HostingCSE and determines the value of the consistency (default is 0);
  • the Remote CSE can modify the resource attributes of the Announced Resource according to the consistency requirements of the data copy management, which ensures the data consistency of the Original Resource and the Announced Resource, and enhances the accuracy of the data read by the user.
  • the copy Announce must select the blocking execution mode.
  • FIG. 17 is a schematic diagram of interaction of a Blocking execution manner according to an embodiment of the present invention, including the steps:
  • Step 001 The initiator AE or the CSE initiates a copy management (including the creation of the Announced Resource, the deleted Announced Resource, and the modified attribute content) request to the Hosting CSE, and the request information may carry the identification information of the consistency requirement, that is, the consistency attribute value. .
  • the request message parameters are as follows:
  • this parameter is the type of the copy resource to be created, otherwise the parameter is not used.
  • Ri The request ID provided by the initiator.
  • Nm optional. If the request is created, this parameter is the name of the copy resource to be created, otherwise the parameter is not used.
  • cn contains (ty, value) and (consistency, value).
  • Update operation: cn contains (attribute, value) or (attribute, NULL), and (consistency, value).
  • Step 002 The Hosting CSE authenticates the corresponding operation of the initiator, and performs corresponding management operations (including creating Announced Resource, deleting Announced Resource, and modifying attribute content, etc.) after authentication.
  • corresponding management operations including creating Announced Resource, deleting Announced Resource, and modifying attribute content, etc.
  • Step 003 The Hosting CSE initiates a copy management request to the Remote CSE, and the request information needs to carry a value of the consistency attribute.
  • the request message parameters are as follows:
  • this parameter is the type of the copy resource to be created, otherwise the parameter is not used.
  • Ri The request ID provided by the initiator.
  • Nm optional. If the request is created, this parameter is the name of the copy resource to be created, otherwise the parameter is not used.
  • cn contains (ty, value), (consistency, value), and (stateTag, value).
  • Update operation: cn contains (attribute, value) or (attribute, NULL), (stateTag, value), and (consistency, value).
  • Delete operation: cn contains (stateTag, value).
  • Step 004 The Remote CSE authenticates the corresponding operation of the initiator, and performs the corresponding management operation after the authentication.
  • Step 005 Remote CSE replies to the Hosting CSE operation result.
  • the reply message parameters are as follows:
  • Ri The request identifier provided by Hosting CSE.
  • Nm optional. If the request is created and the creation is unsuccessful, the parameter is the name of the copy resource to be created, otherwise the parameter is not used.
  • cn can be the content of the created copy resource.
  • Update operation: cn can be all updated attributes.
  • Step 006 Hosting CSE returns the result of AE or CSE operation.
  • the reply message parameters are as follows:
  • Ri Request identifier provided by AE or CSE.
  • Nm optional. If the request is created and the creation is unsuccessful, the parameter is the name of the copy resource to be created, otherwise the parameter is not used.
  • cn can be the content of the created copy resource.
  • Update operation: cn can be all updated attributes.
  • FIG. 18 is a schematic diagram of interaction of a Non-Blocking execution manner according to an embodiment of the present invention, including the steps:
  • Step 001 A request for copy management is initiated by the AE or the CSE to the Hosting CSE, and the request information may carry the consistency requirement information, that is, the consistency attribute value.
  • Copy management includes three situations: creating Announced Resource, deleting Announced Resource, and modifying attribute content.
  • the request parameter is the same as the blocking execution mode Step 001.
  • Step 002 The Hosting CSE authenticates the corresponding operation of the initiator, and performs the corresponding management operation after the authentication.
  • Step 003 Hosting CSE replies to AE or CSE, and the reply message is the result before the copy is updated.
  • the reply parameters are as follows:
  • Ri Request identifier provided by AE or CSE.
  • Step 004 The Hosting CSE initiates a copy management request to the Remote CSE, and the request information carries the value of the consistency attribute.
  • the request parameter is the same as the blocking execution mode Step 003.
  • Step 005 The Remote CSE authenticates the corresponding operation of the initiator, and performs corresponding management operations after the authentication.
  • Step 006 Remote CSE replies to the Hosting CSE operation result.
  • Step 007 The AE or CSE may choose to initiate a query request to the Hosting CSE according to its own consistency requirement, and may request to return the execution status of the queried resource.
  • the request parameters are as follows:
  • Ri The request ID provided by the initiator.
  • Cn can be the result of the operation of the resource or attribute that needs to be queried.
  • Step 008 Hosting CSE responds to AE or CSE query results.
  • the reply parameters are as follows:
  • Ri Request identifier provided by AE or CSE.
  • Cn The final result of the resource or attribute of the query.
  • the data processing method described in the embodiment of the present invention may be specifically applied to specific application scenarios such as disaster emergency processing and intelligent parking.
  • specific application scenarios such as disaster emergency processing and intelligent parking.
  • the following scenarios of disaster emergency response and intelligent parking will be briefly introduced:
  • M2M services need to automatically and automatically transmit the necessary information to the user equipment, as shown in Figure 19.
  • the relevant participants in this scenario have information publishers, provincial centers, county centers, and users.
  • the information publisher provides information sent by various sensors and devices to the provincial center;
  • the provincial center is a provincial-level general service platform for storing and managing data information transmitted by various information publishers;
  • the county-level center is county-level.
  • a universal service platform for storing and managing local data information and copies transmitted from provincial centers.
  • the information is sent to the user equipment through a wireless network (such as WiFi, 3GPP); the user includes a helper, a rescue vehicle, and the like. They have user equipment and can connect to the county center for local information as well as copy information for provincial centers.
  • the national center announces a copy to the county center.
  • the consistency requirement for the copy only needs to meet the final consistency; but when the disaster occurs, the disaster victim urgently needs to obtain all kinds of the latest information for the copy.
  • the update needs to meet strict consistency requirements to meet the needs.
  • Smart parking helps solve a big problem with urban traffic – finding the right parking spot.
  • City The parking spots in the city are widely distributed, and each parking point is often owned by different providers. It is difficult to solve the parking problem of users through a parking point service provider.
  • the copy information of other parking spots will be stored at a fixed parking point service provider (the copy information meets strict consistency requirements), and the user can conveniently find the appropriate information by accessing the copy information of the provider. Parking spot.
  • the scene related participants are a parking service provider (mall), a parking provider (street), and a smartphone navigator.
  • the parking provider (mall) has parking information in the mall, the parking provider has parking information for all the malls in the street (one street has multiple shopping malls), and the smartphone navigator is the M2M used by the user for navigation purposes. device.
  • the scene precondition is that the user sets a mall as a destination with the smartphone terminal, and checks whether the mall has a free parking space.
  • the trigger condition is that the user arrives near the destination mall.
  • the user's smartphone terminal sends the user location information to the mall parking lot.
  • the service provider of mall1 queries the parking information of the place, and if there is no parking space, informs the smartphone terminal of the information.
  • the service provider of mall1 queries the street service provider for the copy information of mall2.
  • the service provider of street informs the service provider of mall1 through the M2M service platform that there is a free parking space at mall2.
  • the service provider of mall1 informs the user that there is a free parking space at mall2.
  • FIG. 21 it is a schematic structural diagram of a first embodiment of a data processing apparatus according to an embodiment of the present invention.
  • the data processing device described in the embodiment of the present invention includes:
  • the receiving module 10 is configured to receive a management request of a data copy of the original data sent by the application entity AE or the public service entity CSE.
  • the determining module 20 is configured to determine a consistency requirement of the data copy management according to the identifier information of the data consistency carried in the management request of the data copy received by the receiving module.
  • the processing module 30 is configured to set data attributes of the original data according to the consistency requirement determined by the determining module, and process the copy data of the original data according to a data management manner corresponding to the consistency requirement.
  • the sending module 40 is configured to send the identifier information of the replica data of the original data obtained by the processing module, or the identifier information of the data consistency received by the receiving module, to the remote public service entity Remote CSE.
  • the management request of the data copy of the original data includes: creating a data copy of the original data, deleting the data copy of the original data, and modifying at least one of the resource attributes of the data copy of the original data Management request;
  • the identifier information of the data consistency is a preset attribute value of data consistency of the original data.
  • the consistency requirement of the data copy management includes: at least one of strict consistency, final consistency, and no consistency;
  • the strict consistency is: the resource attribute included in the original data is consistent with the resource attribute included in the copy data of the original data at any time;
  • the final consistency is: the resource attribute included in the original data is consistent with the resource attribute included in the copy data of the original data at a final moment;
  • the non-conformity is: the resource attribute included in the original data is the same as or different from the resource attribute included in the copy data of the original data.
  • the determining module 20 is specifically configured to:
  • the preset attribute value of the data consistency of the original data is the first attribute value, determining that the consistency requirement of the data copy management is non-conformance
  • the preset attribute value of the data consistency of the original data is not the second attribute value, it is determined that the consistency requirement of the data copy management is strict consistency.
  • the management request of the data copy of the original data is created a copy of the data of the initial data
  • the processing module 30 is specifically configured to:
  • the copy data of the original data is created according to a data processing manner of Blocking or Non-blocking;
  • the determining module determines that the consistency requirement is final consistency, setting a version number of the created copy data of the original data to a latest version number, and the latest version number and the final consistency
  • the identification information is added to the management request message, and the copy data of the original data is created according to the data processing manner of Blocking or Non-blocking according to the management request message;
  • the determining module determines that the consistency requirement is strict consistency
  • the strict consistency identification information is added to the management request message, and the management request message is created according to the Blocking data processing manner according to the management request message. A copy of the original data.
  • the management request of the data copy of the original data is to delete a data copy of the original data
  • the processing module 30 is specifically configured to:
  • the determining module determines that the consistency requirement is non-conformity, deleting the copy data of the original data according to a data processing manner of Blocking or Non-blocking;
  • the determining module determines that the consistency requirement is final consistency, setting a version number of the copy data of the original data to a latest version number, and adding the latest version number to the management request message, according to The management request message deletes the copy data of the original data in a data processing manner of Blocking or Non-blocking;
  • the copy data of the original data is deleted according to a data processing manner of Blocking.
  • the management request of the data copy of the original data is a resource attribute of modifying a data copy of the original data
  • the processing module 30 is specifically configured to:
  • the determining module determines that the consistency requirement is non-conformity, updating the specified attribute value of the copy data of the original data according to a data processing manner of Blocking or Non-blocking;
  • the determining module determines that the consistency requirement is final consistency, setting the version number of the modified copy data of the original data to the latest version number, and the latest version number of the copy data, The identification information of the specified attribute value and the final consistency is added to the management request message. Determining, according to the management request message, a specified attribute value of the copy data of the original data in a data processing manner of Blocking or Non-blocking;
  • the determining module determines that the consistency requirement is strict consistency, adding the strict consistency identification information to the management request message, and modifying the management request message according to the data processing manner of Blocking.
  • the specified attribute of the copy data of the original data is strict consistency, adding the strict consistency identification information to the management request message, and modifying the management request message according to the data processing manner of Blocking.
  • the sending module 40 is specifically configured to:
  • the management request message of the copy data where the management request message carries the identification information of the copy data of the original data, or the identification information of the data consistency.
  • the foregoing data processing apparatus may be the Hosting CSE described in the embodiment of the present invention.
  • the data processing apparatus may perform the foregoing data processing method corresponding to the Hosting CSE by using the receiving module, the determining module, the processing module, and the sending module.
  • the receiving module the determining module
  • the processing module the sending module.
  • FIG. 22 it is a schematic structural diagram of a second embodiment of a data processing apparatus according to an embodiment of the present invention.
  • the data processing device described in the embodiment of the present invention includes:
  • the receiving module 50 is configured to receive a management request for a data copy of the original data sent by the local public service entity Hosting CSE, where the management request carries the data consistency identification information of the data copy management.
  • the determining module 60 is configured to determine, according to the identifier information of the data consistency received by the receiving module, the consistency requirement of the data copy management.
  • the determining module 60 is further configured to determine, according to the consistency requirement, or the identifier information of the first copy data of the original data carried in the management request, the original data stored in the Remote CSE. The management method of the second copy data.
  • the processing module 70 is configured to process the second copy data according to the management manner determined by the determining module to obtain target copy data of the original data that meets the consistency requirement.
  • the management request of the data copy of the original data includes: creating a data copy of the original data, deleting the data copy of the original data, and modifying at least one of the resource attributes of the data copy of the original data Management request;
  • the identifier information of the data consistency is a preset attribute value of data consistency of the original data.
  • the consistency requirement of the data copy management includes: at least one of strict consistency, final consistency, and no consistency;
  • the strict consistency is: the resource attribute included in the original data is consistent with the resource attribute included in the copy data of the original data at any time;
  • the final consistency is: the resource attribute included in the original data is consistent with the resource attribute included in the copy data of the original data at a final moment;
  • the non-conformity is: the resource attribute included in the original data is the same as or different from the resource attribute included in the copy data of the original data.
  • the determining module 60 is specifically configured to:
  • the preset attribute value of the data consistency of the original data is the first attribute value, determining that the consistency requirement of the data copy management is non-conformance
  • the preset attribute value of the data consistency of the original data is not the second attribute value, it is determined that the consistency requirement of the data copy management is strict consistency.
  • the management request of the data copy of the original data is to create a data copy of the original data
  • the determining module 60 is specifically configured to:
  • the consistency requirement is the final consistency, determining whether the second copy data of the original data exists in the Remote CSE, and if the determination result is yes, according to the original data carried in the management request
  • the latest version number of the first copy data determines whether the second copy data is the latest version, and if the second copy data is not the latest version, determining that the second copy data is managed by creating the first copy data
  • the consistency requirement is strict consistency, determining that the second copy data of the original data is managed by creating a target corresponding to the latest version number of the first copy data of the original data carried in the management request Copy data.
  • the management request of the data copy of the original data is to delete a data copy of the original data
  • the determining module 60 is specifically configured to:
  • the consistency requirement is the final consistency
  • determining that the second copy data of the original data is managed is to delete the second copy data.
  • the management request of the data copy of the original data is a resource attribute of modifying a data copy of the original data
  • the determining module 60 is specifically configured to:
  • the consistency requirement is the final consistency
  • the attribute value modifies a specified attribute value of the second copy data
  • determining that the second copy data of the original data is managed is to modify a specified attribute value of the second copy data according to an attribute value of the first copy data.
  • the data processing apparatus may be the Remote CSE described in the embodiment of the present invention, and the data processing apparatus may be implemented by the receiving module, the determining module, and the processing module.
  • the data processing method corresponding to the above-mentioned Remote CSE refer to the corresponding embodiment of the Remote CSE, and details are not described herein.
  • FIG. 23 is a schematic structural diagram of a first embodiment of a public service entity according to an embodiment of the present invention.
  • the public service entity described in the embodiment of the present invention includes: a memory 1000, a transmitter 2000, a receiver 3000, and a processor 4000; the foregoing memory 1000, the transmitter 2000, the receiver 3000, and the processor 4000 are connected by a bus 8000.
  • the memory 1000 is configured to store program code
  • the transmitter 2000, the receiver 3000, and the processor 4000 are configured to invoke the program code stored in the memory 1000, and perform the following operations:
  • the receiver 3000 is configured to receive a management request of a data copy of the original data sent by the application entity AE or the public service entity CSE;
  • the processor 4000 is configured to determine, according to the data consistency identifier information carried in the management request of the data copy received by the receiver, a consistency requirement of data copy management;
  • the processor 4000 is further configured to set data attributes of the original data according to the consistency requirement, and process the copy data of the original data according to a data management manner corresponding to the consistency requirement;
  • the transmitter 2000 is configured to send identifier information of the replica data of the original data processed by the processor, or identifier information of the data consistency received by the receiver, to a remote public service entity Remote CSE.
  • the management request of the data copy of the original data includes: creating a data copy of the original data, deleting the data copy of the original data, and modifying at least one of the resource attributes of the data copy of the original data Management request;
  • the identifier information of the data consistency is a preset attribute value of data consistency of the original data.
  • the consistency requirement of the data copy management includes: at least one of strict consistency, final consistency, and no consistency;
  • the strict consistency is: the resource attribute included in the original data is consistent with the resource attribute included in the copy data of the original data at any time;
  • the final consistency is: the resource attribute included in the original data is consistent with the resource attribute included in the copy data of the original data at a final moment;
  • the non-conformity is: the resource attribute included in the original data is the same as or different from the resource attribute included in the copy data of the original data.
  • the processor 4000 is specifically configured to:
  • the preset attribute value of the data consistency of the original data is the first attribute value, determining that the consistency requirement of the data copy management is non-conformance
  • the preset attribute value of the data consistency of the original data is not the second attribute value, it is determined that the consistency requirement of the data copy management is strict consistency.
  • the management request of the data copy of the original data is to create a data copy of the original data
  • the processor 4000 is specifically configured to:
  • the copy data of the original data is created according to a data processing manner of Blocking or Non-blocking;
  • the copy data of the original data is created according to the management request message in the data processing manner of Blocking or Non-blocking;
  • the management request of the data copy of the original data is to delete a data copy of the original data
  • the processor 4000 is specifically configured to:
  • the copy data of the original data is deleted according to a data processing manner of Blocking or Non-blocking;
  • the consistency requirement is final consistency, setting a version number of the copy data of the original data to a latest version number, and adding the latest version number to the management request message, according to the management request report Copying the copy data of the original data in the data processing manner of Blocking or Non-blocking;
  • the copy data of the original data is deleted according to the data processing method of Blocking.
  • the management request of the data copy of the original data is a resource attribute of modifying a data copy of the original data
  • the processor 4000 is specifically configured to:
  • the specified attribute value of the copy data of the original data is updated according to a data processing manner of Blocking or Non-blocking;
  • the consistency requirement is final consistency
  • setting the version number of the modified copy data of the original data to the latest version number, and the latest version number of the copy data, the specified attribute value, and the The identification information of the final consistency is added to the management request message, and the specified attribute value of the copy data of the original data is modified according to the data processing manner of Blocking or Non-blocking according to the management request message;
  • the strict consistency identification information is added to the management request message, and the copy data of the original data is modified according to the management request message in a data processing manner of Blocking.
  • the specified attribute is the specified attribute.
  • the transmitter 2000 is specifically configured to:
  • the management request message of the copy data where the management request message carries the identification information of the copy data of the original data, or the identification information of the data consistency.
  • the public service entity may be the Hosting CSE described in the embodiment of the present invention
  • the data processing apparatus may execute the data corresponding to the Hosting CSE by using the memory 1000, the transmitter 2000, the receiver 3000, and the processor 4000.
  • the foregoing method refer to the corresponding embodiment of the Hosting CSE, and details are not described herein.
  • FIG. 24 it is a schematic structural diagram of a second embodiment of a public service entity described in the embodiment of the present invention.
  • the public service entity described in the embodiment of the present invention includes: a memory 5000, receiving The processor 6000 and the processor 7000; the above-mentioned memory 5000, receiver 6000 and processor 7000 are connected by a bus 9000.
  • the memory 5000 is configured to store program code
  • the receiver 6000 and the processor 7000 are configured to invoke the program code stored in the memory 5000, and perform the following operations:
  • the receiver 6000 is configured to receive a management request of a data copy of the original data sent by the local public service entity Hosting CSE, where the management request carries the data consistency identifier information of the data copy management;
  • the processor 7000 is configured to determine, according to the identifier information of the data consistency, a consistency requirement of the data copy management;
  • the processor 7000 is further configured to determine, according to the consistency requirement, or the identifier information of the first copy data of the original data carried in the management request, the original data stored in the Remote CSE.
  • the management method of the second copy data is further configured to determine, according to the consistency requirement, or the identifier information of the first copy data of the original data carried in the management request, the original data stored in the Remote CSE.
  • the processor 7000 is further configured to process the second replica data according to the management manner to obtain target replica data of the original data that meets the consistency requirement.
  • the management request of the data copy of the original data includes: creating a data copy of the original data, deleting the data copy of the original data, and modifying at least one of the resource attributes of the data copy of the original data Management request;
  • the identifier information of the data consistency is a preset attribute value of data consistency of the original data.
  • the consistency requirement of the data copy management includes: at least one of strict consistency, final consistency, and no consistency;
  • the strict consistency is: the resource attribute included in the original data is consistent with the resource attribute included in the copy data of the original data at any time;
  • the final consistency is: the resource attribute included in the original data is consistent with the resource attribute included in the copy data of the original data at a final moment;
  • the non-conformity is: the resource attribute included in the original data is the same as or different from the resource attribute included in the copy data of the original data.
  • the processor 7000 is specifically configured to:
  • the preset attribute value of the data consistency of the original data is the first attribute value, determining that the consistency requirement of the data copy management is non-conformance
  • the preset attribute value of the data consistency of the original data is not the second attribute value, it is determined that the consistency requirement of the data copy management is strict consistency.
  • the management request of the data copy of the original data is to create a data copy of the original data
  • the processor 7000 is specifically configured to:
  • the consistency requirement is the final consistency, determining whether the second copy data of the original data exists in the Remote CSE, and if the determination result is yes, according to the original data carried in the management request
  • the latest version number of the first copy data determines whether the second copy data is the latest version, and if the second copy data is not the latest version, determining that the second copy data is managed by creating the first copy data
  • the consistency requirement is strict consistency, determining that the second copy data of the original data is managed by creating a target corresponding to the latest version number of the first copy data of the original data carried in the management request Copy data.
  • the management request of the data copy of the original data is to delete a data copy of the original data
  • the processor 7000 is specifically configured to:
  • the consistency requirement is the final consistency
  • the latest version number of the first copy data determines whether the second copy data is the latest version, and if the second copy data is not the latest version, the management party of the second copy data is determined The method of deleting the second copy data;
  • determining that the second copy data of the original data is managed is to delete the second copy data.
  • the management request of the data copy of the original data is a resource attribute of modifying a data copy of the original data
  • the processor 7000 is specifically configured to:
  • the consistency requirement is the final consistency
  • the attribute value modifies a specified attribute value of the second copy data
  • determining that the second copy data of the original data is managed is to modify a specified attribute value of the second copy data according to an attribute value of the first copy data.
  • the public service entity may be the Remote CSE described in the embodiment of the present invention
  • the data processing apparatus may perform the foregoing data processing method corresponding to the Remote CSE by using the memory 5000, the receiver 6000, and the processor 7000.
  • the description refer to the corresponding embodiment of the Remote CSE, and details are not described herein.
  • FIG. 25 is a schematic structural diagram of an embodiment of a data processing system according to an embodiment of the present invention.
  • the data processing system described in the embodiment of the present invention includes the first public service entity and the second public service entity described in the foregoing embodiments, that is, the Hosting CSE 10001 and the Remote CSE 10002 described in the embodiments of the present invention.
  • system described in the embodiments of the present invention may further include the AE/CSE 10000 described in the foregoing embodiments.
  • AE/CSE 10000 described in the foregoing embodiments.
  • Hosting CSE 10001, and Remote CSE 10002 refer to the implementation manners described in the foregoing embodiments, and details are not described herein again.
  • the readable storage medium when executed, may include the flow of an embodiment of the methods as described above.
  • the storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).

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 Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

本发明实施例提供了一种数据处理方法,包括:Hosting CSE接收AE或者CSE发送的原始数据的数据副本的管理请求;Hosting CSE根据数据副本的管理请求中携带的数据一致性的标识信息,确定数据副本管理的一致性要求;Hosting CSE根据所述一致性要求设置原始数据的数据属性,并按照所述一致性要求对应的数据管理方式处理原始数据的副本数据;Hosting CSE将所述原始数据的副本数据的标识信息,或者所述数据一致性的标识信息发送给Remote CSE。本发明实施例还提供了一种数据处理装置。采用本发明实施例,具有可根据应用自身不同的一致性要求,确定数据处理的一致性要求,可提高应用读取的数据的准确性,保证数据的一致性的优点。

Description

一种数据处理方法及装置 技术领域
本发明涉及通信技术领域,尤其涉及一种数据处理方法及装置。
背景技术
对于分布式系统来说,为了提高检索效率,数据分布在各个不同的节点,同一数据被存储在多个节点上,即存在多个副本(如图1所示)。在数据的分布性处理中,多个用户可同时对位于不同节点的不同数据副本进行读写操作,由此可能出现数据的不一致问题。此外,由于一些不可预测的软、硬件故障及操作失误,也会因传输重试而引起数据的不一致。因此,分布式系统必须采用各种策略保证系统状态和各副本的一致性,从而保证系统正确地运行。
在机器对机器(Machine to Machine,M2M)环境中,为了提高数据访问的性能以及可靠性问题,也采用了数据“副本机制”,将一份数据保存成多个副本。例如,M2M节点N1上有数据资源D1,为了提高性能,M2M系统在另一节点Ni上保存了D1的副本D1’,使得应用程序或用户可以访问任何一个副本(D1或D1’)以读取数据。比如靠近Ni的客户端可以直接从Ni读取数据D1’,无需去N1读取数据。由此,数据副本技术降低了N1节点的负载,同时提高了对数据D1的访问性能。
然而,在M2M中引入副本机制,必然带来一个问题,即数据一致性问题:
1)在任一时刻,不同数据副本的状态(内容)是否一致,比如上述例子中,D1和D1’的内容是否一样?
2)用户读取数据时(用户可以不知道自己读到的是D1还是D1’),是否能够读到最新的数据内容?
由于oneM2M架构是通用的基础架构,oneM2M之上可能运行着不同的应用,它们对数据资源(即,原始资源Original Resource)和数据资源的副本(即,宣布资源Announced Resource)的数据一致性有不同的要求,有些应用需要强的一致性,有些可以接受弱一致性;有些要求在很短时间内达到同步,有些可以接受较长时间的同步。因此,oneM2M需要定义多种数据一致性模型, 以及这些一致性模型的实现机制。然而,现有技术中并未定义多种数据一致性模型,也未提供上述一致性模型的实现机制。
发明内容
本发明实施例提供了一种数据处理方法及装置,可根据应用自身不同的一致性要求,确定数据处理的一致性要求,可提高应用读取的数据的准确性,保证数据的一致性。
本发明实施例第一方面提供了一种数据处理的方法,其可包括:
本地公共服务实体Hosting CSE接收应用实体AE或者公共服务实体CSE发送的原始数据的数据副本的管理请求;
所述Hosting CSE根据所述数据副本的管理请求中携带的数据一致性的标识信息,确定数据副本管理的一致性要求;
所述Hosting CSE根据所述一致性要求设置所述原始数据的数据属性,并按照所述一致性要求对应的数据管理方式处理所述原始数据的副本数据;
所述Hosting CSE将所述原始数据的副本数据的标识信息,或者所述数据一致性的标识信息发送给远程公共服务实体Remote CSE。
结合第一方面,在第一种可能的实现方式中,所述原始数据的数据副本的管理请求包括:创建原始数据的数据副本、删除原始数据的数据副本以及修改原始数据的数据副本的资源属性中的至少一种数据副本的管理请求;
所述数据一致性的标识信息为所述原始数据的数据一致性的预设属性值。
结合第一方面第一种可能的实现方式,在第二种可能的实现方式中,所述数据副本管理的一致性要求包括:严格一致性、最终一致性以及无一致性中的至少一种;
其中,所述严格一致性为:所述原始数据中包含的资源属性,与所述原始数据的副本数据中包含的资源属性在任意时刻均保持一致;
所述最终一致性为:所述原始数据中包含的资源属性,与所述原始数据的副本数据中包含的资源属性在最终时刻保持一致;
所述无一致性为:所述原始数据中包含的资源属性,与所述原始数据的副本数据中包含的资源属性相同或者不同。
结合第一方面第二种可能的实现方式,在第三种可能的实现方式中,所述Hosting CSE根据所述数据副本的管理请求中携带的数据一致性的标识信息,确定数据副本管理的一致性要求,包括:
所述Hosting CSE判断所述数据副本的管理请求中携带的所述原始数据的数据一致性的预设属性值是否为第一属性值;
若所述原始数据的数据一致性的预设属性值为第一属性值,则确定数据副本管理的一致性要求为无一致性;
若所述原始数据的数据一致性的预设属性值不是第一属性值,则判断所述原始数据的数据一致性的预设属性值是否为第二属性值;
若所述原始数据的数据一致性的预设属性值为第二属性值,则确定所述数据副本管理的一致性要求为最终一致性;
若所述原始数据的数据一致性的预设属性值不是第二属性值,则确定所述数据副本管理的一致性要求为严格一致性。
结合第一方面第三种可能的实现方式,在第四种可能的实现方式中,所述原始数据的数据副本的管理请求为创建原始数据的数据副本;
所述按照所述一致性要求对应的数据管理方式处理所述原始数据的副本数据,包括:
若所述一致性要求为无一致性,则按照Blocking或者Non-blocking的数据处理方式创建所述原始数据的副本数据;
若所述一致性要求为最终一致性,则将创建的所述原始数据的副本数据的版本号设置为最新版本号,并将所述最新版本号以及所述最终一致性的标识信息添加至管理请求报文中,根据所述管理请报文以Blocking或者Non-blocking的数据处理方式创建所述原始数据的副本数据;
若所述一致性要求为严格一致性,则将所述严格一致性的标识信息添加至管理请求报文中,并根据所述管理请求报文以Blocking的数据处理方式创建所述原始数据的副本数据。
结合第一方面第三种可能的实现方式,在第五种可能的实现方式中,所述原始数据的数据副本的管理请求为删除原始数据的数据副本;
所述按照所述一致性要求对应的数据管理方式处理所述原始数据的副本数据,包括:
若所述一致性要求为无一致性,则按照Blocking或者Non-blocking的数据处理方式删除所述原始数据的副本数据;
若所述一致性要求为最终一致性,则将所述原始数据的副本数据的版本号设置为最新版本号,并将所述最新版本号添加至管理请求报文中,根据所述管理请求报文以Blocking或者Non-blocking的数据处理方式删除所述原始数据的副本数据;
若所述一致性要求为严格一致性,则按照Blocking的数据处理方式删除所述原始数据的副本数据。
结合第一方面第三种可能的实现方式,在第六种可能的实现方式中,所述原始数据的数据副本的管理请求为修改原始数据的数据副本的资源属性;
所述按照所述一致性要求对应的数据管理方式处理所述原始数据的副本数据,包括:
若所述一致性要求为无一致性,则按照Blocking或者Non-blocking的数据处理方式更新所述原始数据的副本数据的指定属性值;
若所述一致性要求为最终一致性,则将修改后的所述原始数据的副本数据的版本号设置为最新版本号,并将所述副本数据的最新版本号、所述指定属性值以及所述最终一致性的标识信息添加至管理请求报文中,根据所述管理请求报文以Blocking或者Non-blocking的数据处理方式修改所述原始数据的副本数据的指定属性值;
若所述一致性要求为严格一致性,则将所述严格一致性的标识信息添加至管理请求报文中,根据所述管理请求报文以Blocking的数据处理方式修改所述原始数据的副本数据的指定属性。
结合第一方面第四种可能的实现方式至第六种可能的实现方式中任一种,在第七种可能的实现方式中,所述Hosting CSE将所述原始数据的副本数据的标识信息,或者所述数据一致性的标识信息发送给远程公共服务实体Remote CSE,包括:
所述Hosting CSE向所述Remote CSE发送副本数据的所述管理请求报文,所述管理请求报文中携带所述原始数据的副本数据的标识信息,或者所述数据一致性的标识信息。
本发明实施例第二方面提供了一种数据处理方法,其可包括:
远程公共服务实体Remote CSE接收本地公共服务实体Hosting CSE发送的原始数据的数据副本的管理请求,所述管理请求中携带数据副本管理的数据一致性的标识信息;
所述Remote CSE根据所述数据一致性的标识信息确定所述数据副本管理的一致性要求;
所述Remote CSE根据所述一致性要求,或者所述管理请求中携带的所述原始数据的第一副本数据的标识信息,确定所述Remote CSE中存储的所述原始数据的第二副本数据的管理方式;
所述Remote CSE根据所述管理方式对所述第二副本数据进行处理,以得到符合所述一致性要求的所述原始数据的目标副本数据。
结合第二方面,在第一种可能的实现方式中,所述原始数据的数据副本的管理请求包括:创建原始数据的数据副本、删除原始数据的数据副本以及修改原始数据的数据副本的资源属性中的至少一种数据副本的管理请求;
所述数据一致性的标识信息为所述原始数据的数据一致性的预设属性值。
结合第二方面第一种可能的实现方式,在第二种可能的实现方式中,所述数据副本管理的一致性要求包括:严格一致性、最终一致性以及无一致性中的至少一种;
其中,所述严格一致性为:所述原始数据中包含的资源属性,与所述原始数据的副本数据中包含的资源属性在任意时刻均保持一致;
所述最终一致性为:所述原始数据中包含的资源属性,与所述原始数据的副本数据中包含的资源属性在最终时刻保持一致;
所述无一致性为:所述原始数据中包含的资源属性,与所述原始数据的副本数据中包含的资源属性相同或者不同。
结合第二方面第二种可能的实现方式,在第三种可能的实现方式中,所述Remote CSE根据所述数据一致性的标识信息确定所述数据副本管理的一致性要求,包括:
所述Remote CSE判断所述数据副本的管理请求中携带的所述原始数据的数据一致性的预设属性值是否为第一属性值;
若所述原始数据的数据一致性的预设属性值为第一属性值,则确定数据副本管理的一致性要求为无一致性;
若所述原始数据的数据一致性的预设属性值不是第一属性值,则判断所述原始数据的数据一致性的预设属性值是否为第二属性值;
若所述原始数据的数据一致性的预设属性值为第二属性值,则确定所述数据副本管理的一致性要求为最终一致性;
若所述原始数据的数据一致性的预设属性值不是第二属性值,则确定所述数据副本管理的一致性要求为严格一致性。
结合第二方面第三种可能的实现方式,在第四种可能的实现方式中,所述原始数据的数据副本的管理请求为创建原始数据的数据副本;
所述Remote CSE根据所述一致性要求,或者所述管理请求中携带的所述原始数据的第一副本数据的标识信息,确定所述Remote CSE中存储的所述原始数据的第二副本数据的管理方式,包括:
若所述一致性要求为无一致性,则确定所述原始数据的第二副本数据的管理方式为创建所述原始数据的目标副本数据;
若所述一致性要求为最终一致性,则判断所述Remote CSE中是否存在所述原始数据的第二副本数据,若判断结果为是,则根据所述管理请求中携带的所述原始数据的第一副本数据的最新版本号判断所述第二副本数据是否为最新版本,若所述第二副本数据不是最新版本则确定所述第二副本数据的管理方式为创建所述第一副本数据的最新版本号对应的目标副本数据;
若所述一致性要求为严格一致性,则确定所述原始数据的第二副本数据的管理方式为创建所述管理请求中携带的所述原始数据的第一副本数据的最新版本号对应的目标副本数据。
结合第二方面第三种可能的实现方式,在第五种可能的实现方式中,所述原始数据的数据副本的管理请求为删除原始数据的数据副本;
所述Remote CSE根据所述一致性要求,或者所述管理请求中携带的所述原始数据的第一副本数据的标识信息,确定所述Remote CSE中存储的所述原始数据的第二副本数据的管理方式,包括:
若所述一致性要求为无一致性,则确定所述原始数据的第二副本数据的管理方式为删除所述第二副本数据;
若所述一致性要求为最终一致性,则判断所述Remote CSE中是否存在所述原始数据的第二副本数据,若判断结果为是,则根据所述管理请求中携带的所述原始数据的第一副本数据的最新版本号判断所述第二副本数据是否为最新版本,若所述第二副本数据不是最新版本则确定所述第二副本数据的管理方式为删除所述第二副本数据;
若所述一致性要求为严格一致性,则确定所述原始数据的第二副本数据的管理方式为删除所述第二副本数据。
结合第二方面第三种可能的实现方式,在第六种可能的实现方式中,所述原始数据的数据副本的管理请求为修改原始数据的数据副本的资源属性;
所述Remote CSE根据所述一致性要求,或者所述管理请求中携带的所述原始数据的第一副本数据的标识信息,确定所述Remote CSE中存储的所述原始数据的第二副本数据的管理方式,包括:
若所述一致性要求为无一致性,则确定所述原始数据的第二副本数据的管理方式为修改所述原始数据的第二副本数据的指定属性值;
若所述一致性要求为最终一致性,则判断所述Remote CSE中是否存在所述原始数据的第二副本数据,若判断结果为是,则根据所述管理请求中携带的所述原始数据的第一副本数据的最新版本号判断所述第二副本数据是否为最新版本,若所述第二副本数据不是最新版本则确定所述第二副本数据的管理方式为根据所述第一副本数据的属性值修改所述第二副本数据的指定属性值;
若所述一致性要求为严格一致性,则确定所述原始数据的第二副本数据的管理方式为根据所述第一副本数据的属性值修改所述第二副本数据的指定属性值。
本发明实施例第三方面提供了一种数据处理装置,其可包括:
接收模块,用于接收应用实体AE或者公共服务实体CSE发送的原始数据的数据副本的管理请求;
确定模块,用于根据所述接收模块接收的所述数据副本的管理请求中携带的数据一致性的标识信息,确定数据副本管理的一致性要求;
处理模块,用于根据所述确定模块确定的所述一致性要求设置所述原始数据的数据属性,并按照所述一致性要求对应的数据管理方式处理所述原始数据 的副本数据;
发送模块,用于将所述处理模块处理得到的所述原始数据的副本数据的标识信息,或者所述接收模块接收到的所述数据一致性的标识信息发送给远程公共服务实体Remote CSE。
结合第三方面,在第一种可能的实现方式中,所述原始数据的数据副本的管理请求包括:创建原始数据的数据副本、删除原始数据的数据副本以及修改原始数据的数据副本的资源属性中的至少一种数据副本的管理请求;
所述数据一致性的标识信息为所述原始数据的数据一致性的预设属性值。
结合第三方面第一种可能的实现方式,在第二种可能的实现方式中,所述数据副本管理的一致性要求包括:严格一致性、最终一致性以及无一致性中的至少一种;
其中,所述严格一致性为:所述原始数据中包含的资源属性,与所述原始数据的副本数据中包含的资源属性在任意时刻均保持一致;
所述最终一致性为:所述原始数据中包含的资源属性,与所述原始数据的副本数据中包含的资源属性在最终时刻保持一致;
所述无一致性为:所述原始数据中包含的资源属性,与所述原始数据的副本数据中包含的资源属性相同或者不同。
结合第三方面第二种可能的实现方式,在第三种可能的实现方式中,所述确定模块具体用于:
判断所述数据副本的管理请求中携带的所述原始数据的数据一致性的预设属性值是否为第一属性值;
若所述原始数据的数据一致性的预设属性值为第一属性值,则确定数据副本管理的一致性要求为无一致性;
若所述原始数据的数据一致性的预设属性值不是第一属性值,则判断所述原始数据的数据一致性的预设属性值是否为第二属性值;
若所述原始数据的数据一致性的预设属性值为第二属性值,则确定所述数据副本管理的一致性要求为最终一致性;
若所述原始数据的数据一致性的预设属性值不是第二属性值,则确定所述数据副本管理的一致性要求为严格一致性。
结合第三方面第三种可能的实现方式,在第四种可能的实现方式中,所述 原始数据的数据副本的管理请求为创建原始数据的数据副本;
所述处理模块具体用于:
若所述确定模块确定所述一致性要求为无一致性,则按照Blocking或者Non-blocking的数据处理方式创建所述原始数据的副本数据;
若所述确定模块确定所述一致性要求为最终一致性,则将创建的所述原始数据的副本数据的版本号设置为最新版本号,并将所述最新版本号以及所述最终一致性的标识信息添加至管理请求报文中,根据所述管理请报文以Blocking或者Non-blocking的数据处理方式创建所述原始数据的副本数据;
若所述确定模块确定所述一致性要求为严格一致性,则将所述严格一致性的标识信息添加至管理请求报文中,并根据所述管理请求报文以Blocking的数据处理方式创建所述原始数据的副本数据。
结合第三方面第三种可能的实现方式,在第五种可能的实现方式中,所述原始数据的数据副本的管理请求为删除原始数据的数据副本;
所述处理模块具体用于:
若所述确定模块确定所述一致性要求为无一致性,则按照Blocking或者Non-blocking的数据处理方式删除所述原始数据的副本数据;
若所述确定模块确定所述一致性要求为最终一致性,则将所述原始数据的副本数据的版本号设置为最新版本号,并将所述最新版本号添加至管理请求报文中,根据所述管理请求报文以Blocking或者Non-blocking的数据处理方式删除所述原始数据的副本数据;
若所述确定模块确定所述一致性要求为严格一致性,则按照Blocking的数据处理方式删除所述原始数据的副本数据。
结合第三方面第三种可能的实现方式,在第六种可能的实现方式中,所述原始数据的数据副本的管理请求为修改原始数据的数据副本的资源属性;
所述处理模块具体用于:
若所述确定模块确定所述一致性要求为无一致性,则按照Blocking或者Non-blocking的数据处理方式更新所述原始数据的副本数据的指定属性值;
若所述确定模块确定所述一致性要求为最终一致性,则将修改后的所述原始数据的副本数据的版本号设置为最新版本号,并将所述副本数据的最新版本号、所述指定属性值以及所述最终一致性的标识信息添加至管理请求报文中, 根据所述管理请求报文以Blocking或者Non-blocking的数据处理方式修改所述原始数据的副本数据的指定属性值;
若所述确定模块确定所述一致性要求为严格一致性,则将所述严格一致性的标识信息添加至管理请求报文中,根据所述管理请求报文以Blocking的数据处理方式修改所述原始数据的副本数据的指定属性。
结合第三方面第四种可能的实现方式至第六种可能的实现方式中任一种,在第七种可能的实现方式中,所述发送模块具体用于:
向所述Remote CSE发送副本数据的所述管理请求报文,所述管理请求报文中携带所述原始数据的副本数据的标识信息,或者所述数据一致性的标识信息。
本发明实施例第四方面提供了一种终端设备,其可包括:
接收模块,用于接收本地公共服务实体Hosting CSE发送的原始数据的数据副本的管理请求,所述管理请求中携带数据副本管理的数据一致性的标识信息;
确定模块,用于根据所述接收模块接收的所述数据一致性的标识信息确定所述数据副本管理的一致性要求;
所述确定模块,还用于根据所述一致性要求,或者所述管理请求中携带的所述原始数据的第一副本数据的标识信息,确定所述Remote CSE中存储的所述原始数据的第二副本数据的管理方式;
处理模块,用于根据所述确定模块确定的所述管理方式对所述第二副本数据进行处理,以得到符合所述一致性要求的所述原始数据的目标副本数据。
结合第四方面,在第一种可能的实现方式中,所述原始数据的数据副本的管理请求包括:创建原始数据的数据副本、删除原始数据的数据副本以及修改原始数据的数据副本的资源属性中的至少一种数据副本的管理请求;
所述数据一致性的标识信息为所述原始数据的数据一致性的预设属性值。
结合第四方面第一种可能的实现方式,在第二种可能的实现方式中,所述数据副本管理的一致性要求包括:严格一致性、最终一致性以及无一致性中的至少一种;
其中,所述严格一致性为:所述原始数据中包含的资源属性,与所述原始 数据的副本数据中包含的资源属性在任意时刻均保持一致;
所述最终一致性为:所述原始数据中包含的资源属性,与所述原始数据的副本数据中包含的资源属性在最终时刻保持一致;
所述无一致性为:所述原始数据中包含的资源属性,与所述原始数据的副本数据中包含的资源属性相同或者不同。
结合第四方面第二种可能的实现方式,在第三种可能的实现方式中,所述确定模块具体用于:
判断所述数据副本的管理请求中携带的所述原始数据的数据一致性的预设属性值是否为第一属性值;
若所述原始数据的数据一致性的预设属性值为第一属性值,则确定数据副本管理的一致性要求为无一致性;
若所述原始数据的数据一致性的预设属性值不是第一属性值,则判断所述原始数据的数据一致性的预设属性值是否为第二属性值;
若所述原始数据的数据一致性的预设属性值为第二属性值,则确定所述数据副本管理的一致性要求为最终一致性;
若所述原始数据的数据一致性的预设属性值不是第二属性值,则确定所述数据副本管理的一致性要求为严格一致性。
结合第四方面第三种可能的实现方式,在第四种可能的实现方式中,所述原始数据的数据副本的管理请求为创建原始数据的数据副本;
所述确定模块具体用于:
若所述一致性要求为无一致性,则确定所述原始数据的第二副本数据的管理方式为创建所述原始数据的目标副本数据;
若所述一致性要求为最终一致性,则判断所述Remote CSE中是否存在所述原始数据的第二副本数据,若判断结果为是,则根据所述管理请求中携带的所述原始数据的第一副本数据的最新版本号判断所述第二副本数据是否为最新版本,若所述第二副本数据不是最新版本则确定所述第二副本数据的管理方式为创建所述第一副本数据的最新版本号对应的目标副本数据;
若所述一致性要求为严格一致性,则确定所述原始数据的第二副本数据的管理方式为创建所述管理请求中携带的所述原始数据的第一副本数据的最新版本号对应的目标副本数据。
结合第四方面第三种可能的实现方式,在第五种可能的实现方式中,所述原始数据的数据副本的管理请求为删除原始数据的数据副本;
所述确定模块具体用于:
若所述一致性要求为无一致性,则确定所述原始数据的第二副本数据的管理方式为删除所述第二副本数据;
若所述一致性要求为最终一致性,则判断所述Remote CSE中是否存在所述原始数据的第二副本数据,若判断结果为是,则根据所述管理请求中携带的所述原始数据的第一副本数据的最新版本号判断所述第二副本数据是否为最新版本,若所述第二副本数据不是最新版本则确定所述第二副本数据的管理方式为删除所述第二副本数据;
若所述一致性要求为严格一致性,则确定所述原始数据的第二副本数据的管理方式为删除所述第二副本数据。
结合第四方面第三种可能的实现方式,在第六种可能的实现方式中,所述原始数据的数据副本的管理请求为修改原始数据的数据副本的资源属性;
所述确定模块具体用于:
若所述一致性要求为无一致性,则确定所述原始数据的第二副本数据的管理方式为修改所述原始数据的第二副本数据的指定属性值;
若所述一致性要求为最终一致性,则判断所述Remote CSE中是否存在所述原始数据的第二副本数据,若判断结果为是,则根据所述管理请求中携带的所述原始数据的第一副本数据的最新版本号判断所述第二副本数据是否为最新版本,若所述第二副本数据不是最新版本则确定所述第二副本数据的管理方式为根据所述第一副本数据的属性值修改所述第二副本数据的指定属性值;
若所述一致性要求为严格一致性,则确定所述原始数据的第二副本数据的管理方式为根据所述第一副本数据的属性值修改所述第二副本数据的指定属性值。
本发明实施例第五方面提供了一种公共服务实体,其可包括:
存储器、发送器、接收器和处理器;
所述存储器,用于存储程序代码;
所述发送器、所述接收器和所述处理器,用于调用所述存储器中存储的所述程序代码,执行如下操作:
所述接收器,用于接收应用实体AE或者公共服务实体CSE发送的原始数据的数据副本的管理请求;
所述处理器,用于根据所述接收器接收的所述数据副本的管理请求中携带的数据一致性的标识信息,确定数据副本管理的一致性要求;
所述处理器,还用于根据所述一致性要求设置所述原始数据的数据属性,并按照所述一致性要求对应的数据管理方式处理所述原始数据的副本数据;
所述发送器,用于将所述处理器处理的所述原始数据的副本数据的标识信息,或者所述接收器接收的所述数据一致性的标识信息发送给远程公共服务实体Remote CSE。
结合第五方面,在第一种可能的实现方式中,所述原始数据的数据副本的管理请求包括:创建原始数据的数据副本、删除原始数据的数据副本以及修改原始数据的数据副本的资源属性中的至少一种数据副本的管理请求;
所述数据一致性的标识信息为所述原始数据的数据一致性的预设属性值。
结合第五方面第一种可能的实现方式,在第二种可能的实现方式中,所述数据副本管理的一致性要求包括:严格一致性、最终一致性以及无一致性中的至少一种;
其中,所述严格一致性为:所述原始数据中包含的资源属性,与所述原始数据的副本数据中包含的资源属性在任意时刻均保持一致;
所述最终一致性为:所述原始数据中包含的资源属性,与所述原始数据的副本数据中包含的资源属性在最终时刻保持一致;
所述无一致性为:所述原始数据中包含的资源属性,与所述原始数据的副本数据中包含的资源属性相同或者不同。
结合第五方面第二种可能的实现方式,在第三种可能的实现方式中,所述处理器具体用于:
判断所述接收器接收的所述数据副本的管理请求中携带的所述原始数据的数据一致性的预设属性值是否为第一属性值;
若所述原始数据的数据一致性的预设属性值为第一属性值,则确定数据副本管理的一致性要求为无一致性;
若所述原始数据的数据一致性的预设属性值不是第一属性值,则判断所述原始数据的数据一致性的预设属性值是否为第二属性值;
若所述原始数据的数据一致性的预设属性值为第二属性值,则确定所述数据副本管理的一致性要求为最终一致性;
若所述原始数据的数据一致性的预设属性值不是第二属性值,则确定所述数据副本管理的一致性要求为严格一致性。
结合第五方面第三种可能的实现方式,在第四种可能的实现方式中,所述原始数据的数据副本的管理请求为创建原始数据的数据副本;
所述处理器具体用于:
若所述一致性要求为无一致性,则按照Blocking或者Non-blocking的数据处理方式创建所述原始数据的副本数据;
若所述一致性要求为最终一致性,则将创建的所述原始数据的副本数据的版本号设置为最新版本号,并将所述最新版本号以及所述最终一致性的标识信息添加至管理请求报文中,根据所述管理请报文以Blocking或者Non-blocking的数据处理方式创建所述原始数据的副本数据;
若所述一致性要求为严格一致性,则将所述严格一致性的标识信息添加至管理请求报文中,并根据所述管理请求报文以Blocking的数据处理方式创建所述原始数据的副本数据。
结合第五方面第三种可能的实现方式,在第五种可能的实现方式中,所述原始数据的数据副本的管理请求为删除原始数据的数据副本;
所述处理器具体用于:
若所述一致性要求为无一致性,则按照Blocking或者Non-blocking的数据处理方式删除所述原始数据的副本数据;
若所述一致性要求为最终一致性,则将所述原始数据的副本数据的版本号设置为最新版本号,并将所述最新版本号添加至管理请求报文中,根据所述管理请求报文以Blocking或者Non-blocking的数据处理方式删除所述原始数据的副本数据;
若所述一致性要求为严格一致性,则按照Blocking的数据处理方式删除所述原始数据的副本数据。
结合第五方面第三种可能的实现方式,在第六种可能的实现方式中,所述 原始数据的数据副本的管理请求为修改原始数据的数据副本的资源属性;
所述处理器具体用于:
若所述一致性要求为无一致性,则按照Blocking或者Non-blocking的数据处理方式更新所述原始数据的副本数据的指定属性值;
若所述一致性要求为最终一致性,则将修改后的所述原始数据的副本数据的版本号设置为最新版本号,并将所述副本数据的最新版本号、所述指定属性值以及所述最终一致性的标识信息添加至管理请求报文中,根据所述管理请求报文以Blocking或者Non-blocking的数据处理方式修改所述原始数据的副本数据的指定属性值;
若所述一致性要求为严格一致性,则将所述严格一致性的标识信息添加至管理请求报文中,根据所述管理请求报文以Blocking的数据处理方式修改所述原始数据的副本数据的指定属性。
结合第五方面第四种可能的实现方式至第六种可能的实现方式中任一种,在第七种可能的实现方式中,所述发送器具体用于:
向所述Remote CSE发送副本数据的所述管理请求报文,所述管理请求报文中携带所述原始数据的副本数据的标识信息,或者所述数据一致性的标识信息。
本发明实施例第六方面提供了一种公共服务实体,其可包括:
存储器、接收器和处理器;
所述存储器,用于存储程序代码;
所述接收器和所述处理器,用于调用所述存储器中存储的所述程序代码,执行如下操作:
所述接收器,用于接收本地公共服务实体Hosting CSE发送的原始数据的数据副本的管理请求,所述管理请求中携带数据副本管理的数据一致性的标识信息;
所述处理器,用于根据所述数据一致性的标识信息确定所述数据副本管理的一致性要求;
所述处理器,还用于根据所述一致性要求,或者所述管理请求中携带的所述原始数据的第一副本数据的标识信息,确定所述Remote CSE中存储的所述 原始数据的第二副本数据的管理方式;
所述处理器,还用于根据所述管理方式对所述第二副本数据进行处理,以得到符合所述一致性要求的所述原始数据的目标副本数据。
结合第六方面,在第一种可能的实现方式中,所述原始数据的数据副本的管理请求包括:创建原始数据的数据副本、删除原始数据的数据副本以及修改原始数据的数据副本的资源属性中的至少一种数据副本的管理请求;
所述数据一致性的标识信息为所述原始数据的数据一致性的预设属性值。
结合第第六方面第一种可能的实现方式,在第二种可能的实现方式中,所述数据副本管理的一致性要求包括:严格一致性、最终一致性以及无一致性中的至少一种;
其中,所述严格一致性为:所述原始数据中包含的资源属性,与所述原始数据的副本数据中包含的资源属性在任意时刻均保持一致;
所述最终一致性为:所述原始数据中包含的资源属性,与所述原始数据的副本数据中包含的资源属性在最终时刻保持一致;
所述无一致性为:所述原始数据中包含的资源属性,与所述原始数据的副本数据中包含的资源属性相同或者不同。
结合第第六方面第二种可能的实现方式,在第三种可能的实现方式中,所述处理器具体用于:
判断所述接收器接收的所述数据副本的管理请求中携带的所述原始数据的数据一致性的预设属性值是否为第一属性值;
若所述原始数据的数据一致性的预设属性值为第一属性值,则确定数据副本管理的一致性要求为无一致性;
若所述原始数据的数据一致性的预设属性值不是第一属性值,则判断所述原始数据的数据一致性的预设属性值是否为第二属性值;
若所述原始数据的数据一致性的预设属性值为第二属性值,则确定所述数据副本管理的一致性要求为最终一致性;
若所述原始数据的数据一致性的预设属性值不是第二属性值,则确定所述数据副本管理的一致性要求为严格一致性。
结合第六方面第三种可能的实现方式,在第四种可能的实现方式中,所述原始数据的数据副本的管理请求为创建原始数据的数据副本;
所述处理器具体用于:
若所述一致性要求为无一致性,则确定所述原始数据的第二副本数据的管理方式为创建所述原始数据的目标副本数据;
若所述一致性要求为最终一致性,则判断所述Remote CSE中是否存在所述原始数据的第二副本数据,若判断结果为是,则根据所述管理请求中携带的所述原始数据的第一副本数据的最新版本号判断所述第二副本数据是否为最新版本,若所述第二副本数据不是最新版本则确定所述第二副本数据的管理方式为创建所述第一副本数据的最新版本号对应的目标副本数据;
若所述一致性要求为严格一致性,则确定所述原始数据的第二副本数据的管理方式为创建所述管理请求中携带的所述原始数据的第一副本数据的最新版本号对应的目标副本数据。
结合第六方面第三种可能的实现方式,在第五种可能的实现方式中,所述原始数据的数据副本的管理请求为删除原始数据的数据副本;
所述处理器具体用于:
若所述一致性要求为无一致性,则确定所述原始数据的第二副本数据的管理方式为删除所述第二副本数据;
若所述一致性要求为最终一致性,则判断所述Remote CSE中是否存在所述原始数据的第二副本数据,若判断结果为是,则根据所述管理请求中携带的所述原始数据的第一副本数据的最新版本号判断所述第二副本数据是否为最新版本,若所述第二副本数据不是最新版本则确定所述第二副本数据的管理方式为删除所述第二副本数据;
若所述一致性要求为严格一致性,则确定所述原始数据的第二副本数据的管理方式为删除所述第二副本数据。
结合第六方面第三种可能的实现方式,在第六种可能的实现方式中,所述原始数据的数据副本的管理请求为修改原始数据的数据副本的资源属性;
所述处理器具体用于:
若所述一致性要求为无一致性,则确定所述原始数据的第二副本数据的管理方式为修改所述原始数据的第二副本数据的指定属性值;
若所述一致性要求为最终一致性,则判断所述Remote CSE中是否存在所述原始数据的第二副本数据,若判断结果为是,则根据所述管理请求中携带的 所述原始数据的第一副本数据的最新版本号判断所述第二副本数据是否为最新版本,若所述第二副本数据不是最新版本则确定所述第二副本数据的管理方式为根据所述第一副本数据的属性值修改所述第二副本数据的指定属性值;
若所述一致性要求为严格一致性,则确定所述原始数据的第二副本数据的管理方式为根据所述第一副本数据的属性值修改所述第二副本数据的指定属性值。
本发明实施例第七方面提供了一种数据处理系统,其可包括:上述本发明实施例第五方面提供的第一公共服务实体,以及上述本发明实施例第六方面提供的第二公共服务实体。
本发明实施例所描述的数据处理方法中Hosting CSE可接收AE或者CSE发送的原始数据的数据副本的管理请求,根据上述管理请求中携带的数据一致性的标识信息确定数据副本管理的一致性要求。Hosting CSE还可根据上述数据副本管理的一致性要求设置原始数据的数据属性,并按照一致性要求对应的数据管理方式处理原始数据的副本数据。Hosting CSE还可将原始数据的副本数据的标识信息或者上述数据一致性的标识信息发送给Remote CSE。本发明实施例可根据应用自身不同的一致性要求,确定数据处理的一致性要求,可提高应用读取的数据的准确性,保证数据的一致性。
附图说明
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1为现有技术中分布式系统的数据分布示意图;
图2为本发明实施例提供的原始数据的一属性示意图;
图3为本发明实施例提供的原始数据的被宣布数据(数据副本)的属性示意图;
图4为本发明实施例提供的数据副本机制的示例图;
图5为本发明实施例提供的数据副本更新错误的示例图;
图6为本发明实施例提供的数据严格一致性的模型示意图;
图7为本发明实施例提供的数据严最终一致性的模型示意图;
图8为本发明实施例提供的原始数据的另一属性示意图;
图9为本发明实施例数据处理方法的第一实施例流程示意图;
图10为本发明实施例数据处理方法中Hosting CSE创建Announced Resource的步骤示意图;
图10a为本发明实施例数据处理方法中Hosting CSE创建Announced Resource的流程示意图;
图11为本发明实施例数据处理方法中Hosting CSE删除Announced Resource的步骤示意图;
图11a为本发明实施例数据处理方法中Hosting CSE删除Announced Resource的流程示意图;
图12为本发明实施例数据处理方法中Hosting CSE修改Announced Resource的属性值的步骤示意图;
图12a为本发明实施例数据处理方法中Hosting CSE修改Announced Resource的属性值的流程示意图;
图13为本发明实施例数据处理方法的第二实施例流程示意图;
图14为本发明实施例数据处理方法中Remote CSE创建Announced Resource的步骤示意图;
图14a为本发明实施例数据处理方法中Remote CSE创建Announced Resource的流程示意图;
图15为本发明实施例数据处理方法中Remote CSE删除Announced Resource的步骤示意图;
图15a为本发明实施例数据处理方法中Remote CSE删除Announced Resource的流程示意图;
图16为本发明实施例数据处理方法中Remote CSE修改Announced Resource的属性值的步骤示意图;
图16a为本发明实施例数据处理方法中Hosting CSE修改Announced Resource的属性值的流程示意图;
图17为本发明实施例提供的Blocking执行方式的交互示意图;
图18为本发明实施例提供的Non-Blocking执行方式的交互示意图;
图19为本发明实施例提供的数据处理方法的应用场景一的场景分布示意图;
图20为本发明实施例提供的数据处理方法的应用场景二的数据处理流程示意图;
图21为本发明实施例提供的数据处理装置的第一实施例结构示意图;
图22为本发明实施例提供的数据处理装置的第二实施例结构示意图;
图23为本发明实施例提供的公共服务实体的第一实施例结构示意图;
图24为本发明实施例提供的公共服务实体的第二实施例结构示意图;
图25为本发明实施例提供的数据处理系统的实施例结构示意图。
具体实施方式
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。
具体实现中,本发明实施例所描述的数据处理方法及装置所要的技术问题正是M2M中由数据副本引发的一致性问题。与此同时,在不同的M2M应用场景下,系统或用户对一致性可能有不同的要求,比如有的应用要求副本之间需要“高度”一致,而另外一些应用可能要求副本之间“弱”一致。对此,本发明也给出了不同一致性的保证方法。
本发明实施例所描述的数据处理方法及装置正是基于oneM2M现有资源模型实现的,下面将对oneM2M的现有资源模型即相关数据副本进行简单的介绍。
oneM2M标准是机器间通信(M2M)和物联网(Thing of Internet)相结合的标准。在oneM2M功能结构中,公共服务实体(Common Service Entity,CSE)表示了一系列公共服务功能(Common Service Function,CSF)的实例,其中每一个CSF都有相应的资源表示与实现。CSE由CSE标识(Identity,ID)唯一标识,按地理位置可划分为本地CSE和远端CSE。
在oneM2M标准中,某个CSE上的资源(这里称为Original Resource,如图2所示)可以被宣布(announced)为允许有副本的资源,其副本称为Announced  Resource(如图3所示)。
Original Resource的一般属性有announcedTo(宣布到),announcedAttribute(被宣布的属性),resourceID(资源ID),parentID(双亲ID),accessControlPolicyIDs(访问控制协议ID),expirationTime(终结时间),stateTag(状态标签);Announced Resource的一般属性有link(链接),resourceID,parentID,accessControlPolicyIDs,expirationTime,stateTag。其中一些属性是在某个资源下是可有可无的,则用0..1或0..n表示;若果是必须要有的属性,则用1表示;如果属性类型是List,则用(L)表示。
Original Resource下有两个重要属性用于表示副本信息:其一为announceTo属性,该属性类型是List,其中每一项内容是远端CSE的ID或URI,这些远端CSE存放了Original Resource的副本Announced Resource;其二为announcedAttribute属性,该属性类型是List,其中每一项内容表示Original Resource的哪个属性需要被announced。
Announced Resource下有一个重要属性用于表达副本之间的引用关系,即Link属性,它保存了指向Original Resource的统一资源标识符(Uniform Resource Identifier,URI)。
oneM2M数据副本机制的示例如图4所示。其中,CSE0为存放了Original Resource的通用服务实体,CSE1与CSE2为存放了Announced Resource的通用服务实体。Original Resource中announceTo属性表明该资源需要被announced到地址为URI1和URI2的远端CSE,当该资源被announced后,远端CSE处将会存在相应的Announced Resource资源,该Announced Resource资源包含Link属性且该属性内容为CSE0下Original Resource资源的URI地址。
oneM2M采用了主-从(Master-Slaves)方法,其中Original Resource为Master,Announced Resource为Slave,它们分布在不同的CSE节点上。oneM2M副本管理机制下,由Master接收创建或修改请求,触发后续创建或修改动作,并负责将创建或修改同步至Slaves。具体而言:
Figure PCTCN2015079811-appb-000001
创建与删除副本:对Original Resource的announceTo属性的修改,将触发对Announced Resource资源(即副本)的创建和删除;具体创建和删除过程由Original Resource所在的Master节点负责;
Figure PCTCN2015079811-appb-000002
修改数据(属性):对Original Resource被announced的属性内容的修 改,将触发对Announced Resource相应属性的修改,具体同步过程由Original Resource所在的Master节点负责。
现有的oneM2M副本管理和一致性技术存在技术性缺陷:第一,对Original Resource和Announced Resource的数据一致性达到哪种程度(即采用何种一致性模型)未做规定;第二,对Original Resource的修改何时以及如何同步到Announced Resource(即执行性保护机制)未做充分的说明。
由此将导致的不良后果如下:在Original Resource修改属性以及修改未同步到Announced Resource的之间内,数据副本之间存在状态不一致,期间用户或应用可能读到非最新的内容,这是对数据敏感的用户或应用所不能容忍的。
图5是数据不一致的一个示例,描述了一种由数据更新导致的数据不一致的情形。该示例中,用户u1和u2分别对CSE0中的Original Resource做了先后两次修改,其中用户u1修改Attribute1值为s1,然后用户u2修改Attribute1值为s2,正常情况下,用户u2修改的结果将覆盖用户u1修改的结果,即Attribute1为值s2。
由于oneM2M未给定同步方法,比如如何保证不同副本之间的修改次序一致,如何避免旧数据覆盖新数据,等等。因此极有可能出现CSE1收到的修改顺序为先u1后u2,因此u2修改的结果将覆盖用户u1修改的结果,即Attribute1为值s2;而CSE2收到的顺序为先u2后u1,因此u1修改的结果将覆盖用户u2修改的结果,即Attribute1值为s1。由此,CSE0,CSE1,CSE2的数据状态出现了不一致,导致部分用户读到错误的内容。
不同应用场景下,系统或用户对一致性有不同的要求。而oneM2M未能给出一致性规范,也不能给应用或用户提供差异化的一致性服务。根据限制性的强弱与性能将场景划分如下:
场景1:副本之间内容必须严格一致,即对数据的任意修改,都将同时作用到该数据的所有副本上,所有副本在任何时刻都保持一致;
场景2:每个副本被修改的次序必须是一致的,即只要所有的副本都以一定的顺序修改(即所有副本的修改操作在应用或用户看来都是一样的),每个副本的操作都以副本规定的次序实现,结果都应该被接受;
场景3:副本之间内容有段时间不一致是可以接受的,但是最终必须是一致的,即不强调实时一致性,只是在到达一定条件下保证各副本数据之间的一致 性;
场景4:副本之间内容不一致是可以接受的,即无一致性要求,所有副本的数据可以不一致。
严格一致性是限制性最强的模型,但是在分布式副本中实现这种模型代价太大,所以在实际系统中运用有限;最终一致性放松了对数据一致性的要求,提高了系统包容通讯失效和节点失效的能力,如果实际中对副本的一致性要求不高时通常可以选用最终一致性模型,并且在一次写多次读的情况下,最终一致性模型也可以工作得比较好。现有oneM2M标准忽略了系统性能与实现模型的代价,因此需要定义一致性规范满足不同应用或用户的需要。
具体实现中,本发明实施例首先提出了数据一致性的描述方法,具体描述方式如下:
首先,在oneM2M数据副本管理的现有框架下,重要的数据一致性模型参考如下:
(1)严格一致性模型:保证对Original Resource的修改“同时”同步到所有Announced Resource。若同步失败,则修改失败。如图6所示,倘若某用户对Original Resource的属性做了先后两次修改,即u1,u2。即使两次修改时间非常接近,也要按照严格一致性模型要求,对所有副本先后“同时”进行更新u1,u2,保证所有用户在任一时刻从任一副本(包括Original Resource和Announced Resource)读到的数据必须是一致的。
(2)最终一致性模型:对Original Resource的修改最终将同步到不同副本。如图7所示,倘若某用户对Original Resource的属性做了先后两次修改,即u1,u2。在Master-Slave下,最终一致性模型很容易实现为“顺序一致”:对Original Resource的修改可以非“同时”同步到所有Announced Resource,用户在某一时刻从不同副本读到的数据可以不一致(副本一为先u1后u2;副本二为先u2后u1),但是不同用户分别从任一副本连续读到的数据状态的变化次序必须是不矛盾的。如果相当长的一段时间内,没有用户对Original Resource更新,最终,硬件和网络故障修复以后,所有该副本都将返回相同一致的值,即为u2的更新结果。若用户最终再次读取数据时,则将读取得到相同的数据。
其次,本发明利用Resource的stateTag属性表示Resource的整体版本,并且在Original Resource资源下增加属性consistency(一致性),用于表示一致性约定。修改后Original Resource的属性如图8所示。
consistency是枚举类型,其值的含义定义如下:
0-无一致性
1-最终一致性模型
2-严格一致性模型
consistency是可选的参数,如果该参数不存在,默认值是0。consistency属性创建之后,可以由Hosting CSE和AE赋值,其后不可修改。对于每个被announced的属性,分别记录其最新版本(序列号)。其中,上述consistency可有用户决定。AE通过报文传将consistency的属性值送至Hosting CSE,Hosting CSE是Original Resource所在的资源实体。
下面将结合图9至图25,对本发明实施例提供的数据处理的方法、装置及系统进行具体描述。
参见图9,是本发明实施例提供的数据处理方法的第一实施例流程示意图。本发明实施例中所描述的数据处理方法,包括步骤:
S101,本地公共服务实体Hosting CSE接收应用实体AE或者公共服务实体CSE发送的原始数据的数据副本的管理请求。
具体实现中,本发明实施例中所描述的数据处理方法的执行主体具有可为本发明实施例中所描述的Hosting CSE,下面将以Hosting CSE作为执行主体进行具体描述。
在一些可行的实施方式中,Hosting CSE可首先接收AE或者CSE发送的原始数据的数据副本的管理请求,其中,上述原始数据为本发明实施例中所描述的Original Resource,原始数据的副本数据为本发明实施例中所描述的Announced Resource,在此不再赘述。具体实现中,本发明实施例中所描述的原始数据的数据副本的管理请求包括:创建原始数据的数据副本、删除原始数据的数据副本以及修改原始数据的数据副本的资源属性中的至少一种数据副本的管理请求,即创建Announced Resource、删除Announced Resource和修改Announced Resource的资源属性内容等。上述原始数据的副本数据的管理过程 有三个参与者,即AE/CSE、Hosting CSE与Remote CSE。根据对一致性要求的不同,Hosting CSE和Remote CSE需要有相应的执行步骤和交互过程,其中交互过程可采用blocking或non-blocking方式,每种交互方式分别有特定的报文和执行逻辑。本发明实施例将首先以Hosting CSE为执行主体描述其所执行的步骤和交互过程等。
需要说明的是,本发明实施例中所描述的数据一致性的标识信息为原始数据的数据一致性的预设属性值,即本发明实施例中所描述的Original Resource资源下增加的属性consistency的属性值。其中,上述consistency的属性值可包括第一属性值(例如0)、第二属性值(例如1)或者第三属性值(例如2)等,其对应的数据一致性要求可参见上述图8对应的描述,在此不再赘述。
S102,所述Hosting CSE根据所述数据副本的管理请求中携带的数据一致性的标识信息,确定数据副本管理的一致性要求。
在一些可行的实施方式中,Hosting CSE可根据接收到的数据副本的管理请求携带的数据一致性的标识信息,确定数据副本管理的一致性要求。具体的,Hosting CSE可根据上述Original Resource资源下增加的属性consistency的属性值确定数据副本管理的一致性要求。具体实现中,Hosting CSE可判断上述数据副本的管理请求中携带的原始数据的数据一致性的预设属性值是否为第一属性值。若原始数据的数据一致性的预设属性值为第一属性值,则确定数据副本管理的一致性要求为无一致性。若原始数据的数据一致性的预设属性值不是第一属性值,则判断原始数据的数据一致性的预设属性值是否为第二属性值。若原始数据的数据一致性的预设属性值为第二属性值,则确定数据副本管理的一致性要求为最终一致性;若原始数据的数据一致性的预设属性值不是第二属性值(例如预设属性值为第三属性值),则确定数据副本管理的一致性要求为严格一致性。例如,当Original Resource资源下增加的属性consistency的属性值为0时,则可确定数据副本管理的一致性要求为无一致性;当Original Resource资源下增加的属性consistency的属性值为1时,则可确定数据副本管理的一致性要求为最终一致性;当Original Resource资源下增加的属性consistency的属性值为2时,则可确定数据副本管理的一致性要求为严格一致性等。
具体实现中,上述严格一致性为:原始数据中包含的资源属性,与原始数 据的副本数据中包含的资源属性在任意时刻均保持一致;上述最终一致性为:原始数据中包含的资源属性,与原始数据的副本数据中包含的资源属性在最终时刻保持一致;上述无一致性为:原始数据中包含的资源属性,与原始数据的副本数据中包含的资源属性相同或者不同,即没有原始数据及其副本的资源属性可相同也可不同,不做具体限定。上述最终一致性和严格一致性的具体要求可参见上述图6和图7对应的具体描述,在此不再赘述。
S103,所述Hosting CSE根据所述一致性要求设置所述原始数据的数据属性,并按照所述一致性要求对应的数据管理方式处理所述原始数据的副本数据。
在一些可行的实施方式中,Hosting CSE确定了数据副本的管理的一致性要求之后,可根据上述一致性要求设置原始数据的数据属性,并按照上述一致性要求对应的数据管理方式处理上述原始数据。例如,当Hosting CSE确定了数据副本管理的一致性要求为无一致性时,则可根据上述无一致性对应的数据管理方式对原始数据的数据属性进行设置或者修改,进而可根据上述无一致性要求对应的数据管理方式创建原始数据的数据副本、删除原始数据的数据副本以及修改原始数据的数据副本的资源属性。当Hosting CSE确定了数据副本管理的一致性要求为最终一致性时,则可根据上述最终一致性对应的数据管理方式对原始数据的数据属性进行设置或者修改,进而可根据上述最终一致性要求对应的数据管理方式创建原始数据的数据副本、删除原始数据的数据副本以及修改原始数据的数据副本的资源属性。当Hosting CSE确定了数据副本管理的一致性要求为严格一致性时,则可根据上述严格一致性对应的数据管理方式对原始数据的数据属性进行设置或者修改,进而可根据上述严格一致性要求对应的数据管理方式创建原始数据的数据副本、删除原始数据的数据副本以及修改原始数据的数据副本的资源属性。
S104,所述Hosting CSE将所述原始数据的副本数据的标识信息,或者所述数据一致性的标识信息发送给远程公共服务实体Remote CSE。
在一些可行的实施方式中,Hosting CSE根据上述一致性要求对原始数据的数据属性及其数据副本进行处理之后,可将原始数据的副本数据的标识信息,或者数据一致性的标识信息发送给Remote CSE。具体的,Hosting CSE可通过向Remote CSE发送数据副本的管理请求,将上述数据副本的标识信息或 者数据一致性的标识信息发送给Remote CSE,触发Remote CSE创建Announced Resource、或者删除Announced Resource、或者修改Announced Resource的资源属性。
本发明实施例所描述的数据处理方法中Hosting CSE可接收AE或者CSE发送的原始数据的数据副本的管理请求,根据上述管理请求中携带的数据一致性的标识信息确定数据副本管理的一致性要求。Hosting CSE还可根据上述数据副本管理的一致性要求设置原始数据的数据属性,并按照一致性要求对应的数据管理方式处理原始数据的副本数据。Hosting CSE还可将原始数据的副本数据的标识信息或者上述数据一致性的标识信息发送给Remote CSE。本发明实施例可根据应用自身不同的一致性要求,确定数据处理的一致性要求,可提高应用读取的数据的准确性,保证数据的一致性。
下面将结合图10,对本发明实施例中所描述的Hosting CSE创建Announced Resource的具体执行步骤进行描述。
S201,Hosting CSE根据所述数据副本的管理请求中携带的数据一致性的标识信息,确定数据副本管理的一致性要求。
S202,所述Hosting CSE根据所述一致性要求修改所述原始数据的数据属性,并按照所述一致性要求对应的数据管理方式创建所述原始数据的副本数据。
具体实现中,Hosting CSE可接收来自用户的请求,判断consistency的属性值。若上述consistency的属性值为第一属性值(例如0),则可确定上述一致性要求为无一致性;若上述consistency的属性值为第二属性值(例如1),则可确定上述一致性要求为最终一致性;若上述consistency的属性值为第三属性值(例如2),则可确定上述一致性要求为严格一致性。若所述一致性要求为无一致性,则按照Blocking或者Non-blocking的数据处理方式创建所述原始数据的副本数据。若一致性要求为最终一致性,则将创建的所述原始数据的副本数据的版本号设置为最新版本号,并将最新版本号以及最终一致性的标识信息添加至管理请求报文中,根据管理请报文以Blocking或者Non-blocking的数据处理方式创建原始数据的副本数据。若一致性要求为严格一致性,则将严格一致性的标识信息添加至管理请求报文中,并根据管理请求报文以 Blocking的数据处理方式创建原始数据的副本数据。
如图10a,Hosting CSE接收来自用户的请求,判断consistency的取值;
Case 0(即consistency的取值为0):无一致性{
a.修改Original Resource的announceTo属性值(若Original Resource中没有announceTo属性值则创建上述announceTo属性值,下述其他管理方式对应的执行步骤也相似);
b.立刻或按照某种调度策略(例如M2M标准中定义的副本数据的创建、删除或者修改的处理方式),以blocking或non-blocking方式创建Announced Resource;
}Case 1(即consistency的取值为1):最终一致性{
a.修改Original Resource的announceTo属性值(若Original Resource中没有announceTo属性值则创建上述announceTo属性值);
b.给当前修改操作设定一个最新的版本号,并记录本次修改,以供Remote CSE根据上述修改结果确定是否创建Announced Resource,即Remote CSE根据Hosting CSE发送的管理请求创建副本数据时需要上述最新版本的版本号;
c.Hosting CSE(以blocking或non-blocking的方式)创建AnnouncedResource,并且报文中包含最新版本号以及consistency属性值;}Case 2(即consistency的取值为2):严格一致性{
a.修改Original Resource的announceTo属性值(若Original Resource中没有announceTo属性值则创建上述announceTo属性值);
b.以blocking方式创建Announced Resource,并且报文中包含consistency属性值;
c.修改成功则返回,否则回滚至之前状态。
}
Hosting CSE可根据数据副本管理的一致性要求修改Original Resource的announceTo属性值,创建Announced Resource,可保证Original Resource和Announced Resource的数据一致性,增强用户读取数据的准确性。
下面将结合图11,对本发明实施例中所描述的Hosting CSE删除Announced Resource的具体执行步骤进行描述。
S301,Hosting CSE根据所述数据副本的管理请求中携带的数据一致性的标识信息,确定数据副本管理的一致性要求。
S302,所述Hosting CSE根据所述一致性要求设置所述原始数据的数据属性,并按照所述一致性要求对应的数据管理方式删除所述原始数据的副本数据。
具体实现中,Hosting CSE可接收来自用户的请求,判断consistency的属性值。若上述consistency的属性值为第一属性值(例如0),则可确定上述一致性要求为无一致性;若上述consistency的属性值为第二属性值(例如1),则可确定上述一致性要求为最终一致性;若上述consistency的属性值为第三属性值(例如2),则可确定上述一致性要求为严格一致性。若上述一致性要求为无一致性,则按照Blocking或者Non-blocking的数据处理方式删除原始数据的副本数据;若上述一致性要求为最终一致性,则将原始数据的副本数据的版本号设置为最新版本号,并将最新版本号添加至管理请求报文中,根据管理请求报文以Blocking或者Non-blocking的数据处理方式删除原始数据的副本数据;若上述一致性要求为严格一致性,则按照Blocking的数据处理方式删除原始数据的副本数据。
如图11a,Hosting CSE接收请求,判断consistency的取值;
Case 0:无一致性{
a.修改Original Resource的announceTo属性值;
b.立刻或按照某种调度策略,以blocking或non-blocking方式删除Announced Resource
}Case 1:最终一致性{
a.修改Original Resource的announceTo属性值;
b.给当前修改操作设定一个最新的版本号,并记录本次修改;
c.Hosting CSE(以blocking或non-blocking的方式)删除Announced Resource,并且报文中包含最新资源版本号;
}Case 2:严格一致性{
a.Hosting CSE修改Original Resource的announceTo属性值;
b.Hosting CSE以blocking方式删除Announced Resource;
c.删除成功则返回,否则回滚至之前状态;
}
Hosting CSE可根据数据副本管理的一致性要求修改Original Resource的announceTo属性值,删除Announced Resource,可保证Original Resource和Announced Resource的数据一致性,增强用户读取数据的准确性。
下面将结合图12,对本发明实施例中所描述的Hosting CSE修改Announced Resource的属性值的具体执行步骤进行描述。
S401,Hosting CSE根据所述数据副本的管理请求中携带的数据一致性的标识信息,确定数据副本管理的一致性要求。
S402,所述Hosting CSE根据所述一致性要求设置所述原始数据的数据属性,并按照所述一致性要求对应的数据管理方式修改所述原始数据的副本数据的资源属性。
具体实现中,Hosting CSE可接收来自用户的请求,判断consistency的属性值。若上述consistency的属性值为第一属性值(例如0),则可确定上述一致性要求为无一致性;若上述consistency的属性值为第二属性值(例如1),则可确定上述一致性要求为最终一致性;若上述consistency的属性值为第三属性值(例如2),则可确定上述一致性要求为严格一致性。若上述一致性要求为无一致性,则按照Blocking或者Non-blocking的数据处理方式更新原始数据的副本数据的指定属性值;若上述一致性要求为最终一致性,则将修改后的原始数据的副本数据的版本号设置为最新版本号,并将副本数据的最新版本号、指定属性值以及最终一致性的标识信息添加至管理请求报文中,根据管理请求报文以Blocking或者Non-blocking的数据处理方式修改原始数据的副本数据的指定属性值;若上述一致性要求为严格一致性,则将严格一致性的标识信息添加至管理请求报文中,根据管理请求报文以Blocking的数据处理方式修改原始数据的副本数据的指定属性。
如图12a,Hosting CSE接收对请求,判断consistency的取值(缺省值为0);
Case 0:无一致性{
a.修改Original Resource的属性值;
b.立刻或按照某种调度策略,以blocking或non-blocking的方式更新 Announced Resource的对应属性值;
}Case 1:最终一致性{
a.修改Original Resource的属性值;
b.针对被修改的属性,给当前修改操作设定一个最新版本号,并记录本次修改;
c.Hosting CSE(以blocking或non-blocking的方式)修改Announced Resource的对应属性值,并且报文中包含该该资源的最新版本号、该属性的最新版本号以及consistency属性值;
}Case 2:严格一致性{
a.Hosting CSE修改Original Resource的属性值;
b.Hosting CSE以blocking方式修改Announced Resource的对应属性值,并且报文中包含consistency属性值;
c.修改成功则返回,否则回滚至之前状态;
}
Hosting CSE可根据数据副本管理的一致性要求修改Announced Resource的属性值,可保证Original Resource和Announced Resource的数据一致性,增强用户读取数据的准确性。
参见图13,是本发明实施例提供的数据处理方法的第二实施例流程示意图。本发明实施例中所描述的数据处理方法,包括步骤:
S501,远程公共服务实体Remote CSE接收本地公共服务实体Hosting CSE发送的原始数据的数据副本的管理请求,所述管理请求中携带数据副本管理的数据一致性的标识信息。
具体实现中,本发明实施例中所描述的数据处理方法的执行主体具有可为本发明实施例中所描述的Remote CSE,下面将以Remote CSE作为执行主体进行具体描述。
在一些可行的实施方式中,Remote CSE可首先接收Hosting CSE发送的原始数据的数据副本的管理请求,其中,上述原始数据为本发明实施例中所描述的Original Resource,原始数据的副本数据为本发明实施例中所描述的Announced Resource,在此不再赘述。具体实现中,本发明实施例中所描述的 原始数据的数据副本的管理请求包括:创建原始数据的数据副本、删除原始数据的数据副本以及修改原始数据的数据副本的资源属性中的至少一种数据副本的管理请求,即创建Announced Resource、删除Announced Resource和修改资源属性内容等。上述原始数据的副本数据的管理过程有三个参与者,即AE/CSE、Hosting CSE与Remote CSE。根据对一致性要求的不同,Hosting CSE和Remote CSE需要有相应的执行步骤和交互过程,其中交互过程可采用blocking或non-blocking方式,每种交互方式分别有特定的报文和执行逻辑。本发明实施例将以Remote CSE为执行主体描述其所执行的步骤和交互过程等。
需要说明的是,本发明实施例中所描述的数据一致性的标识信息为原始数据的数据一致性的预设属性值,即本发明实施例中所描述的Original Resource资源下增加的属性consistency的属性值。其中,上述consistency的属性值可包括第一属性值(例如0)、第二属性值(例如1)或者第三属性值(例如2)等,其对应的数据一致性要求可参见上述描述,在此不再赘述。
S502,所述Remote CSE根据所述数据一致性的标识信息确定所述数据副本管理的一致性要求。
在一些可行的实施方式中,Remote CSE可根据接收到的数据副本的管理请求携带的数据一致性的标识信息,确定数据副本管理的一致性要求。具体的,Remote CSE可根据上述Original Resource资源下增加的属性consistency的属性值确定数据副本管理的一致性要求。具体实现中,Remote CSE可判断上述数据副本的管理请求中携带的原始数据的数据一致性的预设属性值是否为第一属性值。若原始数据的数据一致性的预设属性值为第一属性值,则确定数据副本管理的一致性要求为无一致性。若原始数据的数据一致性的预设属性值不是第一属性值,则判断原始数据的数据一致性的预设属性值是否为第二属性值。若原始数据的数据一致性的预设属性值为第二属性值,则确定数据副本管理的一致性要求为最终一致性;若原始数据的数据一致性的预设属性值不是第二属性值,则确定数据副本管理的一致性要求为严格一致性。例如,当Original Resource资源下增加的属性consistency的属性值为0时,Remote CSE则可确定数据副本管理的一致性要求为无一致性;当Original Resource资源下增加的属性consistency的属性值为1时,Remote CSE则可确定数据副本管理的一致 性要求为最终一致性;当Original Resource资源下增加的属性consistency的属性值为2时,Remote CSE则可确定数据副本管理的一致性要求为严格一致性等。
具体实现中,上述严格一致性为:原始数据中包含的资源属性,与原始数据的副本数据中包含的资源属性在任意时刻均保持一致;上述最终一致性为:原始数据中包含的资源属性,与原始数据的副本数据中包含的资源属性在最终时刻保持一致;上述无一致性为:原始数据中包含的资源属性,与原始数据的副本数据中包含的资源属性相同或者不同,即没有原始数据及其副本的资源属性可相同也可不同,不做具体限定。上述最终一致性和严格一致性的具体要求可参见上述图6和图7对应的具体描述,在此不再赘述。
S503,所述Remote CSE根据所述一致性要求,或者所述管理请求中携带的所述原始数据的第一副本数据的标识信息,确定所述Remote CSE中存储的所述原始数据的第二副本数据的管理方式。
S504,所述Remote CSE根据所述管理方式对所述第二副本数据进行处理,以得到符合所述一致性要求的所述原始数据的目标副本数据。
在一些可行的实施方式中,Remote CSE确定了数据副本的管理的一致性要求之后,可根据上述一致性要求或者上述管理请求中携带的原始数据的第一副本数据的标识信息,确定Remote CSE中存储的所述原始数据的第二副本数据的管理方式,进而可根据上述管理方式对第二副本数据进行处理。其中,上述原始数据的第一副本数据为Hosting CSE创建的副本数据,上述原始数据的第二副本数据为Remote CSE中存储的副本数据。例如,当Remote CSE确定了数据副本管理的一致性要求为无一致性时,则可确定上述无一致性对应的数据管理方式,进而根据上述管理方式对原始数据的数据属性进行设置或者修改,并根据上述无一致性要求对应的数据管理方式创建原始数据的数据副本、删除原始数据的数据副本以及修改原始数据的数据副本的资源属性。当Remote CSE确定了数据副本管理的一致性要求为最终一致性时,则可确定上述最终一致性对应的数据管理方式,并根据上述管理方式对原始数据的数据属性进行设置或者修改,根据上述最终一致性要求对应的数据管理方式创建原始数据的数据副本、删除原始数据的数据副本以及修改原始数据的数据副本的资源属性。当Remote CSE确定了数据副本管理的一致性要求为严格一致性时, 则可确定上述严格一致性对应的数据管理方式,并根据上述管理方式对原始数据的数据属性进行设置或者修改,根据上述严格一致性要求对应的数据管理方式创建原始数据的数据副本、删除原始数据的数据副本以及修改原始数据的数据副本的资源属性。
本发明实施例所描述的数据处理方法中Remote CSE可接收Hosting CSE发送的原始数据的数据副本的管理请求,根据上述管理请求中携带的数据一致性的标识信息确定数据副本管理的一致性要求。Remote CSE还可根据上述数据一致性的标识信息确定数据副本管理的一致性要求,进而根据上述一致性要求或者管理请求中携带的原始数据的第一副本数据的标识信息,确定Remote CSE中存储的原始数据的第二副本数据的管理方式,Remote CSE还可根据上述管理方式对所述第二副本数据进行处理。本发明实施例可根据Hosting CSE发送的管理请求中携带的数据副本管理的一致性要求,确定副本数据创建、删除或者修改属性的一致性要求,可提高应用读取的数据的准确性,保证数据的一致性。
下面将结合图14,对本发明实施例中所描述的Remote CSE创建Announced Resource的具体执行步骤进行描述。
S601,Remote CSE根据所述数据一致性的标识信息确定所述数据副本管理的一致性要求。
S602,所述Remote CSE根据所述一致性要求,或者所述管理请求中携带的所述原始数据的第一副本数据的标识信息,确定所述Remote CSE中存储的所述原始数据的第二副本数据的管理方式,并根据所述管理方式创建所述第二副本数据。
具体实现中,Remote CSE可接收Hosting CSE的请求,判断consistency的属性值。若上述consistency的属性值为第一属性值(例如0),Remote CSE则可确定上述一致性要求为无一致性;若上述consistency的属性值为第二属性值(例如1),Remote CSE则可确定上述一致性要求为最终一致性;若上述consistency的属性值为第三属性值(例如2),Remote CSE则可确定上述一致性要求为严格一致性。若上述一致性要求为无一致性,Remote CSE则确定原始数据的第二副本数据的管理方式为创建原始数据的目标副本数据;若上 述一致性要求为最终一致性,Remote CSE则判断上述Remote CSE中是否存在原始数据的第二副本数据,若判断结果为是,Remote CSE则根据管理请求中携带的原始数据的第一副本数据的最新版本号判断第二副本数据是否为最新版本,若第二副本数据不是最新版本则确定第二副本数据的管理方式为创建第一副本数据的最新版本号对应的目标副本数据;若上述一致性要求为严格一致性,Remote CSE则确定原始数据的第二副本数据的管理方式为创建管理请求中携带的原始数据的第一副本数据的最新版本号对应的目标副本数据。
如图14a,Remote CSE接收来自Hosting CSE的请求,判断consistency的取值(缺省值为0);
Case 0:无一致性{
a.创建Announced Resource;
}Case 1:最终一致性{
a.判断Remote CSE是否存在该Announced Resource,若存在,则比较版本号;
a1:若报文的版本更加新,则创建;
a2:否则放弃;
}Case 2:严格一致性{
a.创建Announced Resource;
b.修改成功则返回,否则回滚至之前状态;
}
Remote CSE可根据数据副本管理的一致性要求创建Announced Resource,可保证Original Resource和Announced Resource的数据一致性,增强用户读取数据的准确性。
下面将结合图15,对本发明实施例中所描述的Remote CSE删除Announced Resource的具体执行步骤进行描述。
S701,Remote CSE根据所述数据一致性的标识信息确定所述数据副本管理的一致性要求。
S702,所述Remote CSE根据所述一致性要求,或者所述管理请求中携带的所述原始数据的第一副本数据的标识信息,确定所述Remote CSE中存储的 所述原始数据的第二副本数据的管理方式,并根据所述管理方式删除所述第二副本数据。
具体实现中,Remote CSE可接收Hosting CSE的请求,判断consistency的属性值。若上述consistency的属性值为第一属性值(例如0),Remote CSE则可确定上述一致性要求为无一致性;若上述consistency的属性值为第二属性值(例如1),Remote CSE则可确定上述一致性要求为最终一致性;若上述consistency的属性值为第三属性值(例如2),Remote CSE则可确定上述一致性要求为严格一致性。
若上述一致性要求为无一致性,Remote CSE则确定原始数据的第二副本数据的管理方式为删除第二副本数据;若上述一致性要求为最终一致性,Remote CSE则判断Remote CSE中是否存在原始数据的第二副本数据,若判断结果为是,则根据所述管理请求中携带的原始数据的第一副本数据的最新版本号判断第二副本数据是否为最新版本,若第二副本数据不是最新版本则确定第二副本数据的管理方式为删除所述第二副本数据;若上述一致性要求为严格一致性,Remote CSE则确定原始数据的第二副本数据的管理方式为删除第二副本数据。
如图15a,Remote CSE接收来自Hosting CSE的请求,判断报文和本地资源consistency的取值(缺省值为0);
Case 0:无一致性{
a.删除Announced Resource;
}Case 1:最终一致性{
a.判断remoteCSE是否存在该资源副本,若存在,则比较资源版本号:
a1:若请求报文的版本与本地版本相同或更加新,则删除副本;
a2:否则放弃;
}Case 2:严格一致性{
a.Remote CSE删除Announced Resource;
b.删除成功则返回,否则回滚至之前状态;
}
Remote CSE可根据数据副本管理的一致性要求删除Announced Resource,可保证Original Resource和Announced Resource的数据一致性,增强用户读取 数据的准确性。
下面将结合图16,对本发明实施例中所描述的Remote CSE修改Announced Resource的属性值的具体执行步骤进行描述。
S801,Remote CSE根据所述数据一致性的标识信息确定所述数据副本管理的一致性要求。
S802,所述Remote CSE根据所述一致性要求,或者所述管理请求中携带的所述原始数据的第一副本数据的标识信息,确定所述Remote CSE中存储的所述原始数据的第二副本数据的管理方式,并根据所述管理方式修改所述第二副本数据的资源属性。
具体实现中,Remote CSE可接收Hosting CSE的请求,判断consistency的属性值。若上述consistency的属性值为第一属性值(例如0),Remote CSE则可确定上述一致性要求为无一致性;若上述consistency的属性值为第二属性值(例如1),Remote CSE则可确定上述一致性要求为最终一致性;若上述consistency的属性值为第三属性值(例如2),Remote CSE则可确定上述一致性要求为严格一致性。
若上述一致性要求为无一致性,Remote CSE则确定原始数据的第二副本数据的管理方式为修改原始数据的第二副本数据的指定属性值;若上述一致性要求为最终一致性,Remote CSE则判断Remote CSE中是否存在所述原始数据的第二副本数据,若判断结果为是,则根据管理请求中携带的原始数据的第一副本数据的最新版本号判断第二副本数据是否为最新版本,若第二副本数据不是最新版本则确定第二副本数据的管理方式为根据第一副本数据的属性值修改第二副本数据的指定属性值;若上述一致性要求为严格一致性,Remote CSE则确定原始数据的第二副本数据的管理方式为根据第一副本数据的属性值修改第二副本数据的指定属性值。
如图16a,Remote CSE接收来自HostingCSE的请求,判断consistency的取值(缺省值为0);
Case 0:无一致性{
a.修改Announced Resource相应属性值;
}Case 1:最终一致性{
a.判断remote CSE是否存在该Announced Resource,若不存在,则返回;
b.比较remote CSE该Announced Resource的版本和请求报文携带的资源版本,若前者更新,则返回;
c.比较remote CSE该Announced Resource相应属性的版本和请求报文携带的资源属性版本;
c1:若新申请的版本更加新,则修改;
c2:否则放弃
}Case 2:严格一致性{
a.Remote CSE修改Announced Resource相应属性值;
b.修改成功则返回,否则回滚至之前状态
}
Remote CSE可根据数据副本管理的一致性要求修改Announced Resource的资源属性,可保证Original Resource和Announced Resource的数据一致性,增强用户读取数据的准确性。
为了更好地描述本发明实施例中所描述的Blocking和Non-blocking的管理方式,下面将结合图17和图18,对本发明实施例中所描述的Blocking和Non-blocking的执行方式进行具体描述。
一、具体实现中,在一致性要求为严格一致性时,即属性consistency属性值为2,副本Announce必须要选择blocking执行方式。
参见图17,是本发明实施例提供的Blocking执行方式的交互示意图,包括步骤:
Step 001:由发起者AE或CSE向Hosting CSE发起副本管理(包括创建Announced Resource、删除Announced Resource和修改属性内容三种情况)请求,请求信息中可以携带一致性要求的标识信息,即consistency属性值。
请求报文参数如下:
op:C(创建)、U(更新)或者D(删除)。
to:在Hosting CSE处的目标资源的Resource ID。
fr:发起者AE或CSE的ID。
ty:可选。如果是创建请求则该参数为所要创建副本资源的类型,否则不使用该参数。
ri:发起者提供的请求标识。
nm:可选。如果是创建请求则该参数为所要创建的副本资源的名字,否则不使用该参数。
cn:可选。
创建操作:cn包含(ty,value)和(consistency,value)。
更新操作:cn包含(attribute,value)或(attribute,NULL),以及(consistency,value)。
删除操作:不使用该参数。
Step 002:Hosting CSE对发起者进行相应操作的鉴权,通过鉴权后执行相应管理操作(包括创建Announced Resource、删除Announced Resource和修改属性内容等)。
Step 003:Hosting CSE向Remote CSE发起副本管理请求,请求信息中需要携带consistency属性值。
请求报文参数如下:
op:C(创建)、U(更新)或者D(删除)。
to:在Remote CSE处的目标资源的Resource ID。
fr:发起者Hosting CSE的ID。
ty:可选。如果是创建请求则该参数为所要创建副本资源的类型,否则不使用该参数。
ri:发起者提供的请求标识。
nm:可选。如果是创建请求则该参数为所要创建的副本资源的名字,否则不使用该参数。
cn:可选。
创建操作:cn包含(ty,value),(consistency,value),以及(stateTag,value)。
更新操作:cn包含(attribute,value)或(attribute,NULL),(stateTag,value),以及(consistency,value)。
删除操作:cn包含(stateTag,value)。
Step 004:Remote CSE对发起者进行相应操作的鉴权,通过鉴权后执行相应管理操作。
Step 005:Remote CSE回复Hosting CSE操作结果。
回复报文参数如下:
to:Hosting CSE的ID。
fr:可选。Remote CSE的ID。
ri:Hosting CSE提供的请求标识符。
nm:可选。如果是创建请求且创建不成功是则该参数为所要创建的副本资源的名字,否则不使用该参数。
cn:可选。
创建操作:cn可以是创建的副本资源的内容。
更新操作:cn可以是所有被更新的属性。
删除操作:不使用该参数。
rs:最终操作结果。
Step 006:Hosting CSE回复AE或CSE操作结果。
回复报文参数如下:
to:AE或者CSE的ID。
fr:可选。Hosting CSE的ID。
ri:AE或CSE提供的请求标识符。
nm:可选。如果是创建请求且创建不成功是则该参数为所要创建的副本资源的名字,否则不使用该参数。
cn:可选。
创建操作:cn可以是创建的副本资源的内容。
更新操作:cn可以是所有被更新的属性。
删除操作:不使用该参数。
rs:最终操作结果。
二、当一致性要求为最终一致性时,即属性consistency属性值为1,副本 宣布默认选择non-blocking执行方式。
参见图18,是本发明实施例提供的Non-Blocking执行方式的交互示意图,包括步骤:
Step 001:由AE或CSE向Hosting CSE发起副本管理的请求,请求信息中可以携带一致性要求信息,即consistency属性值。
副本管理包括创建Announced Resource、删除Announced Resource和修改属性内容三种情况。
请求参数同blocking执行方式Step 001。
Step 002:Hosting CSE对发起者进行相应操作的鉴权,通过鉴权后执行相应管理操作。
Step 003:Hosting CSE回复AE或CSE,回复信息为未获得副本更新前的结果。
回复参数如下:
Figure PCTCN2015079811-appb-000003
to:AE或者CSE的ID。
Figure PCTCN2015079811-appb-000004
fr:可选。Hosting CSE的ID。
Figure PCTCN2015079811-appb-000005
ri:AE或CSE提供的请求标识符。
Figure PCTCN2015079811-appb-000006
rs:可以是未完成操作,等待执行。
Step 004:Hosting CSE向Remote CSE发起副本管理请求,请求信息中携带consistency属性值。
请求参数同blocking执行方式Step 003。
Step 005:Remote CSE对发起者进行相应操作的鉴权,通过鉴权后执行相应管理操作。
Step 006:Remote CSE回复Hosting CSE操作结果。
回复参数blocking执行方式Step 0005。
Step 007:AE或CSE根据自己一致性要求可以选择向Hosting CSE发起查询请求,可以要求返回所查询的资源的执行情况。
请求参数如下:
Figure PCTCN2015079811-appb-000007
op:R(查询)。
Figure PCTCN2015079811-appb-000008
to:在Hosting CSE处的目标资源的Resource ID。
Figure PCTCN2015079811-appb-000009
fr:发起者AE或CSE的ID。
Figure PCTCN2015079811-appb-000010
ri:发起者提供的请求标识。
Figure PCTCN2015079811-appb-000011
cn:可以是需要查询的资源或属性的操作结果。
Step 008:Hosting CSE回复AE或CSE查询结果。
回复参数如下:
Figure PCTCN2015079811-appb-000012
to:AE或者CSE的ID。
Figure PCTCN2015079811-appb-000013
fr:可选。Hosting CSE的ID。
Figure PCTCN2015079811-appb-000014
ri:AE或CSE提供的请求标识符。
cn:查询的资源或属性的最终操作结果。
具体实现中,本发明实施例中所描述的数据处理方法可具体应用于:灾难应急处理和智能停车等具体应用场景。下面将对上述灾难应急处理和智能停车等场景进行简单介绍:
应用场景一:灾难应急处理
当一个灾难发生在大都市,许多受灾者需要各种各样的信息,如交通、安全和疏散区,M2M服务需要立即自动地传输必要的信息给用户设备,如图19所示。
该场景相关参与者有信息发布者、省级中心、县级中心和用户。信息发布者向省级中心提供各种传感器和设备发送来的信息;省级中心是省级的通用服务平台,用于存储与管理各个信息发布者传送来的数据信息;县级中心是县级的通用服务平台,用于存储与管理当地数据信息和省级中心传来的副本,在紧急情况下通过无线网络(如WiFi,3GPP)发送信息给用户设备;用户包括求助者、救助车等,他们拥有用户设备并且可以连接到县级中心查询当地信息以及省级中心的副本信息。
灾难未发生时,省级中心向县级中心宣布副本,对于副本的一致性要求只需满足最终一致性即可;但当灾难发生时,受灾者急需获取各种各样的最新信息,对于副本的更新需要满足严格一致性要求才能满足需要。
应用场景二:智能停车
智能停车帮助解决了城市交通的一个大问题——找到合适的停车地点。城 市停车点分布范围广,且各个停车点常常都是为不同的提供商所拥有,通过一个停车点服务提供商很难解决用户的停车问题。根据智能停车服务,在一个固定停车点的服务提供商处会存储其它停车点的副本信息(该处副本信息符合严格一致性要求),用户可以通过访问该提供商处的副本信息方便的找到合适停车点。
该场景相关参与者有停车服务提供商(mall)、停车提供商(street)和智能手机导航器。停车提供商(mall)拥有所在商场的停车信息,停车提供商(street)拥有所在街道所有商场的停车信息(一个街道有多个商场),智能手机导航器是用户使用的用于导航目的的M2M设备。
场景先行条件是用户用智能手机终端设定一个商场的作为目的地,并且检查该商场是否有空余停车位。触发条件是用户到达目的商场的附近。
一般过程如图20所示,描述如下:
1.用户的智能手机终端发送用户位置信息给商场停车场。
2.mall1的服务提供商查询该地停车信息,若已无停车位,告知智能手机终端该信息。
3.mall1的服务提供商向street的服务提供商查询mall2的副本信息。
4.若mall2的副本信息显示有空余车位,则street的服务提供商通过M2M服务平台向mall1的服务提供商告知mall2处有空余车位。
5.mall1的服务提供商告知用户在mall2处有空余车位。
6.用户去malll2处停车,并告知mall2的服务提供商。
7.有新用户在mall2处停车,mall2的服务提供商的数据被更新,该信息要被announced到street的服务提供商,street的服务提供商里的mall2副本信息按照严格一致性要求做更新。
参见图21,是本发明实施例中所描述的数据处理装置的第一实施例结构示意图。本发明实施例中所描述的数据处理装置,包括:
接收模块10,用于接收应用实体AE或者公共服务实体CSE发送的原始数据的数据副本的管理请求。
确定模块20,用于根据所述接收模块接收的所述数据副本的管理请求中携带的数据一致性的标识信息,确定数据副本管理的一致性要求。
处理模块30,用于根据所述确定模块确定的所述一致性要求设置所述原始数据的数据属性,并按照所述一致性要求对应的数据管理方式处理所述原始数据的副本数据。
发送模块40,用于将所述处理模块处理得到的所述原始数据的副本数据的标识信息,或者所述接收模块接收到的所述数据一致性的标识信息发送给远程公共服务实体Remote CSE。
在一些可行的实施方式中,所述原始数据的数据副本的管理请求包括:创建原始数据的数据副本、删除原始数据的数据副本以及修改原始数据的数据副本的资源属性中的至少一种数据副本的管理请求;
所述数据一致性的标识信息为所述原始数据的数据一致性的预设属性值。
在一些可行的实施方式中,所述数据副本管理的一致性要求包括:严格一致性、最终一致性以及无一致性中的至少一种;
其中,所述严格一致性为:所述原始数据中包含的资源属性,与所述原始数据的副本数据中包含的资源属性在任意时刻均保持一致;
所述最终一致性为:所述原始数据中包含的资源属性,与所述原始数据的副本数据中包含的资源属性在最终时刻保持一致;
所述无一致性为:所述原始数据中包含的资源属性,与所述原始数据的副本数据中包含的资源属性相同或者不同。
在一些可行的实施方式中,所述确定模块20具体用于:
判断所述数据副本的管理请求中携带的所述原始数据的数据一致性的预设属性值是否为第一属性值;
若所述原始数据的数据一致性的预设属性值为第一属性值,则确定数据副本管理的一致性要求为无一致性;
若所述原始数据的数据一致性的预设属性值不是第一属性值,则判断所述原始数据的数据一致性的预设属性值是否为第二属性值;
若所述原始数据的数据一致性的预设属性值为第二属性值,则确定所述数据副本管理的一致性要求为最终一致性;
若所述原始数据的数据一致性的预设属性值不是第二属性值,则确定所述数据副本管理的一致性要求为严格一致性。
在一些可行的实施方式中,所述原始数据的数据副本的管理请求为创建原 始数据的数据副本;
所述处理模块30具体用于:
若所述确定模块确定所述一致性要求为无一致性,则按照Blocking或者Non-blocking的数据处理方式创建所述原始数据的副本数据;
若所述确定模块确定所述一致性要求为最终一致性,则将创建的所述原始数据的副本数据的版本号设置为最新版本号,并将所述最新版本号以及所述最终一致性的标识信息添加至管理请求报文中,根据所述管理请报文以Blocking或者Non-blocking的数据处理方式创建所述原始数据的副本数据;
若所述确定模块确定所述一致性要求为严格一致性,则将所述严格一致性的标识信息添加至管理请求报文中,并根据所述管理请求报文以Blocking的数据处理方式创建所述原始数据的副本数据。
在一些可行的实施方式中,所述原始数据的数据副本的管理请求为删除原始数据的数据副本;
所述处理模块30具体用于:
若所述确定模块确定所述一致性要求为无一致性,则按照Blocking或者Non-blocking的数据处理方式删除所述原始数据的副本数据;
若所述确定模块确定所述一致性要求为最终一致性,则将所述原始数据的副本数据的版本号设置为最新版本号,并将所述最新版本号添加至管理请求报文中,根据所述管理请求报文以Blocking或者Non-blocking的数据处理方式删除所述原始数据的副本数据;
若所述确定模块确定所述一致性要求为严格一致性,则按照Blocking的数据处理方式删除所述原始数据的副本数据。
在一些可行的实施方式中,所述原始数据的数据副本的管理请求为修改原始数据的数据副本的资源属性;
所述处理模块30具体用于:
若所述确定模块确定所述一致性要求为无一致性,则按照Blocking或者Non-blocking的数据处理方式更新所述原始数据的副本数据的指定属性值;
若所述确定模块确定所述一致性要求为最终一致性,则将修改后的所述原始数据的副本数据的版本号设置为最新版本号,并将所述副本数据的最新版本号、所述指定属性值以及所述最终一致性的标识信息添加至管理请求报文中, 根据所述管理请求报文以Blocking或者Non-blocking的数据处理方式修改所述原始数据的副本数据的指定属性值;
若所述确定模块确定所述一致性要求为严格一致性,则将所述严格一致性的标识信息添加至管理请求报文中,根据所述管理请求报文以Blocking的数据处理方式修改所述原始数据的副本数据的指定属性。
在一些可行的实施方式中,所述发送模块40具体用于:
向所述Remote CSE发送副本数据的所述管理请求报文,所述管理请求报文中携带所述原始数据的副本数据的标识信息,或者所述数据一致性的标识信息。
具体实现中,上述数据处理装置具体可为本发明实施例中所描述的Hosting CSE,上述数据处理装置可通过其接收模块、确定模块、处理模块和发送模块执行上述Hosting CSE对应的数据处理方法中所描述的实现方式,具体实现过程可参见上述Hosting CSE对应的实施例,在此不再赘述。
参见图22,是本发明实施例中所描述的数据处理装置的第二实施例结构示意图。本发明实施例中所描述的数据处理装置,包括:
接收模块50,用于接收本地公共服务实体Hosting CSE发送的原始数据的数据副本的管理请求,所述管理请求中携带数据副本管理的数据一致性的标识信息。
确定模块60,用于根据所述接收模块接收的所述数据一致性的标识信息确定所述数据副本管理的一致性要求。
所述确定模块60,还用于根据所述一致性要求,或者所述管理请求中携带的所述原始数据的第一副本数据的标识信息,确定所述Remote CSE中存储的所述原始数据的第二副本数据的管理方式。
处理模块70,用于根据所述确定模块确定的所述管理方式对所述第二副本数据进行处理,以得到符合所述一致性要求的所述原始数据的目标副本数据。
在一些可行的实施方式中,所述原始数据的数据副本的管理请求包括:创建原始数据的数据副本、删除原始数据的数据副本以及修改原始数据的数据副本的资源属性中的至少一种数据副本的管理请求;
所述数据一致性的标识信息为所述原始数据的数据一致性的预设属性值。
在一些可行的实施方式中,所述数据副本管理的一致性要求包括:严格一致性、最终一致性以及无一致性中的至少一种;
其中,所述严格一致性为:所述原始数据中包含的资源属性,与所述原始数据的副本数据中包含的资源属性在任意时刻均保持一致;
所述最终一致性为:所述原始数据中包含的资源属性,与所述原始数据的副本数据中包含的资源属性在最终时刻保持一致;
所述无一致性为:所述原始数据中包含的资源属性,与所述原始数据的副本数据中包含的资源属性相同或者不同。
在一些可行的实施方式中,所述确定模块60具体用于:
判断所述数据副本的管理请求中携带的所述原始数据的数据一致性的预设属性值是否为第一属性值;
若所述原始数据的数据一致性的预设属性值为第一属性值,则确定数据副本管理的一致性要求为无一致性;
若所述原始数据的数据一致性的预设属性值不是第一属性值,则判断所述原始数据的数据一致性的预设属性值是否为第二属性值;
若所述原始数据的数据一致性的预设属性值为第二属性值,则确定所述数据副本管理的一致性要求为最终一致性;
若所述原始数据的数据一致性的预设属性值不是第二属性值,则确定所述数据副本管理的一致性要求为严格一致性。
在一些可行的实施方式中,所述原始数据的数据副本的管理请求为创建原始数据的数据副本;
所述确定模块60具体用于:
若所述一致性要求为无一致性,则确定所述原始数据的第二副本数据的管理方式为创建所述原始数据的目标副本数据;
若所述一致性要求为最终一致性,则判断所述Remote CSE中是否存在所述原始数据的第二副本数据,若判断结果为是,则根据所述管理请求中携带的所述原始数据的第一副本数据的最新版本号判断所述第二副本数据是否为最新版本,若所述第二副本数据不是最新版本则确定所述第二副本数据的管理方式为创建所述第一副本数据的最新版本号对应的目标副本数据;
若所述一致性要求为严格一致性,则确定所述原始数据的第二副本数据的管理方式为创建所述管理请求中携带的所述原始数据的第一副本数据的最新版本号对应的目标副本数据。
在一些可行的实施方式中,所述原始数据的数据副本的管理请求为删除原始数据的数据副本;
所述确定模块60具体用于:
若所述一致性要求为无一致性,则确定所述原始数据的第二副本数据的管理方式为删除所述第二副本数据;
若所述一致性要求为最终一致性,则判断所述Remote CSE中是否存在所述原始数据的第二副本数据,若判断结果为是,则根据所述管理请求中携带的所述原始数据的第一副本数据的最新版本号判断所述第二副本数据是否为最新版本,若所述第二副本数据不是最新版本则确定所述第二副本数据的管理方式为删除所述第二副本数据;
若所述一致性要求为严格一致性,则确定所述原始数据的第二副本数据的管理方式为删除所述第二副本数据。
在一些可行的实施方式中,所述原始数据的数据副本的管理请求为修改原始数据的数据副本的资源属性;
所述确定模块60具体用于:
若所述一致性要求为无一致性,则确定所述原始数据的第二副本数据的管理方式为修改所述原始数据的第二副本数据的指定属性值;
若所述一致性要求为最终一致性,则判断所述Remote CSE中是否存在所述原始数据的第二副本数据,若判断结果为是,则根据所述管理请求中携带的所述原始数据的第一副本数据的最新版本号判断所述第二副本数据是否为最新版本,若所述第二副本数据不是最新版本则确定所述第二副本数据的管理方式为根据所述第一副本数据的属性值修改所述第二副本数据的指定属性值;
若所述一致性要求为严格一致性,则确定所述原始数据的第二副本数据的管理方式为根据所述第一副本数据的属性值修改所述第二副本数据的指定属性值。
具体实现中,上述数据处理装置具体可为本发明实施例中所描述的Remote CSE,上述数据处理装置可通过其接收模块、确定模块和处理模块执 行上述Remote CSE对应的数据处理方法中所描述的实现方式,具体实现过程可参见上述Remote CSE对应的实施例,在此不再赘述。
参见图23,是本发明实施例中所描述的公共服务实体的第一实施例结构示意图。本发明实施例中所描述的公共服务实体,包括:存储器1000、发送器2000、接收器3000和处理器4000;上述存储器1000、发送器2000、接收器3000和处理器4000通过总线8000连接。
所述存储器1000,用于存储程序代码;
所述发送器2000、所述接收器3000和所述处理器4000,用于调用所述存储器1000中存储的所述程序代码,执行如下操作:
所述接收器3000,用于接收应用实体AE或者公共服务实体CSE发送的原始数据的数据副本的管理请求;
所述处理器4000,用于根据所述接收器接收的所述数据副本的管理请求中携带的数据一致性的标识信息,确定数据副本管理的一致性要求;
所述处理器4000,还用于根据所述一致性要求设置所述原始数据的数据属性,并按照所述一致性要求对应的数据管理方式处理所述原始数据的副本数据;
所述发送器2000,用于将所述处理器处理的所述原始数据的副本数据的标识信息,或者所述接收器接收的所述数据一致性的标识信息发送给远程公共服务实体Remote CSE。
在一些可行的实施方式中,所述原始数据的数据副本的管理请求包括:创建原始数据的数据副本、删除原始数据的数据副本以及修改原始数据的数据副本的资源属性中的至少一种数据副本的管理请求;
所述数据一致性的标识信息为所述原始数据的数据一致性的预设属性值。
在一些可行的实施方式中,所述数据副本管理的一致性要求包括:严格一致性、最终一致性以及无一致性中的至少一种;
其中,所述严格一致性为:所述原始数据中包含的资源属性,与所述原始数据的副本数据中包含的资源属性在任意时刻均保持一致;
所述最终一致性为:所述原始数据中包含的资源属性,与所述原始数据的副本数据中包含的资源属性在最终时刻保持一致;
所述无一致性为:所述原始数据中包含的资源属性,与所述原始数据的副本数据中包含的资源属性相同或者不同。
在一些可行的实施方式中,所述处理器4000具体用于:
判断所述接收器接收的所述数据副本的管理请求中携带的所述原始数据的数据一致性的预设属性值是否为第一属性值;
若所述原始数据的数据一致性的预设属性值为第一属性值,则确定数据副本管理的一致性要求为无一致性;
若所述原始数据的数据一致性的预设属性值不是第一属性值,则判断所述原始数据的数据一致性的预设属性值是否为第二属性值;
若所述原始数据的数据一致性的预设属性值为第二属性值,则确定所述数据副本管理的一致性要求为最终一致性;
若所述原始数据的数据一致性的预设属性值不是第二属性值,则确定所述数据副本管理的一致性要求为严格一致性。
在一些可行的实施方式中,所述原始数据的数据副本的管理请求为创建原始数据的数据副本;
所述处理器4000具体用于:
若所述一致性要求为无一致性,则按照Blocking或者Non-blocking的数据处理方式创建所述原始数据的副本数据;
若所述一致性要求为最终一致性,则将创建的所述原始数据的副本数据的版本号设置为最新版本号,并将所述最新版本号以及所述最终一致性的标识信息添加至管理请求报文中,根据所述管理请报文以Blocking或者Non-blocking的数据处理方式创建所述原始数据的副本数据;
若所述一致性要求为严格一致性,则将所述严格一致性的标识信息添加至管理请求报文中,并根据所述管理请求报文以Blocking的数据处理方式创建所述原始数据的副本数据。
在一些可行的实施方式中,所述原始数据的数据副本的管理请求为删除原始数据的数据副本;
所述处理器4000具体用于:
若所述一致性要求为无一致性,则按照Blocking或者Non-blocking的数据处理方式删除所述原始数据的副本数据;
若所述一致性要求为最终一致性,则将所述原始数据的副本数据的版本号设置为最新版本号,并将所述最新版本号添加至管理请求报文中,根据所述管理请求报文以Blocking或者Non-blocking的数据处理方式删除所述原始数据的副本数据;
若所述一致性要求为严格一致性,则按照Blocking的数据处理方式删除所述原始数据的副本数据。
在一些可行的实施方式中,所述原始数据的数据副本的管理请求为修改原始数据的数据副本的资源属性;
所述处理器4000具体用于:
若所述一致性要求为无一致性,则按照Blocking或者Non-blocking的数据处理方式更新所述原始数据的副本数据的指定属性值;
若所述一致性要求为最终一致性,则将修改后的所述原始数据的副本数据的版本号设置为最新版本号,并将所述副本数据的最新版本号、所述指定属性值以及所述最终一致性的标识信息添加至管理请求报文中,根据所述管理请求报文以Blocking或者Non-blocking的数据处理方式修改所述原始数据的副本数据的指定属性值;
若所述一致性要求为严格一致性,则将所述严格一致性的标识信息添加至管理请求报文中,根据所述管理请求报文以Blocking的数据处理方式修改所述原始数据的副本数据的指定属性。
在一些可行的实施方式中,所述发送器2000具体用于:
向所述Remote CSE发送副本数据的所述管理请求报文,所述管理请求报文中携带所述原始数据的副本数据的标识信息,或者所述数据一致性的标识信息。
具体实现中,上述公共服务实体具体可为本发明实施例中所描述的Hosting CSE,上述数据处理装置可通过其存储器1000、发送器2000、接收器3000和处理器4000执行上述Hosting CSE对应的数据处理方法中所描述的实现方式,具体实现过程可参见上述Hosting CSE对应的实施例,在此不再赘述。
参见图24,是本发明实施例中所描述的公共服务实体的第二实施例结构示意图。本发明实施例中所描述的公共服务实体,包括:存储器5000、接收 器6000和处理器7000;上述存储器5000、接收器6000和处理器7000通过总线9000连接。
所述存储器5000,用于存储程序代码;
所述接收器6000和所述处理器7000,用于调用所述存储器5000中存储的所述程序代码,执行如下操作:
所述接收器6000,用于接收本地公共服务实体Hosting CSE发送的原始数据的数据副本的管理请求,所述管理请求中携带数据副本管理的数据一致性的标识信息;
所述处理器7000,用于根据所述数据一致性的标识信息确定所述数据副本管理的一致性要求;
所述处理器7000,还用于根据所述一致性要求,或者所述管理请求中携带的所述原始数据的第一副本数据的标识信息,确定所述Remote CSE中存储的所述原始数据的第二副本数据的管理方式;
所述处理器7000,还用于根据所述管理方式对所述第二副本数据进行处理,以得到符合所述一致性要求的所述原始数据的目标副本数据。
在一些可行的实施方式中,所述原始数据的数据副本的管理请求包括:创建原始数据的数据副本、删除原始数据的数据副本以及修改原始数据的数据副本的资源属性中的至少一种数据副本的管理请求;
所述数据一致性的标识信息为所述原始数据的数据一致性的预设属性值。
在一些可行的实施方式中,所述数据副本管理的一致性要求包括:严格一致性、最终一致性以及无一致性中的至少一种;
其中,所述严格一致性为:所述原始数据中包含的资源属性,与所述原始数据的副本数据中包含的资源属性在任意时刻均保持一致;
所述最终一致性为:所述原始数据中包含的资源属性,与所述原始数据的副本数据中包含的资源属性在最终时刻保持一致;
所述无一致性为:所述原始数据中包含的资源属性,与所述原始数据的副本数据中包含的资源属性相同或者不同。
在一些可行的实施方式中,所述处理器7000具体用于:
判断所述接收器接收的所述数据副本的管理请求中携带的所述原始数据的数据一致性的预设属性值是否为第一属性值;
若所述原始数据的数据一致性的预设属性值为第一属性值,则确定数据副本管理的一致性要求为无一致性;
若所述原始数据的数据一致性的预设属性值不是第一属性值,则判断所述原始数据的数据一致性的预设属性值是否为第二属性值;
若所述原始数据的数据一致性的预设属性值为第二属性值,则确定所述数据副本管理的一致性要求为最终一致性;
若所述原始数据的数据一致性的预设属性值不是第二属性值,则确定所述数据副本管理的一致性要求为严格一致性。
在一些可行的实施方式中,所述原始数据的数据副本的管理请求为创建原始数据的数据副本;
所述处理器7000具体用于:
若所述一致性要求为无一致性,则确定所述原始数据的第二副本数据的管理方式为创建所述原始数据的目标副本数据;
若所述一致性要求为最终一致性,则判断所述Remote CSE中是否存在所述原始数据的第二副本数据,若判断结果为是,则根据所述管理请求中携带的所述原始数据的第一副本数据的最新版本号判断所述第二副本数据是否为最新版本,若所述第二副本数据不是最新版本则确定所述第二副本数据的管理方式为创建所述第一副本数据的最新版本号对应的目标副本数据;
若所述一致性要求为严格一致性,则确定所述原始数据的第二副本数据的管理方式为创建所述管理请求中携带的所述原始数据的第一副本数据的最新版本号对应的目标副本数据。
在一些可行的实施方式中,所述原始数据的数据副本的管理请求为删除原始数据的数据副本;
所述处理器7000具体用于:
若所述一致性要求为无一致性,则确定所述原始数据的第二副本数据的管理方式为删除所述第二副本数据;
若所述一致性要求为最终一致性,则判断所述Remote CSE中是否存在所述原始数据的第二副本数据,若判断结果为是,则根据所述管理请求中携带的所述原始数据的第一副本数据的最新版本号判断所述第二副本数据是否为最新版本,若所述第二副本数据不是最新版本则确定所述第二副本数据的管理方 式为删除所述第二副本数据;
若所述一致性要求为严格一致性,则确定所述原始数据的第二副本数据的管理方式为删除所述第二副本数据。
在一些可行的实施方式中,所述原始数据的数据副本的管理请求为修改原始数据的数据副本的资源属性;
所述处理器7000具体用于:
若所述一致性要求为无一致性,则确定所述原始数据的第二副本数据的管理方式为修改所述原始数据的第二副本数据的指定属性值;
若所述一致性要求为最终一致性,则判断所述Remote CSE中是否存在所述原始数据的第二副本数据,若判断结果为是,则根据所述管理请求中携带的所述原始数据的第一副本数据的最新版本号判断所述第二副本数据是否为最新版本,若所述第二副本数据不是最新版本则确定所述第二副本数据的管理方式为根据所述第一副本数据的属性值修改所述第二副本数据的指定属性值;
若所述一致性要求为严格一致性,则确定所述原始数据的第二副本数据的管理方式为根据所述第一副本数据的属性值修改所述第二副本数据的指定属性值。
具体实现中,上述公共服务实体具体可为本发明实施例中所描述的Remote CSE,上述数据处理装置可通过其存储器5000、接收器6000和处理器7000执行上述Remote CSE对应的数据处理方法中所描述的实现方式,具体实现过程可参见上述Remote CSE对应的实施例,在此不再赘述。
参见图25,是本发明实施例提供的数据处理系统的实施例结构示意图。本发明实施例中所描述的数据处理系统包括:上述实施例中所描述的第一公共服务实体和第二公共服务实体,即本发明实施例中所描述的Hosting CSE10001和Remote CSE10002。
具体实现中,本发明实施例中所描述的系统还可包括上述实施例中所描述的AE/CSE10000。上述AE/CSE10000、Hosting CSE10001和Remote CSE10002的具体实现过程可参见上述实施例中所描述的实现方式,在此不再赘述。
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,所述的程序可存储于计算机 可读取存储介质中,该程序在执行时,可包括如上述各方法的实施例的流程。其中,所述的存储介质可为磁碟、光盘、只读存储记忆体(Read-Only Memory,ROM)或随机存储记忆体(Random Access Memory,RAM)等。
以上所揭露的仅为本发明较佳实施例而已,当然不能以此来限定本发明之权利范围,因此依本发明权利要求所作的等同变化,仍属本发明所涵盖的范围。

Claims (46)

  1. 一种数据处理方法,其特征在于,包括:
    本地公共服务实体Hosting CSE接收应用实体AE或者公共服务实体CSE发送的原始数据的数据副本的管理请求;
    所述Hosting CSE根据所述数据副本的管理请求中携带的数据一致性的标识信息,确定数据副本管理的一致性要求;
    所述Hosting CSE根据所述一致性要求设置所述原始数据的数据属性,并按照所述一致性要求对应的数据管理方式处理所述原始数据的副本数据;
    所述Hosting CSE将所述原始数据的副本数据的标识信息,或者所述数据一致性的标识信息发送给远程公共服务实体Remote CSE。
  2. 如权利要求1所述的方法,其特征在于,所述原始数据的数据副本的管理请求包括:创建原始数据的数据副本、删除原始数据的数据副本以及修改原始数据的数据副本的资源属性中的至少一种数据副本的管理请求;
    所述数据一致性的标识信息为所述原始数据的数据一致性的预设属性值。
  3. 如权利要求2所述的方法,其特征在于,所述数据副本管理的一致性要求包括:严格一致性、最终一致性以及无一致性中的至少一种;
    其中,所述严格一致性为:所述原始数据中包含的资源属性,与所述原始数据的副本数据中包含的资源属性在任意时刻均保持一致;
    所述最终一致性为:所述原始数据中包含的资源属性,与所述原始数据的副本数据中包含的资源属性在最终时刻保持一致;
    所述无一致性为:所述原始数据中包含的资源属性,与所述原始数据的副本数据中包含的资源属性相同或者不同。
  4. 如权利要求3所述的方法,其特征在于,所述Hosting CSE根据所述数据副本的管理请求中携带的数据一致性的标识信息,确定数据副本管理的一致性要求,包括:
    所述Hosting CSE判断所述数据副本的管理请求中携带的所述原始数据的 数据一致性的预设属性值是否为第一属性值;
    若所述原始数据的数据一致性的预设属性值为第一属性值,则确定数据副本管理的一致性要求为无一致性;
    若所述原始数据的数据一致性的预设属性值不是第一属性值,则判断所述原始数据的数据一致性的预设属性值是否为第二属性值;
    若所述原始数据的数据一致性的预设属性值为第二属性值,则确定所述数据副本管理的一致性要求为最终一致性;
    若所述原始数据的数据一致性的预设属性值不是第二属性值,则确定所述数据副本管理的一致性要求为严格一致性。
  5. 如权利要求4所述的方法,其特征在于,所述原始数据的数据副本的管理请求为创建原始数据的数据副本;
    所述按照所述一致性要求对应的数据管理方式处理所述原始数据的副本数据,包括:
    若所述一致性要求为无一致性,则按照Blocking或者Non-blocking的数据处理方式创建所述原始数据的副本数据;
    若所述一致性要求为最终一致性,则将创建的所述原始数据的副本数据的版本号设置为最新版本号,并将所述最新版本号以及所述最终一致性的标识信息添加至管理请求报文中,根据所述管理请报文以Blocking或者Non-blocking的数据处理方式创建所述原始数据的副本数据;
    若所述一致性要求为严格一致性,则将所述严格一致性的标识信息添加至管理请求报文中,并根据所述管理请求报文以Blocking的数据处理方式创建所述原始数据的副本数据。
  6. 如权利要求4所述的方法,其特征在于,所述原始数据的数据副本的管理请求为删除原始数据的数据副本;
    所述按照所述一致性要求对应的数据管理方式处理所述原始数据的副本数据,包括:
    若所述一致性要求为无一致性,则按照Blocking或者Non-blocking的数据处理方式删除所述原始数据的副本数据;
    若所述一致性要求为最终一致性,则将所述原始数据的副本数据的版本号设置为最新版本号,并将所述最新版本号添加至管理请求报文中,根据所述管理请求报文以Blocking或者Non-blocking的数据处理方式删除所述原始数据的副本数据;
    若所述一致性要求为严格一致性,则按照Blocking的数据处理方式删除所述原始数据的副本数据。
  7. 如权利要求4所述的方法,其特征在于,所述原始数据的数据副本的管理请求为修改原始数据的数据副本的资源属性;
    所述按照所述一致性要求对应的数据管理方式处理所述原始数据的副本数据,包括:
    若所述一致性要求为无一致性,则按照Blocking或者Non-blocking的数据处理方式更新所述原始数据的副本数据的指定属性值;
    若所述一致性要求为最终一致性,则将修改后的所述原始数据的副本数据的版本号设置为最新版本号,并将所述副本数据的最新版本号、所述指定属性值以及所述最终一致性的标识信息添加至管理请求报文中,根据所述管理请求报文以Blocking或者Non-blocking的数据处理方式修改所述原始数据的副本数据的指定属性值;
    若所述一致性要求为严格一致性,则将所述严格一致性的标识信息添加至管理请求报文中,根据所述管理请求报文以Blocking的数据处理方式修改所述原始数据的副本数据的指定属性。
  8. 如权利要求5-7任一项所述的方法,其特征在于,所述Hosting CSE将所述原始数据的副本数据的标识信息,或者所述数据一致性的标识信息发送给远程公共服务实体Remote CSE,包括:
    所述Hosting CSE向所述Remote CSE发送副本数据的所述管理请求报文,所述管理请求报文中携带所述原始数据的副本数据的标识信息,或者所述数据一致性的标识信息。
  9. 一种数据处理方法,其特征在于,包括:
    远程公共服务实体Remote CSE接收本地公共服务实体Hosting CSE发送的原始数据的数据副本的管理请求,所述管理请求中携带数据副本管理的数据一致性的标识信息;
    所述Remote CSE根据所述数据一致性的标识信息确定所述数据副本管理的一致性要求;
    所述Remote CSE根据所述一致性要求,或者所述管理请求中携带的所述原始数据的第一副本数据的标识信息,确定所述Remote CSE中存储的所述原始数据的第二副本数据的管理方式;
    所述Remote CSE根据所述管理方式对所述第二副本数据进行处理,以得到符合所述一致性要求的所述原始数据的目标副本数据。
  10. 如权利要求9所述的方法,其特征在于,所述原始数据的数据副本的管理请求包括:创建原始数据的数据副本、删除原始数据的数据副本以及修改原始数据的数据副本的资源属性中的至少一种数据副本的管理请求;
    所述数据一致性的标识信息为所述原始数据的数据一致性的预设属性值。
  11. 如权利要求10所述的方法,其特征在于,所述数据副本管理的一致性要求包括:严格一致性、最终一致性以及无一致性中的至少一种;
    其中,所述严格一致性为:所述原始数据中包含的资源属性,与所述原始数据的副本数据中包含的资源属性在任意时刻均保持一致;
    所述最终一致性为:所述原始数据中包含的资源属性,与所述原始数据的副本数据中包含的资源属性在最终时刻保持一致;
    所述无一致性为:所述原始数据中包含的资源属性,与所述原始数据的副本数据中包含的资源属性相同或者不同。
  12. 如权利要求11所述的方法,其特征在于,所述Remote CSE根据所述数据一致性的标识信息确定所述数据副本管理的一致性要求,包括:
    所述Remote CSE判断所述数据副本的管理请求中携带的所述原始数据的数据一致性的预设属性值是否为第一属性值;
    若所述原始数据的数据一致性的预设属性值为第一属性值,则确定数据副 本管理的一致性要求为无一致性;
    若所述原始数据的数据一致性的预设属性值不是第一属性值,则判断所述原始数据的数据一致性的预设属性值是否为第二属性值;
    若所述原始数据的数据一致性的预设属性值为第二属性值,则确定所述数据副本管理的一致性要求为最终一致性;
    若所述原始数据的数据一致性的预设属性值不是第二属性值,则确定所述数据副本管理的一致性要求为严格一致性。
  13. 如权利要求12所述的方法,其特征在于,所述原始数据的数据副本的管理请求为创建原始数据的数据副本;
    所述Remote CSE根据所述一致性要求,或者所述管理请求中携带的所述原始数据的第一副本数据的标识信息,确定所述Remote CSE中存储的所述原始数据的第二副本数据的管理方式,包括:
    若所述一致性要求为无一致性,则确定所述原始数据的第二副本数据的管理方式为创建所述原始数据的目标副本数据;
    若所述一致性要求为最终一致性,则判断所述Remote CSE中是否存在所述原始数据的第二副本数据,若判断结果为是,则根据所述管理请求中携带的所述原始数据的第一副本数据的最新版本号判断所述第二副本数据是否为最新版本,若所述第二副本数据不是最新版本则确定所述第二副本数据的管理方式为创建所述第一副本数据的最新版本号对应的目标副本数据;
    若所述一致性要求为严格一致性,则确定所述原始数据的第二副本数据的管理方式为创建所述管理请求中携带的所述原始数据的第一副本数据的最新版本号对应的目标副本数据。
  14. 如权利要求12所述的方法,其特征在于,所述原始数据的数据副本的管理请求为删除原始数据的数据副本;
    所述Remote CSE根据所述一致性要求,或者所述管理请求中携带的所述原始数据的第一副本数据的标识信息,确定所述Remote CSE中存储的所述原始数据的第二副本数据的管理方式,包括:
    若所述一致性要求为无一致性,则确定所述原始数据的第二副本数据的管 理方式为删除所述第二副本数据;
    若所述一致性要求为最终一致性,则判断所述Remote CSE中是否存在所述原始数据的第二副本数据,若判断结果为是,则根据所述管理请求中携带的所述原始数据的第一副本数据的最新版本号判断所述第二副本数据是否为最新版本,若所述第二副本数据不是最新版本则确定所述第二副本数据的管理方式为删除所述第二副本数据;
    若所述一致性要求为严格一致性,则确定所述原始数据的第二副本数据的管理方式为删除所述第二副本数据。
  15. 如权利要求12所述的方法,其特征在于,所述原始数据的数据副本的管理请求为修改原始数据的数据副本的资源属性;
    所述Remote CSE根据所述一致性要求,或者所述管理请求中携带的所述原始数据的第一副本数据的标识信息,确定所述Remote CSE中存储的所述原始数据的第二副本数据的管理方式,包括:
    若所述一致性要求为无一致性,则确定所述原始数据的第二副本数据的管理方式为修改所述原始数据的第二副本数据的指定属性值;
    若所述一致性要求为最终一致性,则判断所述Remote CSE中是否存在所述原始数据的第二副本数据,若判断结果为是,则根据所述管理请求中携带的所述原始数据的第一副本数据的最新版本号判断所述第二副本数据是否为最新版本,若所述第二副本数据不是最新版本则确定所述第二副本数据的管理方式为根据所述第一副本数据的属性值修改所述第二副本数据的指定属性值;
    若所述一致性要求为严格一致性,则确定所述原始数据的第二副本数据的管理方式为根据所述第一副本数据的属性值修改所述第二副本数据的指定属性值。
  16. 一种数据处理装置,其特征在于,包括:
    接收模块,用于接收应用实体AE或者公共服务实体CSE发送的原始数据的数据副本的管理请求;
    确定模块,用于根据所述接收模块接收的所述数据副本的管理请求中携带的数据一致性的标识信息,确定数据副本管理的一致性要求;
    处理模块,用于根据所述确定模块确定的所述一致性要求设置所述原始数据的数据属性,并按照所述一致性要求对应的数据管理方式处理所述原始数据的副本数据;
    发送模块,用于将所述处理模块处理得到的所述原始数据的副本数据的标识信息,或者所述接收模块接收到的所述数据一致性的标识信息发送给远程公共服务实体Remote CSE。
  17. 如权利要求16所述的装置,其特征在于,所述原始数据的数据副本的管理请求包括:创建原始数据的数据副本、删除原始数据的数据副本以及修改原始数据的数据副本的资源属性中的至少一种数据副本的管理请求;
    所述数据一致性的标识信息为所述原始数据的数据一致性的预设属性值。
  18. 如权利要求17所述的装置,其特征在于,所述数据副本管理的一致性要求包括:严格一致性、最终一致性以及无一致性中的至少一种;
    其中,所述严格一致性为:所述原始数据中包含的资源属性,与所述原始数据的副本数据中包含的资源属性在任意时刻均保持一致;
    所述最终一致性为:所述原始数据中包含的资源属性,与所述原始数据的副本数据中包含的资源属性在最终时刻保持一致;
    所述无一致性为:所述原始数据中包含的资源属性,与所述原始数据的副本数据中包含的资源属性相同或者不同。
  19. 如权利要求18所述的装置,其特征在于,所述确定模块具体用于:
    判断所述数据副本的管理请求中携带的所述原始数据的数据一致性的预设属性值是否为第一属性值;
    若所述原始数据的数据一致性的预设属性值为第一属性值,则确定数据副本管理的一致性要求为无一致性;
    若所述原始数据的数据一致性的预设属性值不是第一属性值,则判断所述原始数据的数据一致性的预设属性值是否为第二属性值;
    若所述原始数据的数据一致性的预设属性值为第二属性值,则确定所述数据副本管理的一致性要求为最终一致性;
    若所述原始数据的数据一致性的预设属性值不是第二属性值,则确定所述数据副本管理的一致性要求为严格一致性。
  20. 如权利要求19所述的装置,其特征在于,所述原始数据的数据副本的管理请求为创建原始数据的数据副本;
    所述处理模块具体用于:
    若所述确定模块确定所述一致性要求为无一致性,则按照Blocking或者Non-blocking的数据处理方式创建所述原始数据的副本数据;
    若所述确定模块确定所述一致性要求为最终一致性,则将创建的所述原始数据的副本数据的版本号设置为最新版本号,并将所述最新版本号以及所述最终一致性的标识信息添加至管理请求报文中,根据所述管理请报文以Blocking或者Non-blocking的数据处理方式创建所述原始数据的副本数据;
    若所述确定模块确定所述一致性要求为严格一致性,则将所述严格一致性的标识信息添加至管理请求报文中,并根据所述管理请求报文以Blocking的数据处理方式创建所述原始数据的副本数据。
  21. 如权利要求19所述的装置,其特征在于,所述原始数据的数据副本的管理请求为删除原始数据的数据副本;
    所述处理模块具体用于:
    若所述确定模块确定所述一致性要求为无一致性,则按照Blocking或者Non-blocking的数据处理方式删除所述原始数据的副本数据;
    若所述确定模块确定所述一致性要求为最终一致性,则将所述原始数据的副本数据的版本号设置为最新版本号,并将所述最新版本号添加至管理请求报文中,根据所述管理请求报文以Blocking或者Non-blocking的数据处理方式删除所述原始数据的副本数据;
    若所述确定模块确定所述一致性要求为严格一致性,则按照Blocking的数据处理方式删除所述原始数据的副本数据。
  22. 如权利要求19所述的装置,其特征在于,所述原始数据的数据副本的管理请求为修改原始数据的数据副本的资源属性;
    所述处理模块具体用于:
    若所述确定模块确定所述一致性要求为无一致性,则按照Blocking或者Non-blocking的数据处理方式更新所述原始数据的副本数据的指定属性值;
    若所述确定模块确定所述一致性要求为最终一致性,则将修改后的所述原始数据的副本数据的版本号设置为最新版本号,并将所述副本数据的最新版本号、所述指定属性值以及所述最终一致性的标识信息添加至管理请求报文中,根据所述管理请求报文以Blocking或者Non-blocking的数据处理方式修改所述原始数据的副本数据的指定属性值;
    若所述确定模块确定所述一致性要求为严格一致性,则将所述严格一致性的标识信息添加至管理请求报文中,根据所述管理请求报文以Blocking的数据处理方式修改所述原始数据的副本数据的指定属性。
  23. 如权利要求20-22任一项所述的装置,其特征在于,所述发送模块具体用于:
    向所述Remote CSE发送副本数据的所述管理请求报文,所述管理请求报文中携带所述原始数据的副本数据的标识信息,或者所述数据一致性的标识信息。
  24. 一种数据处理装置,其特征在于,包括:
    接收模块,用于接收本地公共服务实体Hosting CSE发送的原始数据的数据副本的管理请求,所述管理请求中携带数据副本管理的数据一致性的标识信息;
    确定模块,用于根据所述接收模块接收的所述数据一致性的标识信息确定所述数据副本管理的一致性要求;
    所述确定模块,还用于根据所述一致性要求,或者所述管理请求中携带的所述原始数据的第一副本数据的标识信息,确定所述Remote CSE中存储的所述原始数据的第二副本数据的管理方式;
    处理模块,用于根据所述确定模块确定的所述管理方式对所述第二副本数据进行处理,以得到符合所述一致性要求的所述原始数据的目标副本数据。
  25. 如权利要求24所述的装置,其特征在于,所述原始数据的数据副本的管理请求包括:创建原始数据的数据副本、删除原始数据的数据副本以及修改原始数据的数据副本的资源属性中的至少一种数据副本的管理请求;
    所述数据一致性的标识信息为所述原始数据的数据一致性的预设属性值。
  26. 如权利要求25所述的装置,其特征在于,所述数据副本管理的一致性要求包括:严格一致性、最终一致性以及无一致性中的至少一种;
    其中,所述严格一致性为:所述原始数据中包含的资源属性,与所述原始数据的副本数据中包含的资源属性在任意时刻均保持一致;
    所述最终一致性为:所述原始数据中包含的资源属性,与所述原始数据的副本数据中包含的资源属性在最终时刻保持一致;
    所述无一致性为:所述原始数据中包含的资源属性,与所述原始数据的副本数据中包含的资源属性相同或者不同。
  27. 如权利要求26所述的装置,其特征在于,所述确定模块具体用于:
    判断所述数据副本的管理请求中携带的所述原始数据的数据一致性的预设属性值是否为第一属性值;
    若所述原始数据的数据一致性的预设属性值为第一属性值,则确定数据副本管理的一致性要求为无一致性;
    若所述原始数据的数据一致性的预设属性值不是第一属性值,则判断所述原始数据的数据一致性的预设属性值是否为第二属性值;
    若所述原始数据的数据一致性的预设属性值为第二属性值,则确定所述数据副本管理的一致性要求为最终一致性;
    若所述原始数据的数据一致性的预设属性值不是第二属性值,则确定所述数据副本管理的一致性要求为严格一致性。
  28. 如权利要求27所述的装置,其特征在于,所述原始数据的数据副本的管理请求为创建原始数据的数据副本;
    所述确定模块具体用于:
    若所述一致性要求为无一致性,则确定所述原始数据的第二副本数据的管 理方式为创建所述原始数据的目标副本数据;
    若所述一致性要求为最终一致性,则判断所述Remote CSE中是否存在所述原始数据的第二副本数据,若判断结果为是,则根据所述管理请求中携带的所述原始数据的第一副本数据的最新版本号判断所述第二副本数据是否为最新版本,若所述第二副本数据不是最新版本则确定所述第二副本数据的管理方式为创建所述第一副本数据的最新版本号对应的目标副本数据;
    若所述一致性要求为严格一致性,则确定所述原始数据的第二副本数据的管理方式为创建所述管理请求中携带的所述原始数据的第一副本数据的最新版本号对应的目标副本数据。
  29. 如权利要求27所述的装置,其特征在于,所述原始数据的数据副本的管理请求为删除原始数据的数据副本;
    所述确定模块具体用于:
    若所述一致性要求为无一致性,则确定所述原始数据的第二副本数据的管理方式为删除所述第二副本数据;
    若所述一致性要求为最终一致性,则判断所述Remote CSE中是否存在所述原始数据的第二副本数据,若判断结果为是,则根据所述管理请求中携带的所述原始数据的第一副本数据的最新版本号判断所述第二副本数据是否为最新版本,若所述第二副本数据不是最新版本则确定所述第二副本数据的管理方式为删除所述第二副本数据;
    若所述一致性要求为严格一致性,则确定所述原始数据的第二副本数据的管理方式为删除所述第二副本数据。
  30. 如权利要求27所述的装置,其特征在于,所述原始数据的数据副本的管理请求为修改原始数据的数据副本的资源属性;
    所述确定模块具体用于:
    若所述一致性要求为无一致性,则确定所述原始数据的第二副本数据的管理方式为修改所述原始数据的第二副本数据的指定属性值;
    若所述一致性要求为最终一致性,则判断所述Remote CSE中是否存在所述原始数据的第二副本数据,若判断结果为是,则根据所述管理请求中携带的 所述原始数据的第一副本数据的最新版本号判断所述第二副本数据是否为最新版本,若所述第二副本数据不是最新版本则确定所述第二副本数据的管理方式为根据所述第一副本数据的属性值修改所述第二副本数据的指定属性值;
    若所述一致性要求为严格一致性,则确定所述原始数据的第二副本数据的管理方式为根据所述第一副本数据的属性值修改所述第二副本数据的指定属性值。
  31. 一种公共服务实体,其特征在于,包括:存储器、发送器、接收器和处理器;
    所述存储器,用于存储程序代码;
    所述发送器、所述接收器和所述处理器,用于调用所述存储器中存储的所述程序代码,执行如下操作:
    所述接收器,用于接收应用实体AE或者公共服务实体CSE发送的原始数据的数据副本的管理请求;
    所述处理器,用于根据所述接收器接收的所述数据副本的管理请求中携带的数据一致性的标识信息,确定数据副本管理的一致性要求;
    所述处理器,还用于根据所述一致性要求设置所述原始数据的数据属性,并按照所述一致性要求对应的数据管理方式处理所述原始数据的副本数据;
    所述发送器,用于将所述处理器处理的所述原始数据的副本数据的标识信息,或者所述接收器接收的所述数据一致性的标识信息发送给远程公共服务实体Remote CSE。
  32. 如权利要求31所述的公共服务实体,其特征在于,所述原始数据的数据副本的管理请求包括:创建原始数据的数据副本、删除原始数据的数据副本以及修改原始数据的数据副本的资源属性中的至少一种数据副本的管理请求;
    所述数据一致性的标识信息为所述原始数据的数据一致性的预设属性值。
  33. 如权利要求32所述的公共服务实体,其特征在于,所述数据副本管理的一致性要求包括:严格一致性、最终一致性以及无一致性中的至少一种;
    其中,所述严格一致性为:所述原始数据中包含的资源属性,与所述原始数据的副本数据中包含的资源属性在任意时刻均保持一致;
    所述最终一致性为:所述原始数据中包含的资源属性,与所述原始数据的副本数据中包含的资源属性在最终时刻保持一致;
    所述无一致性为:所述原始数据中包含的资源属性,与所述原始数据的副本数据中包含的资源属性相同或者不同。
  34. 如权利要求33所述的公共服务实体,其特征在于,所述处理器具体用于:
    判断所述接收器接收的所述数据副本的管理请求中携带的所述原始数据的数据一致性的预设属性值是否为第一属性值;
    若所述原始数据的数据一致性的预设属性值为第一属性值,则确定数据副本管理的一致性要求为无一致性;
    若所述原始数据的数据一致性的预设属性值不是第一属性值,则判断所述原始数据的数据一致性的预设属性值是否为第二属性值;
    若所述原始数据的数据一致性的预设属性值为第二属性值,则确定所述数据副本管理的一致性要求为最终一致性;
    若所述原始数据的数据一致性的预设属性值不是第二属性值,则确定所述数据副本管理的一致性要求为严格一致性。
  35. 如权利要求34所述的公共服务实体,其特征在于,所述原始数据的数据副本的管理请求为创建原始数据的数据副本;
    所述处理器具体用于:
    若所述一致性要求为无一致性,则按照Blocking或者Non-blocking的数据处理方式创建所述原始数据的副本数据;
    若所述一致性要求为最终一致性,则将创建的所述原始数据的副本数据的版本号设置为最新版本号,并将所述最新版本号以及所述最终一致性的标识信息添加至管理请求报文中,根据所述管理请报文以Blocking或者Non-blocking的数据处理方式创建所述原始数据的副本数据;
    若所述一致性要求为严格一致性,则将所述严格一致性的标识信息添加至 管理请求报文中,并根据所述管理请求报文以Blocking的数据处理方式创建所述原始数据的副本数据。
  36. 如权利要求34所述的公共服务实体,其特征在于,所述原始数据的数据副本的管理请求为删除原始数据的数据副本;
    所述处理器具体用于:
    若所述一致性要求为无一致性,则按照Blocking或者Non-blocking的数据处理方式删除所述原始数据的副本数据;
    若所述一致性要求为最终一致性,则将所述原始数据的副本数据的版本号设置为最新版本号,并将所述最新版本号添加至管理请求报文中,根据所述管理请求报文以Blocking或者Non-blocking的数据处理方式删除所述原始数据的副本数据;
    若所述一致性要求为严格一致性,则按照Blocking的数据处理方式删除所述原始数据的副本数据。
  37. 如权利要求34所述的公共服务实体,其特征在于,所述原始数据的数据副本的管理请求为修改原始数据的数据副本的资源属性;
    所述处理器具体用于:
    若所述一致性要求为无一致性,则按照Blocking或者Non-blocking的数据处理方式更新所述原始数据的副本数据的指定属性值;
    若所述一致性要求为最终一致性,则将修改后的所述原始数据的副本数据的版本号设置为最新版本号,并将所述副本数据的最新版本号、所述指定属性值以及所述最终一致性的标识信息添加至管理请求报文中,根据所述管理请求报文以Blocking或者Non-blocking的数据处理方式修改所述原始数据的副本数据的指定属性值;
    若所述一致性要求为严格一致性,则将所述严格一致性的标识信息添加至管理请求报文中,根据所述管理请求报文以Blocking的数据处理方式修改所述原始数据的副本数据的指定属性。
  38. 如权利要求35-37任一项所述的公共服务实体,其特征在于,所述发 送器具体用于:
    向所述Remote CSE发送副本数据的所述管理请求报文,所述管理请求报文中携带所述原始数据的副本数据的标识信息,或者所述数据一致性的标识信息。
  39. 一种公共服务实体,其特征在于,包括:存储器、接收器和处理器;
    所述存储器,用于存储程序代码;
    所述接收器和所述处理器,用于调用所述存储器中存储的所述程序代码,执行如下操作:
    所述接收器,用于接收本地公共服务实体Hosting CSE发送的原始数据的数据副本的管理请求,所述管理请求中携带数据副本管理的数据一致性的标识信息;
    所述处理器,用于根据所述数据一致性的标识信息确定所述数据副本管理的一致性要求;
    所述处理器,还用于根据所述一致性要求,或者所述管理请求中携带的所述原始数据的第一副本数据的标识信息,确定所述Remote CSE中存储的所述原始数据的第二副本数据的管理方式;
    所述处理器,还用于根据所述管理方式对所述第二副本数据进行处理,以得到符合所述一致性要求的所述原始数据的目标副本数据。
  40. 如权利要求39所述的公共服务实体,其特征在于,所述原始数据的数据副本的管理请求包括:创建原始数据的数据副本、删除原始数据的数据副本以及修改原始数据的数据副本的资源属性中的至少一种数据副本的管理请求;
    所述数据一致性的标识信息为所述原始数据的数据一致性的预设属性值。
  41. 如权利要求40所述的公共服务实体,其特征在于,所述数据副本管理的一致性要求包括:严格一致性、最终一致性以及无一致性中的至少一种;
    其中,所述严格一致性为:所述原始数据中包含的资源属性,与所述原始数据的副本数据中包含的资源属性在任意时刻均保持一致;
    所述最终一致性为:所述原始数据中包含的资源属性,与所述原始数据的副本数据中包含的资源属性在最终时刻保持一致;
    所述无一致性为:所述原始数据中包含的资源属性,与所述原始数据的副本数据中包含的资源属性相同或者不同。
  42. 如权利要求41所述的公共服务实体,其特征在于,所述处理器具体用于:
    判断所述接收器接收的所述数据副本的管理请求中携带的所述原始数据的数据一致性的预设属性值是否为第一属性值;
    若所述原始数据的数据一致性的预设属性值为第一属性值,则确定数据副本管理的一致性要求为无一致性;
    若所述原始数据的数据一致性的预设属性值不是第一属性值,则判断所述原始数据的数据一致性的预设属性值是否为第二属性值;
    若所述原始数据的数据一致性的预设属性值为第二属性值,则确定所述数据副本管理的一致性要求为最终一致性;
    若所述原始数据的数据一致性的预设属性值不是第二属性值,则确定所述数据副本管理的一致性要求为严格一致性。
  43. 如权利要求42所述的公共服务实体,其特征在于,所述原始数据的数据副本的管理请求为创建原始数据的数据副本;
    所述处理器具体用于:
    若所述一致性要求为无一致性,则确定所述原始数据的第二副本数据的管理方式为创建所述原始数据的目标副本数据;
    若所述一致性要求为最终一致性,则判断所述Remote CSE中是否存在所述原始数据的第二副本数据,若判断结果为是,则根据所述管理请求中携带的所述原始数据的第一副本数据的最新版本号判断所述第二副本数据是否为最新版本,若所述第二副本数据不是最新版本则确定所述第二副本数据的管理方式为创建所述第一副本数据的最新版本号对应的目标副本数据;
    若所述一致性要求为严格一致性,则确定所述原始数据的第二副本数据的管理方式为创建所述管理请求中携带的所述原始数据的第一副本数据的最新 版本号对应的目标副本数据。
  44. 如权利要求42所述的公共服务实体,其特征在于,所述原始数据的数据副本的管理请求为删除原始数据的数据副本;
    所述处理器具体用于:
    若所述一致性要求为无一致性,则确定所述原始数据的第二副本数据的管理方式为删除所述第二副本数据;
    若所述一致性要求为最终一致性,则判断所述Remote CSE中是否存在所述原始数据的第二副本数据,若判断结果为是,则根据所述管理请求中携带的所述原始数据的第一副本数据的最新版本号判断所述第二副本数据是否为最新版本,若所述第二副本数据不是最新版本则确定所述第二副本数据的管理方式为删除所述第二副本数据;
    若所述一致性要求为严格一致性,则确定所述原始数据的第二副本数据的管理方式为删除所述第二副本数据。
  45. 如权利要求42所述的公共服务实体,其特征在于,所述原始数据的数据副本的管理请求为修改原始数据的数据副本的资源属性;
    所述处理器具体用于:
    若所述一致性要求为无一致性,则确定所述原始数据的第二副本数据的管理方式为修改所述原始数据的第二副本数据的指定属性值;
    若所述一致性要求为最终一致性,则判断所述Remote CSE中是否存在所述原始数据的第二副本数据,若判断结果为是,则根据所述管理请求中携带的所述原始数据的第一副本数据的最新版本号判断所述第二副本数据是否为最新版本,若所述第二副本数据不是最新版本则确定所述第二副本数据的管理方式为根据所述第一副本数据的属性值修改所述第二副本数据的指定属性值;
    若所述一致性要求为严格一致性,则确定所述原始数据的第二副本数据的管理方式为根据所述第一副本数据的属性值修改所述第二副本数据的指定属性值。
  46. 一种数据处理系统,其特征在于,包括:如权利要求31-38任一项所 述的第一公共服务实体,以及如权利要求39-45任一项所述的第二公共服务实体。
PCT/CN2015/079811 2015-05-26 2015-05-26 一种数据处理方法及装置 WO2016187805A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/CN2015/079811 WO2016187805A1 (zh) 2015-05-26 2015-05-26 一种数据处理方法及装置

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2015/079811 WO2016187805A1 (zh) 2015-05-26 2015-05-26 一种数据处理方法及装置

Publications (1)

Publication Number Publication Date
WO2016187805A1 true WO2016187805A1 (zh) 2016-12-01

Family

ID=57392436

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2015/079811 WO2016187805A1 (zh) 2015-05-26 2015-05-26 一种数据处理方法及装置

Country Status (1)

Country Link
WO (1) WO2016187805A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109101617A (zh) * 2018-08-08 2018-12-28 南京南瑞继保电气有限公司 一种面向多应用的继电保护信息共享方法

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7178055B2 (en) * 2003-06-06 2007-02-13 Hewlett-Packard Development Company, L.P. Method and system for ensuring data consistency after a failover event in a redundant data storage system
CN101187931A (zh) * 2007-12-12 2008-05-28 浙江大学 分布式文件系统多文件副本的管理方法
CN103577047A (zh) * 2013-11-05 2014-02-12 北京国双科技有限公司 用于数据网格控件的水平滚动条的显示处理方法和装置

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7178055B2 (en) * 2003-06-06 2007-02-13 Hewlett-Packard Development Company, L.P. Method and system for ensuring data consistency after a failover event in a redundant data storage system
CN101187931A (zh) * 2007-12-12 2008-05-28 浙江大学 分布式文件系统多文件副本的管理方法
CN103577047A (zh) * 2013-11-05 2014-02-12 北京国双科技有限公司 用于数据网格控件的水平滚动条的显示处理方法和装置

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
ZHOU, HUAN ET AL.: "Consistency and Availability in OceanBase", JOURNAL OF EAST CHINA NORMAL UNIVERSITY ( NATURAL SCIENCES, 30 September 2014 (2014-09-30), pages 105, ISSN: 1000-5641 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109101617A (zh) * 2018-08-08 2018-12-28 南京南瑞继保电气有限公司 一种面向多应用的继电保护信息共享方法

Similar Documents

Publication Publication Date Title
US20220217203A1 (en) Peer-To-Peer Syncable Storage System
US20180063879A1 (en) Apparatus and method for interoperation between internet-of-things devices
JP4465637B2 (ja) プロキシ・サーバ、通信システム、通信方法及びプログラム
EP2180663A1 (en) Trickle sync protocol
JP6700308B2 (ja) データ・コピー方法及びデバイス
WO2018000653A1 (zh) M2m应用的信息方法、cse及ae
WO2014180438A1 (zh) M2m应用的远程注册方法、装置、系统及存储介质
US20160241635A1 (en) M2m data querying and invoking methods, querying and invoking devices, and system
JP2019519975A (ja) リソースサブスクリプション方法、リソースサブスクリプション装置、及びリソースサブスクリプションシステム
TW201735586A (zh) 路由表的同步方法、裝置及系統
WO2015117391A1 (zh) 一种实现资源属性通告的方法和公共业务实体
KR20200005492A (ko) 리소스 관리 방법 및 장치
WO2015168981A1 (zh) 属性的操作方法及装置
KR20140047230A (ko) 분산 시스템에서 분산 트랜잭션의 최적화를 위한 방법 및 트랜잭션을 최적화한 분산 시스템
CN110071964B (zh) 文件同步方法、装置、文件共享网络、文件共系统及存储介质
WO2015117463A1 (zh) 一种数据传输方法、第一cse、中间cse和第二cse
KR20170010300A (ko) M2m 시스템에서 요청 메시지를 처리하는 방법 및 그 장치
WO2016187805A1 (zh) 一种数据处理方法及装置
WO2018107838A1 (zh) 应用实体创建资源和注册方法、通信节点设备及终端设备
US11792627B2 (en) Method and apparatus for managing resources and performing resource offloading in M2M system
CN109299053B (zh) 文件的操作方法、设备和计算机存储介质
WO2017136979A1 (zh) 一种远程访问的实现方法、装置和系统
EP3425931B1 (en) Bluetooth low energy devices
KR101792331B1 (ko) M2M/IoT 플랫폼에서 트랜잭션 방법 및 시스템
JP2020123875A5 (zh)

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 15892886

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 15892886

Country of ref document: EP

Kind code of ref document: A1