Program update method and update device of edge computing device
By receiving and processing update packages and matching function block identifiers to achieve non-stop updates of edge computing nodes, the problem of shutdown and restart during updates in the existing technology is solved, and the stability and update efficiency of the device are improved.
Patent Information
- Application Number
- CN202011464257.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-11
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2040-12-11
AI Technical Summary
Edge computing nodes may need to restart or shut down when updating programs, and the updated program cannot be switched while retaining the current running status, affecting the stability and operating efficiency of the device.
By receiving the update package sent by the server, the update function block is generated, and when the identity of the update function block matches the identity of the currently running function block, the current function block is updated when the next running function block is run, otherwise the update function block is stored. Achieve non-stop updates.
It solves the problem of shutdown and restart when updating the edge computing node program, realizes function block updates without affecting the current operating status, and improves the stability and update efficiency of the equipment.
Smart Images

Figure CN112506544B
Abstract
Description
Technical Field
[0001] The present application relates to the field of program update technology, and in particular to a program update method and an update device for an edge computing device. Background Art
[0002] At present, edge computing refers to the method of providing computing power on site to solve problems with high speed, low latency and low external data traffic. An edge computing node is generally an industrial computer, a server, an edge gateway, or a hardware and software system with certain computing power on the device, such as solving the problems of automatic operation of the assembly line, recognition of images on the assembly line, automatic diagnosis of equipment operating parameters, and autonomous operation of the equipment.
[0003] Specifically: collect and calculate data locally (such as a factory, a small area or a device), and then transmit the calculated results to a remote server or other client to receive the action control signal generated by the remote server or other client based on the calculation results. Not only does it not require high quality and high reliability for external connections, but it also has low latency, low traffic consumption, and flexible and convenient deployment.
[0004] However, when the hardware configuration of the edge computing node is not high enough and does not support multi-core parallel computing, accessing an edge computing node means affecting the operation of its own program and may interfere with its normal operation. In addition, the access method is generally through the network or locally: network access may cause connection interruption, resulting in incomplete information transmission; local access may mean re-burning the entire program, which requires interrupting its operation and may affect the operating stability of the edge computing node, which urgently needs to be improved.
[0005] Application Contents
[0006] The present invention aims to solve one of the technical problems in the related art at least to a certain extent.
[0007] To this end, the first purpose of the present invention is to propose a program update method for an edge computing device, which solves the problem in the related art that when updating the program for the edge computing node, it may be necessary to restart or shut down, and the updated program cannot be switched while retaining the current running state, thereby realizing the non-stop update of functional blocks.
[0008] The second objective of the present invention is to provide a program updating device for an edge computing device.
[0009] A third objective of the present invention is to provide an electronic device.
[0010] A fourth object of the present invention is to provide a computer-readable storage medium.
[0011] To achieve the above objectives, the first embodiment of the present application provides a program update method for an edge computing device, comprising the following steps:
[0012] Receive an update package sent by the server, and generate an update function block from the update package;
[0013] Determining whether the first identifier of the update function block matches the second identifier of the currently running function block;
[0014] If the first identifier matches the second identifier and meets the verification rule, when running the next running function block, the current running function block is updated according to the update function block; otherwise, the update function block is stored.
[0015] According to the program update method of the edge computing device of the embodiment of the present application, an update package sent by the server can be received, and an update function block can be generated from the update package, and when the first identifier of the update function block is the second identifier of the currently running function block, and when the next running function block is running, the currently running function block is updated according to the update function block, otherwise, the update function block is stored. Thus, the problem in the related art that when updating the program for the edge computing node, it may be necessary to restart or shut down, and the updated program cannot be switched while retaining the current running state is solved, and the function block can be updated without stopping.
[0016] In addition, the program update method of the edge computing device according to the above embodiment of the present invention may also have the following additional technical features:
[0017] Optionally, storing the update function block includes:
[0018] When the first identifier is detected to exist, obtaining the current storage space linked list;
[0019] Determine whether the current storage space linked list meets the storage condition;
[0020] If the current storage space linked list meets the storage condition, releasing the redundant storage space;
[0021] If the length of the current storage space linked list does not meet the storage condition, a new address that meets the remaining length is found according to the logic of the update function block, and the found storage space linked list is appended to the current storage space linked list.
[0022] Optionally, before receiving the update package, the method further includes:
[0023] Divide each transaction of the edge node into at least one running function block according to the process type, wherein each running function block includes a plurality of information bodies arranged in sequence;
[0024] The operation priority of each function block is determined according to the multiple information bodies of each operation function block, so as to operate in the operation environment in sequence.
[0025] Optionally, after determining that the first identifier matches the second identifier, the method further includes:
[0026] By inserting unparsed meaningless code fragments enclosed by jump instructions before and after in the function block, and after the binary code stream of the entire function block is hashed, the verification rules defined by the preset regular expression are met.
[0027] To achieve the above-mentioned purpose, a second aspect of the present application provides a program update device for an edge computing device, including:
[0028] A generation module, used for receiving an update package sent by a server, and generating an update function block from the update package;
[0029] A judging module, used for judging whether the first identification of the updating function block matches the second identification of the currently running function block;
[0030] A processing module is used to update the current running function block according to the update function block when running the next running function block if the first identifier matches the second identifier and meets the verification rule, otherwise, store the update function block.
[0031] According to the program update device of the edge computing device of the embodiment of the present application, the update package sent by the server can be received, and the update function block can be generated by the update package, and when the first identifier of the update function block is the second identifier of the currently running function block, and when the next running function block is run, the currently running function block is updated according to the update function block, otherwise, the update function block is stored. Thus, the problem in the related art that when updating the program for the edge computing node, it may be necessary to restart or shut down, and the updated program cannot be switched while retaining the current running state is solved, and the function block can be updated without stopping.
[0032] Optionally, the processing module includes:
[0033] An acquiring unit, configured to acquire a current storage space linked list when the first identifier is detected to exist;
[0034] A judging unit, used to judge whether the current storage space linked list meets the storage condition;
[0035] A release unit, used to release excess storage space when the current storage space linked list meets the storage condition;
[0036] A search unit is used to search for a new address that meets the remaining length according to the logic of the update function block when the length of the current storage space linked list does not meet the storage condition, and append the found storage space linked list to the current storage space linked list.
[0037] Optionally, before receiving the update package, the generating module further includes:
[0038] A division unit, used to divide each transaction of the edge node into at least one operation function block according to the process type, wherein each operation function block includes a plurality of information bodies arranged in sequence;
[0039] The determining unit is used to determine the running priority of each function block according to the multiple information bodies of each running function block, so as to run them in the running environment in sequence.
[0040] Optionally, the processing module is also used to, after determining that the first identifier matches the second identifier, insert unparsed meaningless code fragments enclosed by jump instructions before and after in the function block, and after the binary code stream of the entire function block is hashed, satisfy the verification rules defined by a preset regular expression.
[0041] To achieve the above-mentioned objectives, the third aspect of the present application provides an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are configured to execute the program update method of the edge computing device as described in the above-mentioned embodiment.
[0042] To achieve the above-mentioned objectives, the fourth aspect of the present application provides a computer-readable storage medium, which stores computer instructions, and the computer instructions are used to enable the computer to execute the program update method of the edge computing device as described in the above-mentioned embodiment.
[0043] Additional aspects and advantages of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through the practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:
[0045] Figure 1 A flowchart of a program update method for an edge computing device provided according to an embodiment of the present application;
[0046] Figure 2A flowchart of a program update method for an edge computing device according to a specific embodiment of the present application;
[0047] Figure 3 This is an example diagram of a module of a program update device of an edge computing device corresponding to a specific embodiment of the present application;
[0048] Figure 4 A schematic diagram of the data format and interaction logic received by a program package receiving module according to an embodiment of the present application;
[0049] Figure 5 A schematic diagram of dividing functional blocks of an edge node according to an embodiment of the present application;
[0050] Figure 6 is an example diagram of an information body in a function block according to an embodiment of the present application;
[0051] Figure 7 A flowchart of a storage update function block according to an embodiment of the present application;
[0052] Figure 8 A schematic diagram of the definition of a function block header according to an embodiment of the present application;
[0053] Fig. 9 A flowchart of generating a function block that complies with a verification rule according to an embodiment of the present application;
[0054] Fig.10 A flowchart of checking whether a function block complies with a checking rule according to an embodiment of the present application;
[0055] Fig.11 This is an example diagram of a program update device of an edge computing device according to an embodiment of the present application;
[0056] Fig.12 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0057] Embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present application, and should not be construed as limiting the present application.
[0058] Before describing the program update method and update device of the edge computing device proposed according to the embodiment of the present invention, the defects in the related technology are briefly described first.
[0059] Currently, in the related art, there are the following three methods for updating the program of edge computing devices:
[0060] Method 1: After the edge node and related equipment are shut down, use the local programming data cable to re-burn all programs.
[0061] Method 2: Enter the protection mode, only execute the network access function, and update the program through the network. It is equivalent to having an "update program" and a "running area" in the storage space. Every time an update is needed, enter the "update program" from the running area, and then start receiving information through the network and overwrite the received information to the "running area". When the network anomaly causes the program transmission to fail, restart the update process. Restart the edge node after the update is completed.
[0062] Method 3: Set up two areas inside the program and use dual-image boot (Dual-ImageBoot). For example, we call the two images A and B. If the A image is used for this boot, then when updating the program, update to the B image one by one, and finally write a check code and timestamp at the beginning or end of the B image. At each boot, check which of the two images has the correct check code and the updated timestamp. If only one image has the correct check code, run the one with the correct check code; if the check codes of both images are correct, run the one with the latest timestamp. However, after booting, do not select the image - because switching between the two images means restarting, which may cause some running logic (such as assembly line automatic control, equipment operation status monitoring) to be reinitialized, bringing unexpected consequences.
[0063] However, the above three program update methods have the following defects respectively:
[0064] Method 1: The edge node needs to enter programming mode and a programming cable needs to be carried. Due to product intellectual property protection, the program in the microcontroller will generally force it to not enter programming mode when it leaves the factory, otherwise it may allow unauthorized persons to directly read the contents of its storage space. If you want to put the edge node into programming mode, you may need to open its shell and change its startup mode through some jumpers, which is a very troublesome operation. It is difficult to use programming cables in industrial sites. There may be dangers and electromagnetic interference on site, which makes it impossible for personnel to approach the edge node, shut it down, and burn the program.
[0065] Method 2: Let the edge node jump out of the normal running program and start executing the update program. The consequence is that the normal program is stopped, which may mean that the assembly line is stopped, the equipment is stopped, or the established computing function cannot be executed. For industrial sites, non-stop maintenance of equipment is very important.
[0066] Method 3: The edge node does not need to be shut down during the update process, but it needs to be restarted after the update is completed to start running the new program. In addition, the two images in the system mean that the storage space usage rate is only 50%. Restarting the edge node means losing the current operating status, because the logic of industrial control needs to be executed step by step from initialization. Therefore, the restart operation means that all devices related to this edge node need to be re-initialized together. For some specific equipment, such as assembly lines and process equipment, re-initialization is very time-consuming.
[0067] Based on the above problems, the present application proposes a program update method for an edge computing device and a program update device for an edge computing device.
[0068] The following describes a program update method and an update device for an edge computing device proposed according to an embodiment of the present invention with reference to the accompanying drawings. First, the program update method for an edge computing device proposed according to an embodiment of the present invention will be described with reference to the accompanying drawings.
[0069] Specifically, Figure 1 A flowchart of a program update method for an edge computing device provided in an embodiment of the present application.
[0070] Combination Figure 1 and Figure 2 As shown, the program update method of the edge computing device includes the following steps:
[0071] In step S101, an update package sent by a server is received, and an update function block is generated from the update package.
[0072] It is understandable that if Figure 3 As shown, the program running in the edge node of the embodiment of the present application can be composed of multiple modules, for example, a program package receiving module, a storage access module, an update decision module, a scheduling module, a storage management module and an operation module. The embodiment of the present application can receive the update package sent by the server through the UART (Universal Asynchronous Receiver / Transmitter) interface, or the I2C (Inter-Integrated Circuit, I2C bus) interface, or other interfaces through the program package receiving module, and generate an update function block from the update package. The program package receiving module continuously updates its first-in-first-out buffer, and when the buffer is spliced into a complete function block, it will be output to the update decision module. The data format received by the program package receiving module and the interactive logic are as follows Figure 4As shown. After receiving the end character, the buffer content is output as a whole to the update decision module. At this time, the buffer content is a complete functional block. The update decision module has two inputs, one of which is the combination of the sequence number passed in by the current running environment setting module and the start pointer of the complete code fragment, and the other input is the output of the package receiving module, which is also a complete functional block.
[0073] Optionally, in some embodiments, Figure 2 As shown, before receiving the update package, it also includes: dividing each transaction of the edge node into at least one running function block according to the process type, wherein each running function block includes a plurality of information bodies arranged in sequence; determining the running priority of each function block according to the plurality of information bodies of each running function block, so as to run them in sequence in the running environment.
[0074] It is understandable that if Figure 5 As shown, each transaction of the edge node can be divided into multiple "function blocks", such as function block 1, function block 2, function block 3, function block..., each function block means a process that cannot be interrupted. In addition, the embodiment of the present application can also decompose a transaction into several operations that cannot be interrupted, called several function blocks, and in each function block, there are Figure 6 The body of information shown.
[0075] It should be noted that the function block first saves the serial number, priority, operating environment classification and system settings of the function block in order, and then stores several code fragments in the form of a linked list, where "code" refers to a program that can be executed, not text code; the priority is an unsigned integer, 0 is the highest and 255 is the lowest priority; the operating environment classification is a single-byte unsigned integer with a value of 0, 1, 2 (other values are reserved); the "all" mode means that the function block can use all system functions and use the system's underlying interface; the "protected" mode means that the function block needs to work in protected mode and can only call functions through the interface given by the system; the "isolated" mode means that the function block cannot use the system interaction interface and can only execute using its own information and operating environment information.
[0076] A code fragment is a continuous storage space. The starting address of the next storage space is written at the end of the storage space. In this way, by continuously finding the next code fragment starting from the first code fragment, all code fragments related to this function block can be found and spliced into a complete code.
[0077] When the program is running, it first enters the "main program running environment". At a certain point in time, there are multiple transactions, and each transaction will run different function blocks next. The priority of the function blocks is compared, and the function block with the higher priority is run first. If the priority is the same, a random number generator is used to randomly determine one. The purpose of using random numbers is to disrupt the order of transaction scheduling, so that the access to hardware resources is more uniform.
[0078] After deciding which function block needs to be run next, the parameters of this function block are loaded, including its operating environment classification, system settings, and the complete code composed of code fragments. Through the two parameters of operating environment classification and system settings, the current operating environment setting module is used to adjust the system status, including:
[0079] (1) Set the hardware and software parameters according to the system setting parameters, for example, the system's interrupt vector table and the values of intermediate variables.
[0080] (2) According to the operating environment classification parameters, the system's underlying interfaces are shielded and the storage areas are write-protected to prevent unauthorized calls and modifications.
[0081] After completing the above settings, the current running environment setting module passes the start pointer of the complete code segment to the update decision module and appends the serial number of the function block.
[0082] In step S102, it is determined whether the first identifier of the update function block matches the second identifier of the currently running function block, wherein both the first identifier and the second identifier can be serial numbers, that is, it is determined whether the serial number of the update function block matches the serial number of the currently running function block.
[0083] In step S103, if the first identifier matches the second identifier, when running the next running function block, the current running function block is updated according to the updated function block, otherwise, the updated function block is stored.
[0084] It is understandable that if Figure 2 As shown, the embodiment of the present application can first compare whether the two input serial numbers are the same through the update decision module. If they are the same, it means that the currently running function block needs to be updated. If they are different, it means that the function block to be updated is not the function block that is currently running.
[0085] If the function block to be updated is the currently running function block, the update decision module determines to run the current function block, suspends the update task, and waits for the next function block to run before updating the current function block.
[0086] Therefore, according to the program update method of the edge computing device of the embodiment of the present application, the update process does not depend on the QoS of the connection, and can be updated stably under good or bad network connection conditions; and it supports updating while running, and the update does not require pausing the running program; at the same time, it supports updating only some program modules, and there is no need to restart after the update.
[0087] Furthermore, in some embodiments, Figure 2 As shown, the storage update function block includes: when the first identifier is detected to exist, obtaining the current storage space linked list; judging whether the current storage space linked list meets the storage conditions; if the current storage space linked list meets the storage conditions, releasing the excess storage space; if the length of the current storage space linked list does not meet the storage conditions, searching for a new address that meets the remaining length according to the logic of the update function block, and appending the found storage space linked list to the current storage space linked list.
[0088] It is understandable that if Figure 2 As shown, if the function block to be updated is not the currently running function block, a fragmented storage space is obtained from the storage access module to store the newly sent function block. If the sequence number of the newly sent function block is an existing sequence number, the existing function block is updated, and the storage access module returns the starting address of the existing function block; if the sequence number of the newly sent function block is not an existing sequence number, a new function block is created, and the storage access module returns the storage address of a blank space.
[0089] The logic of the storage access module to find the storage address of a new serial number (new functional block) is: calculate the access frequency of each address segment of the storage space, sort them from low to high according to the access frequency, give priority to the one with the low access frequency, and when the current storage space length is not enough, start looking for a new segment to form a linked list.
[0090] The logic of the storage access module to find the storage address of the existing serial number (update the existing functional block) is: first obtain the storage space linked list of the existing functional block. If the current storage space linked list has exceeded the required storage length, release the excess storage space; if the length of the current storage space linked list is less than the required storage length, find a new address that meets the remaining length according to the logic of the new functional block, and append the obtained storage space linked list to the existing storage space linked list.
[0091] After obtaining the storage space address, the update decision module sends the storage space address, the function block to be updated, and the function block to be executed to the scheduling module. The scheduling module first sends the storage space address and the function block information to be updated to the storage management module, and then sends the function block information to be executed to the operation module. Since the storage space pointer is transmitted here, the execution speed of the scheduling module is very fast.
[0092] Since the running module has been set with running variables and callable interfaces by the "current running environment setting module", it can safely execute the current function block and return to the program entry point after execution: the program main running environment module.
[0093] The storage management module receives the start pointer of the function block to be updated, the start pointer of the storage space address and the pointers of each node in the linked list, and starts to store the function block, where Figure 7 As shown, the stored logic may include the following steps:
[0094] S701, store the function block header.
[0095] Among them, the definition of the function block header can be as follows Figure 8 As shown, it may include serial number (4 Byte), priority (1 Byte), operating environment classification (all / protection / isolation) (1 Byte), system setting (such as interrupt protection) length (2 Byte), system setting (such as interrupt protection) content (N Byte), etc.
[0096] S702, determine whether the remaining length of the remaining space is greater than the pointer length, if so, execute step S603, otherwise, execute step S707.
[0097] S703, storing part of the code.
[0098] S704, reserve a pointer length at the end of the storage space.
[0099] S705, determine whether the code has been stored, if so, execute step S706, otherwise, execute step S702.
[0100] S706, end.
[0101] S707, searching for the next space start address.
[0102] S708, write the start address of the next space.
[0103] S709, code fragment count +1.
[0104] S710, taking the total length of the next space as the "remaining length of the remaining space", and returning to execute step S702.
[0105] From the above, it can be seen that the logic of the storage access module to find the storage address of the existing serial number (update the existing functional block) is to first obtain the storage space linked list of the existing functional block. If the current storage space linked list has exceeded the required storage length, the excess storage space is released; if the length of the current storage space linked list is less than the required storage length, a new address that meets the remaining length is found according to the logic of the newly created functional block, and the obtained storage space linked list is appended to the existing storage space linked list.
[0106] It should be noted that the program update of the edge node can rely on a variety of communication methods such as WiFi (Wireless Fidelity), LoRa, NB-IoT (Narrow Band Internet of Things), etc., and no longer relies on a specific technology or some specific network behaviors (such as long connections, such as large data packets); the program update of the edge node no longer needs to be connected through the on-site programming cable, and all internal function blocks can also be updated; the storage space utilization rate is high, each update of the function block is equivalent to an incremental update, only occupying the storage space equivalent to the size of the function block, and this storage space can be implemented through a linked list and does not require a continuous storage space; the operating environment constraints are imposed on the function blocks, which is safer when updating the program. Most function blocks can be run in "isolation" mode. Even if there is a serious abnormality in the update, it will not affect the execution of other transactions; when the function block is running, random hashing is used, so that the order in which function blocks with the same priority access hardware resources is no longer fixed, reducing the coupling characteristics of software and hardware, making the hardware utilization cycle more even, and can also resist program cracking methods targeting hardware characteristics.
[0107] In summary, by introducing the concept of "running environment" into the program, scheduling the code and program blocks, and changing the storage resources to distributed storage instead of whole block storage through chain storage, the different functional areas of the program are decomposed into several parts, and each functional area is executed independently each time, so that when updating, you can choose to update a certain functional area, or create a new functional area. In this way, the update of a certain functional area will not affect the code integrity of other functional areas, and after a functional area is updated, the new code will be executed the next time it is executed, realizing seamless replacement, and after a functional area is updated, the storage space fragments occupied by the old code are recycled for the next update, thereby realizing efficient use of storage space.
[0108] In addition, in one embodiment of the present application, after determining that the first identifier matches the second identifier, it also includes: inserting unparsed meaningless code fragments enclosed by jump instructions before and after in the function block, and after the binary code stream of the entire function block is hashed, it satisfies the verification rules defined by the preset regular expression.
[0109] Specifically, the verification rules are implemented by inserting unparsed meaningless code fragments enclosed by jump instructions before and after the function block, so that the binary code stream of the entire function block satisfies the verification rules defined by a given regular expression after the hash operation.
[0110] like Fig. 9 As shown, the embodiment of the present application includes the following steps:
[0111] Step S901: Obtain a given regular expression rule.
[0112] Step S902: Acquire a complete functional block.
[0113] Step S903: Randomly select several positions in the functional block.
[0114] Step S904: insert jump instructions before and after to prevent the execution of meaningless code inserted later.
[0115] Step S905: randomly generate characters and insert them into positions;
[0116] Step S906: Calculate the hash result.
[0117] Step S907: Determine whether it complies with the expression rules. If so, execute step S908, otherwise execute step S909. Step S908: Output as a packaged function block that complies with the verification.
[0118] Step S909: Clear the existing random characters.
[0119] Furthermore, if Fig.10 As shown, the steps of checking whether the functional block of the embodiment of the present application complies with the checking rules are:
[0120] Step 1001: Get a given regular expression rule.
[0121] Step 1002: Obtain a complete functional block.
[0122] Step 1003: Calculate the hash result.
[0123] Step 1004: If the regular expression rule is met, a correct answer is returned; if not, an error is returned.
[0124] According to the program update method of the edge computing device proposed in the embodiment of the present application, an update package sent by the server can be received, and an update function block can be generated from the update package. When the first identifier of the update function block is the same as the second identifier of the currently running function block, and when the next running function block is running, the currently running function block is updated according to the update function block, otherwise, the update function block is stored. Thus, the problem in the related art that when updating the program for the edge computing node, it may be necessary to restart or shut down, and the updated program cannot be switched while retaining the current running state is solved, and the function block can be updated without stopping.
[0125] Next, a program update device for an edge computing device according to an embodiment of the present application will be described with reference to the accompanying drawings.
[0126] Fig.11 It is a block diagram of a program update device of an edge computing device according to an embodiment of the present application.
[0127] like Fig.11 As shown, the program updating device 10 of the edge computing device includes: a generating module 100, a judging module 200 and a processing module 300.
[0128] The generation module 100 is used to receive the update package sent by the server, and generate the update function block from the update package;
[0129] The judgment module 200 is used to judge whether the first identification of the updated function block matches the second identification of the currently running function block;
[0130] The processing module 300 is used to update the current running function block according to the updated function block when running the next running function block if the first identifier matches the second identifier, and otherwise store the updated function block.
[0131] Optionally, in some embodiments, the processing module 300 includes: an acquisition unit, a judgment unit, a release unit and a search unit.
[0132] The acquisition unit is used to acquire the current storage space linked list when the first identifier is detected to exist;
[0133] A judging unit, used to judge whether the current storage space linked list meets the storage condition;
[0134] A release unit is used to release excess storage space when the current storage space linked list meets the storage condition;
[0135] The search unit is used to search for a new address that meets the remaining length according to the logic of the update function block when the length of the current storage space linked list does not meet the storage condition, and append the found storage space linked list to the current storage space linked list.
[0136] Optionally, in some embodiments, before receiving the update package, the generation module 100 further includes: a division unit and a determination unit.
[0137] The division unit is used to divide each transaction of the edge node into at least one operation function block according to the process type, wherein each operation function block includes a plurality of information bodies arranged in sequence;
[0138] The determination unit is used to determine the operation priority of each function block according to the multiple information bodies of each running function block, so as to run them in sequence in the operation environment. It should be noted that the aforementioned explanation of the embodiment of the program update method of the edge computing device is also applicable to the program update device of the edge computing device of this embodiment, which will not be repeated here.
[0139] According to the program update device of the edge computing device proposed in the embodiment of the present application, the update package sent by the server can be received, and the update function block can be generated by the update package, and when the first identifier of the update function block is the second identifier of the currently running function block, and when the next running function block is running, the currently running function block is updated according to the update function block, otherwise, the update function block is stored. Thus, the problem in the related art that when updating the program for the edge computing node, it may be necessary to restart or shut down, and the updated program cannot be switched while retaining the current running state is solved, and the function block can be updated without stopping.
[0140] Fig.12 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. The electronic device may include:
[0141] A memory 1201 , a processor 1202 , and a computer program stored in the memory 1201 and executable on the processor 1202 .
[0142] When the processor 1202 executes the program, the program update method of the edge computing device provided in the above embodiment is implemented.
[0143] Furthermore, the electronic device further comprises:
[0144] The communication interface 1203 is used for communication between the memory 1201 and the processor 1202 .
[0145] The memory 1201 is used to store computer programs that can be executed on the processor 1202 .
[0146] The memory 1201 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.
[0147] If the memory 1201, the processor 1202 and the communication interface 1203 are implemented independently, the communication interface 1203, the memory 1201 and the processor 1202 can be connected to each other through a bus and communicate with each other. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Fig. 9 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0148] Optionally, in a specific implementation, if the memory 1201, the processor 1202 and the communication interface 1203 are integrated on a chip, the memory 1201, the processor 1202 and the communication interface 1203 can communicate with each other through an internal interface.
[0149] The processor 1202 may be a central processing unit (CPU), or an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present application.
[0150] This embodiment also provides a computer-readable storage medium on which a computer program is stored, characterized in that when the program is executed by a processor, the program update method of the edge computing device as described above is implemented.
[0151] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or N embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.
[0152] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include at least one of the features. In the description of this application, "N" means at least two, such as two, three, etc., unless otherwise clearly and specifically defined.
[0153] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, fragment or portion of code comprising one or more executable instructions for implementing the steps of a custom logical function or process, and the scope of the preferred embodiments of the present application includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in reverse order depending on the functions involved, which should be understood by technicians in the technical field to which the embodiments of the present application belong.
[0154] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in combination with these instruction execution systems, devices or apparatuses. For the purpose of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in combination with these instruction execution systems, devices or apparatuses. More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or N wirings (electronic devices), a portable computer disk box (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), a fiber optic device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium and then editing, interpreting or processing in other suitable ways if necessary, and then stored in a computer memory.
[0155] It should be understood that the various parts of the present application can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiment, the N steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0156] A person skilled in the art may understand that all or part of the steps in the method for implementing the above-mentioned embodiment may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiment.
[0157] In addition, each functional unit in each embodiment of the present application may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.
[0158] The storage medium mentioned above may be a read-only memory, a magnetic disk or an optical disk, etc. Although the embodiments of the present application have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limiting the present application. A person of ordinary skill in the art may change, modify, replace and modify the above embodiments within the scope of the present application.
Claims
1. A program update method for an edge computing device, characterized in that: The following steps are involved: Divide each transaction of the edge node into at least one running function block according to the process type, determine the running priority of each running function block according to a plurality of information bodies arranged in sequence of each running function block, run each running function block with the running priority, and attach a sequence number of each running function block, receive an update package sent by the server, and generate an update function block from the update package, wherein, if the priorities of two running function blocks are the same, one is randomly determined by a random number generator; Determine whether a first identifier of the update function block matches a second identifier of the currently running function block, wherein the first identifier and the second identifier are both the serial number; If the first identifier matches the second identifier and meets the verification rule, then when running the next running function block, the current running function block is updated according to the update function block; otherwise, the update function block is stored; After determining that the first identifier matches the second identifier, a meaningless code fragment that is not parsed and enclosed by jump instructions is inserted before and after the running function block, and the binary code stream of the entire running function block is hashed to meet the verification rules defined by the preset regular expression.
2. The method according to claim 1, characterized in that: The storing and updating function blocks include: When the first identifier is detected to exist, obtaining the current storage space linked list; Determine whether the current storage space linked list meets the storage condition; If the current storage space linked list meets the storage condition, releasing the redundant storage space; If the length of the current storage space linked list does not meet the storage condition, a new address that meets the remaining length is found according to the logic of the update function block, and the found storage space linked list is appended to the current storage space linked list.
3. A program update device for an edge computing device, characterized in that: include: A generation module, used to divide each transaction of the edge node into at least one running function block according to the process type, determine the running priority of each running function block according to a plurality of information bodies arranged in sequence for each running function block, run each running function block with the running priority, and attach a sequence number of each running function block, receive an update package sent by the server, and generate an update function block from the update package, wherein, if the priorities of two running function blocks are the same, one is randomly determined by a random number generator; A judgment module, used to judge whether the first identifier of the update function block matches the second identifier of the currently running function block, wherein the first identifier and the second identifier are both the serial number; a processing module, configured to update the currently running function block according to the update function block when running the next running function block if the first identifier matches the second identifier and meets the verification rule, and otherwise store the update function block; The processing module is also used to, after determining that the first identifier matches the second identifier, insert a meaningless code fragment that is not parsed and is enclosed by jump instructions before and after in the running function block, and after the binary code stream of the entire running function block is hashed, it satisfies the verification rules defined by a preset regular expression.
4. The device according to claim 3, characterized in that The processing module comprises: An acquiring unit, configured to acquire a current storage space linked list when the first identifier is detected to exist; A judging unit, used to judge whether the current storage space linked list meets the storage condition; A release unit, used to release excess storage space when the current storage space linked list meets the storage condition; A search unit is used to search for a new address that meets the remaining length according to the logic of the update function block when the length of the current storage space linked list does not meet the storage condition, and append the found storage space linked list to the current storage space linked list.
5. An electronic device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the program update method of the edge computing device as described in claim 1 or 2.
6. A computer-readable storage medium having a computer program stored thereon, characterized in that: The program is executed by a processor to implement the program update method of the edge computing device as described in claim 1 or 2.
