Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [basyx-dev] Interact with multiple submodels

Dear Nicolas,

thank you very much for this profiling data.

> Is there a method to get the complete hashmap of a submodel/AAS in one call? (Does the Submodel API does that?)

You can for example do a direct call to .../submodel  (see https://wiki.eclipse.org/BaSyx_/_Documentation_/_API_/_Submodel) to directly retrieve the submodel with all its operations and dataElements. 
Currently, a call to getDataElements() retrieves all DataElements dynamically. In theory, you could cache these elements and thus save time. However, then there's the danger of missing the addition of a new element. In the future, when there's an event mechanism, this issue will be resolved. 

For now, it would also help to this collect this data in parallel. There's no need for collecting the data from each AAS/submodel in sequence. This should help reducing the time significantly.

Best regards,
Frank

----------------------------------------------------------------------------------
M.Sc. Frank Schnicke
Abteilung ESW
Fraunhofer IESE 
Fraunhofer-Platz 1 | 67663 Kaiserslautern 
Tel: +49 631 / 6800-2259 | Fax: +49 631 / 6800-9-2259
www.iese.fraunhofer.de 
Mail: frank.schnicke@xxxxxxxxxxxxxxxxxx


-----Ursprüngliche Nachricht-----
Von: basyx-dev-bounces@xxxxxxxxxxx <basyx-dev-bounces@xxxxxxxxxxx> Im Auftrag von Nicolas DUMINY
Gesendet: Freitag, 13. Dezember 2019 13:14
An: basyx-dev <basyx-dev@xxxxxxxxxxx>
Betreff: Re: [basyx-dev] Interact with multiple submodels

Dear BaSyx development team,

Here are some profiling results about the Dashboard.java buildJsonSnapshot() function I sent earlier:
- The query of the SQL registry took 136ms
- The parsing of the SQL result from registry (dirtyParseSQLGetAllAAS), took 13ms (almost negligible before the 30s total computational time).
- Getting all AAS one by one took 1.35s (the aasManager.retrieveAAS(aasId) calls in total)
- Getting all the submodels took 2.3s (the aasManager.retrieveSubModel(aasId, smId) calls in total)
- Getting all data elements took 16.4s (the for(IDataElement de : sm.getDataElements().values()) loops with all the de.get() calls)
- Getting all operations took 7.8s (the for (IOperation op : sm.getOperations().values()) loops with all op.getIdShort() calls)
- Over all of this, I have 6.6s of various overheads (creating the result hashmaps structures and putting the data in them + some calls to get id of submodels & AAS)

So the problem is not the SQL result parsing, it really is my structured method for getting all AAS/submodels data which doesn't scale at all.
Is there a method to get the complete hashmap of a submodel/AAS in one call? (Does the Submodel API does that?) Because it seems as my problem is that my method needs to query data from the API for each particular dataElement, instead of retrieving all data at once and then parse them locally in the dashboard service.

Best regards,


Nicolas Duminy

----- Mail original -----
De: "Frank Schnicke" <Frank.Schnicke@xxxxxxxxxxxxxxxxxx>
À: "basyx-dev" <basyx-dev@xxxxxxxxxxx>
Envoyé: Vendredi 13 Décembre 2019 08:41:56
Objet: Re: [basyx-dev] Interact with multiple submodels

Dear Nicolas,

> To precise my use case, I have 22 machines connected with one AAS and 
> 2 submodels each, the dashboard connects on request, and list all AAS, 
> submodels and their dataElements/operations, in a simplified JSON format. (machines can plug in/out so the dashboard don't have expectation on the AAS/submodels connected) The source code for my dashboard application is in the attachment (ignore the PerformanceTimer and its calls in the source, only used to measure time spent on each call).
> The method called by the servlet is buildJsonSnapshot(), it takes about 30s to complete.
> Can you tell me which calls or methods do you think are inefficient, and how should I change them?

Did you do additional profiling to pin point where in buildJsonSnapshot() the time is spent? One problem could be the dirtyParseSQLGetAllAAS(). You are using direct string concatenation instead of a string builder. Concatenating strings with "+" requires a complete copying of the two strings (see https://dzone.com/articles/string-concatenation-performacne-improvement-in-ja). 
Depending on the size and the numbers of the strings you are copying, this may take some time. 


> To be also more precise about starting/stopping all connected machines quickly, I mean the calls should take a couple of seconds or less, I don't expect 1ms response time.
Again, can you do some profiling to see where this time is spent?


> On another note, does BaSyx intend to add other communication patterns 
> in the future? Like publisher/subscriber to use for example to advertise the connection of a new AAS/submodel, or changes of dataElements values?

Plattform Industrie 4.0 is currently standardizing events for the Asset Administration Shell. These events then will be used e.g. to propagate the change of DataElements. Events send by the registry will also be a possibility in the future. However, this may take some time until standardization and implementation is finished.

Best regards,
Frank

----------------------------------------------------------------------------------
M.Sc. Frank Schnicke
Abteilung ESW
Fraunhofer IESE
Fraunhofer-Platz 1 | 67663 Kaiserslautern
Tel: +49 631 / 6800-2259 | Fax: +49 631 / 6800-9-2259 www.iese.fraunhofer.de
Mail: frank.schnicke@xxxxxxxxxxxxxxxxxx

-----Ursprüngliche Nachricht-----
Von: basyx-dev-bounces@xxxxxxxxxxx <basyx-dev-bounces@xxxxxxxxxxx> Im Auftrag von Nicolas DUMINY
Gesendet: Donnerstag, 12. Dezember 2019 16:37
An: basyx-dev <basyx-dev@xxxxxxxxxxx>
Betreff: Re: [basyx-dev] Interact with multiple submodels

Dear BaSyx development team,

To precise my use case, I have 22 machines connected with one AAS and 2 submodels each, the dashboard connects on request, and list all AAS, submodels and their dataElements/operations, in a simplified JSON format. (machines can plug in/out so the dashboard don't have expectation on the AAS/submodels connected) The source code for my dashboard application is in the attachment (ignore the PerformanceTimer and its calls in the source, only used to measure time spent on each call).
The method called by the servlet is buildJsonSnapshot(), it takes about 30s to complete.
Can you tell me which calls or methods do you think are inefficient, and how should I change them?

To be also more precise about starting/stopping all connected machines quickly, I mean the calls should take a couple of seconds or less, I don't expect 1ms response time.

On another note, does BaSyx intend to add other communication patterns in the future? Like publisher/subscriber to use for example to advertise the connection of a new AAS/submodel, or changes of dataElements values?

Best regards,


Nicolas Duminy

----- Mail original -----
De: "Frank Schnicke" <Frank.Schnicke@xxxxxxxxxxxxxxxxxx>
À: "basyx-dev" <basyx-dev@xxxxxxxxxxx>
Envoyé: Jeudi 12 Décembre 2019 08:26:18
Objet: Re: [basyx-dev] Interact with multiple submodels

Dear Nicolas,

> Can you tell me what is the fastest way to get all registered data 
> elements of all submodels? (HTTP-REST calls? VAB crud calls? Using the ConnectedAdministrationShell calls?) I need, for a dashboard application, to request all data elements from every submodels, but it is really slow.

The VAB crud calls/the Connected* classes have little overhead in comparison to http-REST calls, so any option should be fine. What exactly is slow? Retrieving the AAS, retrieving their submodels or retrieving the data elements? There are explicit API calls for data element retrieval (https://wiki.eclipse.org/BaSyx_/_Documentation_/_API_/_Submodel). Are you using these?


> I am trying to build a manager application for a complete factory, which can start or stop all machines connected in the factory (the operations must be quickly applied).

What exactly are you aiming at with this start/stop of machines and why does it need to be applied quickly? If there's any real-time requirement involved here, maybe a dashboard is not the best solution. 


> Is there a built-in way in BaSyx to get all submodels of a specific type? (e.g. get all control component submodels).

Currently, there's no built-in way to do this. What we are planning to do is to implement a tagged directory where it will be possible to retrieve all AAS or submodels with a certain tag (e.g. "ControlComponentContaining", "Device"). 


> How do we differentiate and describe submodel types and instances for this purpose?

The meta-model of the AAS and submodels defines the "HasKind" qualifier. This qualifier allows to define if the current entity is a type or an instance. 

Best regards,
Frank

----------------------------------------------------------------------------------
M.Sc. Frank Schnicke
Abteilung ESW
Fraunhofer IESE
Fraunhofer-Platz 1 | 67663 Kaiserslautern
Tel: +49 631 / 6800-2259 | Fax: +49 631 / 6800-9-2259 www.iese.fraunhofer.de
Mail: frank.schnicke@xxxxxxxxxxxxxxxxxx

-----Ursprüngliche Nachricht-----
Von: basyx-dev-bounces@xxxxxxxxxxx <basyx-dev-bounces@xxxxxxxxxxx> Im Auftrag von Nicolas DUMINY
Gesendet: Mittwoch, 11. Dezember 2019 19:22
An: basyx-dev <basyx-dev@xxxxxxxxxxx>
Betreff: [basyx-dev] Interact with multiple submodels

Dear BaSyx development team,

Can you tell me what is the fastest way to get all registered data elements of all submodels? (HTTP-REST calls? VAB crud calls? Using the ConnectedAdministrationShell calls?) I need, for a dashboard application, to request all data elements from every submodels, but it is really slow.

I am trying to build a manager application for a complete factory, which can start or stop all machines connected in the factory (the operations must be quickly applied).
Is there a built-in way in BaSyx to get all submodels of a specific type? (e.g. get all control component submodels) How do we differentiate and describe submodel types and instances for this purpose?

Best regards,


Nicolas Duminy
_______________________________________________
basyx-dev mailing list
basyx-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/basyx-dev
_______________________________________________
basyx-dev mailing list
basyx-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/basyx-dev
_______________________________________________
basyx-dev mailing list
basyx-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/basyx-dev
_______________________________________________
basyx-dev mailing list
basyx-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/basyx-dev

Back to the top