CN109446439B - Resource directory selection method, device, system and storage medium - Google Patents

Resource directory selection method, device, system and storage medium Download PDF

Info

Publication number
CN109446439B
CN109446439B CN201811154462.3A CN201811154462A CN109446439B CN 109446439 B CN109446439 B CN 109446439B CN 201811154462 A CN201811154462 A CN 201811154462A CN 109446439 B CN109446439 B CN 109446439B
Authority
CN
China
Prior art keywords
resource
resource directory
directory
server
cloud platform
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201811154462.3A
Other languages
Chinese (zh)
Other versions
CN109446439A (en
Inventor
梁海山
赵峰
徐志方
刘超
尹德帅
王方前
茹昭
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Qingdao Haier Technology Co Ltd
Original Assignee
Qingdao Haier Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Qingdao Haier Technology Co Ltd filed Critical Qingdao Haier Technology Co Ltd
Priority to CN201811154462.3A priority Critical patent/CN109446439B/en
Publication of CN109446439A publication Critical patent/CN109446439A/en
Application granted granted Critical
Publication of CN109446439B publication Critical patent/CN109446439B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/51Discovery or management thereof, e.g. service location protocol [SLP] or web services

Abstract

The invention discloses a method, a device and a system for selecting a resource catalog and a storage medium.

Description

Resource directory selection method, device, system and storage medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method, an apparatus, a system, and a computer-readable storage medium for selecting a Resource Directory (RD).
Background
In the OCF architecture, entities are represented by resources. Entities are exposed as "resources," have unique URIs, and support interfaces for querying, updating, deleting, etc. resources. Each operation has an initiator (client) and a responder (server). The discovery in existing OCFs is mainly through the use of resource directories as intermediaries. The device with resources issues the resources to a Resource Directory (RD), and the Resource Directory responds to the query of the client instead of the issuing device.
In existing methods for selecting a resource directory based on a Bias factor (Bias factor), the Bias factor is a positive number generated by the resource directory device and is in the range of 0 to 100, where 0 is the lowest and 100 is the highest. However, in the existing scheme, a specific calculation method for the deviation factor is not given, so that the existing method for selecting the resource catalog based on the deviation factor is not accurate, but the existing method can only be used for writing by a manufacturer when the equipment leaves a factory, but if the deviation factors are all set to be a numerical value, the meaning of selecting the resource catalog is lost.
Disclosure of Invention
The invention provides a method, a device and a system for selecting a resource directory and a computer readable storage medium, which aim to solve the problem that the method for selecting the resource directory based on a deviation factor in the prior art is inaccurate.
The first aspect of the present invention provides a method for selecting a resource directory, which is applied to a server device having resources, and includes: judging whether the network is connected or not; if not, performing weighted calculation through preset weight parameters according to the local resource catalog, and determining the resource catalog of the issued resource according to the weighted calculation result; if yes, sending a request for determining a resource catalog for publishing resources to the cloud platform, and receiving the resource catalog for publishing resources determined by the cloud platform.
Preferably, the method further comprises the following steps: automatically setting the preset weight parameters according to preset rules; or, the preset weight parameter is set according to the use environment.
Preferably, the resource directory of the release resource determined by the cloud platform is a resource directory of the release resource determined by the cloud platform through weighting calculation according to a preset weight parameter.
Preferably, the receiving the resource catalog of the publishing resources determined by the cloud platform includes: and receiving the device identifier ID of the device of the resource directory sent by the cloud platform.
The second aspect of the present invention provides a resource directory selection method, which is applied to a cloud platform, and includes: receiving a request for determining a resource directory of a publishing resource sent by a server; and performing weighted calculation according to a pre-stored resource directory and a preset weight parameter, determining the resource directory of the issued resource according to a weighted calculation result, and sending the resource directory to a server.
Preferably, the method further comprises the following steps: registering and storing the resource directory transmitted by the equipment;
according to the pre-stored resource catalog, the weighting calculation is carried out through the preset weighting parameters, and the resource catalog of the issued resource is determined according to the weighting calculation result, which comprises the following steps: and acquiring the resource directory in the same local area network with the server according to the registered resource directory, performing weighting calculation according to preset weighting parameters, and determining the resource directory with a larger weighting calculation result as the resource directory of the issued resource.
Preferably, the method further comprises the following steps: receiving a periodic updating result of the resource directory sent by the equipment;
and updating the stored resource directory according to the periodic updating result of the resource directory.
Preferably, the method further comprises the following steps: automatically setting the preset weight parameters according to preset rules; or, the preset weight parameter is set according to the use environment.
Preferably, the sending the resource directory to a server includes: and sending the device identifier ID of the device in the determined resource directory to the server.
A third aspect of the present invention provides an apparatus for selecting a resource directory, the apparatus comprising:
the judging unit is used for judging whether the network is connected or not, if not, the first processing unit is accessed, and if yes, the second processing unit is accessed;
the first processing unit is used for performing weighted calculation through a preset weight parameter according to a local resource directory and determining a resource directory of the issued resource according to a weighted calculation result;
the second processing unit is configured to send a request for determining a resource directory for publishing resources to a cloud platform, and receive the resource directory for publishing resources determined by the cloud platform.
Preferably, the apparatus further comprises: the first setting unit is used for automatically setting the preset weight parameters according to preset rules; or, the preset weight parameter is set according to the use environment.
Preferably, the second processing unit is specifically configured to send a request for determining to publish a resource directory of a resource to a cloud platform, and receive a device identifier ID of a device of the resource directory sent by the cloud platform.
A fourth aspect of the present invention provides a device for selecting a resource directory, including:
the receiving unit is used for receiving a request which is sent by the server and used for determining the resource catalogue of the release resource;
and the computing unit is used for performing weighted computation according to the pre-stored resource catalog and preset weight parameters, determining the resource catalog of the issued resource according to the weighted computation result, and sending the resource catalog to the server.
Preferably, the method further comprises the following steps: the registration unit is used for registering and storing the resource directory transmitted by the equipment;
the computing unit is specifically configured to obtain a resource directory in the same local area network as the server according to the registered resource directory, perform weighting computation according to a preset weighting parameter, and determine the resource directory with a larger weighting computation result as the resource directory of the issued resource.
Preferably, the registering unit is further configured to receive a periodic update result of the resource directory sent by the device, and update the stored resource directory according to the periodic update result of the resource directory.
Preferably, the apparatus further comprises: the second setting unit is used for automatically setting the preset weight parameters according to preset rules; or, the preset weight parameter is set according to the use environment.
Preferably, the computing unit is further configured to send the device identifier ID of the device in the determined resource directory to the server.
A fifth aspect of the present invention provides a system for selecting a resource directory, including:
the server is used for judging whether the server is networked or not; if not, performing weighted calculation through preset weight parameters according to the local resource catalog, and determining the resource catalog of the issued resource according to the weighted calculation result; if so, sending a request for determining a resource catalog for publishing resources to a cloud platform, and receiving the resource catalog for publishing resources determined by the cloud platform;
registering the equipment serving as the resource catalog to the cloud platform, and sending an updating result to the cloud platform according to a preset period;
and the cloud platform is used for acquiring the resource directory in the same local area network as the server according to the registered resource directory, performing weighting calculation according to preset weighting parameters, determining the resource directory of the issued resource according to the weighting calculation result, and sending the determined resource directory to the server.
A sixth aspect of the invention provides a computer-readable storage medium storing a signal-mapped computer program which, when executed by at least one processor, performs the selection of a resource directory as described in any one of the first aspects of the invention.
A seventh aspect of the invention provides a computer-readable storage medium storing a signal-mapped computer program which, when executed by at least one processor, enables selection of a resource directory as claimed in any one of the second aspects of the invention.
The invention has the following beneficial effects:
according to the method, the server performs weighted calculation on the resource catalog according to the preset weight parameters, determines the resource catalog of the published resource according to the weighted calculation, or determines the resource catalog of the published resource through performing weighted calculation on the resource catalog according to the preset weight parameters by the networked receiving cloud platform, so that the resource catalog can be accurately selected, and the problem that the method for selecting the resource catalog based on the deviation factor in the prior art is inaccurate is effectively solved.
Drawings
Fig. 1 is a flowchart illustrating a method for selecting a resource directory RD according to a first embodiment of the present invention;
fig. 2 is a flowchart illustrating another method for selecting a resource directory RD according to a first embodiment of the present invention;
fig. 3 is a flowchart illustrating a method for selecting a resource directory RD according to a first embodiment of the present invention;
fig. 4 is a flowchart illustrating a method for selecting a resource directory RD according to a first embodiment of the present invention;
fig. 5 is a flowchart illustrating a method for selecting a resource directory RD according to a second embodiment of the present invention;
fig. 6 is a flowchart illustrating a method for selecting a resource directory RD according to a second embodiment of the present invention;
fig. 7 is a schematic structural diagram of a server according to a third embodiment of the present invention;
fig. 8 is a schematic structural diagram of a server according to a fourth embodiment of the present invention.
Detailed Description
In order to solve the problem that a method for selecting a resource directory based on a deviation factor is inaccurate in the prior art, the invention provides a method for selecting a resource directory RD. The present invention will be described in further detail below with reference to the drawings and examples. It should be understood that the specific embodiments described herein are merely illustrative of the invention and do not limit the invention.
A first embodiment of the present invention provides a method for selecting a resource directory RD, which is applied to a server, that is, a server device having resources, and referring to fig. 1, the method includes:
step S101, judging whether the mobile terminal is networked or not, if not, entering step S102, and if so, entering step S103;
step S102, performing weighted calculation through a preset weight parameter according to a local resource directory, and determining a resource directory of a release resource according to a weighted calculation result;
step S103, sending a request for determining a resource catalog of the release resource to the cloud platform, and receiving the resource catalog of the release resource determined by the cloud platform.
That is to say, in the embodiment of the present invention, the server performs weighted calculation on the resource directory according to the preset weight parameter to determine the resource directory of the published resource, or determines the resource directory of the published resource by performing weighted calculation on the resource directory according to the preset weight parameter through the networked receiving cloud platform, so that the resource directory is accurately selected, and the problem that the method for selecting the resource directory based on the deviation factor in the prior art is inaccurate is effectively solved.
On the other hand, the embodiment of the invention automatically performs weighting calculation on the resource directory according to the preset weight parameter, so that the method and the device can effectively improve the efficiency of determining the resource directory. Therefore, the problem that in the prior art, when a large number of devices exist, the processing efficiency of the whole system is low due to the fact that the weighting coefficients are manually configured by a user is effectively solved.
Generally speaking, the core of the embodiment of the invention is that in the networking condition, when the server can interact with the cloud platform, the resource catalog is selected by default in a cloud platform mode, so that the working complexity of the server can be reduced, and when the server is not networked, the weight parameters are selected locally in the server so as to select the resource catalog.
In the embodiment of the invention, under the condition that the server is not networked, the server automatically sets the preset weight parameter according to a preset rule, or sets the preset weight parameter according to a use environment.
In practical implementation, the preset rule of the present invention may be a default recommended weight parameter, for example, the weight parameter of the power source is set to be 25%, the weight parameter of the mobility is set to be 10%, the weight parameter of the network is set to be 30%, the weight parameter of the memory is set to be 25%, the weight parameter of the load factor currently requested by the resource directory is set to be 10%, and the like. Or may be a series of recommended weight parameters set for different situations.
The default recommended weight parameter may be set by the user when the server is configured, or may be set by the user at the time of factory shipment of the device, and the user may select and use a certain recommended weight parameter as needed.
The setting of the weight parameters according to the environment in the embodiment of the present invention means that a user can customize some modes according to the use environment of the device and set default weight parameters for the modes. For example, if a device is used in a factory, the factory mode may be set, and the weight parameter occupied by the power supply may be reduced, so that all the devices set to the factory mode perform calculation using the set weight parameter, and the resource directory to be finally used is selected.
The actual implementation of these two weighting factor selections is determined by an attribute named local _ wei _ choose, which has two values 0 and 1, where 0 represents the automatic setting of the weighting parameter and 1 represents the setting of the weighting parameter according to the environment. The server selects a corresponding weight parameter calculation method by setting the attribute value.
That is, in the implementation, a person skilled in the art can set a series of setting modes of the weight parameters according to different environments and various application scenarios, so as to facilitate the user to select and use the setting modes.
Because the invention defines the determination mode of the weight parameter, the resource catalogue can be accurately selected based on the deviation factor, and the problem of unclear calculation method of the deviation factor is effectively avoided.
In a specific implementation, in the embodiment of the present invention, the resource directory of the release resource determined by the cloud platform is received, and the resource directory of the release resource determined by the cloud platform through weighting calculation according to the preset weight parameter is received.
Specifically, the cloud platform according to the embodiment of the present invention obtains a resource directory that meets the server requirements based on a request of the server, and sends the resource directory to the server.
Moreover, the server in the embodiment of the present invention receives the device identifier ID of the device of the resource directory sent by the cloud platform, and issues the resource on the device.
Fig. 2 is a schematic flowchart of another method for selecting a resource directory RD according to a first embodiment of the present invention, and fig. 3 is a schematic flowchart of another method for selecting a resource directory RD according to a first embodiment of the present invention, as shown in fig. 2 and 3, including:
the server issues a multicast request aiming at the '/oic/rd' resource in the local area network;
the equipment which exposes the "/oic/rd" resource, namely the equipment which can be used as a resource directory responds to the request of the server and returns the relevant parameters to the server in response;
after receiving the response, the server performs weighted calculation on each parameter in the response according to the recommended default weight setting or the environment weight setting;
and the server issues own resources to the equipment corresponding to the larger one in the calculation results, and the resource issuing is completed.
Fig. 4 is a flowchart illustrating a method for selecting a resource directory RD according to a first embodiment of the present invention, as shown in fig. 4, including:
in practice, the server may directly select locally when selecting the resource directory, or may select through the cloud platform. When the server is networked and can interact with the cloud platform, the resource catalog is selected by default in a cloud platform mode, so that the working complexity of the server can be reduced; when the server is not networked, the resource directory can be selected only by locally selecting the weighting coefficient, and the overall process of selecting the resource directory in the embodiment of the invention comprises the following steps:
when the server is not networked, the server cannot interact with the cloud platform:
the server issues a multicast request aiming at the/o i c/rd resource in the local area network;
the equipment which exposes the "/o i c/rd" resource, namely the equipment which can be used as a resource directory responds to the request of the server and returns the relevant parameters to the server in response;
after receiving the response, the server performs weighted calculation on each parameter in the response according to the recommended default weight setting or the environment weight setting;
and the server issues own resources to the equipment corresponding to the larger one in the calculation results, and the resource issuing is completed.
When the server is networked and can interact with the cloud platform, the overall process of selecting the resource catalog in the embodiment of the invention comprises the following steps:
the server sends a request for selecting the resource catalog to the cloud platform;
the cloud platform finds out equipment which can be used as a resource directory in the local area network according to whether the registered equipment contains the "/o i c/rd" resource or not, and obtains relevant parameters of the equipment;
the cloud platform selects one of two weight setting strategies and performs weighted calculation on the related parameters;
the cloud platform returns the device i d of the device with the larger calculation result as a response to the server;
after receiving the response, the server issues its resource to the device corresponding to the device i d, and completes the selection of the resource directory.
A second embodiment of the present invention provides a method for selecting a resource directory RD, which is applied to a cloud platform, and referring to fig. 5, the method includes:
s501, receiving a request for determining a resource directory of a release resource sent by a server;
s502, according to the pre-stored resource catalog, carrying out weighted calculation through preset weight parameters, determining the resource catalog of the issued resource according to the weighted calculation result, and sending the resource catalog to the server.
According to the embodiment of the invention, the cloud platform is used for selecting the resource catalog, so that the working complexity of the server is reduced, and the cloud platform is used for determining the resource catalog of the release resource by performing weighted calculation on the resource catalog according to the preset weight parameter, so that the resource catalog can be accurately selected, and the problem that the method for selecting the resource catalog based on the deviation factor in the prior art is inaccurate is effectively solved.
The method of the embodiment of the invention also comprises the following steps: and registering and storing the resource directory transmitted by the equipment.
Note that the device is a device that serves as a resource directory.
That is to say, to implement the resource directory selection through the cloud, the resource directory needs to be connected with the cloud first, and the relevant attribute parameters of the resource directory need to be issued to the cloud platform, so as to implement the registration of the cloud platform. Since each device has a unique Identifier (ID) and a MAC address, the cloud platform can obtain the relevant information of the device by looking up the device ID or the MAC address.
The equipment which can be used as a resource directory needs to expose '/oic/rd' resources, and by searching the resources, the cloud platform can know which equipment in a certain local area network can be used as the resource directory, and simultaneously acquire the IDs of the equipment, so that the relevant parameters of the resource directory can be acquired.
In the embodiment of the present invention, performing weighted calculation according to a pre-stored resource directory by using a preset weight parameter, and determining a resource directory with a larger weighted calculation result as a resource directory for publishing resources includes: and acquiring a resource directory which is in the same local area network with the server according to the registered resource directory, performing weighting calculation through a preset weighting parameter, and determining the resource directory with a larger weighting calculation result as the resource directory of the release resource.
Since the relevant parameters of the resource directory are constantly changing, such as the memory, the resource directory needs to periodically update the parameter information to the cloud. The cloud platform receives a periodic updating result of the resource directory sent by the equipment, and updates the stored resource directory according to the periodic updating result of the resource directory.
If one server side wants to realize the selection of the resource catalog through the cloud platform, a request for selecting the resource catalog is sent to the cloud platform, the cloud platform can find the equipment which is positioned under the same local area network as the server side and can be used as the resource catalog through the IP address of the server, then the cloud platform can obtain the relevant parameter information of the equipment for weighting, and the selection of the weighting coefficient is consistent with the local selection method. After the weighting calculation is finished, the cloud platform compares the weighting calculation results of the resource directories, selects the resource directory with a larger result, and returns the device id of the resource directory to the server as a response. After receiving the response, the server discovers the corresponding resource directory by using an endpoint discovery mode in the OCF, and issues the resource to the resource directory, so that the selection of the resource directory is completed.
In the embodiment of the present invention, the cloud platform may automatically set the preset weight parameter according to a preset rule, or set the preset weight parameter according to a use environment.
In practical implementation, the preset rule of the present invention may be a default recommended weight parameter, for example, the weight parameter of the power source is set to be 25%, the weight parameter of the mobility is set to be 10%, the weight parameter of the network is set to be 30%, the weight parameter of the memory is set to be 25%, the weight parameter of the load factor currently requested by the resource directory is set to be 10%, and the like.
It should be noted that the default recommended weight parameter may be set by the user when configuring the server.
Setting the weight parameters according to the environment means that a user can customize some modes according to the use environment of the equipment and set default weight parameters for the modes. For example, as described above, if a device is used in a factory, the factory mode may be set, and the weight parameter occupied by the power supply may be reduced, so that all the devices set to the factory mode perform calculation using the set weight parameter, and the resource directory to be finally used is selected.
The actual implementation of these two weighting factor selections is determined by an attribute named local _ wei _ choose, which has two values 0 and 1, 0 representing the automatic setting of the weighting parameters and 1 representing the setting of the weighting parameters according to the environment. The server selects a corresponding weight parameter calculation method by setting the attribute value.
Of course, in the implementation, a person skilled in the art may set a series of setting modes of the weight parameter according to different environments and various application scenarios, so as to facilitate the user to select and use the setting modes.
Fig. 6 is a flowchart illustrating a method for selecting a resource directory RD according to a second embodiment of the present invention, as shown in fig. 6, the method includes:
the server registers and stores the resource directory sent by the equipment;
the server sends a request for selecting the resource directory to the cloud platform;
the cloud platform finds out equipment which can be used as a resource directory in the local area network according to whether the registered equipment contains "/oic/rd" resources, and obtains relevant parameters of the equipment;
the cloud platform selects one of two weight setting strategies and performs weighted calculation on the related parameters;
the cloud platform returns the device id of the device with the larger calculation result to the server as a response;
and the server releases own resources to the equipment corresponding to the equipment id after receiving the response, and completes the selection of the resource directory.
A third embodiment of the present invention provides a server, referring to fig. 7, the apparatus including:
the judging unit is used for judging whether the network is connected or not, if not, the first processing unit is accessed, and if yes, the second processing unit is accessed;
the first processing unit is used for performing weighted calculation through a preset weight parameter according to a local resource directory and determining a resource directory of a release resource according to a weighted calculation result;
the second processing unit is configured to send a request for determining a resource directory for publishing resources to a cloud platform, and receive the resource directory for publishing resources determined by the cloud platform.
That is to say, the embodiment of the present invention determines whether to perform networking through the determining unit, and if not, the first processing unit performs weighted calculation on the resource directory according to the preset weight parameter to determine the resource directory of the published resource, and if so, the second processing unit receives the resource directory of the published resource determined by performing weighted calculation on the resource directory according to the preset weight parameter by the cloud platform, so as to accurately select the resource directory, thereby effectively solving the problem that the method for selecting the resource directory based on the deviation factor in the prior art is inaccurate.
On the other hand, the embodiment of the invention automatically performs weighting calculation on the resource directory according to the preset weight parameter, so that the method and the device can effectively improve the efficiency of determining the resource directory. Therefore, the problem that in the prior art, when a large number of devices exist, the processing efficiency of the whole system is low due to the fact that the weighting coefficients are manually configured by a user is effectively solved.
Generally speaking, the core of the embodiment of the invention is that in the networking condition, when the server can interact with the cloud platform, the resource catalog is selected by default in a cloud platform mode, so that the working complexity of the server can be reduced, and when the server is not networked, the resource catalog is selected by selecting the weight parameters locally in the server.
In specific implementation, the apparatus according to the embodiment of the present invention further includes:
the first setting unit is used for automatically setting the preset weight parameter according to a preset rule; or, the preset weight parameter is set according to the use environment.
The preset rule of the present invention may be a default recommended weight parameter, for example, set the weight parameter of power supply to 25%, the weight parameter of mobility to 10%, the weight parameter of network to 30%, the weight parameter of memory to 25%, the weight parameter of load factor currently requested by the resource directory to 10%, etc. Or may be a series of recommended weight parameters set for different situations.
The default recommended weight parameter may be set by the user when the server is configured, or may be set in a unified manner when the device is shipped from a factory, and the user selects and uses a certain recommended weight parameter as needed.
The setting of the weight parameters according to the environment in the embodiment of the present invention means that a user can customize some modes according to the use environment of the device, and set default weight parameters for the modes. For example, if a device is used in a factory, the factory mode may be set, and the weight parameter occupied by the power supply may be reduced, so that all the devices set to the factory mode perform calculation using the set weight parameter, and the resource directory to be finally used is selected.
The actual implementation of these two weight coefficient selections is determined by an attribute named local _ wei _ choose, which has two values 0 and 1, 0 representing the automatic setting of the weight parameter and 1 representing the setting of the weight parameter according to the environment. The server selects a corresponding weight parameter calculation method by setting the attribute value.
That is, in the implementation, a person skilled in the art can set a series of setting modes of the weight parameters according to different environments and various application scenarios, so as to facilitate the user to select and use the setting modes.
Because the invention defines the determination mode of the weight parameter, the resource catalogue can be accurately selected based on the deviation factor, and the problem of unclear calculation method of the deviation factor is effectively avoided.
In this embodiment of the present invention, the second processing unit is specifically configured to send a request for determining to publish a resource directory of a resource to a cloud platform, and receive a device identifier ID of a device in the resource directory sent by the cloud platform.
Specifically, the cloud platform according to the embodiment of the present invention obtains a resource directory that meets the server requirements based on a request of the server, and sends the resource directory to the server.
Moreover, the server in the embodiment of the present invention receives the device identifier ID of the device of the resource directory sent by the cloud platform, and publishes the resource on the device.
The relevant content of the embodiments of the present invention can be understood by referring to the embodiments of the method of the present invention, and detailed description is not provided herein.
A fourth embodiment of the present invention provides a device for selecting a resource directory RD, referring to fig. 8, the device includes:
a receiving unit, which receives a request for determining a resource directory of a release resource sent by a server;
and the computing unit is used for performing weighted computation according to the pre-stored resource catalog and preset weight parameters, determining the resource catalog of the issued resource according to the weighted computation result, and sending the resource catalog to the server.
The embodiment of the invention selects the resource catalog through the cloud platform, reduces the working complexity of the server, and realizes accurate selection of the resource catalog because the cloud platform determines the resource catalog of the release resource by performing weighted calculation on the resource catalog according to the preset weight parameter, thereby effectively solving the problem that the method for selecting the resource catalog based on the deviation factor in the prior art is inaccurate.
In specific implementation, the apparatus in the embodiment of the present invention further includes: the registration unit is used for registering and storing the resource directory transmitted by the equipment;
the computing unit is specifically configured to obtain a resource directory in the same local area network as the server according to the registered resource directory, perform weighting computation according to a preset weighting parameter, and determine the resource directory with a larger weighting computation result as the resource directory of the issued resource.
That is to say, to implement the resource directory selection through the cloud, the resource directory needs to be connected to the cloud first, and the relevant attribute parameters of the resource directory are issued to the cloud platform, so as to implement the registration of the cloud platform. Since each device has a unique Identifier (ID), the cloud platform may obtain the relevant information of the device by looking up the device ID or the MAC address.
The equipment which can be used as a resource directory needs to expose '/oic/rd' resources, and by searching the resources, the cloud platform can know which equipment in a certain local area network can be used as the resource directory, and simultaneously acquire the IDs of the equipment, so that the relevant parameters of the resource directory can be acquired.
In the embodiment of the present invention, performing weighted calculation according to a pre-stored resource directory by using a preset weight parameter, and determining a resource directory with a larger weighted calculation result as a resource directory for publishing resources includes: and acquiring the resource directory in the same local area network with the server according to the registered resource directory, performing weighting calculation according to preset weighting parameters, and determining the resource directory with a larger weighting calculation result as the resource directory of the issued resource.
In this embodiment of the present invention, the registration unit is further configured to receive a periodic update result of the resource directory sent by the device, and update the stored resource directory according to the periodic update result of the resource directory.
Since the relevant parameters of the resource directory are constantly changing, such as the memory, the resource directory needs to periodically update the parameter information to the cloud. The cloud platform receives a periodic updating result of the resource directory sent by the equipment, and updates the stored resource directory according to the periodic updating result of the resource directory.
In the embodiment of the present invention, the apparatus further includes: the second setting unit is used for automatically setting the preset weight parameters according to preset rules; or, the preset weight parameter is set according to the use environment.
In this embodiment of the present invention, the computing unit is further configured to send the device identifier ID of the device in the determined resource directory to the server.
The relevant content of the embodiments of the present invention can be understood by referring to the embodiments of the method of the present invention, and detailed description is not repeated here.
A fifth embodiment of the present invention provides a system for selecting a resource directory RD, where the system includes:
the server is used for judging whether the server is networked or not; if not, performing weighted calculation through a preset weight parameter according to the local resource directory, and determining the resource directory of the release resource according to a weighted calculation result; if so, sending a request for determining a resource catalog for publishing resources to a cloud platform, and receiving the resource catalog for publishing resources determined by the cloud platform;
registering the equipment serving as the resource catalog to the cloud platform, and sending an updating result to the cloud platform according to a preset period;
and the cloud platform is used for acquiring the resource directory in the same local area network as the server according to the registered resource directory, performing weighting calculation according to preset weighting parameters, determining the resource directory of the issued resource according to the weighting calculation result, and sending the determined resource directory to the server.
The related content of the embodiments of the present invention can be understood by referring to the embodiments of the method and the apparatus of the present invention, and detailed description thereof is omitted here.
The method, the apparatus, and the system for selecting the resource directory in the foregoing embodiments may all be applied to the OCF, that is, the method, the apparatus, and the system for selecting the OCF resource directory.
A sixth embodiment of the invention provides a computer-readable storage medium storing a signal-mapped computer program which, when executed by at least one processor, implements a method comprising:
judging whether the network is connected or not;
if not, performing weighted calculation through preset weight parameters according to the local resource catalog, and determining the resource catalog of the issued resource according to the weighted calculation result;
if yes, sending a request for determining the resource catalog of the release resource to the cloud platform, and receiving the resource catalog of the release resource determined by the cloud platform.
The relevant content of the embodiments of the present invention can be understood by referring to the method embodiments, which are not described in detail herein.
A seventh embodiment of the invention provides a computer-readable storage medium storing a signal-mapped computer program which, when executed by at least one processor, implements a method comprising:
receiving a request for determining a resource directory of a publishing resource sent by a server;
and performing weighted calculation according to a pre-stored resource directory and a preset weight parameter, determining the resource directory of the issued resource according to a weighted calculation result, and sending the resource directory to a server.
The relevant content of the embodiments of the present invention can be understood by referring to the method embodiments, which are not described in detail herein.
Although the preferred embodiments of the present invention have been disclosed for illustrative purposes, those skilled in the art will appreciate that various modifications, additions and substitutions are possible, and the scope of the invention should not be limited to the embodiments described above.

Claims (19)

1. A resource directory selection method is applied to a server and comprises the following steps:
judging whether the network is connected or not;
if not, performing weighted calculation through preset weight parameters according to the local resource catalog, and determining the resource catalog of the issued resource according to the weighted calculation result;
if so, sending a request for determining a resource catalog for publishing resources to a cloud platform, and receiving the resource catalog for publishing resources determined by the cloud platform;
the resource directory of the released resource determined by the cloud platform is the resource directory which is obtained by the cloud platform according to the registered resource directory and is in the same local area network with the server, the resource directory with a larger weighted calculation result is determined as the resource directory of the released resource through weighting calculation according to preset weight parameters;
the method further comprises the following steps: and setting the preset weight parameter according to the use environment.
2. The method of claim 1, further comprising:
and automatically setting the preset weight parameters according to preset rules.
3. The method according to any one of claims 1-2, wherein receiving the resource catalog of published resources determined by the cloud platform comprises:
and receiving the device identifier ID of the device of the resource directory sent by the cloud platform.
4. A resource directory selection method is applied to a cloud platform and comprises the following steps:
receiving a request for determining a resource directory of a publishing resource sent by a server;
according to a pre-stored resource directory, performing weighted calculation through a preset weight parameter, determining a resource directory of a released resource according to a weighted calculation result, and sending the resource directory to a server;
according to the pre-stored resource catalog, the weighting calculation is carried out through the preset weighting parameters, and the resource catalog of the issued resource is determined according to the weighting calculation result, which comprises the following steps:
acquiring a resource directory in the same local area network as the server according to the registered resource directory, performing weighting calculation according to preset weighting parameters, and determining the resource directory with a larger weighting calculation result as a resource directory of the issued resource;
the method further comprises the following steps: and setting the preset weight parameter according to the use environment.
5. The method of claim 4,
further comprising: and registering and storing the resource directory transmitted by the equipment.
6. The method of claim 5, further comprising:
receiving a periodic updating result of the resource directory sent by the equipment;
and updating the stored resource directory according to the periodic updating result of the resource directory.
7. The method of claim 4, further comprising:
and automatically setting the preset weight parameters according to preset rules.
8. The method according to any one of claims 4-7, wherein sending the resource directory to a server comprises:
and sending the device identifier ID of the device in the determined resource directory to the server.
9. An apparatus for selecting a resource directory, comprising:
the judging unit is used for judging whether the network is connected or not, if not, the first processing unit is accessed, and if yes, the second processing unit is accessed;
the first processing unit is used for performing weighted calculation through a preset weight parameter according to a local resource directory and determining a resource directory of the issued resource according to a weighted calculation result;
the second processing unit is used for sending a request for determining a resource directory for publishing resources to the cloud platform and receiving the resource directory for publishing resources determined by the cloud platform;
the resource directory of the released resource determined by the cloud platform is the resource directory which is obtained by the cloud platform according to the registered resource directory and is in the same local area network with the server, the resource directory with a larger weighted calculation result is determined as the resource directory of the released resource through weighting calculation according to preset weight parameters;
further comprising:
and the setting unit is used for setting the preset weight parameters according to the use environment.
10. The apparatus of claim 9, further comprising:
and the setting unit is used for automatically setting the preset weight parameters according to preset rules.
11. The apparatus of claim 9 or 10,
the second processing unit is specifically configured to send a request for determining to publish a resource directory of a resource to a cloud platform, and receive a device identifier ID of a device of the resource directory sent by the cloud platform.
12. An apparatus for selecting a resource directory, comprising:
the receiving unit is used for receiving a request which is sent by the server and used for determining the resource catalogue of the release resource;
the computing unit is used for carrying out weighted computation through preset weight parameters according to a prestored resource directory, determining the resource directory of the issued resource according to the weighted computation and sending the resource directory to the server;
the computing unit is specifically configured to obtain a resource directory in the same local area network as the server according to the registered resource directory, perform weighting computation according to a preset weighting parameter, and determine the resource directory with a larger weighting computation result as a resource directory of the issued resource;
further comprising:
and the setting unit is used for setting the preset weight parameters according to the use environment.
13. The apparatus of claim 12,
further comprising: and the registration unit is used for registering and storing the resource directory transmitted by the equipment.
14. The apparatus of claim 13,
the registration unit is further configured to receive a periodic update result of the resource directory sent by the device, and update the stored resource directory according to the periodic update result of the resource directory.
15. The apparatus of claim 12, further comprising:
and the setting unit is used for automatically setting the preset weight parameters according to preset rules.
16. The apparatus according to any one of claims 12 to 15,
the computing unit is further configured to send the device identifier ID of the device in the determined resource directory to the server.
17. A system for selecting a resource directory, comprising:
the server is used for judging whether the server is networked or not; if not, performing weighted calculation through a preset weight parameter according to the local resource directory, and determining the resource directory of the release resource according to a weighted calculation result; if so, sending a request for determining a resource catalog for publishing resources to a cloud platform, and receiving the resource catalog for publishing resources determined by the cloud platform; the resource directory of the released resource determined by the cloud platform is the resource directory which is obtained by the cloud platform according to the registered resource directory and is in the same local area network with the server, the resource directory with a larger weighted calculation result is determined as the resource directory of the released resource through weighting calculation according to preset weight parameters;
registering the equipment serving as the resource catalog to the cloud platform, and sending an updating result to the cloud platform according to a preset period;
the cloud platform is used for acquiring a resource directory which is in the same local area network with the server according to the registered resource directory, performing weighting calculation through preset weighting parameters, determining a resource directory for issuing resources according to a weighting calculation result, and sending the determined resource directory to the server;
the preset weight parameter is set according to the use environment.
18. A computer-readable storage medium, characterized in that it stores a signal-mapped computer program which, when executed by at least one processor, implements the method for selecting a resource directory of any one of claims 1-3.
19. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a signal-mapped computer program which, when executed by at least one processor, implements the method for selecting a resource directory of any one of claims 4-8.
CN201811154462.3A 2018-09-30 2018-09-30 Resource directory selection method, device, system and storage medium Active CN109446439B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811154462.3A CN109446439B (en) 2018-09-30 2018-09-30 Resource directory selection method, device, system and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811154462.3A CN109446439B (en) 2018-09-30 2018-09-30 Resource directory selection method, device, system and storage medium

Publications (2)

Publication Number Publication Date
CN109446439A CN109446439A (en) 2019-03-08
CN109446439B true CN109446439B (en) 2022-09-06

Family

ID=65546127

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811154462.3A Active CN109446439B (en) 2018-09-30 2018-09-30 Resource directory selection method, device, system and storage medium

Country Status (1)

Country Link
CN (1) CN109446439B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113439427B (en) * 2019-07-24 2023-10-27 Oppo广东移动通信有限公司 Resource release method and device
CN113454586A (en) * 2019-07-24 2021-09-28 Oppo广东移动通信有限公司 Method and device for generating shadow device and storage medium

Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1968266A (en) * 2006-06-05 2007-05-23 华为技术有限公司 Resource management system and method for media resource server
CN102694849A (en) * 2012-05-14 2012-09-26 中国科学院计算机网络信息中心 IOT (Internet of Things) resource information acquiring method, terminal equipment and system
WO2014102325A1 (en) * 2012-12-28 2014-07-03 Koninklijke Kpn N.V. Emulating functionality for constrained devices
CN104601682A (en) * 2014-12-31 2015-05-06 北京海尔广科数字技术有限公司 Method for switching gateway of internet of things as well as associated device and system
CN104704794A (en) * 2012-10-05 2015-06-10 诺基亚技术有限公司 Method for proxying communication between content-centric network and internet domain
CN106134159A (en) * 2014-03-11 2016-11-16 康维达无线有限责任公司 Strengthen distributive resources list
WO2016210109A1 (en) * 2015-06-23 2016-12-29 Convida Wireless, Llc Mechanisms to support adaptive constrained application protocol (coap) streaming for internet of things (iot) systems
WO2017030943A1 (en) * 2015-08-14 2017-02-23 Convida Wireless, Llc Enhanced coap group communications with selective responses
CN106489144A (en) * 2014-04-28 2017-03-08 康维达无线有限责任公司 Search engine optimization for Resource TOC
CN106797392A (en) * 2014-07-22 2017-05-31 康维达无线有限责任公司 The issue and discovery of M2M IOT services
CN107046537A (en) * 2017-04-01 2017-08-15 上海润欣科技股份有限公司 A kind of discovery method that OCF clients based on DNS SD are serviced AllJoyn
CN107852430A (en) * 2015-07-06 2018-03-27 康维达无线有限责任公司 The wide-area services of Internet of Things are found
WO2018106985A1 (en) * 2016-12-09 2018-06-14 Convida Wireless, Llc Mechanisms for resource-directory to resource- directory communications

Patent Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1968266A (en) * 2006-06-05 2007-05-23 华为技术有限公司 Resource management system and method for media resource server
CN102694849A (en) * 2012-05-14 2012-09-26 中国科学院计算机网络信息中心 IOT (Internet of Things) resource information acquiring method, terminal equipment and system
CN104704794A (en) * 2012-10-05 2015-06-10 诺基亚技术有限公司 Method for proxying communication between content-centric network and internet domain
WO2014102325A1 (en) * 2012-12-28 2014-07-03 Koninklijke Kpn N.V. Emulating functionality for constrained devices
CN106134159A (en) * 2014-03-11 2016-11-16 康维达无线有限责任公司 Strengthen distributive resources list
CN106489144A (en) * 2014-04-28 2017-03-08 康维达无线有限责任公司 Search engine optimization for Resource TOC
CN106797392A (en) * 2014-07-22 2017-05-31 康维达无线有限责任公司 The issue and discovery of M2M IOT services
CN104601682A (en) * 2014-12-31 2015-05-06 北京海尔广科数字技术有限公司 Method for switching gateway of internet of things as well as associated device and system
WO2016210109A1 (en) * 2015-06-23 2016-12-29 Convida Wireless, Llc Mechanisms to support adaptive constrained application protocol (coap) streaming for internet of things (iot) systems
CN107852430A (en) * 2015-07-06 2018-03-27 康维达无线有限责任公司 The wide-area services of Internet of Things are found
WO2017030943A1 (en) * 2015-08-14 2017-02-23 Convida Wireless, Llc Enhanced coap group communications with selective responses
WO2018106985A1 (en) * 2016-12-09 2018-06-14 Convida Wireless, Llc Mechanisms for resource-directory to resource- directory communications
CN107046537A (en) * 2017-04-01 2017-08-15 上海润欣科技股份有限公司 A kind of discovery method that OCF clients based on DNS SD are serviced AllJoyn

Also Published As

Publication number Publication date
CN109446439A (en) 2019-03-08

Similar Documents

Publication Publication Date Title
US9398081B2 (en) Automating client development for network APIs
JP4806273B2 (en) Method and recording medium for discovering at least one of network settings and network resources
EP3557841A1 (en) Dns attack defense method, apparatus and system
KR101047875B1 (en) Object directory system with ip-based usn
CN109446439B (en) Resource directory selection method, device, system and storage medium
US20060224731A1 (en) Method for measuring server performance, system for measuring server performance and computer programs therefor
JP2005332220A5 (en)
RU2597511C2 (en) Creating maps of private spaces using sensors of mobile computing devices
TWI517737B (en) Indoor positioning method, indoor positioning system, and computer-readable medium
US20180034923A1 (en) Device discovery framework
CN112363775B (en) Method, system and storage medium for dynamically modifying microservice configuration information
US20210092073A1 (en) Resource trees by management controller
CN105425603A (en) Method and apparatus for controlling intelligent equipment
EP3777096A1 (en) Thing description to resource directory mapping
CN105376309B (en) Access gateway allocation method and device
WO2018129956A1 (en) Method and device for operating instance resources
US7587478B2 (en) Method and computer program product for measuring quality of network services
CN114518970A (en) High availability of dynamic asset model information views
US11449326B2 (en) Systems and methods for recomputing services
JP4351591B2 (en) Server system and server
US20170286540A1 (en) Local and remote execution of standing queries
KR101275995B1 (en) Data storing system and data processing method of informational household appliance
CN115329005A (en) Multi-cluster cooperation method, system, device and computer readable storage medium
JPH05134959A (en) Remote service execution control system
JP2011134005A (en) Configuration information management device, system, method and program for managing distributed information

Legal Events

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