Pengalaman dalam menciptakan solusi cloud untuk memantau kios digital di Azure IoT Central

Tentang tugas



Salah satu klien kami memiliki banyak kios swalayan di berbagai toko di seluruh negeri. Infokiosk adalah komputer dalam bentuk rak dengan monitor, yang tugasnya adalah memberikan informasi kepada seseorang tentang sesuatu. Tunjukkan rute di suatu tempat di mal, bantu Anda memilih sesuatu dari katalog produk, dan sebagainya. Infokiosk tidak harus berupa komputer yang berdiri sendiri, dapat dibuat menjadi mesin kopi atau bahkan pembersih. Terminal pesanan makanan di restoran cepat saji juga info kios.



Keinginan umum dari pemilik kios informasi adalah untuk memahami apa yang sebenarnya terjadi saat ini, apakah kios itu berfungsi atau tidak, dalam keadaan apa kios itu. Misalnya, apakah ada air di mesin kopi? Jika demikian, apa persediaannya?



Dalam kasus kami, tugas kios info hanya untuk membantu orang yang datang untuk memilih produk dari katalog dan mencetak barcode untuk pembayaran berikutnya untuk produk ini di kasir.

Masalahnya terletak pada kenyataan bahwa solusi seperti itu seringkali tidak memiliki sistem pemberitahuan untuk menghentikan pekerjaan karena berbagai alasan. Sebagai contoh, sebuah kios kadang-kadang kehabisan kaset, koneksi terputus, beberapa jenis kegagalan terjadi, dan sementara staf toko memperhatikan hal ini, pelanggan potensial akan melewati (paling-paling), atau bahkan mengolok-olok pengusaha yang lalai dalam jaringan.





, , , ( ). , , . , , , . !



«». , , , - . , , , , , , , , .



(« ?») «» :



  • , ?
  • , ? (, «SLA »)
  • ?


, , , , . , , , .



, , . – «». . «» - , .



— ( , ), — , email HelpDesk. «», – ( ) .



, «» , .



, , , . , , .



« »?



« » 20 . , , : , , .



20 – , , . . Microsoft, Microsoft, , . Microsoft, :



  • Microsoft IoT . PaaS, SaaS;
  • Microsoft Azure, ( !) . , ;
  • , , ;
  • . , , ;
  • ;
  • – ( ), , .


? , , , , .. , . « » – -. - , - . , , «», .



« » .



  1. , , . , . , , , , . , , . , , ? , , USB , .
  2. , (CapEx, ) , , (.. , OpEx).
  3. , , . Microsoft, , best practices, .. Design Sessions ( .. ), , . , , ?


, « » , , . , , : , « ». , , ( , «» ). , , , , , .



, -, .





Windows 10 IoT Enterprise LTSC (Long-term Servicing Channel). 10 , , , , , . . (https://www.quarta-embedded.ru/we/10/, https://habr.com/ru/company/quarta/blog/279521/), 3 «» .



, , .. , , «» ( : « ») .



Windows 10 IoT Enterprise LTSC Microsoft, , . , , Windows, , , Visual Studio.



, «» -, Microsoft IoT Central. , , , .



, , OEM-, , , , , : OEM- , . , . - -.



, .





:





, IoT Central , , , .



SaaS- IoT Central?



  • , ;
  • , ;
  • : , , ;
  • ( 30 );
  • : , . ;
  • ;
  • ;
  • , ;
  • , , ;
  • .


, IoT Central , : SDK . , , . . , .



Azure ( 5 ) IoT Central www.azureiotcentral.com, «» , «», .. .





«» « 1». « 2». «», – 4 . IoT Central JSON, .. , «» . 4 , .



« » «Custom application», «Custom Application (legacy)». Legacy- , , , .



IoT Central .azureiotcentral.com.

:





. IoT Central , .. . , , , , . . , , , « ».



: , , , – . , , , , - «»: .

:





IoT Central « ». . – - , / , . IoT Central , , «» «».



:



  • Device capability model (DCM): – , IoT Central, ;
  • Cloud properties: , , , (, - );
  • Customizations: «» , DCM, , ;
  • Views: , , .


DCM , , , :



  • , .. , ;
  • , , . , ;
  • , ( ).


. – IoT Central JSON .



, . .



IoT Central. JSON.



DCM :



  • Device Information: , , ..
  • Printer: , , ( ), ;
  • Paper: – , , ;
  • Performance: , «» : , ;
  • Commands: . , , .


(Views), , . , :





. , - , ( «»), , . «».



, « » «» :





, .



«» , «».



, .





, . .



«» . (. SampleApp.cs).



, . «», «» , « » « URL- (SAS)» « » SampleApp.cs:



static string scopeId = "...";
static string deviceId = "...";
static string key = "...";


Visual Studio . . , / .



:



  • SAS (Shared Access Signature), , , . . , «» ;
  • , «» , («Provisioning») , . , . , .


, . String.Format() Double JSON IoT Central. , , «,» «.», IoT Central . . , , telemetryStateEvent*.cs



String.Format(...)




String.Format(CultureInfo.InvariantCulture, ...)




using System.Globalization;


, , , .



, , . SaaS: .



, . , , , 9 .



«»



, , . , «», .



. 30 . : , .. , 5 , ( ) , .. . 30 000 / 4 = 7500 , , 250, 10 , 6 . 5 . :



  • ( ), .. 60 , 40, 20, ;
  • , 10 .


, .. . , , , .



, - , : , , «» . , , , , - .



, , ( !) , : . ( , – ) . .



, :



  • . WMI PerformanceCounter.

    :


public static string OSFriendlyName
{
    get
    {
        string result = string.Empty;
        ManagementObjectSearcher searcher = new ManagementObjectSearcher("SELECT Caption FROM Win32_OperatingSystem");
        foreach (ManagementObject os in searcher.Get())
        {
            result = os["Caption"].ToString();
            break;
        }
        return result;
    }
}


:



PerformanceCounter cpuCounter = new PerformanceCounter("Processor", "% Processor Time", "_Total");


:



cpuCounter.NextValue();


, .

WMI .



  • . , , USB . , :


PrintServer ps = new PrintServer();
pq = ps.GetPrintQueue(name);


,



pq.HasPaperProblem


  • , .
  • , IoT Central. -, , , , .




-, , - , , SAS, . , , , - .



IoT Central – Device Provisioning Service (DPS), :



  1. (Device ID), , . IoT Central , .
  2. (Scope ID). DPS IoT Hub, IoT Central, URL . , , SDK .
  3. . Base64.


DPS (connection.cs) :



using (var security = new SecurityProviderSymmetricKey(deviceId, deviceKey, deviceKey))
using (var transport = new ProvisioningTransportHandlerAmqp(TransportFallbackType.TcpOnly))
{
    var provClient = ProvisioningDeviceClient.Create("global.azure-devices-provisioning.net", scopeId, security, transport);
    DeviceRegistrationResult result = await provClient.RegisterAsync().ConfigureAwait(false);
    ...


( ) X.509, , , .



, SAS, , , . , SAS HMAC SHA256 , «» SAS. C# :



var hmac = new HMACSHA256(Convert.FromBase64String(sas_key));
var sig = hmac.ComputeHash(Encoding.ASCII.GetBytes(device_id));


sig , .



. , , . , , – DPAPI. , / . .., - – .



DPAPI .



, , «» IoT Central. :



  1. IoT Central «» — « » « » :




: IoT Central , , . IoT Central, , .2.



  1. connection.cs


var provClient = ProvisioningDeviceClient.Create("global.azure-devices-provisioning.net", scopeId, security, transport);
DeviceRegistrationResult result = await provClient.RegisterAsync().ConfigureAwait(false);


, JSON :



var data = new ProvisioningRegistrationAdditionalData();
data.JsonData = "{ \"iotcModelId\": \"URI\" }";
DeviceRegistrationResult result = await provClient.RegisterAsync(data).ConfigureAwait(false);


URI – . , IoT Central JSON .



"@id": "URI"


URI.



: Plug-and-Play . – SDK . .



, , . DPS? MAC- , , ? ( SAS) ? , .



, , , , « » , , SAS, « » .



Azure Functions: , . Azure Active Directory, Azure Key Vault. , , -, , . , :





. ( SDK ), (Device ID), , (Device Key) (Scope ID).



- 24/7



- , , . : .



- Windows, . , :



  1. , - .
  2. , .
  3. .


, .



-, . :



  1. - IoT Central , . .
  2. - , , « » ( ) .
  3. , . « » , , -.
  4. , .
  5. IoT Central.


, , .





– , – , .



, , . , ( – ), (, ).



, , IoT Central , . , , .





, , IoT Central . . .. , , IoT Central, , , .



, , . , , - . - , . - . .





, , - IPC.



, : -. , IoT Central , .





«» :



  • - IoT Central, , ;
  • Windows, IoT Central;
  • , -, . . Azure;
  • , - . , , IoT Central.


IoT Central Azure Functions, .



– . . :



  1. .
  2. . – , .
  3. , .
  4. , , , .


, .



.



, «» , :







IoT Central , .



«» . :





«» . , , . , .



, « », .





«» :





:





, . , , . .



IoT Central, , , , - . , - , , . – . , PaaS, , , , .



? ,



, . . , , - . , , - , , .



, IoT Central. . :



  1. , .. .
  2. . , , (, ), (, ..), , .
  3. . – . - , - (Azure Functions, Microsoft Flow, Azure Logic Apps, ) Azure Monitor.


, «Template», 80%, 45 ().





, , :





, .



. , « » 5 , « ». , 15 :





IoT Central .



.



« » «Template», « ». 31 2 . , , , , « ».







. , 1 17.00 , , . 1 E-mail , « > 80%».



, , e-mail, , « » — « ».



?



. , . , 10 , .



. «» :





, , : , . .





IoT Central 30 . , . «» «»:





BLOB-:





Azure, , . , .



, , , .



BLOB- Azure, (.. «», Azure Functions : https://docs.microsoft.com/en-us/azure/azure-functions/functions-bindings-storage-blob) . Azure , , -, « » , « » — ( ), IoT Central .





– , , IoT Central , .., , Power BI.





SaaS, .



, , , . .



. , , :



  • X.509 ;
  • - IoT Central;
  • DCM ;
  • IoT Edge -. IoT Edge – , «», .. . IoT Edge ;
  • , , , SaaS.


, . , : IoT Central 50 . .



Pricing Calculator, , .



, . .



: , . sergant (at) quarta.ru.




All Articles