CN115051919A - OTA (over the air) upgrading system and OTA upgrading method - Google Patents
OTA (over the air) upgrading system and OTA upgrading method Download PDFInfo
- Publication number
- CN115051919A CN115051919A CN202210764355.2A CN202210764355A CN115051919A CN 115051919 A CN115051919 A CN 115051919A CN 202210764355 A CN202210764355 A CN 202210764355A CN 115051919 A CN115051919 A CN 115051919A
- Authority
- CN
- China
- Prior art keywords
- upgrading
- ota
- upgrade
- state value
- module
- 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.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 50
- 238000009434 installation Methods 0.000 claims abstract description 160
- 230000002452 interceptive effect Effects 0.000 claims abstract description 33
- 230000007246 mechanism Effects 0.000 claims abstract description 9
- 230000003993 interaction Effects 0.000 claims description 24
- 238000013467 fragmentation Methods 0.000 claims 1
- 238000006062 fragmentation reaction Methods 0.000 claims 1
- 239000003795 chemical substances by application Substances 0.000 description 130
- 230000008569 process Effects 0.000 description 23
- 238000004891 communication Methods 0.000 description 8
- 238000004590 computer program Methods 0.000 description 6
- 238000010200 validation analysis Methods 0.000 description 5
- 230000005540 biological transmission Effects 0.000 description 4
- 230000000903 blocking effect Effects 0.000 description 4
- 238000012790 confirmation Methods 0.000 description 4
- 238000007726 management method Methods 0.000 description 4
- 230000008878 coupling Effects 0.000 description 3
- 238000010168 coupling process Methods 0.000 description 3
- 238000005859 coupling reaction Methods 0.000 description 3
- 238000013461 design Methods 0.000 description 3
- 238000010586 diagram Methods 0.000 description 3
- 230000006870 function Effects 0.000 description 3
- 230000009286 beneficial effect Effects 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 239000012634 fragment Substances 0.000 description 2
- 238000012544 monitoring process Methods 0.000 description 2
- 238000012795 verification Methods 0.000 description 2
- 238000013475 authorization Methods 0.000 description 1
- 230000015572 biosynthetic process Effects 0.000 description 1
- 230000003247 decreasing effect Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000002360 preparation method Methods 0.000 description 1
- 238000012545 processing Methods 0.000 description 1
- 238000011084 recovery Methods 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 238000003786 synthesis reaction Methods 0.000 description 1
- 238000012546 transfer Methods 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L41/00—Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
- H04L41/08—Configuration management of networks or network elements
- H04L41/0803—Configuration setting
- H04L41/0813—Configuration setting characterised by the conditions triggering a change of settings
- H04L41/082—Configuration setting characterised by the conditions triggering a change of settings the condition being updates or upgrades of network functionality
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L69/00—Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
- H04L69/16—Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
- H04L69/161—Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields
- H04L69/162—Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields involving adaptations of sockets based mechanisms
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Computer Security & Cryptography (AREA)
- Stored Programmes (AREA)
Abstract
The application discloses an OTA upgrading system and an OTA upgrading method, wherein the OTA upgrading system comprises: the system comprises an installation agent module and an upgrading service module, wherein the upgrading service module is positioned at a cloud end, and the installation agent module is positioned at a boat end; the upgrading service module is used for determining the state value of the installation agent module and triggering corresponding upgrading interactive operation according to the state value aiming at the installation agent module; the installation agent module and the upgrade service module are communicated based on an NIO mechanism, and a custom data protocol based on a socket is adopted. Through this application scheme, can realize the OTA upgrading to the ships and light boats.
Description
Technical Field
The application belongs to the technical field of the Internet of things, and particularly relates to an OTA upgrading system and an OTA upgrading method.
Background
Over-the-Air Technology (OTA) refers to upgrading its own system by downloading new software update packages from a remote server Over a network. At present, OTA has had comparatively extensive application on equipment such as smart mobile phone, but the application of this technique on ships and light boats, especially unmanned ship is blank at present.
In an actual application scene, a plurality of boats may need to be updated; also, there may be multiple systems in the same boat that need to be updated. Therefore, how to guarantee the OTA upgrading performance of the ships becomes a problem to be solved at present under the application scene of large-scale concurrent upgrading of the ships.
Disclosure of Invention
The application provides an OTA upgrading system and an OTA upgrading method, which can guarantee the OTA upgrading performance of ships in the application scene of large-scale concurrent upgrading of the ships.
In a first aspect, the present application provides an OTA upgrade system, including: the system comprises an installation agent module and an upgrading service module, wherein the upgrading service module is positioned at the cloud end, and the installation agent module is positioned at the boat end;
the upgrading service module is used for determining the state value of the installation agent module;
the upgrading service module is also used for triggering corresponding upgrading interactive operation aiming at the installation agent module according to the state value;
the installation agent module and the upgrade service module are communicated based on an NIO mechanism, and a custom data protocol based on a socket is adopted.
In a second aspect, the present application provides an OTA upgrading method applied to an OTA upgrading system, which includes: the system comprises an installation agent module and an upgrading service module, wherein the upgrading service module is positioned at the cloud end, and the installation agent module is positioned at the boat end; the OTA upgrading method comprises the following steps:
the upgrading service module determines a state value of the installation agent module;
the upgrading service module triggers corresponding upgrading interactive operation according to the state value aiming at the installation agent module;
the installation agent module and the upgrade service module are communicated based on an NIO mechanism, and a custom data protocol based on a socket is adopted.
Compared with the prior art, the beneficial effect that this application exists is: an installation agent module is deployed at a boat end, an upgrading service module is deployed at a cloud end (namely a platform end), and OTA upgrading service is provided for the installation agent module by the upgrading service module. Specifically, when upgrading is needed, the upgrade service module determines the state of the installation agent module, the state is represented by a state value, and upgrading interactive operation adapting to the installation agent module in the state is performed in order, so that OTA (over the air) upgrading of the boat is realized. Moreover, the installation agent module and the upgrading service module are communicated based on an NIO mechanism, and a socket-based custom data protocol is adopted, so that the OTA upgrading performance of the boat can be still guaranteed in the application scene of large-scale concurrent upgrading of the boat.
It is understood that the beneficial effects of the second aspect can be referred to the related description of the first aspect, and are not described herein again.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings without creative efforts.
Fig. 1 is an exemplary diagram of a state machine applied in an OTA upgrade system provided by an embodiment of the present application;
fig. 2 is a diagram illustrating an architecture of an OTA upgrade system provided in an embodiment of the present application;
fig. 3 is a schematic implementation flow diagram of an OTA upgrading method provided in an embodiment of the present application.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular system structures, techniques, etc. in order to provide a thorough understanding of the embodiments of the present application. It will be apparent, however, to one skilled in the art that the present application may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.
The embodiment of the application provides an OTA upgrading system and an OTA upgrading method. The following describes an OTA upgrade system provided in an embodiment of the present application:
the OTA upgrade system may include the following basic software entities: and installing an agent module and an upgrading service module. The upgrading service module is deployed at the cloud end, namely a ship big data platform. The installation agent module is deployed at the boat end. Typically, only one installation agent module is deployed at one boat end.
Because there may be an application scenario in which a plurality of boat ends all have upgrading requirements, in order to ensure OTA management and implementation efficiency, when an OTA upgrading system is designed, a controllable problem of large-scale data concurrence can be taken into account, so that the installation agent module and the upgrading service module communicate with each other based on an NIO (non-blocking IO) mechanism, wherein the NIO mechanism has the characteristics that: high concurrency, high performance and asynchronous non-blocking are supported. By way of example only, the OTA upgrade system may employ a netty framework that supports high concurrency, high performance, and asynchronous non-blocking. Under the netty framework, the installation agent module is a netty client, and the upgrade service module is a netty server. Of course, other frameworks capable of supporting high concurrency, high performance and asynchronous non-blocking may also be adopted to construct the OTA upgrading system proposed in the embodiment of the present application, and is not limited herein.
Of course, the user may also add some other functional modules to the proposed OTA upgrading system according to the specific requirements in the actual application scenario, which is not limited herein.
The following describes various modules that may be involved in an OTA upgrade system:
the installation agent module is an executor for OTA upgrading at the boat end.
The upgrading service module can establish and maintain long connection with the installation agent module with upgrading requirements based on the Netty technology, realize receiving and sending of OTA messages, and realize operations such as OTA notification, software transmission and verification, OTA upgrading and state feedback based on the OTA messages.
Specifically, for an installation agent module with an upgrade requirement, the upgrade service module may determine a state value of the installation agent module first. It will be appreciated that the status value represents the status of the installation agent module currently in the process of upgrading. In different states, the upgrade interaction operation that the upgrade service module can perform for the installation agent module is also different, and therefore, the upgrade service module can trigger the upgrade interaction operation corresponding to the state value for the upgrade service module after determining the state value of the installation agent module.
A binary custom data protocol based on a socket is adopted between the installation agent module and the upgrading service module, and the protocol defines interactive messages and data formats between the installation agent module and the upgrading service module. The data format includes format information such as a header, a version, a length, a data payload, and a check code, which is not limited herein.
In some embodiments, boats are not standardized devices, i.e., different boats may vary in configuration depending on cost and application constraints, and thus differential upgrade management of the primary control systems and/or secondary application systems of different boats may need to be considered when designing OTA upgrade systems. In addition, there may be multiple versions under each software, so differential upgrade management based on software versions needs to be considered when designing OTA upgrade systems. Based on this, the OTA upgrade system may further include: and an OTA planning module. The OTA planning module can receive OTA planning information input by a user and generate an OTA plan table according to the OTA planning information. Wherein, the OTA schedule is used for recording when and to what version which software of which unmanned ships is updated; that is, the OTA schedule may record the planned upgrade time, planned upgrade software, and planned upgrade versions of the boat end at which each installation agent module is located. In addition, the OTA schedule can record the status value of the installation agent module. Specifically, the OTA schedule may record the status values of all installation agent modules; alternatively, the OTA schedule may record only the status values of the installation agent modules where the upgrade requirements exist, and is not limited herein.
It can be understood that a user can make OTA plans of all boats according to actual application scenes through the OTA planning module, so that an OTA plan table is formed. And then, once the current time reaches the planned upgrading time of a certain boat, the boat is considered to have upgrading requirements, namely the installation agent module of the boat has upgrading requirements. The upgrading service module can determine the state value of the installation agent module according to the OTA schedule and trigger corresponding upgrading interactive operation aiming at the installation agent module.
It can be understood that, based on the OTA planning module, the OTA upgrading system supports the simultaneous upgrading of a plurality of pieces of software on one boat side; that is, for a certain boat end, more than two pieces of planned upgrading software can be set at the same planned upgrading time. Moreover, the OTA upgrading system also supports the simultaneous upgrading of different or same software of a plurality of boat ends.
In some embodiments, to ensure the orderly execution of the OTA upgrade operation of the installation agent module, the upgrade service module is optimized by using the design idea of the state machine, and the optimized upgrade service module may perform the following operations:
and triggering the installation agent module and/or the upgrade service module to execute corresponding upgrade interactive operation according to the state value of the installation agent module, and updating the state value of the installation agent module recorded by the OTA schedule according to an execution result after the corresponding upgrade interactive operation is executed, so that the OTA schedule can record the current latest state value of the installation agent module. The above process is repeatedly executed until the boat end where the agent module is installed finishes all upgrading tasks.
For example only, eight different state values, first through eighth state values, may be preset. The different state values represent different states of the installation agent module, and the different states correspond to different upgrading interactive operations.
The first state value is used to indicate that the installation agent module has not been notified to perform the upgrade, that is, the upgrade service module has not notified that the installation agent module can perform the upgrade currently. Based on this, the upgrade interaction operation corresponding to the first state value is: and (6) notification operation. For example only, the first state value may be "0".
The second state value is used for indicating that the installation agent module is notified to be upgraded, namely the upgrade service module is notified that the installation agent module can be upgraded currently. After the notification is completed and before the formal upgrade is started, the installation agent module should establish connection with the upgrade service module and log in. Based on this, the upgrade interaction operation corresponding to the second state value is: and (6) logging in. For example only, the second state value may be "1".
For example only, the process of the installation agent module establishing a connection with the upgrade service module and logging in may be:
in the case of a clustered deployment of upgrade service modules, an addressing service module may also be included in the OTA upgrade system. The installation proxy module is preset with address information for addressing the service module. The installation agent module can access the addressing service module through the address information and send an addressing request to the addressing service module. The addressing service module searches a proper upgrading service module for the installation agent module through a load balancing strategy or other strategies according to the addressing request, and feeds back the address information of the upgrading service module to the installation agent module. The installation agent module and the addressing service module realize communication based on HyperText Transfer Protocol (HTTP). Of course, the installation agent module may also determine the address information of the upgrade service module in other manners, for example, in a case that the upgrade service module is not deployed in a cluster, the installation agent module may also directly preset an address of the upgrade service module, which is not limited herein.
After the installation agent module determines the address information of the upgrade service module, a long connection communication request can be sent to the upgrade service module according to the address information, and a Transmission Control Protocol/Internet Protocol (TCP/IP) long connection with the upgrade service module is established. Subsequently, the upgrade agent module may perform a login operation through a channel (connection) established by the TCP/IP long connection, specifically: the installation agent module sends a LOGIN message to the upgrade service module; after receiving the logic message, the upgrade service module replies a logic _ ACK message to the installation agent module. Therefore, a session between the installation agent module and the upgrading service module can be established, the installation agent module can perform upgrading data interaction with the upgrading service module through the session, and the ships can receive and transmit related OTA upgrading data with the cloud. At this point, the installation agent module has established a connection with the upgrade service module and has completed the login.
And the third state value is used for indicating that the installation agent module establishes the connection with the upgrade service module and finishes logging in. At which point operation of the OTA upgrade may be initiated. Based on this, the upgrade interaction operation corresponding to the third state value is: and starting the OTA upgrade. For example only, the third state value may be "2".
The fourth state value is used to indicate that the installation agent module has initiated an OTA upgrade operation. It is understood that in the OTA schedule specified by the user, a boat may be specified to perform more than two software upgrade tasks; that is, in the OTA upgrade process of installing the agent module, more than two pieces of software may need to be upgraded successively. Based on this, the upgrade interaction operation corresponding to the fourth state value is: and starting operation of the upgrading task. For example only, the fourth state value may be "3".
The fifth state value is used to indicate that the installation agent module is in the process of a file download cycle. Because one software supports a plurality of program package files, the upgrading can be realized only by triggering the circular downloading operation to download the plurality of program package files under the software. Based on this, the upgrade interaction operation corresponding to the fifth state value is: and (5) file downloading operation. For example only, the fifth state value may be "4".
The sixth status value is used to indicate that the installation agent module is in the process of a file block download cycle. It will be appreciated that a package file may be split into multiple package file blocks to support segmented downloading of the package file. Based on this, the upgrade interaction operation corresponding to the sixth state value is: and (5) downloading the file blocks. For example only, the sixth state value may be "5".
The seventh value is used to indicate that the installation agent module is in the process of installing the software. It will be appreciated that after the download of all package files for a piece of software is complete, the installation of the software can proceed based on these package files. Based on this, the upgrade interaction operation corresponding to the seventh state value is: and (5) software installation operation. For example only, the seventh status value may be "6".
The eighth value is used to indicate that the current OTA upgrade of the installation agent module is finished, and the OTA upgrade process for the installation agent module can be exited. Based on this, the upgrade interaction operation corresponding to the eighth state value is: and finishing the OTA upgrading operation. For example only, the eighth state value may be "7".
For example only, the package file may be a single executable program or a compressed and packaged collection of files, wherein the compressed format may be ZIP, and is not limited herein. The package file may be divided into package file blocks in units of a specified size, which may be 64KB, but is not limited thereto.
In some embodiments, the working environment of a boat is severe, and the problems of low communication bandwidth, poor network stability and the like are often faced; in addition, the operation time of the boat is limited, and the OTA upgrading operation of the boat cannot completely occupy the operation time, namely, the OTA upgrading operation usually needs the boat to be carried out intermittently by utilizing scattered time. For the above reasons, a need for high fault tolerance for OTA upgrade systems is presented. Under the condition that the OTA schedule records the current latest state value of the installation agent module, if the installation agent module accidentally drops off in the OTA upgrading process, the upgrading service module can determine the state value of the installation agent module through the OTA schedule after the installation agent module is reconnected. It is understood that the state value is the state value of the installation agent module before the disconnection. Therefore, the installation agent module and/or the upgrade service module can recover and execute the upgrade interactive operation before the disconnection according to the backtracking of the state value, and the fault tolerance of the OTA system is greatly improved.
In some embodiments, the OTA upgrading system further includes a file upload service module, which may upload the package files of each software to the distributed file system, wherein the file upload service module may support breakpoint resuming (i.e., fragment uploading). The operations performed by the file upload service module may be understood as preparation for subsequent OTA upgrade operations that may be performed. For example only, the distributed file system may be a lightweight distributed file system fastDFS.
In some embodiments, the OTA upgrading system further comprises a file download service module, corresponding to the file upload service module. Under the condition that the upgrading interaction operation executed by the upgrading service module has a file requirement, the file downloading service module can acquire a corresponding program package file from the distributed file system according to the file requirement and transmit the acquired program package file to the upgrading service module so that the upgrading service module can complete the upgrading interaction operation, wherein the file downloading service module can support breakpoint continuous transmission (namely fragment downloading). For example, when the state value of the installation agent module is the sixth state value, the file block downloading operation executed by the upgrade service module has a requirement for each package file block of the same package file, and the file downloading service module may obtain each package file block from the distributed file system and transmit the obtained package file block to the upgrade service module, so that the upgrade service module pushes the obtained package file block to the installation agent module.
In some embodiments, under a preset condition, for example, when a user directly controls a boat to perform upgrading through a control terminal such as a mobile phone or the like, or when a network environment where the boat is located is good, the installation agent module may directly request the distributed file system to download all package files of the software to be upgraded (i.e., all package file blocks of all package files of the software to be upgraded) required by the installation agent module itself, in a HTTP request manner, instead of performing OTA upgrading through each upgrade interaction operation provided by the upgrade service module. In this process, the upgrade service module may only be used to provide the file address to the installation agent module.
The following describes the operation of each module of the OTA upgrade system by taking a complete OTA upgrade process as an example:
(1) software upload
The administrator can submit the package file of the software on the POST page based on the HTTP protocol. The package file is uploaded to the distributed file system fastDFS through the file upload service module. The file uploading service module supports breakpoint uploading. After successful upload of the package file, the record in the OTA schedule for the package file for the software can be updated.
(2) OTA planning
The administrator may enter OTA planning information at the OTA planning module that indicates when to update what software of what boats to what version. The OTA schedule information can be stored by the OTA schedule module into the OTA schedule.
(3) Task triggering
The task execution module scans the OTA schedule at regular time, and informs the upgrading service module when the scheduled upgrading time of a boat (recorded as boat A) is reached according to the setting of the OTA schedule. The upgrade service module can trigger an OTA upgrade process aiming at the installation agent module of the boat A, namely, the upgrade service module starts to read the state value of the installation agent module of the boat A and executes corresponding upgrade interactive operation. Wherein the state value of the installation agent module of the boat a defaults to the first state value 0 in the initial state.
(4) OTA execution
Referring to fig. 1, fig. 1 shows an example of a state machine applied in an OTA upgrade system. According to the fig. 1, the specific flow of each state value and the corresponding upgrade interaction operation is as follows:
the state value is a first state value, and the notification operation is executed: considering that for ships and boats, especially unmanned ships, which are managed by people but operated by no people, OTA upgrade needs to confirm authorization and cannot be performed by human operation from the aspects of management and safety, the embodiment of the present application designs the notification operation corresponding to the first state value. After the scheduled upgrade time has been reached, the upgrade service module may send an OTA notification to the user client associated with the boat a. The user may make a confirmation on the user client to run the upgrade. And after receiving a confirmation message fed back by the user client aiming at the OTA notification, the upgrading service module changes the state value into a second state value. When the upgrade service module does not receive the confirmation message fed back by the user client for the OTA notification, the upgrade service module waits indefinitely without triggering subsequent operations for the installation upgrade module of the boat a, and there is no time-out limit here.
And the state value is a second state value, and the login operation is executed: the upgrade service module takes care of boat a and checks if boat a has successfully established a communication connection with the upgrade service module and successfully LOGIN. And after determining that the communication connection between the boat A and the upgrading service module is successfully established and the LOGIN is successful, the upgrading service module changes the state value into a third state value.
And the state value is a third state value, and OTA upgrade starting operation is executed: the upgrade service module sends an OTA _ START message to the installation agent module, which carries the task list. Specifically, the task list includes information of upgrade tasks to be executed by the boat a at this time, where the number of the upgrade tasks is not limited, and the information of the upgrade tasks includes: the upgrade software is planned, the upgrade version is planned, the number of package files of the upgrade software is planned, the name of each package file of the upgrade software is planned, and the size of each package file of the upgrade software is planned. After the installation agent module confirms that no error exists, OTA _ START _ ACK information can be sent to the upgrade service module, the information carries a task number i, and the installation agent module selects the ith upgrade task to START. And after receiving the OTA _ START _ ACK message, the upgrading service module changes the state value into a fourth state value.
And the state value is a fourth state value, and the upgrading task starting operation is executed: after receiving the OTA _ START _ ACK message, the upgrade service module sends an OTA _ VAR message to the installation agent module, where the message carries parameter setting information of the ith upgrade task and information of a package file of the ith upgrade task, and the information of the package file includes: the number of package files of the planned upgrade software indicated by the ith upgrade task, and a Uniform Resource Locator (URL) of each package file of the planned upgrade software. And after receiving the parameter setting information of the ith upgrading task, the installation agent module executes corresponding parameter setting and sends an OTA _ VAR _ ACK message to the upgrading service module. After receiving the OTA _ VAR _ ACK message, the upgrade service module determines whether the installation agent module is ready according to a status field carried by the OTA _ VAR _ ACK message. In the case of confirming that the installation agent module is ready, the upgrade service module changes the state value to a fifth state value. In the event that the installation agent module is not confirmed to be ready, the current steps are repeated.
And if the state value is a fifth state value, executing file downloading operation: in this state, a file loop is established. And the installation agent module sends an OTA _ SOFT message to the upgrade service module to carry out download negotiation of the program package file of the ith task. The upgrading service module returns an OTA _ SOFT _ ACK message to the installation agent module, the message carries the information of the current program package file, and the information of the current program package file comprises the following steps: file name, size, block size, number of blocks, file HASH value, etc. Thereafter, the upgrade service module changes the state value to a sixth state value.
And if the state value is a sixth state value, executing file block downloading operation: and after receiving the OTA _ SOFT _ ACK message, the installation agent module establishes file block circulation. The installation agent module continuously sends OTA _ SEG messages to the upgrade service module to request the file blocks of the current package files. And the upgrading service module replies an OTA _ SEG _ ACK message to the installation agent module, and the package file block and the block HASH value of the current package file are carried. And after receiving the OTA _ SEG _ ACK message, the installation agent module checks whether the corresponding block HASH value is correct or not. If the program package file block is correct, the installation agent module requests the next program package file block of the current program package file in sequence. If the program package file block is not correct, the installation agent module requests the current program package file block of the current program package file again until all program package file blocks of the current program package file are completely requested. After the upgrade service module checks that all program package file blocks of the current program package file are completely requested, if the ith upgrade task has no next program package file, the state value is changed into a seventh state value; and if the ith upgrading task still has the next program package file, changing the state value into a fifth state value, thereby realizing file circulation.
The state value is a seventh state value, and the software installation operation is executed: and finishing the request of all file blocks of all program package files of the ith upgrading task. And aiming at each package file, the installation agent module merges all the received package file blocks of the package file and calculates the HASH value. If the calculated HASH value does not match the corresponding file HASH value for a certain package file, the file block downloading operation is restarted, and the upgrade service module changes the state value into a sixth state value. If all package files match the corresponding file HASH value, the installation agent module may open the installation of the planned upgrade software indicated by the ith upgrade task. During installation, the upgrade service module continuously sends an OTA _ RUN message to the installation agent module to inquire the progress, the installation agent module replies an OTA _ RUN _ ACK message to report the progress percentage, and the upgrade service module may record the installation progress of the planned upgrade software indicated by the ith upgrade task according to the OTA _ RUN _ ACK message. After the installation is completed, the installation agent module checks whether there is a next upgrade task by means of the OTA _ START message that has been received before. In case it is checked that there is still a next upgrade task, the installation agent module sends an OTA _ START _ ACK message carrying the updated task number i (e.g., i ═ i + 1). And after receiving the OTA _ START _ ACK message, the upgrading service module changes the state value into a fourth state value, and triggers the upgrading task starting operation, the file downloading operation, the file block downloading operation and the software installation operation again according to the logic so as to complete the installation of the planned upgrading software indicated by the next upgrading task until the next upgrading task does not exist, and the details are not repeated here. And in the case that the next upgrading task does not exist, the installation agent module sends an OTA _ END message to the upgrading service module, and the upgrading service module replies an OTA _ END _ ACK message to the installation agent module and changes the state value into a seventh state value.
And if the state value is the eighth state value, performing OTA upgrade ending operation: at this time, it can be known that the upgrade task for the boat a is completely completed, and the OTA upgrade process for the boat a is completely completed.
Through the above processes, each upgrade task (i.e. the ith upgrade task) in the task list includes independent parameter setting, file downloading, file block downloading, file synthesis verification, software installation and confirmation completion processes. For example only, i is initially 1, and each updated i does not exceed the total number of upgrade tasks indicated by the task list.
(5) OTA monitoring
It can be understood that in the OTA execution process, the upgrade service module can update the state value of the installation agent module of the boat a recorded in the OTA schedule in real time to ensure that the OTA schedule records the latest state value of the installation agent module of the boat a, thereby realizing the monitoring of the OTA progress and state of the boat a. When the OTA upgrading process of the boat A is accidentally stopped due to communication faults or other reasons, as long as the boat A is connected to the upgrading service module again, the upgrading service module can perform upgrading interactive operation before disconnection again through the state value of the installation agent module of the boat A before disconnection, which is recorded by the OTA schedule table, so that the breakpoint continuous transmission capability and the OTA fault recovery capability of the OTA upgrading system are ensured.
It can be understood that, in the OTA execution process, the upgrade service module is a state master, constantly maintains the accuracy of the state machine and the state value and writes in the OTA schedule; and the installation agent module is a state slave controller and keeps the synchronization of state values according to the actual application condition. The OTA message related to the process is summarized as follows:
OTA _ START: platform issues OTA upgrade start notification
OTA _ VAR: USV request variable information
OTA _ VAR _ ACK: platform validation
OTA _ SOFT: USV acquisition software package
OTA _ SOFT _ ACK: platform validation
OTA _ SEG: USV file block fetching
OTA _ SEG _ ACK: platform validation
OTA _ RUN: USV software package installation
OTA _ END: usv update validation
OTA _ END _ ACK: platform validation
The platform refers to a cloud (a ship big data platform), namely an upgrade service module; the USV refers to the boat end, i.e. the installation agent module.
Based on the OTA upgrading system proposed above, please refer to fig. 2, and fig. 2 shows an example of a possible architecture of the OTA upgrading system. The arrows in this fig. 2 indicate the data flow direction, and P1 indicates the custom data protocol.
As can be seen from the above, in the embodiment of the present application, the installation agent module is deployed at the boat end, the upgrade service module is deployed at the cloud end (also referred to as the platform end), and the OTA upgrade service is provided for the installation agent module by the upgrade service module. Specifically, when upgrading is needed, the upgrade service module determines the state of the installation agent module, the state is represented by a state value, and upgrading interactive operation adapting to the installation agent module in the state is performed in order, so that OTA (over the air) upgrading of the boat is realized.
The following describes an OTA upgrading method provided in the embodiment of the present application, where the OTA upgrading method is applied to an OTA upgrading system, which has been described in the previous embodiment and is not described herein again; referring to fig. 3, the OTA upgrading method includes:
the installation agent module and the upgrade service module are communicated based on an NIO mechanism, and a custom data protocol based on a socket is adopted.
In some embodiments, the OTA upgrade system further comprises an OTA planning module, and the OTA upgrade method further comprises:
the OTA planning module generates an OTA planning table according to the OTA planning information when receiving the input OTA planning information, and the OTA planning table is used for recording the planned upgrading time of the ship end where the installation agent module is located and the state value of the installation agent module;
accordingly, step 201 includes: and after the current time reaches the planned upgrading time, the upgrading service module determines the state value of the installation agent module through the OTA schedule.
In some embodiments, the OTA upgrade method further comprises:
the task execution module periodically scans the OTA schedule to determine whether the current time reaches the scheduled upgrade time.
In some embodiments, step 202 comprises: and the upgrading service module triggers the installation agent module and/or the upgrading service module to execute corresponding upgrading interactive operation according to the state value, and updates the state value of the installation agent module recorded by the OTA schedule according to an execution result after the corresponding upgrading interactive operation is executed until the ship end where the installation agent module is located finishes all upgrading tasks.
In some embodiments, when the state value is a preset first state value, the corresponding upgrade interaction operation is: a notification operation;
when the state value is a preset second state value, the corresponding upgrading interactive operation is as follows: performing login operation;
when the state value is a preset third state value, the corresponding upgrading interactive operation is as follows: OTA upgrade starting operation;
when the state value is a preset fourth state value, the corresponding upgrading interactive operation is as follows: starting an upgrading task;
when the state value is a preset fifth state value, the corresponding upgrading interactive operation is as follows: file downloading operation;
when the state value is a preset sixth state value, the corresponding upgrading interaction operation is as follows: downloading a file block;
when the state value is a preset seventh state value, the corresponding upgrading interaction operation is as follows: installing software;
when the state value is a preset eighth state value, the corresponding upgrading interactive operation is as follows: finishing OTA upgrading operation;
in some embodiments, step 201 further comprises: and after the installation agent module is disconnected and reconnected, the upgrading service module determines the state value of the installation agent module through the OTA schedule so that the installation agent module and/or the upgrading service module can restore and execute upgrading interactive operation before disconnection.
In some embodiments, the OTA upgrade system further includes a file upload service module, and the OTA upgrade method further includes: and the file uploading service module uploads the breakpoint of the package file of the software to the distributed file system.
In some embodiments, the OTA upgrade method further comprises: and the installation agent module establishes HTTP connection with the distributed file system under a preset upgrading condition and directly downloads the package file of the software to be upgraded from the distributed file system.
In some embodiments, the OTA upgrade system further includes a file download service module, and the OTA upgrade method further includes: under the condition that the upgrading interactive operation executed by the upgrading service module has a file requirement, the file downloading service module acquires a corresponding program package file from the distributed file system according to the file requirement, and transmits the acquired program package file to the upgrading service module so that the upgrading service module can complete the upgrading interactive operation.
From the above, it can be seen that, through the embodiments of the present application,
it should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned functions may be distributed as different functional units and modules according to needs, that is, the internal structure of the apparatus may be divided into different functional units or modules to implement all or part of the above-mentioned functions. Each functional unit and module in the embodiments may be integrated in one processing unit, or each unit may exist alone physically, or two or more units are integrated in one unit, and the integrated unit may be implemented in a form of hardware, or in a form of software functional unit. In addition, specific names of the functional units and modules are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working processes of the units and modules in the system may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or illustrated in a certain embodiment.
Those of ordinary skill in the art would appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of external device software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described system embodiments are merely illustrative, and for example, the division of the above-described modules or units is only one logical functional division, and in actual implementation, there may be another division, for example, multiple units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one position, or may be distributed on multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
The integrated unit may be stored in a computer-readable storage medium if it is implemented in the form of a software functional unit and sold or used as a separate product. Based on such understanding, all or part of the flow in the method of the embodiments described above can be realized by a computer program, which can be stored in a computer-readable storage medium and can realize the steps of the embodiments of the methods described above when the computer program is executed by a processor. The computer program includes computer program code, and the computer program code may be in a source code form, an object code form, an executable file or some intermediate form. The computer-readable storage medium may include: any entity or device capable of carrying the above-described computer program code, recording medium, usb disk, removable hard disk, magnetic disk, optical disk, computer readable Memory, Read-Only Memory (ROM), Random Access Memory (RAM), electrical carrier wave signal, telecommunication signal, software distribution medium, etc. It should be noted that the computer readable storage medium may contain other contents which can be appropriately increased or decreased according to the requirements of the legislation and the patent practice in the jurisdiction, for example, in some jurisdictions, the computer readable storage medium does not include an electrical carrier signal and a telecommunication signal according to the legislation and the patent practice.
The above embodiments are only used to illustrate the technical solutions of the present application, and not to limit the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present application and are intended to be included within the scope of the present application.
Claims (10)
1. An OTA upgrade system, comprising: the system comprises an installation agent module and an upgrading service module, wherein the upgrading service module is positioned at a cloud end, and the installation agent module is positioned at a boat end;
the upgrading service module is used for determining the state value of the installation agent module;
the upgrading service module is also used for triggering corresponding upgrading interactive operation according to the state value aiming at the installation agent module;
the installation agent module and the upgrade service module are communicated based on an NIO mechanism, and a custom data protocol based on a socket is adopted.
2. The OTA upgrade system of claim 1 further comprising:
the OTA planning module is used for generating an OTA planning table according to the OTA planning information when receiving the input OTA planning information, and the OTA planning table is used for recording the planned upgrading time of the ship end where the installation agent module is located and the state value of the installation agent module;
correspondingly, the upgrade service module is used for determining the state value of the installation agent module through the OTA schedule after the current time reaches the planned upgrade time.
3. The OTA upgrade system of claim 2, wherein the OTA upgrade system further comprises:
and the task execution module is used for scanning the OTA schedule regularly to determine whether the current time reaches the scheduled upgrading time.
4. The OTA upgrading system according to claim 2, wherein the upgrade service module is configured to trigger the installation agent module and/or the upgrade service module to execute the corresponding upgrade interaction operation according to the state value, and update the state value of the installation agent module recorded in the OTA schedule according to an execution result after the corresponding upgrade interaction operation is executed, until the ship end where the installation agent module is located completes all upgrading tasks.
5. The OTA upgrade system of claim 4, wherein when the state value is a preset first state value, the corresponding upgrade interaction operation is to: a notification operation;
when the state value is a preset second state value, the corresponding upgrading interactive operation is as follows: performing login operation;
when the state value is a preset third state value, the corresponding upgrading interaction operation is as follows: OTA upgrade starting operation;
when the state value is a preset fourth state value, the corresponding upgrading interaction operation is as follows: starting an upgrading task;
when the state value is a preset fifth state value, the corresponding upgrading interactive operation is as follows: file downloading operation;
when the state value is a preset sixth state value, the corresponding upgrading interactive operation is as follows: downloading a file block;
when the state value is a preset seventh state value, the corresponding upgrading interactive operation is as follows: installing software;
when the state value is a preset eighth state value, the corresponding upgrading interaction operation is as follows: and finishing the OTA upgrading operation.
6. The OTA upgrading system according to claim 4, wherein the upgrade service module is further configured to determine a state value of the installation agent module through the OTA schedule after the installation agent module is disconnected and reconnected, so that the installation agent module and/or the upgrade service module resumes the upgrading interactive operation before the disconnection.
7. The OTA upgrade system of claim 1, wherein the OTA upgrade system further comprises:
and the file uploading service module is used for uploading the package files of the software to the distributed file system in a fragmentation mode.
8. The OTA upgrade system of claim 7 wherein the installation agent module is further configured to establish a HTTP connection with the distributed file system under a predetermined upgrade condition, and to download the package files of the software to be upgraded directly from the distributed file system.
9. The OTA upgrade system of claim 7, wherein the OTA upgrade system further comprises:
and the file downloading service module is used for acquiring a corresponding program package file from the distributed file system according to the file requirement under the condition that the upgrading interactive operation executed by the upgrading service module has the file requirement, and transmitting the acquired program package file to the upgrading service module so that the upgrading service module can complete the upgrading interactive operation.
10. An OTA upgrade method, characterized in that, the OTA upgrade method is applied to an OTA upgrade system, the OTA upgrade system includes: the system comprises an installation agent module and an upgrading service module, wherein the upgrading service module is positioned at a cloud end, and the installation agent module is positioned at a boat end; the OTA upgrading method comprises the following steps:
the upgrading service module determines the state value of the installation agent module;
the upgrading service module triggers corresponding upgrading interactive operation according to the state value aiming at the installation agent module;
the installation agent module and the upgrade service module are communicated based on an NIO mechanism, and a custom data protocol based on a socket is adopted.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210764355.2A CN115051919B (en) | 2022-06-30 | 2022-06-30 | OTA upgrading system and OTA upgrading method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210764355.2A CN115051919B (en) | 2022-06-30 | 2022-06-30 | OTA upgrading system and OTA upgrading method |
Publications (2)
Publication Number | Publication Date |
---|---|
CN115051919A true CN115051919A (en) | 2022-09-13 |
CN115051919B CN115051919B (en) | 2024-07-12 |
Family
ID=83166161
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210764355.2A Active CN115051919B (en) | 2022-06-30 | 2022-06-30 | OTA upgrading system and OTA upgrading method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115051919B (en) |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105227647A (en) * | 2015-09-18 | 2016-01-06 | 浪潮软件股份有限公司 | Distributed software upgrading method |
CN109491688A (en) * | 2018-11-16 | 2019-03-19 | 珠海云洲智能科技有限公司 | The method, apparatus and system of firmware upgrade are carried out to the control equipment of unmanned boat |
CN111722860A (en) * | 2020-06-16 | 2020-09-29 | 东软睿驰汽车技术(沈阳)有限公司 | OTA (over the air) upgrading method and device based on finite state machine |
CN111741131A (en) * | 2020-08-12 | 2020-10-02 | 广州汽车集团股份有限公司 | OTA upgrade control method and TSP platform |
US20220075613A1 (en) * | 2020-09-07 | 2022-03-10 | Nutanix, Inc. | Adaptive feedback based system and method for predicting upgrade times and determining upgrade plans in a virtual computing system |
CN114584539A (en) * | 2021-12-28 | 2022-06-03 | 上海繁易信息科技股份有限公司 | Cloud upgrading method and system for industrial field device |
-
2022
- 2022-06-30 CN CN202210764355.2A patent/CN115051919B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105227647A (en) * | 2015-09-18 | 2016-01-06 | 浪潮软件股份有限公司 | Distributed software upgrading method |
CN109491688A (en) * | 2018-11-16 | 2019-03-19 | 珠海云洲智能科技有限公司 | The method, apparatus and system of firmware upgrade are carried out to the control equipment of unmanned boat |
CN111722860A (en) * | 2020-06-16 | 2020-09-29 | 东软睿驰汽车技术(沈阳)有限公司 | OTA (over the air) upgrading method and device based on finite state machine |
CN111741131A (en) * | 2020-08-12 | 2020-10-02 | 广州汽车集团股份有限公司 | OTA upgrade control method and TSP platform |
US20220075613A1 (en) * | 2020-09-07 | 2022-03-10 | Nutanix, Inc. | Adaptive feedback based system and method for predicting upgrade times and determining upgrade plans in a virtual computing system |
CN114584539A (en) * | 2021-12-28 | 2022-06-03 | 上海繁易信息科技股份有限公司 | Cloud upgrading method and system for industrial field device |
Non-Patent Citations (2)
Title |
---|
YANJIAO CHEN; LINGJIE DUAN; QIAN ZHANG: "Financial Analysis of Network Upgrade", IEEE TRANSACTIONS ON VEHICULAR TECHNOLOGY, 8 February 2018 (2018-02-08) * |
吴宇;刘渭滨;: "CIR设备GIS数据远程升级系统研发", 铁道通信信号, no. 08, 17 August 2018 (2018-08-17) * |
Also Published As
Publication number | Publication date |
---|---|
CN115051919B (en) | 2024-07-12 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
EP3011446B1 (en) | Synchronized update of multiple devices in a local network | |
CN111817874A (en) | Remote maintenance system and method for electric power internet of things terminal equipment | |
CN102055785A (en) | Online upgrade method for distributed system, distributed system and equipment | |
KR101528210B1 (en) | Software downloading method and device | |
CN112069154B (en) | etcd distributed database automatic operation and maintenance method and related device | |
CN110262820A (en) | Method, apparatus, system and storage medium based on MQTT protocol realization OTA upgrading | |
CN107483297B (en) | Active monitoring system and method for quality of service carried on embedded equipment | |
CN111240713A (en) | Method for detecting remote breakpoint continuous transmission through power utilization | |
CN111142905A (en) | OTA (over-the-air) upgrading method, OTA server and OTA upgrading system | |
CN102546207A (en) | Distributed centralized scheduling upgrading method and system for network element software version | |
CN111857772B (en) | Method and device for remote transmission and dynamic loading of terminal edge application program | |
CN112737847B (en) | Node upgrading method and device, storage medium and electronic device | |
CN113746892B (en) | Remote upgrading method and wireless terminal equipment | |
US11811864B2 (en) | Network connection method and device for training participant end of common training model | |
CN105812176A (en) | Client-initiative and concurrent upgrade-supporting remote upgrade method | |
CN112527346A (en) | Software upgrading method and device, storage medium and electronic device | |
CN112637266A (en) | AWS IoT-based intelligent photo frame management method, equipment and medium | |
CN109936609B (en) | Terminal chain type upgrading method and device and upgrading management server | |
WO2017124741A1 (en) | Method and device for synchronizing apparatus version | |
CN113949700A (en) | Cloud edge cooperation-based Docker application accelerated issuing method and system | |
CN115051919B (en) | OTA upgrading system and OTA upgrading method | |
CN109302456A (en) | A kind of document transmission method and device based on aerial downloading OTA technology | |
CN113497720A (en) | Firmware server, electric power internet of things proxy gateway and firmware remote upgrading method | |
CN116414411A (en) | Program upgrading method, system, electronic equipment and storage medium | |
EP2426859B1 (en) | Method and server for transferring large object |
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 |