Method, system, equipment and medium for power internet of things edge computing architecture based on autonomous controllable operating system
By introducing program synchronization methods in the OpenHarmony operating system, the interface changes and call information are automatically processed, and the problem of low hardware adaptation update efficiency in power IoT edge computing is solved, efficient automatic updates are achieved, and cost is reduced.
Patent Information
- Application Number
- CN202411285983.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-13
- Publication Date
- 2024-12-31
AI Technical Summary
The version update of the OpenHarmony operating system in the power IoT edge computing scenario is frequent, resulting in the hardware adapter update relies on manual development by professional engineers, which consumes a lot of manpower and material resources, and is inefficient.
Provide a program synchronization method based on the power IoT edge computing architecture of an autonomous and controllable operating system. By obtaining system update documents and original adapter programs, extracting interface call information, adding change marks based on interface change information, and updating adapter programs. Implement automated updates.
Improve the update efficiency of device adapter programs, reduce update costs, and ensure synchronous updates between adapter programs and operating systems.
Smart Images

Figure CN119225761A_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present invention relate to the field of Internet of Things technology, and in particular, to a method, system, device and medium for an edge computing architecture of power Internet of Things based on an autonomous and controllable operating system. Background Art
[0002] At present, the design research and application of edge computing architecture for the Internet of Things are becoming more and more in-depth, and the edge computing system architecture in the power Internet of Things scenario is in a stage of rapid development. In this process, with the continuous increase in the number and types of networked devices, a variety of new edge computing architectures have gradually emerged, and in the continuous application and evolution, these new architectures have gradually received widespread attention and unanimous recognition from the industry and academia.
[0003] In recent years, autonomous operating systems have developed rapidly, and a large number of excellent operating systems have been born. Among them, the OpenHarmony operating system is mainly aimed at terminals and IoT scenarios. As an autonomous and controllable open source operating system for all scenarios, full connection, and full intelligence, its main goal is to build an ecosystem in all aspects of chips, modules, solutions, and industry standards, solve industry-specific problems, and enable the development of the Internet of Things. Therefore, autonomous and controllable operating systems represented by the OpenHarmony operating system have gradually played a key role in the edge computing framework of the power IoT. However, the use of such autonomous and controllable operating systems to quickly build IoT edge applications still requires addressing many challenges.
[0004] At present, the functional interface provided by the OpenHarmony operating system is relatively complex, and the OpenHarmony operating system is still in a stage of rapid development, with frequent iterations of operating system versions. The hardware adapter program updates brought about by operating system version updates still need to rely on manual development by professional engineers, which requires a lot of manpower and material resources. Summary of the invention
[0005] The embodiments of the present invention provide a method, system, device and medium for an electric power Internet of Things edge computing architecture based on an autonomous and controllable operating system, which can improve the update efficiency of device adapter programs and reduce update costs.
[0006] In a first aspect, an embodiment of the present invention provides a program synchronization method for an edge computing architecture of a power Internet of Things based on an autonomous and controllable operating system, comprising:
[0007] Obtaining a system update document and an original adapter; wherein the system update document includes interface change information, and the interface change information includes a first interface name, a first return value information, a first parameter information, and a change description information;
[0008] Extracting interface call information from the original adapter; wherein the interface call information includes: the line number of the interface call, the second interface name, the second return value information, the second parameter information, the starting line number of the calling function and the calling function name;
[0009] Adding a change mark to the original adapter based on the interface change information and the interface call information;
[0010] The original adapter is updated based on the change mark to obtain a target adapter.
[0011] In a second aspect, an embodiment of the present invention further provides a resource scheduling method for an edge computing architecture of a power Internet of Things based on an autonomous and controllable operating system, comprising:
[0012] Respectively obtain the next subtasks to be executed of multiple tasks to be executed, and obtain multiple subtasks;
[0013] Combining the multiple subtasks to obtain multiple subtask groups;
[0014] Determine a target subtask group from the multiple subtask groups based on first resource information; wherein the first resource includes input / output IO resources and / or memory resources;
[0015] Sort the subtasks in the target subtask group based on the second resource information; wherein the second resource includes a central processing unit (CPU) resource;
[0016] The first resource and the second resource are scheduled according to the sorting order to sequentially execute the sorted subtasks.
[0017] In a third aspect, an embodiment of the present invention further provides a power IoT edge computing architecture system based on an autonomous and controllable operating system, including: an operating system adaptation module, a resource scheduling module, a device discovery and registration module, and a device collaborative interaction module;
[0018] The operating system adaptation module is used to execute the program synchronization method of the power Internet of Things edge computing architecture based on the autonomous and controllable operating system described in the embodiment of the present invention; the resource scheduling module is used to execute the resource scheduling method of the power Internet of Things edge computing architecture based on the autonomous and controllable operating system described in the embodiment of the present invention;
[0019] The device discovery and registration module is used to discover the access of new devices, register the new devices, and send registration information to the device collaborative interaction module;
[0020] The device collaborative interaction module is used to manage the interaction between devices based on the registration information.
[0021] In a fourth aspect, an embodiment of the present invention provides an electronic device, the electronic device comprising:
[0022] at least one processor; and
[0023] a memory communicatively connected to the at least one processor; wherein,
[0024] The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the program synchronization method of the power Internet of Things edge computing architecture based on an autonomous and controllable operating system described in an embodiment of the present invention or the resource scheduling method of the power Internet of Things edge computing architecture based on an autonomous and controllable operating system described in an embodiment of the present invention.
[0025] In a fifth aspect, an embodiment of the present invention provides a computer-readable storage medium, which stores computer instructions, and the computer instructions are used to enable a processor to implement the program synchronization method of the power Internet of Things edge computing architecture based on an autonomous and controllable operating system described in an embodiment of the present invention, or the resource scheduling method of the power Internet of Things edge computing architecture based on an autonomous and controllable operating system described in an embodiment of the present invention.
[0026] The embodiment of the present invention discloses a program synchronization method, resource scheduling method, system, device and medium for an edge computing architecture of an electric power Internet of Things based on an autonomous and controllable operating system. Obtain a system update document and an original adapter program; wherein the system update document includes interface change information, and the interface change information includes a first interface name, a first return value information, a first parameter information and a change description information; extract interface call information from the original adapter program; wherein the interface call information includes: the line number of the interface call, the second interface name, the second return value information, the second parameter information, the starting line number of the calling function and the calling function name; add a change mark to the original adapter program based on the interface change information and the interface call information; update the original adapter program based on the change mark to obtain a target adapter program. The program synchronization method for an edge computing architecture of an electric power Internet of Things based on an autonomous and controllable operating system provided by the embodiment of the present invention realizes the update of the original adapter program based on the interface change information and the interface call information, which can not only ensure the synchronous update of the adapter program and the operating system program, but also improve the update efficiency of the device adapter program and reduce the update cost. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] Figure 1 It is a flowchart of a program synchronization method of a power Internet of Things edge computing architecture based on an autonomous and controllable operating system in Embodiment 1 of the present invention;
[0028] Figure 2It is a flow chart of a resource scheduling method of a power Internet of Things edge computing architecture based on an autonomous and controllable operating system in Embodiment 2 of the present invention;
[0029] Figure 3 It is a structural schematic diagram of a power Internet of Things edge computing architecture system based on an autonomous and controllable operating system in Embodiment 3 of the present invention;
[0030] Figure 4 This is a schematic diagram of the structure of a power IoT edge system in the third embodiment;
[0031] Figure 5 It is a structural schematic diagram of an electronic device in Embodiment 4 of the present invention. DETAILED DESCRIPTION
[0032] The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the present invention, rather than to limit the present invention. It should also be noted that, for ease of description, only parts related to the present invention, rather than all structures, are shown in the accompanying drawings.
[0033] Embodiment 1
[0034] Figure 1 A flowchart of a program synchronization method for a power Internet of Things edge computing architecture based on an autonomous and controllable operating system provided in the first embodiment of the present invention. This embodiment is applicable to the case of synchronizing the update of the adaptation program with the operating system. The method can be executed by a program synchronization device for a power Internet of Things edge computing architecture based on an autonomous and controllable operating system. The device can be implemented in the form of software and / or hardware, and optionally, by an electronic device, which can be a mobile terminal, a PC or a server, etc. Specifically comprising the following steps:
[0035] S110, obtaining system update documents and original adapter programs.
[0036] Among them, the system update document includes interface change information, and the interface change information includes the first interface name, the first return value information, the first parameter information and the change description information. In this embodiment, the system change document records the change information of the system interface of the operating system program from the original version to the new version, and the interface information includes the name, return value information and parameter information. The first interface name, the first return value information and the first parameter information represent the interface information of the new version, which is the same as or different from the original interface information. The change description information contains the changes in the interface information of the operating system from the original version to the new version, for example: it may include the changes in the interface name, the changes in the return value information and the changes in the parameter information.
[0037] The original adapter is an adapter corresponding to the original version of the operating system. In this embodiment, the adapter is the original program code of the application device compatible with the operating system. Through the adapter, the application device can work normally in the operating system and implement a series of calls to the interface in the operating system. Exemplarily, the adapter includes a call sequence for the camera's functional interface and a call sequence for the microphone's functional interface.
[0038] The interface change information includes two categories, namely interface deletion information and interface modification information. The interface modification information includes interface name modification information, return value and / or parameter modification information; if the interface modification information is interface name modification information, the interface change information also includes the second interface name, wherein the first interface name is the name after the change, and the second interface name is the name before the change.
[0039] Among them, interface modification information can be understood as the interface name in the interface information has changed, and return value and / or parameter modification information can be understood as the return value information and / or parameter information in the interface information has changed.
[0040] In this embodiment, natural language processing technology is used to analyze the system update document, identify the contents such as "interface deletion" and "interface modification or update", extract interface deletion information and interface modification information, and store these two types of change information in two tables. One of the tables is the interface deletion table, which is used to record interface deletion information, and each piece of information includes: interface name, return value information, parameter information and change description information. The other table is the interface modification table, which is used to record interface modification information, and each piece of information includes: first interface name, first return value information, first parameter information and change description information. For interface name modification information, the second interface name is also included.
[0041] Specifically, the system update document and the original adapter program are obtained, so as to facilitate the subsequent update of the original adapter program based on the system update document.
[0042] S120, extracting interface call information from the original adapter program.
[0043] The interface call information includes: the line number of the interface call, the second interface name, the second return value information, the second parameter information, the starting line number of the calling function and the calling function name. The second interface name, the second return value information and the second parameter information represent the interface information of the original version. The line number of the interface call can be understood as the line number of the code that calls the interface in the original adapter program, the starting line number of the calling function can be understood as the starting line number of the code of the function that calls the interface, and the calling function name can be understood as the name of the function that calls the interface.
[0044] Specifically, the method of extracting the interface call information from the original adapter program may be: parsing the original adapter program to obtain an abstract syntax tree corresponding to the original adapter program; and extracting the interface call information from the abstract syntax tree.
[0045] The interface call information may include one or more call records, each of which includes: the line number of the interface call, the second interface name, the second return value information, the second parameter information, the starting line number of the calling function and the calling function name. In this embodiment, one operating system may correspond to multiple adapters. It is necessary to use a static analysis tool to analyze each original adapter to obtain the abstract syntax tree of each original adapter. After obtaining the abstract syntax tree, the interface call information is extracted from the abstract syntax tree.
[0046] S130, adding a change mark to the original adapter based on the interface change information and the interface call information.
[0047] Optionally, before adding a change mark to the original adapter program based on the interface change information and the interface call information, the following steps are also included: matching the second interface name in the interface name modification class information with the second interface name in the interface call information to obtain the line number of the interface call corresponding to the matching second interface name; updating the interface name in the code corresponding to the line number of the interface call in the original adapter program from the second interface name to the corresponding first interface name.
[0048] Among them, if the second interface name in the interface name modification class information matches the second interface name in the interface call information, it means that after the interface name is upgraded from the original version to the new version, the interface name is changed from the second interface name to the first interface name, and accordingly, the name of the interface in the original adapter needs to be changed. At this time, according to the line number of the interface call corresponding to the matching second interface name obtained from the interface call information, the interface name in the corresponding line of the original adapter code is then updated from the second interface name to the corresponding first interface name. In this way, the name of the interface whose name has been changed in the adapter is updated.
[0049] The change mark includes a deletion mark or a modification mark, and the change mark is represented in an annotation manner.
[0050] Specifically, the method of adding change marks to the original adapter program based on interface change information and interface call information can be: for interface deletion class information or return value and / or parameter modification class information, match the first interface name in the system interface deletion class information or return value and / or parameter modification class information with the second interface name in the interface call information, and obtain the line number of the interface call corresponding to the matching second interface name; add change marks in the form of comments in the code corresponding to the line number of the interface call in the original adapter program.
[0051] In this embodiment, for all interface deletion class information, the first interface name contained therein is compared one by one with the second interface name in each call record in the interface call information. When the first interface name in the interface deletion class information is the same as the second interface name in each call record in the interface call information, the line number of the interface call corresponding to the second interface name in the call record is obtained, and then a deletion mark is added in the code of the corresponding line of the original adapter in the form of a comment. Exemplary: the deletion mark can be expressed as "del: interface name".
[0052] In this embodiment, for all return value and / or parameter modification class information, the first interface name contained therein is compared one by one with the second interface name in each call record in the interface call information. When the first interface name in the return value and / or parameter modification class information is the same as the second interface name in each call record in the interface call information, the line number of the interface call corresponding to the second interface name in the call record is obtained, and then a modification mark is added in the form of a comment in the code of the corresponding line of the original adapter. Exemplary: the modification mark can be expressed as "update: interface name".
[0053] S140: Update the original adapter based on the change mark to obtain a target adapter.
[0054] Among them, updating the original adapter program based on the change mark can be understood as: deleting the interface-related code corresponding to the interface deletion class information from the original adapter program, and updating the return value or parameters in the interface-related code corresponding to the return value and / or parameter modification class information to the return value or parameters corresponding to the new version.
[0055] Specifically, the original adapter is updated based on the change mark, and the target adapter is obtained by: extracting the code segment corresponding to the target calling function and the function call chain composed of the target calling function from the original adapter based on the change mark; sending the code segment corresponding to the target calling function and the function call chain composed of the target calling function to the development user, so that the development user updates the code segment based on the function call chain and the change mark; and updating the original adapter based on the updated code segment to obtain the target adapter.
[0056] Among them, the target calling function is the calling function whose called interface has changed, and the number of target calling functions can be one or more. The code segment corresponding to the target calling function is composed of the code between the starting line code and the ending line code of the target calling function. Extracting the code segment corresponding to the target calling function from the original adapter based on the change mark can be understood as: extracting the code segment corresponding to the target calling function from the original adapter with the change mark added. The function call chain composed of the target calling function can be understood as a function call chain composed of all target calling functions. Specifically, the process of extracting the function call chain composed of the target calling function from the original adapter based on the change mark can be: first generate a function call graph based on the original adapter with the change mark added, and then extract the function call chain composed of all target calling functions from the function call graph.
[0057] In this embodiment, the code segment corresponding to the target calling function and the function call chain constituted by the target calling function are sent to the development user, so that the development user performs a deletion operation on the interface code corresponding to the deletion mark in the code segment based on the function call chain, and modifies the return value or parameter in the interface code corresponding to the modification mark in the code segment based on the function call chain.
[0058] In this embodiment, after all code segments are updated, the updated code segments are updated to the original adapter program to obtain the target adapter program, and the updated code segments are used to replace the corresponding code segments in the original video program.
[0059] In this embodiment, the starting line number of the code segment can be used to find the corresponding code segment of the updated code segment in the original adapter. For the accuracy of the update, the updated code segment can be updated to the original adapter in reverse order of the starting line number.
[0060] Specifically, the original adapter program is updated based on the updated code segment, and the target adapter program can be obtained by: obtaining the starting line number of the calling function corresponding to the updated code segment; the updated code segment is updated to the original adapter program in reverse order of the starting line number of the calling function to obtain the target adapter program.
[0061] Among them, the updated code segments are updated to the original adapter in the reverse order of the starting line number of the calling function, which can be understood as: starting from the code segment with the largest starting line number of the calling function, they are updated in sequence until the code segment with the largest starting line number of the calling function is updated. The advantage of this is that the line number of the code before the code in the original adapter is not affected, which is conducive to finding the corresponding code segment of the updated code segment in the original adapter.
[0062] Specifically, the program synchronization method of the power Internet of Things edge computing architecture based on the autonomous and controllable operating system in this embodiment includes the following steps:
[0063] Step 1) Obtain the system update document, which lists the system interface change information in detail.
[0064] Step 2) Apply natural language processing technology to analyze the document, identify the content related to "interface deletion" and "interface modification or update", extract and classify the interface change information, and generate two lists: apiList_del (deletion list) and apiList_update (modification list), which record the table items of interface deletion and interface modification respectively. The table items of the two lists are composed of the same four-tuple<apiName,returnValue,arguments,description> , describing the name, return value, parameters and update description of the interface. Among them, arguments is a list and description is a string.
[0065] Step 3) Expand apiList_update and add the originalApiName field to become<apiName,returnValue,arguments,description,originalApiName> . Analyze the description of each table item and identify the contents such as "Interface Name" and "Update / Replacement" in the update description. If there is no relevant content, it is assumed that the interface name has not changed, and originalApiName is set to the apiName value. If there is relevant content, extract the English string different from apiName and set it as the value of originalApiName;
[0066] Step 4) Extract the description of all items in the list apiList_update, identify the content of the "return value" and "parameters" in the update content description. If these two keywords are not identified, or the description related to these two keywords does not identify "change to", "become" and other keywords, it means that the corresponding content has not changed. Otherwise, in order to modify the "return value" or "parameters", all related items are summarized into a new list apiList_deep_update.
[0067] Step 5) Use static analysis tools to analyze all adapter programs (expressed as {p_0, p_1, ... p_n}) and generate abstract syntax trees {ast_0, ast_1, ..., ast_n} for each adapter program.
[0068] Step 6) extract the interface call information of each generated abstract syntax tree to form an interface call information list of the adapter called ApiList_i, where one table entry is a call record, which can be expressed as<line,calledApiName,returnValue,arguments,declLine,functionDecl> Specifically, it is necessary to traverse an abstract syntax tree ast_i and perform the following steps in sequence: whenever the keyword "CallExpr" is encountered, a table entry record is generated, and the line number after the subsequent keyword "line" of "CallExpr" is recorded in the middle line position of the table entry; then, all the lines containing indents after the "CallExpr" are traversed, and the strings after "DeclRefExpr" and "Function" are recorded in the calledApiName, returnValue and arguments of the table entry in sequence; finally, the string after the keyword "line" in the keyword "FunctionDecl" mark line of the module where the "CallExpr" is located is recorded as the line number and name of the function where the call is located, and filled in the final declLine and functionDecl areas.
[0069] Step 7) Extract the originalApiName (expressed as {originalApiName_0, originalApiName_1, ..., originalApiName_m}) of all the table items in the expanded list apiList_update, and compare the calledApiName in all the table items in the interface call information list calledApiList_i of each generated abstract syntax tree one by one. If there are no exactly the same items, it means that the adapter has no interface with the name changed. Otherwise, it is necessary to obtain the line number line and the function name functionDecl of the same item in the table item of calledApiList_i, and then return to the corresponding line position of the adapter, and modify the originalApiName in the line position to the corresponding apiName. At this time, the adapter has been updated once and is p_i1.
[0070] Step 8) Extract the apiName (expressed as {apiName_0, apiName_1, …, apiName_m}) of all entries in the list apiList_del, and compare the calledApiName in all entries in the interface call information list calledApiList_i of each generated abstract syntax tree one by one. If there are no identical entries, it means that the adapter does not use the deleted interface. Otherwise, it is necessary to obtain the line number line and the function name functionDecl of the same entry in the table entry of calledApiList_i, and then return to the corresponding line position of the adapter, add a comment at the end of the code line, and the comment content is a combination of the "del" mark plus the apiName. The adapter is further updated to p_i2, and all synchronously obtained functionDecl and the corresponding line number declLine are added to the collection ManualCheckList.
[0071] Step 9) Extract the apiName of all entries in the list apiList_deep_update, and compare the calledApiName of all entries in the interface call information list calledApiList_i of each generated abstract syntax tree one by one. If there are no identical entries, go directly to the next step. Otherwise, it is necessary to obtain the function declaration line number declLine and function name functionDecl of the same entry in the table entry of calledApiList_i. Then, return to the corresponding line position of the adapter (the adapter is p_i2 at this time), add a comment at the end of the code line, and the comment content is a combination of the "update" mark plus the apiName. The adapter is further updated to p_i3, and all synchronously obtained functionDecl and the corresponding line number declLine are added to the collection ManualCheckList.
[0072] Step 10) Continue to apply Clang to generate a function call graph callGraph_0 for the updated adapter p_i3, extract all function names {functionDecl_0, functionDecl_1, ..., functionDecl_j} stored in ManualCheckList, and extract all function call graph chains starting from any function mentioned in ManualCheckList from callGraph_0 to form callGraph_1. According to the function functionListtoManualCheck mentioned in callGraph_1 (where the functions covered are mostly equal to ManualCheckList), extract the corresponding implementation code from the adapter p_i3 and send it to the developer, requiring the developer to update and confirm all automatically generated comment parts, and finally the developer returns all the updated functions functionListtoManualCheck1;
[0073] Step 11) After the adaptive update module receives functionListtoManualCheck1, it obtains the line number declLine according to the function name, starts from the function with the largest declLine in the adapter p_i3, and overwrites the version in p_i3 with the implementation version in functionListtoManualCheck1 until all functions in functionListtoManualCheck1 are overwritten, and finally obtains the adapter p_i4 that completes the adaptive update.
[0074] The technical solution of this embodiment is to obtain the system update document and the original adapter program; wherein the system update document includes interface change information, and the interface change information includes the first interface name, the first return value information, the first parameter information and the change description information; extract the interface call information from the original adapter program; wherein the interface call information includes: the line number of the interface call, the second interface name, the second return value information, the second parameter information, the starting line number of the calling function and the calling function name; add a change mark to the original adapter program based on the interface change information and the interface call information; update the original adapter program based on the change mark to obtain the target adapter program. The program synchronization method of the power Internet of Things edge computing architecture based on the autonomous and controllable operating system provided in the embodiment of the present invention realizes the update of the original adapter program based on the interface change information and the interface call information, which can not only ensure the synchronous update of the adapter program and the operating system program, but also improve the update efficiency of the device adapter program and reduce the update cost.
[0075] Embodiment 2
[0076] Figure 2A flowchart of a resource scheduling method for an edge computing architecture of the power Internet of Things based on an autonomous and controllable operating system provided in the second embodiment of the present invention. This embodiment is applicable to the case of calling resources to perform tasks. The method can be executed by a resource scheduling device for an edge computing architecture of the power Internet of Things based on an autonomous and controllable operating system. The device can be implemented in the form of software and / or hardware, and optionally, by an electronic device, which can be a mobile terminal, a PC or a server, etc. Specifically, the following steps are included:
[0077] S210, respectively obtaining the next subtask to be executed of the multiple tasks to be executed, to obtain the multiple subtasks.
[0078] In this application scenario, a series of applications (Application, app) are running in the operating system. Each running app corresponds to a task, and the operating system needs to handle the tasks of multiple apps; a specific task can be divided into multiple sequential subtasks, and the order between subtasks in each task cannot be changed. Each subtask requires a certain amount of I / O, memory, and CPU resources. For example, suppose there are currently three tasks to be executed, namely A, B, and C. The subtasks included in A are: A1, A2, ...An, the subtasks included in B are: B1, B2, ...Bm, and the subtasks included in C are: C1, C2, ...Cp. The next subtasks to be executed of the three tasks to be executed can be obtained as: A2, B2, and C2.
[0079] S220, combining multiple subtasks to obtain multiple subtask groups.
[0080] The way to combine multiple subtasks is to combine multiple subtasks in a permutation and combination manner, thereby obtaining multiple subtask groups. Assuming there are 3 subtasks, A can be obtained according to the permutation and combination formula: 3 3=6 seed task groups.
[0081] S230: Determine a target subtask group from the multiple subtask groups based on the first resource information.
[0082] The first resource includes IO resources and / or memory resources. The target subtask group meets the following conditions: the sum of the first resources required by each subtask in the target subtask group is less than or equal to the first resource threshold value, and the target subtask group contains the largest number of subtasks.
[0083] Specifically, a method for determining a target subtask group from multiple subtask groups based on the first resource information may be: determining the first resource information of each subtask group; determining a subtask group whose first resource information is less than or equal to a first resource threshold value and contains the most subtasks as a candidate subtask group; and determining the target subtask group from the candidate subtask groups.
[0084] The first resource information is obtained by accumulating the first resource information of each subtask in the subtask group. The method of determining the target subtask group from the candidate subtask groups may be: randomly selecting a candidate subtask group as the target subtask group.
[0085] S240: Sort the subtasks in the target subtask group based on the second resource information.
[0086] The second resource includes a central processing unit (CPU) resource.
[0087] Specifically, the method of sorting the subtasks in the target subtask group based on the second resource information may be: obtaining the second resource information of each subtask in the target subtask group; and sorting the subtasks in the target subtask group in ascending order of the second resource information.
[0088] In this embodiment, the subtasks in the target subtask group are sorted according to the positive order of the second resource information. The advantage of this is that the subtasks with small resource occupancy are executed first, thereby improving the success rate of task execution.
[0089] S250: Schedule the first resource and the second resource in the sorting order to sequentially execute the sorted subtasks.
[0090] Optionally, after scheduling the first resource and the second resource in the sorted order to execute the sorted subtasks in sequence, the following steps are also included: after each subtask in the target subtask group is executed, return to execute the operation of obtaining the next subtask to be executed of the multiple tasks to be executed until the multiple tasks to be executed are completed.
[0091] Specifically, the resource scheduling method of the power Internet of Things edge computing architecture based on the autonomous and controllable operating system provided in this embodiment includes the following steps:
[0092] Step 21) The scheduling environment is as follows: a series of apps are running in the operating system, each running app corresponds to a task, and the operating system needs to handle multiple tasks proposed by multiple apps; a specific task can be divided into multiple sequential subtasks, and the order between subtasks in each task cannot be changed. Each subtask requires a certain amount of I / O, memory, and CPU resources.
[0093] Step 22) The resource scheduling system receives multiple tasks to be executed: {task_0, task_1, ..., task_n}, each task task_i consists of a subtask sequence:<subtask_i0,subtask_i1,...,subtask_im> , the resources that a subtask subtask_ij depends on are represented as {io_ij, mem_ij, cpu_ij}.
[0094] Step 23) Use index k_curr to mark the number of the next subtask to be executed in task task_k.
[0095] Step 24) Construct all combinations of the subtasks to be executed, that is, combination_0 = {subtask_0_curr}, combination_1 = {subtask_0_curr, subtask_1_curr}, combination_2 = {subtask_0_curr, subtask_1_curr, subtask_2_curr}, ..., combination_x = {subtask_0_curr, subtask_1_curr, ..., subtask_n_curr}.
[0096] Step 25) Calculate the I / O and memory resource requirements of all x groups of combinations, {IO_com_0, MEM_com_0}, {IO_com_1, MEM_com_1}, ..., {IO_com_x, MEM_com_x}.
[0097] Step 26) Based on the upper limits IO_budget and MEM_budget of I / O and memory resources, without exceeding the upper limits, select the combination containing the largest number of subtasks, there is at least one, there may be multiple {combination_o, combination_p, ..., combination_q}, and randomly select one from these combinations as the scheduling scheme for the current step, for example, select combination_o = {subtask_o0_curr, subtask_o1_curr, ..., subtask_oy_curr}.
[0098] Step 27) Get the CPU resource consumption corresponding to the subtasks in combination_o, sort the CPU usage time from small to large, and obtain the subtask sequence<subtask_oy_curr,subtask_o5_curr,…,subtask_o3_curr> , and allocate CPU resources in this order, and start the execution operations of the corresponding subtasks in turn.
[0099] Step 28) When all subtasks in combination_o are executed, the number of the pending subtasks of the tasks whose subtasks have been executed in this round of execution is incremented by 1, that is, {o0_curr, o1_curr, ..., oy_curr} are all incremented by 1. If the number of subtasks of a task is less than the result of the increment by 1, it means that the task has been completed and the corresponding number of the pending subtask is discarded.
[0100] Step 29) If all tasks are completed, the process ends; otherwise, the process jumps to step 24) for execution.
[0101] The technical solution of this embodiment is to obtain the next subtask to be executed of multiple tasks to be executed respectively to obtain multiple subtasks; combine multiple subtasks to obtain multiple subtask groups; determine the target subtask group from the multiple subtask groups based on the first resource information; wherein the first resource includes input / output IO resources and / or memory resources; sort the subtasks in the target subtask group based on the second resource information; wherein the second resource includes a central processing unit CPU resource; and schedule the first resource and the second resource in the sorting order to sequentially execute the sorted subtasks. The success rate of task execution can be improved.
[0102] Embodiment 3
[0103] Figure 3 is a structural diagram of a power Internet of Things edge computing architecture system based on an autonomous and controllable operating system provided by an embodiment of the present invention, such as Figure 3 The system includes: an operating system adaptation module 310 , a resource scheduling module 320 , a device discovery and registration module 330 , and a device collaborative interaction module 340 .
[0104] Among them, the operating system adaptation module 310 and the resource scheduling module 320 are in the adaptation layer, and the device discovery registration module 330 and the device collaborative interaction module 340 are in the device interaction bus layer.
[0105] In this embodiment, the operating system adaptation module 310 is used to execute the program synchronization method of the power Internet of Things edge computing architecture based on the autonomous and controllable operating system of the above embodiment. That is, the version and update status of the current operating system are obtained from the operating system. According to the rapid adaptation of the upgrade adapter program synchronization of the operating system, the adaptive updated adapter program is output. The resource scheduling module 320 is used to execute the resource scheduling method of the power Internet of Things edge computing architecture based on the autonomous and controllable operating system of the above embodiment. That is, after the hardware module is adapted, the adaptation of the current hardware resources is re-evaluated, and the resource allocation scheme is updated, and the three different resources in the operating system, namely, I / O, memory, and CPU, are optimally scheduled, and an efficient resource scheduling scheme is given in real time, and the status information of the current hardware module is output to the device interaction bus to ensure that the system understands the current available resources and constraints. The device discovery registration module 330 is used to discover the access of new devices, register the new devices, and send the registration information to the device collaborative interaction module. The registration information and function information of the new device to be discovered are output to the collaborative interaction module of the device to ensure that all devices can be identified and managed; in addition, the adaptation module of the hardware module is notified about the addition of new devices to re-evaluate the resource allocation scheme. The device collaborative interaction module 340 is used to manage the interaction between devices based on the registration information, that is, to obtain the information and function description of the registered devices and the status information of the current hardware devices, and to achieve the collaborative operation of the discovered and registered devices with low latency and conflict-free information and device resources.
[0106] Among them, the device discovery and registration module 330 uses terminal device discovery technology, heterogeneous network networking technology, and multipath transmission technology to achieve rapid discovery between multiple devices and solve the problem of interaction between different protocols of multiple devices. The device collaborative interaction module 340 uses cross-device collaborative interaction technology, intelligent delay control technology, and minimalist protocol management to interact between devices, and proposes solutions for high-speed communication, resource integration, device management, and data processing between different devices in the power Internet of Things, optimizing device resource allocation management.
[0107] The power Internet of Things edge computing architecture system based on an autonomous and controllable operating system in this embodiment is part of the perception layer of the power Internet of Things edge system. Figure 4 is a schematic diagram of the structure of a power IoT edge system in this embodiment. Figure 4As shown in the figure, the system includes: application layer, platform layer, network layer and perception layer. Among them, the application layer is the final output end of the Internet of Things system, responsible for converting the data processed by the platform layer into actual applications; the platform layer is the data processing center of the Internet of Things system, responsible for storing, managing and analyzing the data transmitted by the network layer; the network layer is the data transmission channel of the Internet of Things system, responsible for transmitting the data collected by the perception layer to the platform layer and the application layer; the perception layer is the foundation of the Internet of Things system, responsible for collecting information from the physical world. The power Internet of Things edge computing architecture system (referred to as the edge computing framework in the figure) includes the Internet of Things devices and Internet of Things terminals, which include the underlying terminal devices and operating systems, and constitute the perception layer of the entire power Internet of Things. It is the most basic component for building the power Internet of Things. The development and application of other layers will rely on the perception layer infrastructure.
[0108] The power Internet of Things edge computing architecture system based on an autonomous and controllable operating system provided in this embodiment is characterized by comprising: an operating system adaptation module, a resource scheduling module, a device discovery registration module and a device collaborative interaction module; the operating system adaptation module is used to execute the program synchronization method of the power Internet of Things edge computing architecture based on an autonomous and controllable operating system in this embodiment; the resource scheduling module is used to execute the resource scheduling method of the power Internet of Things edge computing architecture based on an autonomous and controllable operating system in this embodiment; the device discovery registration module is used to discover the access of new devices, register new devices, and send registration information to the device collaborative interaction module; the device collaborative interaction module is used to manage the interaction between devices based on the registration information. It can meet the computing needs of the power Internet of Things edge.
[0109] Embodiment 4
[0110] Figure 5 A schematic diagram of an electronic device 10 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, the connections and relationships between the components, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.
[0111] like Figure 5As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0112] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0113] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The processor 11 executes the various methods and processes described above, such as a program synchronization method for an electric power Internet of Things edge computing architecture based on an autonomous and controllable operating system or a resource scheduling method for an electric power Internet of Things edge computing architecture based on an autonomous and controllable operating system.
[0114] In some embodiments, a program synchronization method for an edge computing architecture of the power Internet of Things based on an autonomous and controllable operating system or a resource scheduling method for an edge computing architecture of the power Internet of Things based on an autonomous and controllable operating system may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the program synchronization method for the edge computing architecture of the power Internet of Things based on an autonomous and controllable operating system or the resource scheduling method for the edge computing architecture of the power Internet of Things based on an autonomous and controllable operating system described above may be executed. Alternatively, in other embodiments, the processor 11 may be configured to execute a program synchronization method for an edge computing architecture of the power Internet of Things based on an autonomous and controllable operating system or a resource scheduling method for an edge computing architecture of the power Internet of Things based on an autonomous and controllable operating system by any other appropriate means (e.g., by means of firmware).
[0115] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0116] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0117] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0118] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0119] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0120] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.
[0121] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.
[0122] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A program synchronization method for an edge computing architecture of the power Internet of Things based on an autonomous and controllable operating system, characterized in that: include: Obtaining a system update document and an original adapter; wherein the system update document includes interface change information, and the interface change information includes a first interface name, a first return value information, a first parameter information, and a change description information; Extracting interface call information from the original adapter; wherein the interface call information includes: the line number of the interface call, the second interface name, the second return value information, the second parameter information, the starting line number of the calling function and the calling function name; Adding a change mark to the original adapter based on the interface change information and the interface call information; The original adapter is updated based on the change mark to obtain a target adapter.
2. The method according to claim 1, characterized in that Extracting interface call information from the original adapter program includes: Parsing the original adapter to obtain an abstract syntax tree corresponding to the original adapter; Interface call information is extracted from the abstract syntax tree.
3. The method according to claim 1, characterized in that The interface change information includes interface deletion class information and interface modification class information; wherein, the interface modification class information includes interface name modification class information, return value and / or parameter modification class information; if the interface modification class information is interface name modification class information, then the interface change information also includes a second interface name, wherein the first interface name is the name after the change, and the second interface name is the name before the change.
4. The method according to claim 3, characterized in that Before adding a change mark to the original adapter based on the interface change information and the interface call information, the method further includes: Matching the second interface name in the interface name modification class information with the second interface name in the interface call information to obtain the line number of the interface call corresponding to the matched second interface name; The interface name in the code corresponding to the line number of the interface call in the original adapter program is updated from the second interface name to the corresponding first interface name.
5. The method according to claim 4, characterized in that Adding a change mark to the original adapter based on the interface change information and the interface call information includes: For interface deletion class information or return value and / or parameter modification class information, match the first interface name in the interface deletion class information or return value and / or parameter modification class information with the second interface name in the interface call information to obtain the line number of the interface call corresponding to the matched second interface name; A change mark is added in the form of a comment in the code corresponding to the line number of the interface call in the original adapter; wherein the change mark is a deletion mark or a modification mark.
6. The method according to claim 1, characterized in that The original adapter is updated based on the change mark to obtain a target adapter, including: Extracting a code segment corresponding to a target calling function and a function calling chain formed by the target calling function from the original adapter based on the change mark; wherein the target calling function is a calling function whose called interface is changed; Sending the code segment corresponding to the target calling function and the function calling chain formed by the target calling function to the development user, so that the development user updates the code segment based on the function calling chain and the change mark; The original adapter is updated based on the updated code segment to obtain a target adapter.
7. The method according to claim 6, characterized in that The original adapter is updated based on the updated code segment to obtain a target adapter, including: Get the starting line number of the calling function corresponding to the updated code segment; The updated code segments are updated into the original adapter program in reverse order of the starting line numbers of the calling functions to obtain a target adapter program.
8. A resource scheduling method for an edge computing architecture of the power Internet of Things based on an autonomous and controllable operating system, characterized in that: include: Respectively obtain the next subtasks to be executed of multiple tasks to be executed, and obtain multiple subtasks; Combining the multiple subtasks to obtain multiple subtask groups; Determine a target subtask group from the multiple subtask groups based on first resource information; wherein the first resource includes input / output IO resources and / or memory resources; Sort the subtasks in the target subtask group based on the second resource information; wherein the second resource includes a central processing unit (CPU) resource; The first resource and the second resource are scheduled according to the sorting order to sequentially execute the sorted subtasks.
9. The method according to claim 8, characterized in that Determining a target subtask group from the multiple subtask groups based on the first resource information includes: Determine the first resource information of each subtask group; wherein the first resource information is obtained by accumulating the first resource information of each subtask in the subtask group; Determine a subtask group whose first resource information is less than or equal to a first resource threshold value and contains the most subtasks as a candidate subtask group; A target subtask group is determined from the candidate subtask groups.
10. The method according to claim 9, characterized in that Sorting the subtasks in the target subtask group based on the second resource information includes: Acquire second resource information of each subtask in the target subtask group; The subtasks in the target subtask group are sorted in ascending order according to the second resource information.
11. The method according to claim 9, characterized in that After scheduling the first resource and the second resource in the sorting order to sequentially execute the sorted subtasks, the method further includes: When each subtask in the target subtask group is completed, the operation of obtaining the next subtask to be executed of the multiple tasks to be executed is returned to execute respectively until the multiple tasks to be executed are completed.
12. A power Internet of Things edge computing architecture system based on an autonomous and controllable operating system, characterized in that: include: Operating system adaptation module, resource scheduling module, device discovery and registration module, and device collaborative interaction module; The operating system adaptation module is used to execute the program synchronization method of the power Internet of Things edge computing architecture based on the autonomous and controllable operating system described in any one of claims 1-7; the resource scheduling module is used to execute the resource scheduling method of the power Internet of Things edge computing architecture based on the autonomous and controllable operating system described in any one of claims 8-11; The device discovery and registration module is used to discover the access of new devices, register the new devices, and send registration information to the device collaborative interaction module; The device collaborative interaction module is used to manage the interaction between devices based on the registration information.
13. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the program synchronization method of the power Internet of Things edge computing architecture based on an autonomous and controllable operating system as described in any one of claims 1-7 or the resource scheduling method of the power Internet of Things edge computing architecture based on an autonomous and controllable operating system as described in any one of claims 8-11.
14. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, which are used to enable the processor to implement the program synchronization method of the power Internet of Things edge computing architecture based on an autonomous and controllable operating system as described in any one of claims 1-7 or the resource scheduling method of the power Internet of Things edge computing architecture based on an autonomous and controllable operating system as described in any one of claims 8-11.
Citation Information
Cited By
Method, device, equipment and product for updating adapter program of internet-of-things operating system
CN119806603A
Update Method, Device, Equipment and Product of Internet of Things Operating System Adaptation Program
CN119806603B
