WO2015128914A1 - Software-installed apparatus, and software updating method - Google Patents

Software-installed apparatus, and software updating method Download PDF

Info

Publication number
WO2015128914A1
WO2015128914A1 PCT/JP2014/005658 JP2014005658W WO2015128914A1 WO 2015128914 A1 WO2015128914 A1 WO 2015128914A1 JP 2014005658 W JP2014005658 W JP 2014005658W WO 2015128914 A1 WO2015128914 A1 WO 2015128914A1
Authority
WO
WIPO (PCT)
Prior art keywords
program
software
execution instruction
instruction sequence
update
Prior art date
Application number
PCT/JP2014/005658
Other languages
French (fr)
Japanese (ja)
Other versions
WO2015128914A9 (en
Inventor
昌行 桐村
Original Assignee
三菱電機株式会社
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 三菱電機株式会社 filed Critical 三菱電機株式会社
Priority to JP2016504868A priority Critical patent/JP6042025B2/en
Priority to CN201480075765.XA priority patent/CN106030539A/en
Priority to TW103139501A priority patent/TW201533664A/en
Publication of WO2015128914A1 publication Critical patent/WO2015128914A1/en
Publication of WO2015128914A9 publication Critical patent/WO2015128914A9/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates

Definitions

  • the present invention relates to a software update method for software-equipped devices.
  • the update program is downloaded to the reserved area in advance while the current program is being executed. After the download is completed, the current program is replaced with the update program.
  • Patent Document 1 in an environment where a plurality of OSs (Operating Systems) operate on the same H / W, a time during which processes with the same processing content executed when updating the software of each OS is executed in parallel There has been proposed a method of adjusting the execution order so that is shortened.
  • OSs Operating Systems
  • Patent Document 2 proposes a method of storing a means for determining whether a device is used or not, and automatically downloading software from a server when the device is not used.
  • Patent Document 3 a normal state in which an application can be executed in a normal energized state and a standby state in which the power consumption is limited and the application is not executed can be switched, and the application is downloaded in the standby state. Has been proposed.
  • the present invention has been made to solve the above-described problems.
  • the first program for controlling a device connected to a device, and the size of the program is smaller than that of the first program.
  • a storage unit storing a second program including a part of the plurality of functions of the program, and the first unit when connected to the storage unit and receiving an update request for the first program
  • a control unit that stops the execution of the program, overwrites and updates the first program, and executes the partial function of the second program during the update of the first program.
  • the present invention can update software with a small storage area.
  • FIG. 1 is a system configuration diagram according to an embodiment of the present invention. It is a hardware block diagram of the software mounting apparatus in embodiment of this invention. It is a software block diagram which operate
  • FIG. 1 is a system configuration diagram according to the present embodiment.
  • the system in the present embodiment includes a software-equipped device 1, a software distribution server 2, and a network 3.
  • the software-equipped device 1 is a built-in device such as white goods or a personal computer, and downloads software and updates the downloaded software through a network.
  • the software distribution server 2 has a function of distributing an update program (software) to the software-equipped device 1 through the network.
  • the network 3 is a communication means such as the Internet.
  • the network 3 may be wireless or wired.
  • FIG. 2 is a hardware configuration diagram of the software-equipped device 1 in the present embodiment.
  • the software-equipped device 1 includes a CPU 10 (Central Processor Unit), ROM 11 (Read Only Memory), RAM 12 (Random Access Memory), a communication module 13, a device 14, an LED (Light Emitting Diode) 15, and an electronic buzzer. 16, a timer 17, and a power switch 18.
  • the ROM 11 provides an area for storing a program instruction sequence and fixed data. It corresponds to a flash memory and the like, and the written program content can be rewritten.
  • the RAM 12 provides a work area for storing and referring to data used by the program.
  • the communication module 13 transmits and receives data between communication devices through a network infrastructure such as the Internet.
  • the device 14 is a device that the software-equipped device 1 has. Examples of devices include stepping motors and PWM (Pulse Width Modulation) motors that are used to operate refrigerator fans and compressors, air conditioner fans and louvers, and the like. Note that although only one device 14 is described in the software-equipped device 1 in FIG. 2, it may be configured by a plurality of devices.
  • PWM Pulse Width Modulation
  • the LED 15 is a semiconductor element that notifies the user of the operation status of the device by light pattern output such as lighting and blinking.
  • the electronic buzzer 16 is a device that notifies the user of the operation status of the device by ringing an electronic sound.
  • the timer 17 measures the timing at which a program command is executed, the output timing to the device 14 and the like in addition to the time.
  • the power switch 18 is a button for operating the power source of the software-equipped device 1, and the switch may be mounted on the main body or a remote controller.
  • FIG. 3 is an overall configuration diagram of software operating on the software-equipped device 1 in the present embodiment. These software are stored in the ROM 11 or the RAM 12 and executed by the CPU 10 as a control unit.
  • a main program (first program) 100 is a program that characterizes the function of the software-equipped device 1 as a product. Usually, the main program 100 is a device connected to the software-equipped device 1. Control is in progress.
  • the subprogram 200 has an instruction to execute device control instead of the main program 100 when an update request to the main program 100 is generated, and includes a software module for updating the main program 100.
  • the program switching unit 300 receives an update request for the main program 100 from the outside such as the software distribution server 2 or makes an inquiry about the update request to the outside. As a result, when the update request is received, the subprogram 200 Is a program that instructs updating. In addition, the program switching unit 300 has a function of ending the control of the device executed by the subprogram 200 after the update to the main program 100 is completed and returning the device control to the main program 100 replaced with the update program. have.
  • the OS 110 is basic software for operating the main program 100.
  • the application operating on the OS 110, the application a (120a), the application b (120b), and the application n (120n) are programs in which the functions of the software-equipped device 1 are installed.
  • a driver a (130a), a driver b (130b), and a driver m (130m) incorporated in the OS 100 are device drivers and programs for controlling the hardware (device) of the software-equipped device 1. is there.
  • the scheduling unit 210 receives an operation instruction from the program switching unit 300.
  • operation instructions There are two types of operation instructions. The first is an analysis instruction for examining the operation status of the main program 100. The second is an update execution instruction for executing the control of the device in place of the main program 100 during the update work and the update work in which the content of the main program 100 is replaced with the update program.
  • the scheduling unit 210 When the analysis instruction is received, the scheduling unit 210 is called.
  • the called analysis unit 220 collects execution instructions of the main program 100 and pattern-determines the periodicity of the execution instructions from the collected execution instruction sequence (execution instruction sequence). Based on this pattern determination, the analysis unit 220 extracts a group of instructions that the CPU 10 executes periodically, and stores the instruction group in the storage area 230 as a periodic execution instruction sequence. After the analysis is completed, the analysis unit 220 notifies the program switching unit 300 of the completion.
  • the storage area 230 is an area (storage section) for storing the periodic execution instruction sequence extracted by the analysis section 220, and is a storage area on the ROM 11 and RAM 12 that is reserved by the subprogram 200.
  • the scheduling unit 210 calls the execution unit 240 and the update unit 250 when receiving an update execution instruction.
  • the execution unit 240 is a module that executes a periodic program (second program) previously extracted from the software operation of the main program 100 and stored in the storage area 230.
  • the update unit 250 receives the update program from the software distribution server 2 via the communication module 13 while the execution unit 240 is executing the periodic program extracted from the software operation of the main program 100. It is a module that performs rewriting and updating.
  • the program switching unit 300 is a program for instructing the main program 100 and the subprogram 200 to start or stop.
  • the program switching unit 300 is called first when the software-equipped device 1 is activated, and causes the CPU 10 to execute the main program 100.
  • FIG. 4 is a diagram illustrating a software configuration inside the program switching unit 300.
  • an update request receiving unit 310 receives an update request that the software distribution server 2 transmits to the software-equipped device 1 before distributing the update program. This reception is performed via the communication module 13 of FIG.
  • the update request receiving unit 310 sends an analysis instruction to the subprogram 200 via the program start / stop unit 320.
  • the program start / stop unit 320 sends an operation instruction to the main program 100 and the subprogram 200.
  • the subprogram 200 that receives the analysis instruction executes the analysis of the main program 100, and returns an analysis completion notification when the analysis is completed. Receiving this analysis completion notification, the cycle timing synchronization unit 330 sends a stop instruction to the main program 100 and an update execution instruction to the subprogram 200 via the program start / stop unit 320.
  • the subprogram 200 Upon receiving the update execution instruction, the subprogram 200 executes the update process of the main program 100 and transmits an update completion notification to the update completion receiving unit 340 when the update is completed. Receiving this notification, the update completion receiving unit 340 sends a stop instruction to the subprogram 200 and sends an execution instruction to the main program 100 via the program start / stop unit 320. Note that since the program switching unit 300 starts the main program 100 immediately after startup, the main program 100 can be started by rebooting the software-equipped device 1.
  • the software distribution server 2 obtains an update program for the main program 100 from the outside (not shown).
  • the acquisition method may be received from another network, or may be acquired via an external storage device or medium.
  • the software distribution server 2 manages the version of the main program 100 used in the software-equipped device 1, and when an update program is obtained, the software distribution server 2 performs a comparison and updates only when it is determined that an update is necessary. Assume that a request is sent to the software device 1.
  • the software distribution server 2 may send all received update programs to the software-equipped device 1 so that the software-equipped device 1 may determine whether update is necessary.
  • the software distribution server 2 may send an update request only when the software-equipped device 1 inquires about the presence or absence of the update program and the update program exists.
  • the update request receiving unit 310 receives a software update request from the software distribution server 2 (S101). Next, the update request receiving unit 310 sends an analysis instruction for examining the operation status of the main program 100 to the subprogram 200 via the program start / stop unit 320.
  • the scheduling unit 210 may be called together with an argument that can be determined as an analysis instruction from the program start / stop unit 320. Also, a memory area that can be accessed in common by the program start / stop unit 320 and the scheduling unit 210 is prepared, the scheduling unit 210 polls this area, and the program start / stop unit 320 changes the value of this area. Analysis instructions may be sent to the subprogram 200.
  • the scheduling unit 210 that has received the analysis instruction calls the analysis unit 220.
  • the analysis unit 220 analyzes the main program 100. In performing the analysis, the analysis unit 220 records an execution instruction operating in the main program 100 (S102).
  • the analysis unit 220 analyzes the recorded sequence of execution instructions (execution instruction sequence), extracts a cyclic execution instruction sequence from the execution instruction sequence, and stores it in the storage area 230 (S103). The analysis of the execution instruction sequence will be described with reference to FIGS.
  • FIG. 6 is a diagram showing an example of extraction of a cyclic execution instruction sequence in the present embodiment.
  • a method for detecting periodically executed instructions and extracting instructions to be executed during update processing will be described.
  • the present invention is not limited to this, and instructions corresponding to predetermined functions are described below. It is also possible to use a method of detecting an instruction and extracting an instruction.
  • an address indicating a specific range in the main program 100 can be stored in the ROM 11 in advance, or the software-equipped device 1 can obtain from the distribution server 2 to specify and extract a command.
  • execution instructions 610a to 610m are machine languages of the main program 100 executed by the CPU 10.
  • FIG. 6 shows a state in which execution is performed sequentially from the left along the execution time.
  • a group of a plurality of execution instructions is called an execution instruction sequence.
  • a group of execution instructions 610a to 610m is called an execution instruction sequence 610.
  • the periodic execution instruction sequence 620 is an execution instruction sequence that is periodically repeated as a result of analyzing the execution instruction sequence 610 (execution instructions 610a to 610m).
  • an instruction executed by an application (120a to 120n) operating in the main program 100 may be output to a log, and the analysis unit 220 may refer to it.
  • an instruction executed by the OS 110 may be output to a log, and the analysis unit 220 may refer to it.
  • the analysis unit 220 records and analyzes the collected execution instructions. As shown in FIG. 6, A, B, C, D, A, B, C, D, A, B, C, D, A, etc., the same repetitive pattern continues for a certain period of time. If detected, for example, in this case, A, B, C, and D are extracted as the periodic execution instruction sequence 620. Thereafter, the analysis unit 220 stores the extracted periodic execution instruction sequence 620 in the storage area 230.
  • the fixed period and the number of repetitive patterns to be analyzed depend on how periodically all the applications (120a to 120n) executed on the software-equipped device 1 operate, so statistically investigated in advance. For example, a value such as a period of 100 milliseconds and the number of patterns of 5 is used as a predetermined condition.
  • a pattern extraction algorithm for determining periodicity an algorithm such as a pattern recognition algorithm used in natural information processing or the like may be used.
  • Fig. 7 shows an example of execution instructions.
  • the collected data 701 is a collection of execution instructions collected by the analysis unit 220, and the analysis data 702 indicates a periodic execution instruction sequence extracted after the analysis unit 220 analyzes the collected data 701.
  • the left column of the collected data 701 and the analysis data 702 is an execution ID for identifying an execution command.
  • execution instruction column of FIG. 7 for ease of understanding, it is written in assembly language (mnemonic), but actually machine language is substituted.
  • the analysis unit 220 extracts the execution ID 0x3502 to execution ID 0x3505 and the execution ID 0x3506 to execution ID 0x350B as a cyclic execution instruction sequence. To do.
  • the execution instruction is recorded (S102) again.
  • the execution instruction may be executed after waiting for a while, not immediately.
  • the time to wait for a while may be determined in advance, or a value sent together with the update program may be used.
  • the analysis unit 220 sends an analysis completion notification to the program switching unit 300.
  • the cycle timing synchronization unit 330 switches from the main program 100 to the subprogram 200.
  • the cycle timing synchronization unit 330 calculates the timing for switching the execution position from the main program 100 to the cycle execution command sequence based on the information of the cycle execution command sequence received from the analysis unit 220 (S105).
  • the analysis unit 220 executes an execution ID of the first execution instruction in the cyclic execution instruction sequence, a time when the first execution instruction is executed in the main program 100, and The period time required for the execution of the cyclic execution instruction sequence is sent. Note that when this method is used, when the analysis unit 220 collects execution instructions of the main program 100, it is also necessary to record the time.
  • the cycle timing synchronization unit 330 calculates the next time from the current time (eg, t1), the time (t0) last executed by the main program 100, and the cycle time (tc) required to execute the cycle execution instruction sequence.
  • the predicted time (tn) of the first execution instruction of the cyclic execution instruction sequence to be executed is calculated. Then, the cycle timing synchronization unit 330 performs switching from the main program 100 to the subprogram 200 at the predicted time (tn). (S106).
  • FIG. 8 shows an example of switching from the main program 100 to the subprogram 200.
  • the execution of the main program 100 is stopped at the time tn obtained by adding the period time tc to the time t0 last executed by the main program 100, and the subprogram 200 instead.
  • the execution instruction of the periodic execution instruction sequence 620 is issued.
  • the program start / stop unit 320 sends a stop operation instruction to the main program 100.
  • an application for receiving a stop instruction may be prepared in advance on the main program 100 side and called from the program start / stop section 320, or the program switching section 300 and the main program may be called.
  • a memory area that can be accessed in common with 100 is prepared, and the program start / stop unit 320 may send a stop operation instruction to the main program 100 by changing the value of this area.
  • the program start / stop unit 320 sends an update execution instruction to the scheduling unit 210.
  • the scheduling unit 210 that has received the update execution instruction executes the execution unit 240 and the update unit 250 at the same time.
  • One execution unit 240 refers to the storage area 230 and starts executing the cyclic execution instruction sequence. Note that the execution unit 240 continues to execute the cyclic execution instruction sequence repeatedly.
  • the other update unit 250 downloads the update program via the communication module 13 and updates the main program 100 by overwriting (S107). While performing the update, the execution unit 240 executes a part of the processing required by the software-equipped device 1, so that a new memory is not required for the update program, and the update program is directly added to the main program 100. It can be downloaded.
  • the update unit 250 sends a completion notification to the program switching unit 300 (S108).
  • the program switching unit 300 Upon receipt of the completion notification, the program switching unit 300 stops the device (S109) and restarts the software-equipped device 1 (S110). Note that, depending on the device 14 connected to the software-equipped device 1, for example, in the case of a device that requires time for activation, the operation of the device 14 is temporarily interrupted, so the program switching unit 300 automatically restarts. Instead, the restart timing may be adjusted by manually operating the power switch 18.
  • the program switching unit 300 starts the updated main program 100 (S111).
  • the copy program is smaller in size than the main program 100, and the capacity of the storage area necessary for software update can be saved.
  • the update operation can be performed while continuing the operation on the device 14.
  • the analysis unit 220 extracts the cyclic execution instruction sequence. However, the cyclic execution instruction sequence is extracted before the update request is received. You can go there. Further, while the analysis unit 220 does not extract the periodic execution instruction sequence and updates the main program 100, the cyclic execution instruction sequence necessary for the software-equipped device 1 to control the device 14 is stored in the storage area 230 in advance. It may be stored. At this time, the timing at which the cycle timing synchronization means 330 sends a stop instruction to the main program 100 is also stored in the storage area 230. The periodic execution instruction sequence necessary for the software-equipped device 1 to control the device 14 may be stored in the storage area 230 at the time of factory shipment, or may be written later. Alternatively, the update unit 250 may receive the update program received from the software distribution server 2 and store it in the storage area 230.
  • Embodiment 2 FIG. In the present embodiment, a case will be described in which the operation of the device 14 connected to the device is referred to in order to extract a process that repeatedly operates.
  • FIG. 9 is an overall configuration diagram of software that operates on the software-equipped device 1 in the present embodiment.
  • a periodic output analysis unit 920 is software for monitoring the operation of the device driver of the main program 100, determines its periodicity from its execution order and timing, extracts a periodic output pattern, and executes the same periodic output A possible periodic execution instruction sequence is stored in the storage area 230.
  • the same reference numerals as those in FIG. 3 represent the same or corresponding parts, and operations other than the periodic output analysis unit 920 perform the same operations as those described in FIG. 3 used in the first embodiment.
  • the update request receiving unit 310 sends an analysis instruction for examining the operation status of the main program 100.
  • This instruction can be realized by sending an analysis instruction by calling the scheduling unit 210 from the program start / stop unit 320, or can be commonly accessed by the program start / stop unit 320 and the scheduling unit 210.
  • a memory area is prepared, the scheduling unit 210 polls this area, and the program start / stop unit 320 changes the value of this area, thereby sending an analysis instruction to the subprogram 200. You can also.
  • the scheduling unit 210 calls and executes the periodic output analysis unit 920.
  • the periodic output analysis unit 920 analyzes the main program 100. In performing the analysis, the periodic output analysis unit 920 monitors the device drivers (driver a to driver m) operating in the main program 100 and records their execution order (output instructions) and their execution times ( S202).
  • the recording destination of the periodic output may be the memory area on the RAM 12 temporarily prepared by the periodic output analysis unit 920 or the storage area 230.
  • the periodic output analysis unit 920 analyzes the recorded periodic output, extracts an execution instruction sequence that can execute the same periodic output from a list of execution instruction sequences prepared in advance, and stores it as a periodic execution instruction sequence Store in the area 230 (S203).
  • the cyclic execution instruction sequence is the same as in the first embodiment. Note that only one execution instruction sequence prepared in advance may be used as a cyclic execution instruction sequence that is repeatedly executed. When repeatedly executing, the time, the address of the memory to be written, the value to be written, and the time to write the value may be passed as arguments to the execution instruction sequence.
  • FIG. 11 is a diagram showing an example of extraction of a periodic output pattern in the present embodiment.
  • device output records 1110a to 1110i are records of output patterns for the device 14 and their execution times.
  • FIG. 11 shows a state in which execution is performed sequentially from the left along the execution time.
  • the periodic output pattern 1120 is an output pattern that is periodically repeated as a result of analyzing the device output records 1110a to 1110i.
  • the execution instruction sequence list 1130 is a list of execution instruction sequences for executing a specific output pattern. Advance what the output instruction previously examined whether performed, are prepared an execution command sequence to perform the same output. In FIG.
  • the state of outputting 1 to the motor X is a millisecond (this is an output pattern ⁇ ), and the state of outputting 2 to the motor X.
  • b milliseconds this is assumed to be output pattern ⁇
  • the state that 3 is output to motor Y is c milliseconds (this is assumed to be output pattern ⁇ )
  • Output pattern ⁇ and output pattern ⁇ The output pattern ⁇ is extracted as the periodic output pattern 1120.
  • the periodic output analysis unit 920 creates a periodic execution instruction sequence combination 1140 for executing the extracted periodic output pattern 1120 by referring to the execution instruction sequence list 1130. Thereafter, the cycle output analysis unit 920 stores the combination 1140 of cycle execution instructions in the storage area 230.
  • the fixed period and the number of repetitive output patterns to be analyzed depend on how periodically all the device drivers executed in the software-equipped device 1 operate. For example, it is used as a condition where a value such as a period of 100 milliseconds and an output pattern number of 5 is given.
  • a pattern extraction algorithm for determining periodicity an algorithm such as a pattern recognition algorithm used in natural information processing or the like may be used.
  • the access time to the device may vary depending on the device status (environment such as temperature and humidity, and aging degradation). Therefore, for example, in the above example, if the output patterns of ⁇ , ⁇ , and ⁇ are observed, even if there is a slight increase / decrease in each execution period, it is allowed. Since the allowable range depends on the device connected to the software-equipped device 1, it is used as a condition in which a value such as an increase or decrease of 1% is given as a result of statistical investigation in advance.
  • the device drivers (driver a to driver m) operating in the main program 100 are monitored and their execution order is monitored. (Output command) and its execution time are recorded again (S202).
  • the execution order and the recording of the execution time (S202) may be executed after waiting for a while rather than immediately. The time to wait for a while may be determined in advance, or a value sent together with the update program may be used.
  • the periodic output analysis unit 920 sends an analysis completion notification to the program switching unit 300.
  • the cycle timing synchronization unit 330 switches from the main program 100 to the subprogram 200.
  • the cycle timing synchronization unit 330 calculates timing for switching execution from the main program 100 to the execution unit 240 based on the information of the cycle output pattern received from the cycle output analysis unit 920 (S205). There are the following methods for calculating the timing.
  • the periodic output analysis unit 920 includes, as an analysis completion notification or in addition to an analysis completion notification, an execution ID of the first execution instruction sequence of the cycle execution instruction sequence combination 1140 and a device corresponding to the first execution instruction sequence
  • the time when the output 14 is executed by the main program 100 and the period time required for the execution of the cycle execution instruction sequence are sent. Note that when this method is used, when the output pattern of the main program 100 is collected by the periodic output analysis unit 920, the time must also be recorded.
  • the cycle timing synchronization unit 330 is configured to execute the current time (for example, t1), the time (t0) when the output pattern was last output in the main program 100, and the cycle time required to execute the combination 1140 of the cycle execution instruction sequence ( From tc), the predicted time (tn) of the first execution instruction of the cyclic execution instruction sequence to be executed next is calculated. Then, the cycle timing synchronization unit 330 performs switching from the main program 100 to the subprogram 200 at the predicted time (tn). (S206).
  • FIG. 12 shows an example of switching from the main program 100 to the subprogram 200.
  • the execution of the main program 100 is stopped at the time tn obtained by adding the period time tc to the time t0 last executed in the main program 100, and ⁇ is output to the subprogram 200 instead.
  • An instruction to execute a combination of periodic execution instruction sequences 1140 is issued.
  • the program start / stop unit 320 sends a stop operation instruction to the main program 100.
  • an application for receiving a stop instruction may be prepared in advance on the main program 100 side and called from the program start / stop section 320, or the program switching section 300 and the main program may be called.
  • a memory area that can be accessed in common with 100 is prepared, and the program start / stop unit 320 may send a stop operation instruction to the main program 100 by changing the value of this area.
  • the program start / stop unit 320 sends an update execution instruction to the scheduling unit 210.
  • the scheduling unit 210 executes the execution unit 240 and the update unit 250 at the same time.
  • the execution unit 240 refers to the storage area 230 and starts executing the cyclic execution instruction sequence. Note that the execution unit 240 continues to execute the cyclic execution instruction sequence repeatedly.
  • the subsequent processing is the same as the procedure described in the first embodiment.
  • the periodic output analysis unit 920 extracts the periodic output pattern after receiving the software update request from the software distribution server 2, but the periodic output pattern is extracted before the update request is received. You can go there.
  • Embodiment 3 FIG.
  • a no-processing period is analyzed with respect to the periodic execution instruction sequence 620 analyzed by the analysis unit 220 and an extended processing program statically prepared by a user is inserted in advance.
  • an extended processing program prepared statically by the user it is possible to execute the extended processing program while the periodic execution instruction sequence 620 is being executed.
  • an external interrupt reception such as a remote control or an LED flashing program
  • the remote control reception processing and LED flashing processing may be performed while the periodic execution instruction sequence 620 is being executed. it can.
  • FIG. 13 is an overall configuration diagram of software operating on the software-equipped device 1 in the present embodiment.
  • an extended processing storage area 2040 is an extended processing program that is statically prepared in advance by the user.
  • the extended processing program is a program that is desired to be further executed during execution of the periodic execution instruction sequence 620, and may be a program for accepting external interrupts such as the above-mentioned remote control or a blinking program for LEDs.
  • the extended processing program prepared in the extended processing storage area 2040 may be obtained via an external storage device or a communication module.
  • the no-process period extraction unit 2010 extracts a period (no-process period) in which no-process continues continuously from the periodic execution instruction sequence stored in the storage area 230 and stores it in the no-process-period storage area 2020. It is.
  • the non-processing period storage area 2020 and the extended processing storage area 2040 are configured differently from the storage area 230. However, the contents stored in the non-processing period storage area 2020 and the extended processing storage area 2040 May be stored in the storage area 230.
  • the extended process division insertion unit 2030 refers to the no-process period from the no-process period storage area 2020, divides the extended process instruction sequence stored in the extended process storage area 2040 by the no-process period length, and Duplicate the cyclic execution instruction sequence by the number, and for each duplicated cyclic execution instruction sequence, duplicate the divided extended processing instruction sequence in its non-processing period part, and copy those extended processing instruction sequences to one cyclic execution instruction It is stored in the storage area 230 as a column.
  • the same reference numerals as those in FIG. 3 represent the same or corresponding parts, except for the non-processing period extraction unit 2010, the non-processing period storage area 2020, the extended processing division insertion section 2030, and the extended processing storage area 2040. Performs the same operation as that described in FIG. 3 used in the first embodiment.
  • the operation in the third embodiment is the same as the procedure described in the first embodiment, and only the difference from the operation described in the first embodiment will be described below.
  • the non-processing period extraction unit 2010 extracts a non-processing period from the cyclic execution instruction sequence stored in the storage area 230.
  • the no-processing period refers to a period in which a situation in which the CPU is not performing calculation processing or accessing a register, such as a NOP (No Operation) instruction in the assembler.
  • the non-processing period extraction unit 2010 stores this non-processing period information in the non-processing period storage area 2020 (S301). With the above processing, it can be understood at which timing no processing is performed in the cyclic execution instruction sequence.
  • the non-processing period extraction unit 2010 calls the extended processing division insertion unit 2030 after storing the non-processing period information in the non-processing period storage area 2020.
  • the extended process dividing / inserting unit 2030 copies the extended process program stored in the extended process storage area 2030 to the non-process period of the cyclic execution instruction sequence and stores it in the storage area 230 as a new cyclic execution instruction sequence. Yes (S302).
  • the update unit 250 checks the cyclic execution instruction sequence stored in the storage area 230 and determines whether there is an external interrupt process in the interrupt process (S303). The determination may be performed by directly checking the inside of the cyclic execution instruction sequence, or when the extended processing division insertion unit 2030 updates the cyclic execution instruction sequence, information indicating that fact is included in a part of the storage area 230. It may be stored. For example, when it is desired to interrupt and restart a periodic execution by an external interrupt from a remote controller or the like, a process for receiving an external interrupt signal is defined as an extended process.
  • the update unit 250 When the update unit 250 receives an external interrupt signal (S304: YES), the update unit 250 sends a download completion notification of the update program to the program switching unit 300, and the program switching unit 300 stops the device and restarts it.
  • the update unit 250 waits until an external interrupt signal is received. Although not shown, the update unit 250 continues to wait until an external interrupt signal is received, so that the process automatically proceeds to S108 when a preset time has elapsed. Also good.
  • FIGS. 15 and 16 are diagrams illustrating an example of extraction of a non-processing period in the non-processing period extraction unit 2010 of this embodiment and addition of an extension process to the non-processing period.
  • execution instruction sequences 2110a to 2110m are execution instruction sequences obtained by collecting execution instructions of the main program 100, and NOPs appear periodically such as 2110c, 2110g, and 2110k.
  • the method for extracting the repetitive pattern is the same as in the first embodiment, and the extracted periodic execution instruction sequence is defined as a first periodic execution instruction sequence 2120.
  • the first periodic execution instruction sequence 2120 includes NOP2120 nop.
  • the details when the no-process period extraction unit 2010 extracts the no-process period and stores the extension process will be described with reference to FIG.
  • the extension process stored in the extension process storage area 2040 there is an extension process 2130 having an instruction length of topt.
  • the no-process period extraction unit 2010 extracts the continuous NOP process continuous period 2120 nop from the extracted periodic execution instruction sequence 2120 and stores it in the no-process period storage area 2020.
  • the extended process division inserting unit 2030 refers to the extended process 2130 stored in the extended process storage area 2040 and compares the no-process period 2120 nop with its instruction length. At this time, when the instruction length topt of the extension process 2130 is longer than the instruction length tnop of the no-process period 2020 nop, the extension process 2130 is time-divided by tnop. For example, it is assumed that the time-divided expansion processes are stored as the expansion process 2131 (expansion 1) and the expansion process 2132 (expansion 2), respectively.
  • the extended process dividing / inserting unit 2030 duplicates the cyclic execution instruction sequence 2120 and prepares it for the number of time divisions (two in this case), and creates the cyclic execution instruction sequence 2141 and the cyclic execution instruction sequence 2142. Then, the extension process 2131 and the extension process 2132 are duplicated for the no-process period 2120 nop of each cyclically executed instruction sequence.
  • the non-processing period 2120 nop of the cyclic execution instruction sequence 2141 and the extended processing 2131 are exactly the same because the processing time is the same, but the non-processing period 2120 nop of the cyclic execution instruction sequence 2141 and the extended processing 2132 do not match the processing time. In the illustrated example, NOP2133 remains.
  • the extended process dividing / inserting unit 2030 concatenates the copied periodic execution instruction sequences and stores them in the storage area 230.
  • the cyclic execution instruction sequence 2141 and the cyclic execution instruction sequence 2142 are concatenated to generate one cyclic execution instruction sequence 2150 and save it in the storage area 230.
  • the subsequent processing is the same as the procedure described in the first embodiment.
  • an algorithm such as a pattern recognition algorithm used in natural information processing or the like may be used as a pattern extraction algorithm for extracting a non-processing period.
  • an arbitrary program of the user may be stored in the expansion process.
  • a program that causes the LED to blink it is possible to cause the LED that accompanies the product to blink while the update program is being downloaded.
  • the program receives a remote control interrupt and restarts (jumps to the reset vector), after downloading the update program, it receives the remote control signal, stops periodic execution at the user's timing, and restarts Is possible.
  • the extension process may be an arbitrary program of the user, but it must not be a program dependent on the OS or existing library, such as an OS system call or an existing library call. This is because the periodic processing is composed only of a periodic execution instruction sequence and does not include processing such as an OS.
  • the storage area 230 is the storage unit.
  • the areas for storing the main program 100, the subprogram 200, and the program switching unit 300 may be combined as a storage unit.
  • 1 software-equipped device 2 software distribution server, 3 network, 10 CPU, 11 ROM, 12 RAM, 13 communication module, 14 device, 15 LED, 16 electronic buzzer, 17 timer, 18 power switch, 100 main program, 110 OS, 120a-120n application, 130a-130m device driver, 200 subprogram, 210 scheduling unit, 220 analysis unit, 230 storage area, 240 execution unit, 250 update unit, 300 program switching unit, 310 update request receiving unit, 320 program start / stop Unit, 330 periodic timing synchronization unit, 340 update completion receiving unit, 610a to 610m execution instruction sequence, 620 periodic execution instruction sequence, 701 analysis unit 22 , 702, table showing periodic execution instruction sequences extracted after analysis by the analysis unit 220, 920 periodic output analysis unit, 1110a to 1110i device output record, 1120 periodic output pattern, 1130 List of execution instruction sequences, 1140 Combination of cyclic execution instruction sequences, 2010 No processing period extraction unit, 2020 No processing period storage area, 2030 Extended processing division insertion section, 2040 Extended processing storage area, 21

Abstract

 The present invention is provided with a software-installed apparatus (1) characterized in having: a storage unit which is designed to realize the updating of software in a small storage area, and in which are stored a first program (100) for controlling a device (14) connected to the apparatus and a second program (200) smaller in size than the first program (100), the second program (200) including only some of a plurality of functions of the first program (100); and a control unit, connected to the storage unit, which, when a request for updating the first program (100) is accepted, stops executing the first program and updates the first program (100) by overwriting, and also executes some functions of the second program while updating the first program.

Description

ソフトウェア搭載機器及びソフトウェア更新方法Software-equipped equipment and software update method
 本発明は、ソフトウェア搭載機器におけるソフトウェア更新方法に関する。 The present invention relates to a software update method for software-equipped devices.
 インターネットなどの通信手段を通じてソフトウェアをダウンロード及び更新可能な情報機器において、機器の動作を継続しつつ、ソフトウェアの更新を同時に行うことが求められている。 In an information device that can download and update software through communication means such as the Internet, it is required to update the software simultaneously while continuing the operation of the device.
 このような要求に対して、修正プログラムを含むすべての更新プログラムを格納する領域をあらかじめ確保する方法が提案されている。 In response to such a request, a method has been proposed in which an area for storing all update programs including a correction program is secured in advance.
 この方法では、現行のプログラムを実行したまま、更新プログラムをあらかじめ確保しておいた領域にダウンロードしている。そして、ダウンロードが終了した後に現行プログラムから更新プログラムへの置き換えを行っている。 In this method, the update program is downloaded to the reserved area in advance while the current program is being executed. After the download is completed, the current program is replaced with the update program.
 特許文献1では、複数OS(Operating System)が同一のH/W上で動作する環境下において、それぞれのOSのソフトウェアの更新の際に実行される処理内容が等しい処理を並列に実行される時間が短くなるよう、実行順序を調整する手法が提案されている。 In Patent Document 1, in an environment where a plurality of OSs (Operating Systems) operate on the same H / W, a time during which processes with the same processing content executed when updating the software of each OS is executed in parallel There has been proposed a method of adjusting the execution order so that is shortened.
 特許文献2では、機器の使用及び非使用時を判断する手段を保有し、非使用時に自動的にソフトウェアをサーバからダウンロードする手法について提案されている。 Patent Document 2 proposes a method of storing a means for determining whether a device is used or not, and automatically downloading software from a server when the device is not used.
 特許文献3では、通常の通電状態でありアプリケーションが実行可能な通常状態と、消費電力を制限するとともにアプリケーションの実行を伴わないスタンバイ状態の切り替えを可能とし、そのスタンバイ状態においてアプリケーションのダウンロードを行う手法が提案されている。 In Patent Document 3, a normal state in which an application can be executed in a normal energized state and a standby state in which the power consumption is limited and the application is not executed can be switched, and the application is downloaded in the standby state. Has been proposed.
特開2012-181578号公報JP 2012-181578 A 特開2012-018657号公報JP 2012-018657 A 特開2013-099557号公報JP 2013-099557 A
 従来のソフトウェア搭載機器では、更新対象となるプログラムと同等の空き記憶領域を用意しておく必要がある。従来のソフトウェア搭載機器では、更新の通知を受けた後、更新プログラムを前記空き記憶領域に、ダウンロードする。そして、ダウンロード完了後に既存プログラムから更新プログラムに切り替えを行っている。 In conventional software-equipped devices, it is necessary to prepare a free storage area equivalent to the program to be updated. In a conventional software-equipped device, after receiving an update notification, the update program is downloaded to the free storage area. Then, after the download is completed, the existing program is switched to the update program.
 そのため、従来のソフトウェア搭載機器では、ソフトウェアの更新規模に応じた記憶領域が別途必要となり、記憶領域のコストが増大するという課題があった。 For this reason, conventional software-equipped devices require a separate storage area in accordance with the software update scale, which increases the cost of the storage area.
 この発明は、上記のような課題を解消するためになされたもので、機器に接続されたデバイスを制御する第1のプログラム及び、前記第1のプログラムよりプログラムの大きさが小さく、前記第1のプログラムの複数の機能のうち、一部の機能を含む第2のプログラムが記憶された記憶部と、前記記憶部と接続され前記第1のプログラムの更新要求を受け付けた場合に、前記第1のプログラムの実行を停止し、前記第1のプログラムを上書き更新するとともに、前記第1のプログラムの更新中に、前記第2のプログラムの前記一部の機能を実行する制御部とを有することを特徴とするソフトウェア搭載機器を提供する。 The present invention has been made to solve the above-described problems. The first program for controlling a device connected to a device, and the size of the program is smaller than that of the first program. A storage unit storing a second program including a part of the plurality of functions of the program, and the first unit when connected to the storage unit and receiving an update request for the first program A control unit that stops the execution of the program, overwrites and updates the first program, and executes the partial function of the second program during the update of the first program. Providing software-equipped equipment with features.
 本発明は、少ない記憶領域でソフトウェアの更新ができる。 The present invention can update software with a small storage area.
この発明の実施の形態におけるシステム構成図である。1 is a system configuration diagram according to an embodiment of the present invention. この発明の実施の形態におけるソフトウェア搭載機器のハードウェア構成図である。It is a hardware block diagram of the software mounting apparatus in embodiment of this invention. この発明の実施の形態1におけるソフトウェア搭載機器上で動作するソフトウェア構成図である。It is a software block diagram which operate | moves on the software mounting apparatus in Embodiment 1 of this invention. この発明の実施の形態におけるプログラム切り換え部の構成図である。It is a block diagram of the program switching part in embodiment of this invention. この発明の実施の形態1における全体処理の動作を示すフローチャートである。It is a flowchart which shows the operation | movement of the whole process in Embodiment 1 of this invention. この発明の実施の形態1における周期実行命令列の抽出例を示した図である。It is the figure which showed the example of extraction of the periodic execution command sequence in Embodiment 1 of this invention. この発明の実施の形態1における実行命令の例である。It is an example of the execution instruction in Embodiment 1 of this invention. この発明の実施の形態1におけるメインプログラムからサブプログラムへの切り換えを示す図である。It is a figure which shows switching from the main program in Embodiment 1 of this invention to a subprogram. この発明の実施の形態2におけるソフトウェア搭載機器上で動作するソフトウェア構成図である。It is a software block diagram which operate | moves on the software mounting apparatus in Embodiment 2 of this invention. この発明の実施の形態2における全体処理の動作を示すフローチャートである。It is a flowchart which shows the operation | movement of the whole process in Embodiment 2 of this invention. この発明の実施の形態2における周期出力パターンの抽出の例を示した図である。It is the figure which showed the example of extraction of the periodic output pattern in Embodiment 2 of this invention. この発明の実施の形態2におけるメインプログラムからサブプログラムへの切り換えを示す図である。It is a figure which shows the switching from the main program in Embodiment 2 of this invention to a subprogram. この発明の実施の形態3におけるソフトウェア搭載機器上で動作するソフトウェア構成図である。It is a software block diagram which operate | moves on the software loading apparatus in Embodiment 3 of this invention. この発明の実施の形態3における全体処理の動作を示すフローチャートである。It is a flowchart which shows the operation | movement of the whole process in Embodiment 3 of this invention. この発明の実施の形態3におけるNOPを含んだ周期出力パターンの抽出の例を示した図である。It is the figure which showed the example of extraction of the periodic output pattern containing NOP in Embodiment 3 of this invention. この発明の実施の形態3における周期実行命令列内の無処理時間に対する拡張処理の追加の例を示した図である。It is the figure which showed the example of the addition of the expansion process with respect to the no-processing time in the periodic execution command sequence in Embodiment 3 of this invention.
実施の形態1.
 図1は、本実施の形態におけるシステム構成図である。本実施の形態におけるシステムは、ソフトウェア搭載機器1、ソフトウェア配信サーバ2、ネットワーク3で構成される。ソフトウェア搭載機器1は、白物家電などの組込み機器やパソコンなどであり、ネットワークを通じてソフトウェアのダウンロード及びダウンロードしたソフトウェアへの更新を行う。ソフトウェア配信サーバ2は、ネットワークを通じてソフトウェア搭載機器1に対して、更新プログラム(ソフトウェア)を配信する機能を有する。ネットワーク3は、インターネットなどの通信手段である。ネットワーク3は無線であっても有線であってもよい。
Embodiment 1 FIG.
FIG. 1 is a system configuration diagram according to the present embodiment. The system in the present embodiment includes a software-equipped device 1, a software distribution server 2, and a network 3. The software-equipped device 1 is a built-in device such as white goods or a personal computer, and downloads software and updates the downloaded software through a network. The software distribution server 2 has a function of distributing an update program (software) to the software-equipped device 1 through the network. The network 3 is a communication means such as the Internet. The network 3 may be wireless or wired.
 図2は、本実施の形態における、ソフトウェア搭載機器1のハードウェア構成図である。図2において、ソフトウェア搭載機器1は、CPU10(Central Processor Unit)、ROM11(Read Only Memory)、RAM12(Random Access Memory)に加え、通信モジュール13、デバイス14、LED(Light Emitting Diode)15、電子ブザー16、タイマー17、電源スィッチ18などの複数のハードウェアを備えている。 FIG. 2 is a hardware configuration diagram of the software-equipped device 1 in the present embodiment. In FIG. 2, the software-equipped device 1 includes a CPU 10 (Central Processor Unit), ROM 11 (Read Only Memory), RAM 12 (Random Access Memory), a communication module 13, a device 14, an LED (Light Emitting Diode) 15, and an electronic buzzer. 16, a timer 17, and a power switch 18.
 ROM11は、プログラム命令列や固定データを格納する領域を提供する。フラッシュメモリなどが相当し、書き込まれたプログラム内容を書き換えることが可能である。
 RAM12は、プログラムが使用するデータを保存及び参照するための作業領域を提供する。
The ROM 11 provides an area for storing a program instruction sequence and fixed data. It corresponds to a flash memory and the like, and the written program content can be rewritten.
The RAM 12 provides a work area for storing and referring to data used by the program.
 通信モジュール13は、インターネットなどのネットワークインフラを通じて通信機器同士でデータの送受信を行う。 The communication module 13 transmits and receives data between communication devices through a network infrastructure such as the Internet.
 デバイス14は、ソフトウェア搭載機器1が有するデバイスである。デバイスの一例として、冷蔵庫のファンやコンプレッサ、エアコンのファンやルーバーなどを動作させるために用いられる、ステッピングモーターやPWM(Pulse Width Modulation)モーターなどが挙げられる。なお、図2のソフトウェア搭載機器1ではデバイス14を一つしか記載していないが、複数のデバイスで構成されていてもよい。 The device 14 is a device that the software-equipped device 1 has. Examples of devices include stepping motors and PWM (Pulse Width Modulation) motors that are used to operate refrigerator fans and compressors, air conditioner fans and louvers, and the like. Note that although only one device 14 is described in the software-equipped device 1 in FIG. 2, it may be configured by a plurality of devices.
 LED15は、点灯、点滅などの光のパターン出力によってユーザに機器の動作状況などを通知する半導体素子である。 The LED 15 is a semiconductor element that notifies the user of the operation status of the device by light pattern output such as lighting and blinking.
 電子ブザー16は、電子音の鳴動によって、ユーザに機器の動作状況を通知する機器である。 The electronic buzzer 16 is a device that notifies the user of the operation status of the device by ringing an electronic sound.
 タイマー17は、時刻の他、プログラム命令が実行されるタイミングや、デバイス14に対する出力タイミングなどを計測する。 The timer 17 measures the timing at which a program command is executed, the output timing to the device 14 and the like in addition to the time.
 電源スイッチ18は、ソフトウェア搭載機器1の電源を操作するためのボタンで、そのスイッチの搭載場所は本体付属及びリモコンなどでも構わない。 The power switch 18 is a button for operating the power source of the software-equipped device 1, and the switch may be mounted on the main body or a remote controller.
 図3は、本実施の形態における、ソフトウェア搭載機器1上で動作するソフトウェアの全体構成図である。これらのソフトウェアはROM11、若しくはRAM12に記憶され、制御部であるCPU10により実行される。図3において、メインプログラム(第1のプログラム)100は、ソフトウェア搭載機器1の製品としての機能を特徴づけるプログラムであり、普段はこのメインプログラム100が、ソフトウェア搭載機器1に接続されているデバイスの制御を行っている。 FIG. 3 is an overall configuration diagram of software operating on the software-equipped device 1 in the present embodiment. These software are stored in the ROM 11 or the RAM 12 and executed by the CPU 10 as a control unit. In FIG. 3, a main program (first program) 100 is a program that characterizes the function of the software-equipped device 1 as a product. Usually, the main program 100 is a device connected to the software-equipped device 1. Control is in progress.
 サブプログラム200は、メインプログラム100に対する更新要求が発生したとき、メインプログラム100の代わりにデバイスの制御を実行する命令を有しており、メインプログラム100の更新に係るソフトウェアモジュールを備えている。 The subprogram 200 has an instruction to execute device control instead of the main program 100 when an update request to the main program 100 is generated, and includes a software module for updating the main program 100.
 プログラム切り換え部300は、メインプログラム100に対する更新要求をソフトウェア配信サーバ2等の外部から受け取った、または、更新要求の問い合わせを外部に対して行い、その結果、更新要求を受取ったとき、サブプログラム200に対し、更新を指示するプログラムである。また、プログラム切り換え部300は、メインプログラム100に対する更新が完了した後、サブプログラム200で実行しているデバイスの制御を終了し、更新プログラムに置き換えられたメインプログラム100にデバイスの制御を戻す機能を持っている。 The program switching unit 300 receives an update request for the main program 100 from the outside such as the software distribution server 2 or makes an inquiry about the update request to the outside. As a result, when the update request is received, the subprogram 200 Is a program that instructs updating. In addition, the program switching unit 300 has a function of ending the control of the device executed by the subprogram 200 after the update to the main program 100 is completed and returning the device control to the main program 100 replaced with the update program. have.
 まず、メインプログラム100の詳細について説明する。OS110は、メインプログラム100を動作させるための基本ソフトウェアである。このOS110上で動作するアプリケーション、アプリa(120a)、アプリb(120b)、アプリn(120n)は、ソフトウェア搭載機器1のそれぞれの機能を実装したプログラムである。また、OS100に組み込まれているドライバa(130a)、ドライバb(130b)、ドライバm(130m)は、デバイスドライバであり、ソフトウェア搭載機器1が有するハードウェア(デバイス)を制御するためのプログラムである。 First, the details of the main program 100 will be described. The OS 110 is basic software for operating the main program 100. The application operating on the OS 110, the application a (120a), the application b (120b), and the application n (120n) are programs in which the functions of the software-equipped device 1 are installed. A driver a (130a), a driver b (130b), and a driver m (130m) incorporated in the OS 100 are device drivers and programs for controlling the hardware (device) of the software-equipped device 1. is there.
 次にサブプログラム200の詳細について述べる。スケジューリング部210は、プログラム切り換え部300からの動作指示を受け付ける。動作指示には2種類あり、一つ目はメインプログラム100の動作状況を調べる解析指示である。二つ目はメインプログラム100の内容を更新プログラムで置き換える更新作業及び更新作業中のメインプログラム100に代わってデバイスの制御を実行する、更新実行指示である。 Next, the details of the subprogram 200 will be described. The scheduling unit 210 receives an operation instruction from the program switching unit 300. There are two types of operation instructions. The first is an analysis instruction for examining the operation status of the main program 100. The second is an update execution instruction for executing the control of the device in place of the main program 100 during the update work and the update work in which the content of the main program 100 is replaced with the update program.
 解析指示を受けたときスケジューリング部210を呼び出す。呼び出された解析部220は、メインプログラム100の実行命令を収集し、収集した実行命令の列(実行命令列)から実行命令の周期性をパターン判定する。解析部220はこのパターン判定により、CPU10が周期的に実行する命令群を抽出し、周期実行命令列として、格納領域230に記憶する。解析部220は、解析終了後、プログラム切り換え部300に完了を通知する。 When the analysis instruction is received, the scheduling unit 210 is called. The called analysis unit 220 collects execution instructions of the main program 100 and pattern-determines the periodicity of the execution instructions from the collected execution instruction sequence (execution instruction sequence). Based on this pattern determination, the analysis unit 220 extracts a group of instructions that the CPU 10 executes periodically, and stores the instruction group in the storage area 230 as a periodic execution instruction sequence. After the analysis is completed, the analysis unit 220 notifies the program switching unit 300 of the completion.
 格納領域230は、解析部220で抽出した周期実行命令列を保存するための領域(記憶部)であり、サブプログラム200により、領域確保されたROM11、RAM12上の記憶領域である。 The storage area 230 is an area (storage section) for storing the periodic execution instruction sequence extracted by the analysis section 220, and is a storage area on the ROM 11 and RAM 12 that is reserved by the subprogram 200.
 次に、メインプログラム100の更新に関するモジュールについて説明する。スケジューリング部210は更新実行指示を受けたときに実行部240と更新部250を呼び出す。実行部240は、予めメインプログラム100のソフトウェア動作から抽出し、格納領域230に保存しておいた周期プログラム(第2のプログラム)を実行するモジュールである。一方、更新部250は、実行部240でメインプログラム100のソフトウェア動作から抽出された周期プログラムが実行されている間、通信モジュール13を介し、ソフトウェア配信サーバ2から更新プログラムを受信し、メインプログラム100の書き換え更新を行うモジュールである。 Next, a module related to the update of the main program 100 will be described. The scheduling unit 210 calls the execution unit 240 and the update unit 250 when receiving an update execution instruction. The execution unit 240 is a module that executes a periodic program (second program) previously extracted from the software operation of the main program 100 and stored in the storage area 230. On the other hand, the update unit 250 receives the update program from the software distribution server 2 via the communication module 13 while the execution unit 240 is executing the periodic program extracted from the software operation of the main program 100. It is a module that performs rewriting and updating.
 次にプログラム切り換え部300の詳細について説明する。プログラム切り換え部300は、メインプログラム100とサブプログラム200に起動または停止の指示を出すプログラムである。プログラム切り換え部300は、ソフトウェア搭載機器1が起動されると最初に呼び出され、CPU10にメインプログラム100を実行させる。 Next, details of the program switching unit 300 will be described. The program switching unit 300 is a program for instructing the main program 100 and the subprogram 200 to start or stop. The program switching unit 300 is called first when the software-equipped device 1 is activated, and causes the CPU 10 to execute the main program 100.
 図4は、プログラム切り換え部300内部のソフトウェア構成を表す図である。図4において、更新要求受信部310は、ソフトウェア配信サーバ2がソフトウェア搭載機器1に対して、更新プログラムの配信前に送信する更新要求を受信する。この受信は図2の通信モジュール13を介して行われる。更新要求受信部310は、更新要求を受信すると、プログラム起動停止部320を介して、サブプログラム200に対し、解析指示を送る。プログラム起動停止部320は、メインプログラム100及びサブプログラム200に対し、動作の指示を送る。 FIG. 4 is a diagram illustrating a software configuration inside the program switching unit 300. In FIG. 4, an update request receiving unit 310 receives an update request that the software distribution server 2 transmits to the software-equipped device 1 before distributing the update program. This reception is performed via the communication module 13 of FIG. When receiving the update request, the update request receiving unit 310 sends an analysis instruction to the subprogram 200 via the program start / stop unit 320. The program start / stop unit 320 sends an operation instruction to the main program 100 and the subprogram 200.
 解析指示を受信したサブプログラム200は、メインプログラム100の解析を実行し、解析が終了すると解析完了通知を返信する。この解析完了通知を受信した周期タイミング同期部330は、プログラム起動停止部320を介して、メインプログラム100に停止の指示を送り、サブプログラム200に更新実行指示を送る。 The subprogram 200 that receives the analysis instruction executes the analysis of the main program 100, and returns an analysis completion notification when the analysis is completed. Receiving this analysis completion notification, the cycle timing synchronization unit 330 sends a stop instruction to the main program 100 and an update execution instruction to the subprogram 200 via the program start / stop unit 320.
 更新実行指示を受けたサブプログラム200は、メインプログラム100の更新処理を実行し、更新が終了すると更新完了の通知を、更新完了受信部340へ送信する。この通知を受信した更新完了受信部340は、プログラム起動停止部320を介して、サブプログラム200に停止の指示を送り、メインプログラム100に実行指示を送る。なお、プログラム切り換え部300は、起動直後にメインプログラム100を起動するようになっているため、ソフトウェア搭載機器1をリブートすることで、メインプログラム100を起動させることが可能である。 Upon receiving the update execution instruction, the subprogram 200 executes the update process of the main program 100 and transmits an update completion notification to the update completion receiving unit 340 when the update is completed. Receiving this notification, the update completion receiving unit 340 sends a stop instruction to the subprogram 200 and sends an execution instruction to the main program 100 via the program start / stop unit 320. Note that since the program switching unit 300 starts the main program 100 immediately after startup, the main program 100 can be started by rebooting the software-equipped device 1.
 次に図5を用いて、本実施の形態1における全体処理の動作について説明する。ここでは、ソフトウェア搭載機器1がデバイスの制御を実行中に、ソフトウェア配信サーバ2からソフトウェア更新通知があった場合を例に説明する。 Next, the operation of the overall processing in the first embodiment will be described with reference to FIG. Here, a case where a software update notification is received from the software distribution server 2 while the software-equipped device 1 is executing device control will be described as an example.
 本実施の形態において、ソフトウェア配信サーバ2は、メインプログラム100の更新プログラムを、外部(図示せず)から入手するものとする。入手方法は別のネットワークから受信してもよいし、外部記憶装置や媒体を介して、入手してもよい。 In this embodiment, it is assumed that the software distribution server 2 obtains an update program for the main program 100 from the outside (not shown). The acquisition method may be received from another network, or may be acquired via an external storage device or medium.
 また、ソフトウェア配信サーバ2は、ソフトウェア搭載機器1で用いられているメインプログラム100のバージョンを管理しており、更新プログラムを入手すると、比較を行い、更新が必要であると判断した場合のみ、更新要求をソフトウェア機器1に送るものとする。 Further, the software distribution server 2 manages the version of the main program 100 used in the software-equipped device 1, and when an update program is obtained, the software distribution server 2 performs a comparison and updates only when it is determined that an update is necessary. Assume that a request is sent to the software device 1.
 なお、ソフトウェア配信サーバ2は、受け取った更新プログラムを全てソフトウェア搭載機器1に送るようにし、ソフトウェア搭載機器1が更新の要否を判定してもよい。
 このほかにも、ソフトウェア搭載機器1が更新プログラムの有無を問い合わせし、更新プログラムが存在した場合にのみ、ソフトウェア配信サーバ2が更新要求を送ってもよい。
Note that the software distribution server 2 may send all received update programs to the software-equipped device 1 so that the software-equipped device 1 may determine whether update is necessary.
In addition to this, the software distribution server 2 may send an update request only when the software-equipped device 1 inquires about the presence or absence of the update program and the update program exists.
 まず、更新要求受信部310が、ソフトウェア配信サーバ2からソフトウェアの更新要求を受取る(S101)。次に更新要求受信部310は、プログラム起動停止部320を介して、サブプログラム200に対し、メインプログラム100の動作状況を調べる解析指示を送る。 First, the update request receiving unit 310 receives a software update request from the software distribution server 2 (S101). Next, the update request receiving unit 310 sends an analysis instruction for examining the operation status of the main program 100 to the subprogram 200 via the program start / stop unit 320.
 サブプログラム200に対し、解析指示を送る方法として、プログラム起動停止部320から解析指示だと判断できる引数とともにスケジューリング部210を呼び出してもよい。また、プログラム起動停止部320とスケジューリング部210とで共通にアクセスできるメモリ領域を用意しておき、スケジューリング部210はこの領域をポーリングし、プログラム起動停止部320はこの領域の値を変更することにより、サブプログラム200に対し、解析指示を送ってもよい。 As a method of sending an analysis instruction to the subprogram 200, the scheduling unit 210 may be called together with an argument that can be determined as an analysis instruction from the program start / stop unit 320. Also, a memory area that can be accessed in common by the program start / stop unit 320 and the scheduling unit 210 is prepared, the scheduling unit 210 polls this area, and the program start / stop unit 320 changes the value of this area. Analysis instructions may be sent to the subprogram 200.
 解析指示を受け取ったスケジューリング部210は、解析部220を呼び出す。解析部220ではメインプログラム100の解析を行う。解析を行うにあたり、解析部220は、メインプログラム100で動作している実行命令の記録を行う(S102)。 The scheduling unit 210 that has received the analysis instruction calls the analysis unit 220. The analysis unit 220 analyzes the main program 100. In performing the analysis, the analysis unit 220 records an execution instruction operating in the main program 100 (S102).
 メインプログラム100で動作している実行命令の情報を入手するには、CPU10のプログラムカウンタレジスタから、マシン語が格納されているメモリを参照する方法や、メインプログラム100で動作するアプリケーション(120a~120n)及びOS110の実行命令をメモリ上の領域若しくはログファイルにマシン語を出力させ、それを参照する方法がある。 In order to obtain information on an execution instruction operating in the main program 100, a method of referring to a memory storing a machine language from a program counter register of the CPU 10 or an application (120a to 120n operating in the main program 100) ) And an execution instruction of the OS 110 to output a machine language to a memory area or a log file and refer to it.
 解析部220は、記録した実行命令の列(実行命令列)を解析し、実行命令列の中から周期実行命令列を抽出し、格納領域230に格納する(S103)。図6及び図7を用いて実行命令列の解析について説明する。 The analysis unit 220 analyzes the recorded sequence of execution instructions (execution instruction sequence), extracts a cyclic execution instruction sequence from the execution instruction sequence, and stores it in the storage area 230 (S103). The analysis of the execution instruction sequence will be described with reference to FIGS.
 図6は本実施の形態における周期実行命令列の抽出の例を表した図である。以下、周期的に実行される命令を検出して、更新処理中に実行する命令を抽出する方法を説明するが、この発明はこれに限定されることなく、予め定められた機能に対応する命令を検出して、命令を抽出する方法を用いてもよい。例えば、メインプログラム100における特定範囲を示すアドレスをROM11に予め記憶、若しくは、配信サーバ2からソフトウェア搭載機器1が入手して、命令を特定し、抽出することもできる。 FIG. 6 is a diagram showing an example of extraction of a cyclic execution instruction sequence in the present embodiment. In the following, a method for detecting periodically executed instructions and extracting instructions to be executed during update processing will be described. However, the present invention is not limited to this, and instructions corresponding to predetermined functions are described below. It is also possible to use a method of detecting an instruction and extracting an instruction. For example, an address indicating a specific range in the main program 100 can be stored in the ROM 11 in advance, or the software-equipped device 1 can obtain from the distribution server 2 to specify and extract a command.
 図6において、実行命令610a~610mは、CPU10が実行するメインプログラム100のマシン語である。図6では、実行時刻に沿って左から順に実行される様子を示している。なお、複数の実行命令をまとめたものを実行命令列と呼ぶ。図6の例だと、実行命令610a~610mをまとめたものを実行命令列610と呼ぶ。周期実行命令列620は、実行命令列610(実行命令610a~610m)を解析した結果、周期的に繰り返されている実行命令列である。 In FIG. 6, execution instructions 610a to 610m are machine languages of the main program 100 executed by the CPU 10. FIG. 6 shows a state in which execution is performed sequentially from the left along the execution time. A group of a plurality of execution instructions is called an execution instruction sequence. In the example of FIG. 6, a group of execution instructions 610a to 610m is called an execution instruction sequence 610. The periodic execution instruction sequence 620 is an execution instruction sequence that is periodically repeated as a result of analyzing the execution instruction sequence 610 (execution instructions 610a to 610m).
 実行命令をメインプログラム100から収集する方法としては、メインプログラム100で動作するアプリケーション(120a~120n)が実行している命令をログに出力するようにし、それを解析部220が参照してもよい。また、OS110が実行している命令をログに出力、それを解析部220が参照してもよい。 As a method of collecting execution instructions from the main program 100, an instruction executed by an application (120a to 120n) operating in the main program 100 may be output to a log, and the analysis unit 220 may refer to it. . In addition, an instruction executed by the OS 110 may be output to a log, and the analysis unit 220 may refer to it.
 解析部220は、収集した実行命令の記録を行い、解析を行う。図6に示すように、A、B、C、D、A、B、C、D、A、B、C、D、A、のように、ある一定の期間、同一の繰返しパターンが連続して検出された場合、例えばこの場合だと、A、B、C、Dを周期実行命令列620として抽出を行う。その後、解析部220は、抽出された周期実行命令列620を、格納領域230に格納する。 The analysis unit 220 records and analyzes the collected execution instructions. As shown in FIG. 6, A, B, C, D, A, B, C, D, A, B, C, D, A, etc., the same repetitive pattern continues for a certain period of time. If detected, for example, in this case, A, B, C, and D are extracted as the periodic execution instruction sequence 620. Thereafter, the analysis unit 220 stores the extracted periodic execution instruction sequence 620 in the storage area 230.
 解析の対象とする一定の期間及び繰り返しパターンの数は、ソフトウェア搭載機器1で実行される全てのアプリケーション(120a~120n)がどの程度周期的に動作するのかによるため、予め統計的に調査した、例えば期間100ミリ秒、パターン数5回などの値を予め与えられている条件として用いる。 The fixed period and the number of repetitive patterns to be analyzed depend on how periodically all the applications (120a to 120n) executed on the software-equipped device 1 operate, so statistically investigated in advance. For example, a value such as a period of 100 milliseconds and the number of patterns of 5 is used as a predetermined condition.
 なお、周期性を判定するためのパターン抽出アルゴリズムについては、自然情報処理などで用いられるパターン認識アルゴリズムなどのアルゴリズムを利用しても構わない。 Note that as a pattern extraction algorithm for determining periodicity, an algorithm such as a pattern recognition algorithm used in natural information processing or the like may be used.
 図7に実行命令の例を示す。収集データ701は、解析部220が収集した実行命令の集まりであり、解析データ702は、解析部220が収集データ701に対し解析を行った後に抽出された周期実行命令列を示す。 Fig. 7 shows an example of execution instructions. The collected data 701 is a collection of execution instructions collected by the analysis unit 220, and the analysis data 702 indicates a periodic execution instruction sequence extracted after the analysis unit 220 analyzes the collected data 701.
 収集データ701及び解析データ702の左の列は、実行命令を識別するための実行IDである。なお、図7の実行命令の欄には、理解しやすくするため、アセンブリ言語(ニーモニック)で表記したが、実際にはマシン語が代入されている。 The left column of the collected data 701 and the analysis data 702 is an execution ID for identifying an execution command. In the execution instruction column of FIG. 7, for ease of understanding, it is written in assembly language (mnemonic), but actually machine language is substituted.
 例えば、収集データ701のように、同じ実行命令が繰り返し連続で発生している場合、解析部220は、実行ID0x3502から実行ID0x3505の間と、実行ID0x3506から実行ID0x350Bの間を周期実行命令列として抽出する。 For example, when the same execution instruction is repeatedly generated continuously as in the collected data 701, the analysis unit 220 extracts the execution ID 0x3502 to execution ID 0x3505 and the execution ID 0x3506 to execution ID 0x350B as a cyclic execution instruction sequence. To do.
 周期実行命令列が抽出できなかった場合(S104:NO)、実行命令の記録(S102)を再度行う。図5には示していないが、実行命令の記録(S102)の繰り返しを行う際、すぐに繰返し行うのではなく、しばらく待機してから実行してもよい。しばらく待機する時間は、予め定めておいても良いし、更新プログラムとともに送られてきた値を用いるようにしてもよい。 When the cyclic execution instruction sequence cannot be extracted (S104: NO), the execution instruction is recorded (S102) again. Although not shown in FIG. 5, when the execution instruction recording (S102) is repeated, the execution instruction may be executed after waiting for a while, not immediately. The time to wait for a while may be determined in advance, or a value sent together with the update program may be used.
 周期実行命令列の抽出(S103)ができた場合(S104:YES)、解析部220は、解析の完了通知をプログラム切り換え部300に送る。解析の完了通知を受けた周期タイミング同期部330はメインプログラム100からサブプログラム200への切り換えを行う。まず、周期タイミング同期部330は、解析部220から受けた周期実行命令列の情報を基に、メインプログラム100から周期実行命令列に実行位置の切り換えを行うためのタイミングを算出する(S105)。 When the cyclic execution instruction sequence can be extracted (S103) (S104: YES), the analysis unit 220 sends an analysis completion notification to the program switching unit 300. Receiving the analysis completion notification, the cycle timing synchronization unit 330 switches from the main program 100 to the subprogram 200. First, the cycle timing synchronization unit 330 calculates the timing for switching the execution position from the main program 100 to the cycle execution command sequence based on the information of the cycle execution command sequence received from the analysis unit 220 (S105).
 タイミングを算出する方法として、次の方法がある。解析部220が、解析の完了通知として、若しくは解析の完了通知の他に、周期実行命令列の最初の実行命令の実行IDと、その最初の実行命令がメインプログラム100で実行された時刻と、周期実行命令列が実行されるのにかかる周期時間を送るようにする。なお、この方法を用いる場合には、解析部220で、メインプログラム100の実行命令を収集する際、その時刻も記録しておく必要がある。 There are the following methods for calculating the timing. As an analysis completion notification or in addition to an analysis completion notification, the analysis unit 220 executes an execution ID of the first execution instruction in the cyclic execution instruction sequence, a time when the first execution instruction is executed in the main program 100, and The period time required for the execution of the cyclic execution instruction sequence is sent. Note that when this method is used, when the analysis unit 220 collects execution instructions of the main program 100, it is also necessary to record the time.
 周期タイミング同期部330は、現在の時刻(例えばt1)とメインプログラム100で最後に実行された時刻(t0)及び、周期実行命令列が実行されるのにかかる周期時間(tc)から、次に実行される周期実行命令列の最初の実行命令の予測時刻(tn)を計算する。そして、周期タイミング同期部330は、予測時刻(tn)に、メインプログラム100からサブプログラム200への切り換えを行う。(S106)。 The cycle timing synchronization unit 330 calculates the next time from the current time (eg, t1), the time (t0) last executed by the main program 100, and the cycle time (tc) required to execute the cycle execution instruction sequence. The predicted time (tn) of the first execution instruction of the cyclic execution instruction sequence to be executed is calculated. Then, the cycle timing synchronization unit 330 performs switching from the main program 100 to the subprogram 200 at the predicted time (tn). (S106).
 図8にメインプログラム100からサブプログラム200への切り換えの例を示す。図8の例だと、周期実行命令列620のAが、メインプログラム100で最後に実行された時刻t0に周期時間tc加算したtnで、メインプログラム100の実行を停止し、代わりにサブプログラム200に周期実行命令列620の実行指示を出している。 FIG. 8 shows an example of switching from the main program 100 to the subprogram 200. In the example of FIG. 8, the execution of the main program 100 is stopped at the time tn obtained by adding the period time tc to the time t0 last executed by the main program 100, and the subprogram 200 instead. The execution instruction of the periodic execution instruction sequence 620 is issued.
 周期タイミング同期部330が、メインプログラム100からサブプログラム200への切り換えを行うにあたり、プログラム起動停止部320を用いる方法がある。プログラム起動停止部320は、メインプログラム100に対し、停止の動作指示を送る。 There is a method of using the program start / stop unit 320 when the cycle timing synchronization unit 330 switches from the main program 100 to the subprogram 200. The program start / stop unit 320 sends a stop operation instruction to the main program 100.
 停止の動作指示を送る方法は、メインプログラム100側に予め停止の指示を受け取るためのアプリケーションを用意しておき、プログラム起動停止部320から呼び出すようにしてもよいし、プログラム切り換え部300とメインプログラム100とで共通にアクセスできるメモリ領域を用意しておき、プログラム起動停止部320はこの領域の値を変更することにより、メインプログラム100に対し、停止の動作指示を送ってもよい。 As a method of sending a stop operation instruction, an application for receiving a stop instruction may be prepared in advance on the main program 100 side and called from the program start / stop section 320, or the program switching section 300 and the main program may be called. A memory area that can be accessed in common with 100 is prepared, and the program start / stop unit 320 may send a stop operation instruction to the main program 100 by changing the value of this area.
 そして、サブプログラム200に対し、プログラム起動停止部320は、更新実行指示をスケジューリング部210に送る。 Then, for the subprogram 200, the program start / stop unit 320 sends an update execution instruction to the scheduling unit 210.
 更新実行指示を受け取ったスケジューリング部210は、実行部240と更新部250を同時に実行する。一方の実行部240は、格納領域230を参照し、周期実行命令列の実行を開始する。なお、実行部240は周期実行命令列の実行を繰返し実行し続ける。 The scheduling unit 210 that has received the update execution instruction executes the execution unit 240 and the update unit 250 at the same time. One execution unit 240 refers to the storage area 230 and starts executing the cyclic execution instruction sequence. Note that the execution unit 240 continues to execute the cyclic execution instruction sequence repeatedly.
 もう一方の更新部250は、通信モジュール13を介して更新プログラムをダウンロードし、メインプログラム100の上書き更新を行う(S107)。更新を行っている間、ソフトウェア搭載機器1が必要とする一部の処理を実行部240で実行する事により、更新プログラムのために新たなメモリを必要とせず、直接メインプログラム100に更新プログラムをダウンロードすることが可能となる。 The other update unit 250 downloads the update program via the communication module 13 and updates the main program 100 by overwriting (S107). While performing the update, the execution unit 240 executes a part of the processing required by the software-equipped device 1, so that a new memory is not required for the update program, and the update program is directly added to the main program 100. It can be downloaded.
 更新部250は、更新プログラムのダウンロードが完了したのち、完了通知をプログラム切り換え部300に送る(S108)。 After the download of the update program is completed, the update unit 250 sends a completion notification to the program switching unit 300 (S108).
 完了通知を受けたプログラム切り換え部300は、機器の停止を行い(S109)、ソフトウェア搭載機器1の再起動を行う(S110)。なお、ソフトウェア搭載機器1に接続されているデバイス14によっては、例えば、起動時に時間を要するデバイスなどの場合、デバイス14の動作が一旦途切れてしまうため、プログラム切り換え部300が自動的に再起動を行わず、手動で電源スィッチ18を操作することで再起動のタイミングを調整するようにしてもよい。 Upon receipt of the completion notification, the program switching unit 300 stops the device (S109) and restarts the software-equipped device 1 (S110). Note that, depending on the device 14 connected to the software-equipped device 1, for example, in the case of a device that requires time for activation, the operation of the device 14 is temporarily interrupted, so the program switching unit 300 automatically restarts. Instead, the restart timing may be adjusted by manually operating the power switch 18.
 ソフトウェア搭載機器1が再起動したのち、プログラム切り換え部300は、更新されたメインプログラム100を起動する(S111)。 After the software-equipped device 1 is restarted, the program switching unit 300 starts the updated main program 100 (S111).
 上記のような構成にする事により、メインプログラム100が有する複数の機能のうち、更新中においても実行が必要な一部機能に絞ってプログラムの一部を記憶装置に複製し、使用する。そのため、複製されたプログラムは、サイズがメインプログラム100に比べて小さくなり、ソフトウェアの更新に必要な保存領域の容量を節約することができる。また、デバイス14に対する動作を継続しつつ、更新作業を行うことが可能となる。 By adopting the configuration as described above, a part of the program is copied to the storage device and used by focusing on some of the functions of the main program 100 that need to be executed even during the update. Therefore, the copied program is smaller in size than the main program 100, and the capacity of the storage area necessary for software update can be saved. In addition, the update operation can be performed while continuing the operation on the device 14.
 なお、本実施の形態では、ソフトウェア配信サーバ2からソフトウェアの更新要求を受けた後に、解析部220が周期実行命令列の抽出を行ったが、更新要求を受ける前から周期実行命令列の抽出を行っておいてもよい。また、解析部220で周期実行命令列の抽出を行わず、メインプログラム100を更新している間、ソフトウェア搭載機器1がデバイス14を制御するのに必要な周期実行命令列を予め格納領域230に格納しておいてもよい。その際、周期タイミング同期手段330がメインプログラム100に停止の指示を送るタイミングも併せて格納領域230に格納しておく。
 ソフトウェア搭載機器1がデバイス14を制御するのに必要な周期実行命令列は、工場出荷時に格納領域230に入れておいてもよいし、後から書き込めるようにしてもよい。また、更新部250がソフトウェア配信サーバ2から受け取る更新プログラムと一緒に受け取り、格納領域230に格納してもよい。
In this embodiment, after receiving the software update request from the software distribution server 2, the analysis unit 220 extracts the cyclic execution instruction sequence. However, the cyclic execution instruction sequence is extracted before the update request is received. You can go there. Further, while the analysis unit 220 does not extract the periodic execution instruction sequence and updates the main program 100, the cyclic execution instruction sequence necessary for the software-equipped device 1 to control the device 14 is stored in the storage area 230 in advance. It may be stored. At this time, the timing at which the cycle timing synchronization means 330 sends a stop instruction to the main program 100 is also stored in the storage area 230.
The periodic execution instruction sequence necessary for the software-equipped device 1 to control the device 14 may be stored in the storage area 230 at the time of factory shipment, or may be written later. Alternatively, the update unit 250 may receive the update program received from the software distribution server 2 and store it in the storage area 230.
実施の形態2.
 本実施の形態では、繰返し動作する処理を抽出するために、機器に接続されているデバイス14の動作を参照した場合について説明する。
Embodiment 2. FIG.
In the present embodiment, a case will be described in which the operation of the device 14 connected to the device is referred to in order to extract a process that repeatedly operates.
 図9は、本実施の形態における、ソフトウェア搭載機器1上で動作するソフトウェアの全体構成図である。 FIG. 9 is an overall configuration diagram of software that operates on the software-equipped device 1 in the present embodiment.
 図9において、周期出力解析部920はメインプログラム100のデバイスドライバの動作を監視するソフトウェアであり、その実行順序とタイミングからその周期性を判別し、周期出力パターン抽出し、同様の周期出力を実行できる周期実行命令列を格納領域230に格納するものである。 In FIG. 9, a periodic output analysis unit 920 is software for monitoring the operation of the device driver of the main program 100, determines its periodicity from its execution order and timing, extracts a periodic output pattern, and executes the same periodic output A possible periodic execution instruction sequence is stored in the storage area 230.
 図9において、図3と同一の符号は、同一または相当する部分を表しており、周期出力解析部920以外については、実施の形態1で用いた図3で記載したものと同じ動作をする。 9, the same reference numerals as those in FIG. 3 represent the same or corresponding parts, and operations other than the periodic output analysis unit 920 perform the same operations as those described in FIG. 3 used in the first embodiment.
 次に図10を用いて、本実施の形態2における全体動作について説明する。実施の形態1のときと同様、ソフトウェア搭載機器1が実行中に、ソフトウェア配信サーバ2からソフトウェア更新通知があった場合を例に説明する。 Next, the overall operation in the second embodiment will be described with reference to FIG. As in the case of the first embodiment, a case where a software update notification is received from the software distribution server 2 while the software-equipped device 1 is executing will be described as an example.
 本実施の形態2における動作については、実施の形態1で述べた手順と同じであり、以下に実施の形態1で説明した動作との差異についてのみ説明する。 The operation in the second embodiment is the same as the procedure described in the first embodiment, and only the difference from the operation described in the first embodiment will be described below.
 更新要求受信部310は、メインプログラム100の動作状況を調べる解析指示を送る。なお、この指示は、プログラム起動停止部320からスケジューリング部210を呼び出すことで解析指示を送ることにより、実現することもできるし、また、プログラム起動停止部320とスケジューリング部210とで共通にアクセスできるメモリ領域を用意しておき、スケジューリング部210はこの領域をポーリングし、プログラム起動停止部320はこの領域の値を変更することにより、サブプログラム200に対し、解析指示を送ることにより、実現することもできる。 The update request receiving unit 310 sends an analysis instruction for examining the operation status of the main program 100. This instruction can be realized by sending an analysis instruction by calling the scheduling unit 210 from the program start / stop unit 320, or can be commonly accessed by the program start / stop unit 320 and the scheduling unit 210. A memory area is prepared, the scheduling unit 210 polls this area, and the program start / stop unit 320 changes the value of this area, thereby sending an analysis instruction to the subprogram 200. You can also.
 出力の解析指示を受け取ったスケジューリング部210は、周期出力解析部920を呼び出し実行する。周期出力解析部920ではメインプログラム100の解析を行う。解析を行うにあたり、周期出力解析部920は、メインプログラム100で動作しているデバイスドライバ(ドライバa~ドライバm)を監視し、それらの実行順序(出力命令)とその実行時刻の記録を行う(S202)。 Upon receiving the output analysis instruction, the scheduling unit 210 calls and executes the periodic output analysis unit 920. The periodic output analysis unit 920 analyzes the main program 100. In performing the analysis, the periodic output analysis unit 920 monitors the device drivers (driver a to driver m) operating in the main program 100 and records their execution order (output instructions) and their execution times ( S202).
 出力命令の情報を入手するには、デバイスの制御を行うためのデバイスレジスタが割り振られているメモリ領域をポーリングして参照する方法や、デバイスへの制御を行う際に割込みを発生させるようにデバイスドライバを設計しておき、それを周期出力解析部920で受け取る方法がある。 To obtain output instruction information, you can poll the memory area to which the device register for controlling the device is allocated and refer to it, or generate an interrupt when controlling the device. There is a method of designing a driver and receiving it by the periodic output analysis unit 920.
 なお、周期出力の記録先は、周期出力解析部920が一時的に用意したRAM12上のメモリ領域でも、格納領域230でも良い。 The recording destination of the periodic output may be the memory area on the RAM 12 temporarily prepared by the periodic output analysis unit 920 or the storage area 230.
 周期出力解析部920は、記録した周期出力を解析し、予め用意しておいた、実行命令列一覧の中から同様の周期出力を実行できる実行命令列を抽出し、周期実行命令列として、格納領域230に格納する(S203)。周期実行命令列については、実施の形態1と同じである。
 なお、予め用意しておいた実行命令列は一つだけとし、これを繰り返し実行する周期実行命令列としてもよい。繰り返し実行する際には、実行命令列への引数として、時刻、書き込むメモリのアドレス、書き込む値、値を書き込んでおく時間を渡してもよい。図11を用いて周期出力の解析について説明する。
The periodic output analysis unit 920 analyzes the recorded periodic output, extracts an execution instruction sequence that can execute the same periodic output from a list of execution instruction sequences prepared in advance, and stores it as a periodic execution instruction sequence Store in the area 230 (S203). The cyclic execution instruction sequence is the same as in the first embodiment.
Note that only one execution instruction sequence prepared in advance may be used as a cyclic execution instruction sequence that is repeatedly executed. When repeatedly executing, the time, the address of the memory to be written, the value to be written, and the time to write the value may be passed as arguments to the execution instruction sequence. The analysis of periodic output will be described with reference to FIG.
 図11は本実施の形態における周期出力パターンの抽出の例を表した図である。図11において、デバイス出力記録1110a~1110iは、デバイス14に対する出力パターンとその実行時刻の記録である。図11では、実行時刻に沿って左から順に実行される様子を示している。周期出力パターン1120は、デバイス出力記録1110a~1110iを解析した結果、周期的に繰り返されている出力パターンである。実行命令列一覧1130は、特定の出力パターンを実行するための実行命令列の一覧である。予めどのような出力命令が行われるのかを調べておき、同様の出力を行う実行命令列を用意しておく。図11では、出力パターンαの場合の実行命令列f_E、出力パターンβの場合の実行命令列f_F、出力パターンγの場合の実行命令列f_G、出力パターンΔの場合の実行命令列f_Hの例を示す。 FIG. 11 is a diagram showing an example of extraction of a periodic output pattern in the present embodiment. In FIG. 11, device output records 1110a to 1110i are records of output patterns for the device 14 and their execution times. FIG. 11 shows a state in which execution is performed sequentially from the left along the execution time. The periodic output pattern 1120 is an output pattern that is periodically repeated as a result of analyzing the device output records 1110a to 1110i. The execution instruction sequence list 1130 is a list of execution instruction sequences for executing a specific output pattern. Advance what the output instruction previously examined whether performed, are prepared an execution command sequence to perform the same output. In FIG. 11, examples of the execution instruction sequence f_E for the output pattern α, the execution instruction sequence f_F for the output pattern β, the execution instruction sequence f_G for the output pattern γ, and the execution instruction sequence f_H for the output pattern Δ are shown. Show.
 例えば、デバイス14としてモーターXとモーターYがあったとし、モーターXに対し1を出力すると言う状態がaミリ秒(これを出力パターンαとする)、モーターXに対し2を出力すると言う状態がbミリ秒(これを出力パターンβとする)、モーターYに対し3を出力すると言う状態がcミリ秒(これを出力パターンγとする)、出力パターンα、出力パターンβ、出力パターンγ、出力パターンα、出力パターンβ、出力パターンγ、のように、ある一定の期間、同一の繰返し出力パターンが連続して検出された場合(図11のデバイス出力記録の例)出力パターンα、出力パターンβ、出力パターンγを周期出力パターン1120として抽出を行う。 For example, if there are a motor X and a motor Y as the device 14, the state of outputting 1 to the motor X is a millisecond (this is an output pattern α), and the state of outputting 2 to the motor X. b milliseconds (this is assumed to be output pattern β), the state that 3 is output to motor Y is c milliseconds (this is assumed to be output pattern γ), output pattern α, output pattern β, output pattern γ, output When the same repeated output pattern is detected continuously for a certain period of time, such as pattern α, output pattern β, and output pattern γ (example of device output recording in FIG. 11). Output pattern α and output pattern β The output pattern γ is extracted as the periodic output pattern 1120.
 周期出力解析部920は、実行命令列一覧1130を参照することにより、抽出された周期出力パターン1120を実行する為の周期実行命令列の組合せ1140を作成する。その後、周期出力解析部920は、周期実行命令の組合せ1140を、格納領域230に格納する。 The periodic output analysis unit 920 creates a periodic execution instruction sequence combination 1140 for executing the extracted periodic output pattern 1120 by referring to the execution instruction sequence list 1130. Thereafter, the cycle output analysis unit 920 stores the combination 1140 of cycle execution instructions in the storage area 230.
 なお、解析の対象とする一定の期間及び繰り返し出力パターンの数は、ソフトウェア搭載機器1で実行される全てのデバイスドライバがどの程度周期的に動作するのかによるため、予め統計的に調査した結果、例えば期間100ミリ秒、出力パターン数5回などの値を与えられている条件として用いる。 The fixed period and the number of repetitive output patterns to be analyzed depend on how periodically all the device drivers executed in the software-equipped device 1 operate. For example, it is used as a condition where a value such as a period of 100 milliseconds and an output pattern number of 5 is given.
 なお、周期性を判定するためのパターン抽出アルゴリズムについては、自然情報処理などで用いられるパターン認識アルゴリズムなどのアルゴリズムを利用しても構わない。 Note that as a pattern extraction algorithm for determining periodicity, an algorithm such as a pattern recognition algorithm used in natural information processing or the like may be used.
 また、デバイスに対するアクセス時間は、デバイスの状況(温度や湿度などの環境や、経年劣化)によって変動する場合がある。このため、例えば、上記の例であればα、β、γと言う出力パターンが守られていれば、それぞれの実行期間に対し、多少の増減があっても許容するものとする。許容の範囲は、ソフトウェア搭載機器1に接続されているデバイスによるため、予め統計的に調査した結果、例えば増減1%以内などの値が与えられている条件として用いる。 Also, the access time to the device may vary depending on the device status (environment such as temperature and humidity, and aging degradation). Therefore, for example, in the above example, if the output patterns of α, β, and γ are observed, even if there is a slight increase / decrease in each execution period, it is allowed. Since the allowable range depends on the device connected to the software-equipped device 1, it is used as a condition in which a value such as an increase or decrease of 1% is given as a result of statistical investigation in advance.
 図10の処理フローの説明に戻り、周期出力パターンが特定できなかった場合(S204:NO)、メインプログラム100で動作しているデバイスドライバ(ドライバa~ドライバm)を監視し、それらの実行順序(出力命令)とその実行時刻の記録(S202)を再度行う。図10には示していないが、実行順序と実行時刻の記録(S202)の繰り返しを行う際、すぐに繰返し行うのではなく、しばらく待機してから実行してもよい。しばらく待機する時間は、予め定めておいても良いし、更新プログラムとともに送られてきた値を用いるようにしてもよい。 Returning to the description of the processing flow of FIG. 10, when the periodic output pattern cannot be specified (S204: NO), the device drivers (driver a to driver m) operating in the main program 100 are monitored and their execution order is monitored. (Output command) and its execution time are recorded again (S202). Although not shown in FIG. 10, when the execution order and the recording of the execution time (S202) are repeated, they may be executed after waiting for a while rather than immediately. The time to wait for a while may be determined in advance, or a value sent together with the update program may be used.
 周期出力パターンの特定(S203)ができた場合(S204:YES)、周期出力解析部920は、解析の完了通知をプログラム切り換え部300に送る。解析の完了通知を受けた周期タイミング同期部330はメインプログラム100からサブプログラム200への切り換えを行う。まず、周期タイミング同期部330は、周期出力解析部920から受けた周期出力パターンの情報を基に、メインプログラム100から実行部240に実行の切り換えを行うためのタイミングを算出する(S205)。
 タイミングを算出する方法として、次の方法がある。周期出力解析部920が、解析の完了通知として、若しくは解析の完了通知の他に、周期実行命令列の組合せ1140の最初の実行命令列の実行IDと、その最初の実行命令列に相当するデバイス14の出力がメインプログラム100で実行された時刻と、周期実行命令列が実行されるのにかかる周期時間を送るようにする。なお、この方法を用いる場合には、周期出力解析部920で、メインプログラム100の出力パターンを収集する際、その時刻も記録しておく必要がある。
When the periodic output pattern is identified (S203) (S204: YES), the periodic output analysis unit 920 sends an analysis completion notification to the program switching unit 300. Receiving the analysis completion notification, the cycle timing synchronization unit 330 switches from the main program 100 to the subprogram 200. First, the cycle timing synchronization unit 330 calculates timing for switching execution from the main program 100 to the execution unit 240 based on the information of the cycle output pattern received from the cycle output analysis unit 920 (S205).
There are the following methods for calculating the timing. The periodic output analysis unit 920 includes, as an analysis completion notification or in addition to an analysis completion notification, an execution ID of the first execution instruction sequence of the cycle execution instruction sequence combination 1140 and a device corresponding to the first execution instruction sequence The time when the output 14 is executed by the main program 100 and the period time required for the execution of the cycle execution instruction sequence are sent. Note that when this method is used, when the output pattern of the main program 100 is collected by the periodic output analysis unit 920, the time must also be recorded.
 周期タイミング同期部330は、現在の時刻(例えばt1)とメインプログラム100で最後に出力パターンが出力された時刻(t0)及び、周期実行命令列の組合せ1140が実行されるのにかかる周期時間(tc)から、次に実行される周期実行命令列の最初の実行命令の予測時刻(tn)を計算する。そして、周期タイミング同期部330は、予測時刻(tn)に、メインプログラム100からサブプログラム200への切り換えを行う。(S206)。 The cycle timing synchronization unit 330 is configured to execute the current time (for example, t1), the time (t0) when the output pattern was last output in the main program 100, and the cycle time required to execute the combination 1140 of the cycle execution instruction sequence ( From tc), the predicted time (tn) of the first execution instruction of the cyclic execution instruction sequence to be executed next is calculated. Then, the cycle timing synchronization unit 330 performs switching from the main program 100 to the subprogram 200 at the predicted time (tn). (S206).
 図12にメインプログラム100からサブプログラム200への切り換えの例を示す。図12の例だと、周期出力パターン1120のαが、メインプログラム100で最後に実行された時刻t0に周期時間tc加算したtnで、メインプログラム100の実行を停止し、代わりにサブプログラム200に周期実行命令列の組合せ1140の実行指示を出している。 FIG. 12 shows an example of switching from the main program 100 to the subprogram 200. In the example of FIG. 12, the execution of the main program 100 is stopped at the time tn obtained by adding the period time tc to the time t0 last executed in the main program 100, and α is output to the subprogram 200 instead. An instruction to execute a combination of periodic execution instruction sequences 1140 is issued.
 周期タイミング同期部330が、メインプログラム100からサブプログラム200への切り換えを行うにあたり、プログラム起動停止部320を用いる方法がある。プログラム起動停止部320は、メインプログラム100に対し、停止の動作指示を送る。 There is a method of using the program start / stop unit 320 when the cycle timing synchronization unit 330 switches from the main program 100 to the subprogram 200. The program start / stop unit 320 sends a stop operation instruction to the main program 100.
 停止の動作指示を送る方法は、メインプログラム100側に予め停止の指示を受け取るためのアプリケーションを用意しておき、プログラム起動停止部320から呼び出すようにしてもよいし、プログラム切り換え部300とメインプログラム100とで共通にアクセスできるメモリ領域を用意しておき、プログラム起動停止部320はこの領域の値を変更することにより、メインプログラム100に対し、停止の動作指示を送ってもよい。 As a method of sending a stop operation instruction, an application for receiving a stop instruction may be prepared in advance on the main program 100 side and called from the program start / stop section 320, or the program switching section 300 and the main program may be called. A memory area that can be accessed in common with 100 is prepared, and the program start / stop unit 320 may send a stop operation instruction to the main program 100 by changing the value of this area.
 そして、サブプログラム200に対し、プログラム起動停止部320は、更新実行指示をスケジューリング部210に送る。 Then, for the subprogram 200, the program start / stop unit 320 sends an update execution instruction to the scheduling unit 210.
 この指示を受け取ったスケジューリング部210は、実行部240と更新部250を同時に実行する。実行部240は、格納領域230を参照し、周期実行命令列の実行を開始する。なお、実行部240は周期実行命令列の実行を繰返し実行し続ける。 Upon receiving this instruction, the scheduling unit 210 executes the execution unit 240 and the update unit 250 at the same time. The execution unit 240 refers to the storage area 230 and starts executing the cyclic execution instruction sequence. Note that the execution unit 240 continues to execute the cyclic execution instruction sequence repeatedly.
 以降の処理については、実施の形態1で述べた手順と同じである。 The subsequent processing is the same as the procedure described in the first embodiment.
 上記のような構成にする事により、ソフトウェアの更新に必要な保存領域の容量を節約することができる。また、デバイスに対する動作を継続しつつ、更新作業を行うことが可能となる。 に す る With the above configuration, it is possible to save the capacity of the storage area required for software update. In addition, the update operation can be performed while continuing the operation on the device.
 なお、本実施の形態では、ソフトウェア配信サーバ2からソフトウェアの更新要求を受けた後に、周期出力解析部920が周期出力パターンの抽出を行ったが、更新要求を受ける前から周期出力パターンの抽出を行っておいてもよい。 In the present embodiment, the periodic output analysis unit 920 extracts the periodic output pattern after receiving the software update request from the software distribution server 2, but the periodic output pattern is extracted before the update request is received. You can go there.
実施の形態3.
 本実施の形態では、解析部220が解析した周期実行命令列620に対し、無処理期間を解析し、予めユーザが静的に用意した拡張処理プログラムを挿入した場合について説明する。
 ユーザが静的に予め用意した拡張処理プログラムを挿入することで、周期実行命令列620を実行中に拡張処理プログラムを実行することが可能である。
 例えばリモコンなどの外部割込の受付やLEDの点滅プログラムを拡張処理プログラムとして静的に用意しておけば、周期実行命令列620を実行中にリモコンの受付処理やLEDの点滅処理を行うことができる。
Embodiment 3 FIG.
In the present embodiment, a case will be described in which a no-processing period is analyzed with respect to the periodic execution instruction sequence 620 analyzed by the analysis unit 220 and an extended processing program statically prepared by a user is inserted in advance.
By inserting an extended processing program prepared statically by the user, it is possible to execute the extended processing program while the periodic execution instruction sequence 620 is being executed.
For example, if an external interrupt reception such as a remote control or an LED flashing program is statically prepared as an extended processing program, the remote control reception processing and LED flashing processing may be performed while the periodic execution instruction sequence 620 is being executed. it can.
 図13は、本実施の形態における、ソフトウェア搭載機器1上で動作するソフトウェアの全体構成図である。 FIG. 13 is an overall configuration diagram of software operating on the software-equipped device 1 in the present embodiment.
 図13において、拡張処理格納領域2040は、ユーザが静的に予め用意した拡張処理プログラムである。拡張処理プログラムは、周期実行命令列620を実行中に、更に実行したいプログラムであり、前述したリモコンなどの外部割込の受付やLEDの点滅プログラムなどであってもよい。なお、拡張処理格納領域2040に用意する拡張処理プログラムは、外部記憶装置や通信モジュールを介して入手できるようにしてもよい。 In FIG. 13, an extended processing storage area 2040 is an extended processing program that is statically prepared in advance by the user. The extended processing program is a program that is desired to be further executed during execution of the periodic execution instruction sequence 620, and may be a program for accepting external interrupts such as the above-mentioned remote control or a blinking program for LEDs. The extended processing program prepared in the extended processing storage area 2040 may be obtained via an external storage device or a communication module.
 図13において、無処理期間抽出部2010は格納領域230に格納された周期実行命令列から無処理が連続して続く期間(無処理期間)を抽出し、無処理期間格納領域2020に格納するものである。
 なお、本実施の形態では、無処理期間格納領域2020および拡張処理格納領域2040を格納領域230とは別の構成としたが、無処理期間格納領域2020および拡張処理格納領域2040に格納された内容を、格納領域230に格納した構成であっても良い。
In FIG. 13, the no-process period extraction unit 2010 extracts a period (no-process period) in which no-process continues continuously from the periodic execution instruction sequence stored in the storage area 230 and stores it in the no-process-period storage area 2020. It is.
In this embodiment, the non-processing period storage area 2020 and the extended processing storage area 2040 are configured differently from the storage area 230. However, the contents stored in the non-processing period storage area 2020 and the extended processing storage area 2040 May be stored in the storage area 230.
 図13において、拡張処理分割挿入部2030は、無処理期間格納領域2020から無処理期間を参照し、拡張処理格納領域2040に格納された拡張処理命令列を無処理期間長で分割し、その分割数だけ周期実行命令列を複製し、複製したそれぞれの周期実行命令列に対して、分割した拡張処理命令列をその無処理期間部分に複製し、それらの拡張処理命令列を1つの周期実行命令列として格納領域230に格納するものである。 In FIG. 13, the extended process division insertion unit 2030 refers to the no-process period from the no-process period storage area 2020, divides the extended process instruction sequence stored in the extended process storage area 2040 by the no-process period length, and Duplicate the cyclic execution instruction sequence by the number, and for each duplicated cyclic execution instruction sequence, duplicate the divided extended processing instruction sequence in its non-processing period part, and copy those extended processing instruction sequences to one cyclic execution instruction It is stored in the storage area 230 as a column.
 図13において、図3と同一の符号は、同一または相当する部分を表しており、無処理期間抽出部2010、無処理期間格納領域2020、拡張処理分割挿入部2030、拡張処理格納領域2040以外については、実施の形態1で用いた図3で記載したものと同じ動作をする。 In FIG. 13, the same reference numerals as those in FIG. 3 represent the same or corresponding parts, except for the non-processing period extraction unit 2010, the non-processing period storage area 2020, the extended processing division insertion section 2030, and the extended processing storage area 2040. Performs the same operation as that described in FIG. 3 used in the first embodiment.
 次に図14を用いて、本実施の形態3における全体動作について説明する。実施の形態1のときと同様、ソフトウェア搭載機器1が実行中に、ソフトウェア配信サーバ2からソフトウェア更新通知があった場合を例に説明する。 Next, the overall operation in the third embodiment will be described with reference to FIG. As in the case of the first embodiment, a case where a software update notification is received from the software distribution server 2 while the software-equipped device 1 is executing will be described as an example.
 本実施の形態3における動作については、実施の形態1で述べた手順と同じであり、以下に実施の形態1で説明した動作との差異についてのみ説明する。 The operation in the third embodiment is the same as the procedure described in the first embodiment, and only the difference from the operation described in the first embodiment will be described below.
 無処理期間抽出部2010は、格納領域230に格納された周期実行命令列に対して無処理期間の抽出を行うものである。
 無処理期間とは、アセンブラでのNOP(No OPeration)命令など、CPUが計算処理やレジスタにアクセスを行っていないような状況が続く期間のことを指す。
 無処理期間抽出部2010は、この無処理期間の情報を無処理期間格納領域2020に格納する(S301)。以上の処理により、周期実行命令列において、どのタイミングで無処理なのかが分かる。
 無処理期間抽出部2010は、無処理期間の情報を無処理期間格納領域2020に格納したのち、拡張処理分割挿入部2030を呼ぶ。
The non-processing period extraction unit 2010 extracts a non-processing period from the cyclic execution instruction sequence stored in the storage area 230.
The no-processing period refers to a period in which a situation in which the CPU is not performing calculation processing or accessing a register, such as a NOP (No Operation) instruction in the assembler.
The non-processing period extraction unit 2010 stores this non-processing period information in the non-processing period storage area 2020 (S301). With the above processing, it can be understood at which timing no processing is performed in the cyclic execution instruction sequence.
The non-processing period extraction unit 2010 calls the extended processing division insertion unit 2030 after storing the non-processing period information in the non-processing period storage area 2020.
 拡張処理分割挿入部2030は、拡張処理格納領域2030に格納された拡張処理プログラムを、上記周期実行命令列の無処理期間にコピーし、新たな周期実行命令列として格納領域230に格納するものである(S302)。 The extended process dividing / inserting unit 2030 copies the extended process program stored in the extended process storage area 2030 to the non-process period of the cyclic execution instruction sequence and stores it in the storage area 230 as a new cyclic execution instruction sequence. Yes (S302).
 更新部250は、更新プログラムのダウンロードが完了したのち、格納領域230に格納されている周期実行命令列を確認し、割込処理に外部割込処理があるかどうか判断する(S303)。判断する方法は、直接周期実行命令列の内部を確認しても良いし、拡張処理分割挿入部2030が、周期実行命令列を更新する際、その旨を示す情報を格納領域230の一部に格納しても良い。
 例えば、リモコンなどの外部割込により周期実行を中断して再起動したい場合、外部割込信号を受信する処理を拡張処理として定義する。
 更新部250は、外部割込信号を受信した場合(S304:YES)、更新プログラムのダウンロード完了通知をプログラム切り替え部300へ送り、プログラム切り替え部300は機器の停止を行い、再起動を実施する。
 外部割込信号を受信しない場合(S304:NO)、更新部250は、外部割込み信号を受け付けるまで待機する。なお、図示していないが、更新部250はこのままでは外部割込み信号を受け付けるまで待機し続けてしまうため、予め設定しておいた時間が経過した場合、自動的にS108へ処理を進めるようにしてもよい。
After completing the download of the update program, the update unit 250 checks the cyclic execution instruction sequence stored in the storage area 230 and determines whether there is an external interrupt process in the interrupt process (S303). The determination may be performed by directly checking the inside of the cyclic execution instruction sequence, or when the extended processing division insertion unit 2030 updates the cyclic execution instruction sequence, information indicating that fact is included in a part of the storage area 230. It may be stored.
For example, when it is desired to interrupt and restart a periodic execution by an external interrupt from a remote controller or the like, a process for receiving an external interrupt signal is defined as an extended process.
When the update unit 250 receives an external interrupt signal (S304: YES), the update unit 250 sends a download completion notification of the update program to the program switching unit 300, and the program switching unit 300 stops the device and restarts it.
When the external interrupt signal is not received (S304: NO), the update unit 250 waits until an external interrupt signal is received. Although not shown, the update unit 250 continues to wait until an external interrupt signal is received, so that the process automatically proceeds to S108 when a preset time has elapsed. Also good.
 図15と図16は本実施の形態の無処理期間抽出部2010における無処理期間の抽出と、無処理期間への拡張処理の追加の例を表した図である。
 図15において、実行命令列2110a~2110mは、メインプログラム100の実行命令を収集した実行命令列で、周期的に2110c、2110gおよび2110kのようにNOPが現れている例である。
 繰り返しのパターンを抽出する方法は実施の形態1と同様で、抽出した周期実行命令列を第1の周期実行命令列2120とする。第1の周期実行命令列2120にはNOP2120nopが含まれる。
FIGS. 15 and 16 are diagrams illustrating an example of extraction of a non-processing period in the non-processing period extraction unit 2010 of this embodiment and addition of an extension process to the non-processing period.
In FIG. 15, execution instruction sequences 2110a to 2110m are execution instruction sequences obtained by collecting execution instructions of the main program 100, and NOPs appear periodically such as 2110c, 2110g, and 2110k.
The method for extracting the repetitive pattern is the same as in the first embodiment, and the extracted periodic execution instruction sequence is defined as a first periodic execution instruction sequence 2120. The first periodic execution instruction sequence 2120 includes NOP2120 nop.
 図16を用いて、無処理期間抽出部2010が無処理期間を抽出し、拡張処理を格納する際の詳細を説明する。本実施の形態では、拡張処理格納領域2040に格納された拡張処理として、命令長がtoptの拡張処理2130があった場合を例とする。
 無処理期間抽出部2010は抽出した周期実行命令列2120から連続したNOP処理の連続期間2120nopを抽出し、無処理期間格納領域2020に格納する。
The details when the no-process period extraction unit 2010 extracts the no-process period and stores the extension process will be described with reference to FIG. In the present embodiment, as an example of the extension process stored in the extension process storage area 2040, there is an extension process 2130 having an instruction length of topt.
The no-process period extraction unit 2010 extracts the continuous NOP process continuous period 2120 nop from the extracted periodic execution instruction sequence 2120 and stores it in the no-process period storage area 2020.
 次に、拡張処理分割挿入部2030は、拡張処理格納領域2040に格納された拡張処理2130を参照し、無処理期間2120nopとその命令長を比較する。
 このとき、無処理期間2020nopの命令長tnopよりも拡張処理2130の命令長toptが長い場合、拡張処理2130をtnopで時分割する。
 例えば、時分割した拡張処理をそれぞれ拡張処理2131(拡1)、拡張処理2132(拡2)として保存したとする。
Next, the extended process division inserting unit 2030 refers to the extended process 2130 stored in the extended process storage area 2040 and compares the no-process period 2120 nop with its instruction length.
At this time, when the instruction length topt of the extension process 2130 is longer than the instruction length tnop of the no-process period 2020 nop, the extension process 2130 is time-divided by tnop.
For example, it is assumed that the time-divided expansion processes are stored as the expansion process 2131 (expansion 1) and the expansion process 2132 (expansion 2), respectively.
 次に、拡張処理分割挿入部2030は、周期実行命令列2120を複製して上記時分割数分(この場合2つ分)用意し、周期実行命令列2141、周期実行命令列2142を作成する。
 そして、それぞれの周期実行命令列の無処理期間2120nopに対して、拡張処理2131、拡張処理2132を複製する。なお、周期実行命令列2141の無処理期間2120nopと拡張処理2131は処理時間が同一のため、ちょうどあてはまるが、周期実行命令列2141の無処理期間2120nopと拡張処理2132は処理時間が一致しないため、図の例では、NOP2133が余る。
Next, the extended process dividing / inserting unit 2030 duplicates the cyclic execution instruction sequence 2120 and prepares it for the number of time divisions (two in this case), and creates the cyclic execution instruction sequence 2141 and the cyclic execution instruction sequence 2142.
Then, the extension process 2131 and the extension process 2132 are duplicated for the no-process period 2120 nop of each cyclically executed instruction sequence. The non-processing period 2120 nop of the cyclic execution instruction sequence 2141 and the extended processing 2131 are exactly the same because the processing time is the same, but the non-processing period 2120 nop of the cyclic execution instruction sequence 2141 and the extended processing 2132 do not match the processing time. In the illustrated example, NOP2133 remains.
 次に、拡張処理分割挿入部2030は、複製した周期実行命令列を連結し、格納領域230に保存する。本実施の形態の例では、周期実行命令列2141と周期実行命令列2142を連結し、一つの周期実行命令列2150を生成し、格納領域230に保存する。 Next, the extended process dividing / inserting unit 2030 concatenates the copied periodic execution instruction sequences and stores them in the storage area 230. In the example of the present embodiment, the cyclic execution instruction sequence 2141 and the cyclic execution instruction sequence 2142 are concatenated to generate one cyclic execution instruction sequence 2150 and save it in the storage area 230.
 以降の処理については、実施の形態1で述べた手順と同じである。 The subsequent processing is the same as the procedure described in the first embodiment.
 なお、無処理期間の抽出を行うためのパターン抽出アルゴリズムについては、自然情報処理などで用いられるパターン認識アルゴリズムなどのアルゴリズムを利用しても構わない。 It should be noted that an algorithm such as a pattern recognition algorithm used in natural information processing or the like may be used as a pattern extraction algorithm for extracting a non-processing period.
 また、拡張処理には、ユーザの任意のプログラムを格納しても構わない。例えば、LEDを点滅させるプログラムであれば、更新プログラムのダウンロード中に製品に付随のLEDを点滅させることが可能である。
 例えば、リモコンの割込を受信し、再起動(リセットベクタにジャンプする)プログラムであれば、更新プログラムのダウンロード完了後に、リモコンの信号を受信し、周期実行をユーザのタイミングで停止し、再起動することが可能である。
Further, an arbitrary program of the user may be stored in the expansion process. For example, in the case of a program that causes the LED to blink, it is possible to cause the LED that accompanies the product to blink while the update program is being downloaded.
For example, if the program receives a remote control interrupt and restarts (jumps to the reset vector), after downloading the update program, it receives the remote control signal, stops periodic execution at the user's timing, and restarts Is possible.
 なお、拡張処理はユーザの任意のプログラムでよいが、OSのシステムコールや既存ライブラリ呼出など、OSや既存ライブラリに依存したプログラムであってはならない。なぜなら、周期処理は周期実行命令列のみから成り立つものであり、OSなどの処理を含まないためである。 The extension process may be an arbitrary program of the user, but it must not be a program dependent on the OS or existing library, such as an OS system call or an existing library call. This is because the periodic processing is composed only of a periodic execution instruction sequence and does not include processing such as an OS.
 上記のような構成にする事により、ソフトウェアの更新に必要な保存領域の容量を節約することができる。また、デバイスに対する動作を継続しつつ、更新作業を行うことが可能となる。また、ソフトウェアの更新中に事前に用意した任意のプログラムを実行することが可能である。
 なお、上記の説明では、格納領域230を記憶部としたが、メインプログラム100、サブプログラム200、プログラム切り替え部300を記憶する領域も合わせて記憶部としても良い。
With the configuration as described above, it is possible to save the capacity of a storage area necessary for software update. In addition, the update operation can be performed while continuing the operation on the device. It is also possible to execute an arbitrary program prepared in advance during software update.
In the above description, the storage area 230 is the storage unit. However, the areas for storing the main program 100, the subprogram 200, and the program switching unit 300 may be combined as a storage unit.
1 ソフトウェア搭載機器、2 ソフトウェア配信サーバ、3 ネットワーク、10 CPU、11 ROM、12 RAM、13 通信モジュール、14 デバイス、15 LED、16 電子ブザー、17 タイマー、18 電源スィッチ、100 メインプログラム、110 OS、120a~120n アプリケーション、130a~130m デバイスドライバ、200 サブプログラム、210 スケジューリング部、220 解析部、230 格納領域、240 実行部、250 更新部、300 プログラム切り換え部、310 更新要求受信部、320 プログラム起動停止部、330 周期タイミング同期部、340 更新完了受信部、610a~610m 実行命令列、620 周期実行命令列、701 解析部220が収集した実行命令列を示す表、702 解析部220が解析を行った後に抽出された周期実行命令列を示す表、920 周期出力解析部、1110a~1110i デバイス出力記録、1120 周期出力パターン、1130 実行命令列一覧、1140 周期実行命令列の組合せ、2010 無処理期間抽出部、2020 無処理期間格納領域、2030 拡張処理分割挿入部、2040 拡張処理格納領域、2110a~2110h 実行命令列、2120nop 無処理期間、2130 拡張処理命令列、2131 拡張処理命令列、2132 拡張処理命令列、2133 NOP、2141 周期実行命令列、2142 周期実行命令列、2150 周期実行命令列。 1 software-equipped device, 2 software distribution server, 3 network, 10 CPU, 11 ROM, 12 RAM, 13 communication module, 14 device, 15 LED, 16 electronic buzzer, 17 timer, 18 power switch, 100 main program, 110 OS, 120a-120n application, 130a-130m device driver, 200 subprogram, 210 scheduling unit, 220 analysis unit, 230 storage area, 240 execution unit, 250 update unit, 300 program switching unit, 310 update request receiving unit, 320 program start / stop Unit, 330 periodic timing synchronization unit, 340 update completion receiving unit, 610a to 610m execution instruction sequence, 620 periodic execution instruction sequence, 701 analysis unit 22 , 702, table showing periodic execution instruction sequences extracted after analysis by the analysis unit 220, 920 periodic output analysis unit, 1110a to 1110i device output record, 1120 periodic output pattern, 1130 List of execution instruction sequences, 1140 Combination of cyclic execution instruction sequences, 2010 No processing period extraction unit, 2020 No processing period storage area, 2030 Extended processing division insertion section, 2040 Extended processing storage area, 2110a to 2110h Execution instruction sequence, 2120 nop No processing Period, 2130 Extended processing instruction sequence, 2131 Extended processing instruction sequence, 2132 Extended processing instruction sequence, 2133 NOP, 2141 Periodic execution instruction sequence, 2142 Periodic execution instruction sequence, 2150 Periodic execution instruction sequence

Claims (6)

  1.  機器に接続されたデバイスを制御する第1のプログラム及び、前記第1のプログラムよりプログラムの大きさが小さく、前記第1のプログラムの複数の機能のうち、一部の機能を含む第2のプログラムが記憶された記憶部と、
    前記記憶部と接続され前記第1のプログラムの更新要求を受け付けた場合に、前記第1のプログラムの実行を停止し、前記第1のプログラムを上書き更新するとともに、前記第1のプログラムの更新中に、前記第2のプログラムの前記一部の機能を実行する制御部とを備えることを特徴とするソフトウェア搭載機器。
    A first program for controlling a device connected to the device, and a second program having a smaller program size than the first program and including a part of the plurality of functions of the first program A storage unit storing
    When receiving an update request for the first program connected to the storage unit, the execution of the first program is stopped, the first program is overwritten and updated, and the first program is being updated. And a control unit that executes the partial function of the second program.
  2.  前記制御部は、前記第1のプログラムがデバイスを制御するために実行している命令を参照し、繰り返し実行される命令を周期実行命令列として抽出するとともに、抽出した周期実行命令列を前記第2のプログラムとして前記記憶部に記憶することを特徴とする、請求項1に記載のソフトウェア搭載機器。 The control unit refers to an instruction executed by the first program to control a device, extracts a repeatedly executed instruction as a periodic execution instruction sequence, and extracts the extracted periodic execution instruction sequence as the first execution sequence. The software-equipped device according to claim 1, wherein the software is stored in the storage unit as a second program.
  3.  前記制御部は、前記デバイスに対し、繰り返し行われている動作を検出し、繰り返し動作する処理に対応する複数の命令を周期実行命令列として抽出するとともに、抽出した周期実行命令列を前記第2のプログラムとして前記記憶部に記憶することを特徴とする、請求項1に記載のソフトウェア搭載機器。 The control unit detects an operation that is repeatedly performed on the device, extracts a plurality of instructions corresponding to a process that repeatedly operates as a periodic execution instruction sequence, and extracts the extracted periodic execution instruction sequence as the second execution sequence. The software-equipped device according to claim 1, wherein the software-installed device is stored in the storage unit as a program.
  4.  前記制御部は、前記周期実行命令列に対し、処理が行われていない無処理期間を抽出するとともに、更新中に実行したい拡張処理を前記無処理期間へ挿入することを特徴とする、請求項2に記載のソフトウェア搭載機器。 The control unit extracts a no-process period during which no processing is performed for the periodic execution instruction sequence, and inserts an extension process to be executed during an update into the no-process period. 2. Software-equipped device according to 2.
  5.  前記制御部は、前記拡張処理を分割して複数の前記無処理期間へ挿入することを特徴とする、請求項4に記載のソフトウェア搭載機器。 5. The software-equipped device according to claim 4, wherein the control unit divides the extended processing and inserts the extended processing into a plurality of the non-processing periods.
  6.  機器に接続されたデバイスを制御する第1のプログラムに対する更新要求を送信するステップと、
    前記第1のプログラムが更新している間に、前記デバイスの一部の制御のみを継続するための周期実行命令列を抽出し、記憶部に記憶するステップと、
    前記更新要求を受け付けた場合に前記機器が前記第1のプログラムの実行を停止するとともに、前記周期実行命令列を実行するステップと、
    前記周期実行命令列を実行している前記機器へ、前記第1のプログラムの更新プログラムを送信するステップと、
    前記更新プログラムのダウンロード終了後、前記機器が前記周期実行命令列の実行を停止し、前記更新プログラムに置き換えられた前記第1のプログラムを実行するステップとを
    備えたことを特徴とするソフトウェア更新方法。
    Transmitting an update request for a first program that controls a device connected to the device;
    While the first program is being updated, extracting a periodic execution instruction sequence for continuing only a part of the control of the device and storing it in a storage unit;
    When the device receives the update request, the device stops executing the first program and executes the periodic execution instruction sequence;
    Transmitting an update program of the first program to the device executing the periodic execution instruction sequence;
    A software updating method comprising: after the download of the update program, the device stops executing the cyclic execution instruction sequence and executes the first program replaced by the update program. .
PCT/JP2014/005658 2014-02-27 2014-11-11 Software-installed apparatus, and software updating method WO2015128914A1 (en)

Priority Applications (3)

Application Number Priority Date Filing Date Title
JP2016504868A JP6042025B2 (en) 2014-02-27 2014-11-11 Software-equipped equipment and software update method
CN201480075765.XA CN106030539A (en) 2014-02-27 2014-11-11 Software-installed apparatus, and software updating method
TW103139501A TW201533664A (en) 2014-02-27 2014-11-14 Software-installed apparatus, and software updating method

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2014-036463 2014-02-27
JP2014036463 2014-02-27

Publications (2)

Publication Number Publication Date
WO2015128914A1 true WO2015128914A1 (en) 2015-09-03
WO2015128914A9 WO2015128914A9 (en) 2016-06-23

Family

ID=54008288

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2014/005658 WO2015128914A1 (en) 2014-02-27 2014-11-11 Software-installed apparatus, and software updating method

Country Status (4)

Country Link
JP (1) JP6042025B2 (en)
CN (1) CN106030539A (en)
TW (1) TW201533664A (en)
WO (1) WO2015128914A1 (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2017159508A1 (en) * 2016-03-16 2017-09-21 日本電気株式会社 Setting device, communication system, method for updating setting of communication device and program
JP2018081543A (en) * 2016-11-17 2018-05-24 セイコーエプソン株式会社 Display device, head-mounted display device, control method for display device, and program
CN111026425A (en) * 2019-12-11 2020-04-17 腾讯科技(深圳)有限公司 Service updating method, device, server and medium
JPWO2021075361A1 (en) * 2019-10-18 2021-04-22

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6723941B2 (en) * 2017-02-15 2020-07-15 株式会社デンソーテン Control device and control program updating method

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000132401A (en) * 1998-10-27 2000-05-12 Matsushita Electric Ind Co Ltd On-vehicle controller
JP2008158801A (en) * 2006-12-22 2008-07-10 Matsushita Electric Works Ltd Authentication device and authentication system
JP2009265923A (en) * 2008-04-24 2009-11-12 Mitsubishi Electric Corp Software rewriting device, software rewriting method and software rewriting program
JP2010125925A (en) * 2008-11-26 2010-06-10 Toyota Motor Corp Software management apparatus

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4243571B2 (en) * 2003-08-05 2009-03-25 パナソニック株式会社 Broadcast receiver
CN103064797B (en) * 2012-12-21 2016-06-29 华为技术有限公司 Data processing method and virtual machine management platform

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000132401A (en) * 1998-10-27 2000-05-12 Matsushita Electric Ind Co Ltd On-vehicle controller
JP2008158801A (en) * 2006-12-22 2008-07-10 Matsushita Electric Works Ltd Authentication device and authentication system
JP2009265923A (en) * 2008-04-24 2009-11-12 Mitsubishi Electric Corp Software rewriting device, software rewriting method and software rewriting program
JP2010125925A (en) * 2008-11-26 2010-06-10 Toyota Motor Corp Software management apparatus

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
HARUYASU UEDA ET AL.: "Extracting highly frequent trace to evaluate huge benchmark test", IPSJ SIG NOTES, vol. 2002, no. 37, 13 May 2002 (2002-05-13), pages 1 - 6, XP055220009 *

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2017159508A1 (en) * 2016-03-16 2017-09-21 日本電気株式会社 Setting device, communication system, method for updating setting of communication device and program
JP2018081543A (en) * 2016-11-17 2018-05-24 セイコーエプソン株式会社 Display device, head-mounted display device, control method for display device, and program
JPWO2021075361A1 (en) * 2019-10-18 2021-04-22
JP7312268B2 (en) 2019-10-18 2023-07-20 日立Astemo株式会社 Redundant system and load drive controller
CN111026425A (en) * 2019-12-11 2020-04-17 腾讯科技(深圳)有限公司 Service updating method, device, server and medium

Also Published As

Publication number Publication date
TW201533664A (en) 2015-09-01
CN106030539A (en) 2016-10-12
WO2015128914A9 (en) 2016-06-23
JP6042025B2 (en) 2016-12-14
JPWO2015128914A1 (en) 2017-03-30

Similar Documents

Publication Publication Date Title
JP6042025B2 (en) Software-equipped equipment and software update method
US11080066B2 (en) Method for starting embedded apparatus, and apparatus
CN106648863B (en) Android application installation package, application target process keep-alive method and system
US10776129B2 (en) Method and apparatus for controlling a startup bootstrap program of an intelligent TV set
TWI530789B (en) ?graceful out-of-band power control of remotely-managed computer systems
JP2017157004A5 (en)
US20070168985A1 (en) Thread debugging device, thread debugging method and information storage medium
US9189293B2 (en) Computer, virtualization mechanism, and scheduling method
WO2007080931A1 (en) Debug supporting device, and program for causing computer to execute debug processing method
EP3489777B1 (en) Control device, control method, and program
WO2018123456A1 (en) Programmable controller, management device, and control system
CN113641378B (en) Optical module program upgrading method, device, equipment and readable storage medium
US9262301B2 (en) Observability control with observability information file
WO2019207729A1 (en) Industrial computer, industrial computer system, operating system update method, and program
JP2004338883A (en) Elevator controller
US10761512B2 (en) Numerical controller
CN107924322B (en) Apparatus and method for hardware virtualization support
CN114780234A (en) Method and device for realizing BOOT and application program separation and related components
KR102434126B1 (en) Apparatus for processing programmable logic controller program
JP2017162135A (en) Information processing device, debug system, and stack overflow detection method
CN108595193B (en) Firmware updating method of baseboard management controller for fan rotating speed control
ATE259528T1 (en) MONITORING SYSTEM
JP2006318197A (en) Controller support device and program
KR102339278B1 (en) How Calculation Units Work
JP7331774B2 (en) electronic controller

Legal Events

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

Ref document number: 14883600

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2016504868

Country of ref document: JP

Kind code of ref document: A

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 14883600

Country of ref document: EP

Kind code of ref document: A1