CN113672269B - Data processing method, system, electronic device and program product - Google Patents

Data processing method, system, electronic device and program product Download PDF

Info

Publication number
CN113672269B
CN113672269B CN202111228419.9A CN202111228419A CN113672269B CN 113672269 B CN113672269 B CN 113672269B CN 202111228419 A CN202111228419 A CN 202111228419A CN 113672269 B CN113672269 B CN 113672269B
Authority
CN
China
Prior art keywords
scheduler
kernel
module
function
directory
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202111228419.9A
Other languages
Chinese (zh)
Other versions
CN113672269A (en
Inventor
陈善佩
邓二伟
吴一昊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Alibaba Cloud Computing Ltd
Original Assignee
Alibaba Cloud Computing Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Alibaba Cloud Computing Ltd filed Critical Alibaba Cloud Computing Ltd
Priority to CN202111228419.9A priority Critical patent/CN113672269B/en
Publication of CN113672269A publication Critical patent/CN113672269A/en
Application granted granted Critical
Publication of CN113672269B publication Critical patent/CN113672269B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The embodiment of the application provides a data processing method, a data processing system, electronic equipment and a program product. Wherein the method comprises the following steps: acquiring a first kernel program and a scheduler boundary configuration parameter; extracting a first scheduler correlation function from the first kernel program according to the scheduler boundary configuration parameter; and generating a first directory for assisting compiling of a scheduler module according to the extracted first scheduler related function, wherein the scheduler module can be loaded for hot upgrade of a kernel scheduler. According to the technical scheme provided by the embodiment of the application, when the scheduler is upgraded, all functions or parameters contained in the scheduler do not need to be upgraded one by one, but the scheduler module can be upgraded in an integral modularization mode through the first directory generated based on the boundary configuration parameters of the scheduler, and the upgrading efficiency of the scheduler module can be effectively improved.

Description

Data processing method, system, electronic device and program product
Technical Field
The present application relates to the field of computer technologies, and in particular, to a data processing method, a data processing system, an electronic device, and a program product.
Background
With the development of the diversified application requirements of the Linux system, each sub-function system (for example, a scheduler) in the corresponding Linux system also needs to be adjusted to meet the diversified requirements of the user.
In the prior art, in order to meet the requirement for a customized application scenario of a Linux system, a new kernel program for upgrading an old kernel program needs to be developed in a targeted manner to realize kernel upgrading. When performing hot upgrade, a function-by-function hot upgrade scheme is generally adopted.
However, thermal upgrades are sometimes required for an overall subsystem. For example, as an important item in kernel programs, kernel schedulers sometimes need to be upgraded for the whole scheduler. Since the scheduler includes many functions and parameters, the prior art uses a function-by-function upgrade processing mode, which consumes a lot of labor cost and time cost.
Disclosure of Invention
To solve or improve the problems in the prior art, embodiments of the present application provide a data processing method, a system, an electronic device, and a program product.
In a first aspect, in one embodiment of the present application, a data processing method is provided. The method comprises the following steps:
acquiring a first kernel program and a scheduler boundary configuration parameter;
extracting a first scheduler correlation function from the first kernel program according to the scheduler boundary configuration parameter;
and generating a first directory for assisting in compiling a scheduler module according to the extracted first scheduler related function, wherein the scheduler module can be loaded for hot upgrade of a kernel scheduler.
In a second aspect, in one embodiment of the present application, another data processing method is provided. The method comprises the following steps:
acquiring a first directory, wherein the first directory contains a first scheduler correlation function;
responding to the development operation of the dispatcher module completed by the user based on the first catalogue, and obtaining the dispatcher module;
acquiring a hot upgrade technology code of a scheduler;
and generating a kernel module for hot upgrading the kernel scheduler according to the scheduler module and the scheduler hot upgrading technology code.
In a third aspect, in one embodiment of the present application, there is provided yet another data processing method. The method comprises the following steps:
acquiring a kernel module for a hot upgrade kernel scheduler;
executing a scheduler hot upgrade technology code in the kernel module to obtain a first directory which is preset in the kernel module and used for representing a relevant function of a scheduler;
and replacing the first directory for a second directory in the scheduler to be upgraded in a hot state, and executing data synchronization.
In a fourth aspect, in one embodiment of the present application, there is provided a data processing system, the system comprising:
the first client is used for acquiring a first kernel program and a dispatcher boundary configuration parameter; extracting a first scheduler correlation function from the first kernel program according to the scheduler boundary configuration parameter; generating a first directory for assisting in compiling a scheduler module according to the extracted first scheduler related function, wherein the scheduler module can be loaded for hot upgrade of a kernel scheduler;
the second client is used for acquiring a first directory, and the first directory contains a first scheduler correlation function; responding to the development operation of the dispatcher module completed by the user based on the first catalogue, and obtaining the dispatcher module; acquiring a hot upgrade technology code of a scheduler; and generating a kernel module for hot upgrading the kernel scheduler according to the scheduler module and the scheduler hot upgrading technology code.
In a fifth aspect, in one embodiment of the present application, there is provided another data processing system, the system comprising:
the first client is used for acquiring a first kernel program and a dispatcher boundary configuration parameter; extracting a first scheduler correlation function from the first kernel program according to the scheduler boundary configuration parameter; generating a first directory for assisting in compiling a scheduler module according to the extracted first scheduler related function, wherein the scheduler module can be loaded for hot upgrade of a kernel scheduler;
the second client is used for acquiring a first directory, and the first directory contains a first scheduler correlation function; responding to the development operation of the dispatcher module completed by the user based on the first catalogue, and obtaining the dispatcher module; acquiring a hot upgrade technology code of a scheduler; generating a kernel module for hot upgrading a kernel scheduler according to the scheduler module and the scheduler hot upgrading technology code;
the server is used for acquiring a kernel module for the kernel scheduler for hot upgrade; executing a scheduler hot upgrade technology code in the kernel module to obtain a first directory preset in the kernel module and used for representing a scheduler related function; and replacing the first directory for a second directory in the scheduler to be upgraded in a hot state, and executing data synchronization.
In a sixth aspect, in one embodiment of the present application, an electronic device is provided. The electronic device includes: a memory and a processor; wherein the content of the first and second substances,
the memory is used for storing programs;
the processor, coupled to the memory, is configured to execute the program stored in the memory, so as to implement the data processing method according to the first aspect; or the data processing method of the second aspect above; or the data processing method of the third aspect.
Seventh aspect, in an embodiment of the present application, there is provided a computer program product comprising computer programs/instructions which, when executed by a processor, cause the processor to implement the steps in the data processing method of the first aspect; or implementing the steps in the data processing method of the second aspect; or implementing the steps in the data processing method of the third aspect.
According to the technical scheme provided by the embodiment of the application, when the kernel scheduler needs to be upgraded, a first kernel program and a scheduler boundary configuration parameter are obtained; extracting a first scheduler correlation function from the kernel program according to the scheduler boundary configuration parameter; and generating a first directory for assisting compiling of a scheduler module according to the extracted first scheduler related function, wherein the scheduler module can be loaded for hot upgrade of a kernel scheduler. By adopting the technical scheme, when the scheduler is upgraded, all functions or parameters contained in the scheduler do not need to be upgraded one by one, but the scheduler module can be upgraded in an integral modularization mode through the first directory generated based on the boundary configuration parameters of the scheduler, and the upgrading efficiency of the scheduler module can be effectively improved.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative efforts.
Fig. 1 is a schematic flow chart of data processing provided in an embodiment of the present application;
fig. 2 is a schematic flowchart of a first directory generation method according to an embodiment of the present disclosure;
fig. 3 is a schematic flowchart of a method for generating a consistent version file according to an embodiment of the present application;
fig. 4 is a schematic flowchart of another data processing method according to an embodiment of the present application;
fig. 5 is a schematic flowchart of another data processing method according to an embodiment of the present application;
fig. 6 is a schematic overall flowchart of a scheduler module according to an embodiment of the present application;
FIG. 7 is a block diagram of a data processing system according to an embodiment of the present application;
fig. 8 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure;
fig. 9 is a schematic structural diagram of a data processing apparatus according to an embodiment of the present application;
fig. 10 is a schematic structural diagram of a data processing apparatus according to an embodiment of the present application;
fig. 11 is a schematic structural diagram of another electronic device provided in the embodiment of the present application;
fig. 12 is a schematic structural diagram of another data processing apparatus according to an embodiment of the present application;
fig. 13 is a schematic structural diagram of another electronic device according to an embodiment of the present application;
fig. 14 is a schematic structural diagram of another data processing apparatus according to an embodiment of the present application.
Detailed Description
With the diversified development of the application scenes of the Linux system, the Linux system which meets the application requirements of the Linux system needs to be developed specifically for different application scenes. In addition, in the application process, each application scenario also needs to update the kernel program in the corresponding Linux system, for example, some application scenarios need to update the kernel scheduler. However, many functions and parameters are involved in the mesh scheduler, and the function types may include many kinds, and the upgrade work is complicated. For example, a large amount of code may need to be modified, new and old design inconsistencies may easily occur, creating conflicts, and eliminating conflicts requires a large number of test reviews by a skilled technician. Obviously, under the development trend that the scheduler is updated more and more frequently, the existing function updating mode can not meet the updating requirement of the Linux kernel scheduler obviously. Therefore, a scheme for upgrading the scheduler module as a whole is needed to reduce the adverse effect on the normal operation of the electronic device.
In order to make the technical solutions better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application.
In some of the flows described in the specification, claims, and above-described figures of the present application, a number of operations are included that occur in a particular order, which operations may be performed out of order or in parallel as they occur herein. The sequence numbers of the operations, e.g., 101, 102, etc., are used merely to distinguish between the various operations, and do not represent any order of execution per se. Additionally, the flows may include more or fewer operations, and the operations may be performed sequentially or in parallel. It should be noted that, the descriptions of "first", "second", etc. in this document are used for distinguishing different messages, devices, modules, etc., and do not represent a sequential order, nor limit the types of "first" and "second" to be different. In addition, the embodiments described below are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Fig. 1 is a schematic flow chart of data processing according to an embodiment of the present application. The method is applied to the electronic equipment (such as a computer, a server and the like) of the early preparation working phase generated by the kernel scheduler module. The method specifically comprises the following steps:
101: and acquiring boundary configuration parameters of the first kernel program and the scheduler.
102: and extracting a first scheduler related function from the kernel program according to the scheduler boundary configuration parameter.
103: and generating a first directory for assisting compiling of a scheduler module according to the extracted first scheduler related function, wherein the scheduler module can be loaded for hot upgrade of a kernel scheduler.
It should be noted that the scheduler task types can be divided into interactive and non-interactive tasks. An interactive task typically relies heavily on the interface to perform input and output operations (e.g., GUI applications) and typically runs out of time slices assigned to it. Whereas non-interactive tasks (e.g., mathematical operations) require the use of more CPU resources. When the scheduler executes interactive tasks, the scheduler plays a role of an intermediate bridge through an interface function, and helps the kernel and the external subsystem to realize data interaction and execute the possibility of corresponding tasks.
The first kernel program can be any Linux version kernel program or a scheduler hot-upgrade customized optimized kernel program. The boundary configuration parameters referred to herein include a scheduler file, an interface function name, and the like.
In practical application, in order to meet the calling requirements of the system of various scenarios, the scheduler is provided with a plurality of interface functions for external presentation, and the interface functions can also be called by internal functions. The scheduler module includes an internal function and an external function in addition to an interface function. The internal function is used for calling the interface function and the external function, and the external function can only be used for calling the interface function. Various types of data are contained in the scheduler, and can be divided into private data and public data; wherein private data may be understood as data defined inside the scheduler and only referenced inside the scheduler; public data may be understood as data that can be referenced by multiple parties, in addition to private data. Function names, scheduler files, individual function pointers, etc. are used as boundary configuration parameters. During the calling process, basic calling requirements on the scheduler can be realized based on the boundary configuration parameters.
As described above, only the scheduler boundary configuration parameters are obtained, and these parameters are parameters such as function names, and it is necessary to further determine the first scheduler related function according to the function names.
In order to facilitate the subsequent development of the scheduler module by the developer and avoid the random modification of the boundary configuration parameters in the scheduler module by the developer, the first scheduler related function extracted from the first kernel program is stored in the first directory. That is, in the development work of the scheduler module by the developer, when a certain function needs to be called, only the function needed by the function can be called and further developed from the first directory, and the developer is not allowed to add a new function in the first directory. Therefore, the scheduler module can be conveniently managed, and the hidden danger of collision caused by too many functions generated in the development process of the scheduler module is avoided. After the boundary partition directory is generated, the boundary partition directory needs to be compiled in combination with hot upgrade support codes.
In one or more embodiments of the present application, as described in step 102, the extracting a first scheduler related function from the first kernel according to the scheduler boundary configuration parameter includes: extracting an interface function from the first kernel program according to the scheduler boundary configuration parameter; extracting an internal function and an external function which have a calling relation with the interface function from the first kernel program based on the interface function; wherein the scheduler correlation function comprises: and extracting the interface function, the internal function and the external function.
As mentioned above, the interface function is defined as an outward presented function in the scheduler module, and can be called by an external function outside the scheduler module or by an internal function in the scheduler module. Since the function name is explicitly specified in the scheduler boundary configuration parameter, the interface function in the kernel program can be accurately determined according to the function name. As for other external functions and internal functions related to the interface function, the number of the external functions and the internal functions is large, and all the external functions and the internal functions cannot be defined in the scheduler boundary configuration parameters, and therefore, it is also necessary to continue extracting from the kernel program after determining the interface function, which will be specifically exemplified in the following embodiments.
In order to realize the overall upgrade of the scheduler module, other functions which have calling relationship with the interface function, including but not limited to external functions outside the scheduler module and internal functions inside the scheduler module, need to be further extracted from the first kernel program. Therefore, after the interface function is accurately determined through the above steps, the external function and the internal function are further extracted from the first kernel program according to the calling relationship between the interface function and other functions. In addition, public data and private data for participating in implementing interface function calls may also be partitioned into boundary function data. Generally, to avoid the scheduler being too complex, the number of interface functions in the scheduler is controlled, and these interface functions of the scheduler are usually only allowed to be used by the scheduler developer, but are not allowed to add or delete the interface function. Thus, the scheduler boundary configuration parameters may be generated based on the function name of the interface function and the scheduler file. The scheduler boundary configuration parameters referred to herein may be understood as various functions (e.g., interface functions), data (e.g., public data, private data) required to help the scheduler module implement the interactive function.
Fig. 2 is a schematic flowchart of a first directory generation method according to an embodiment of the present disclosure. As shown in fig. 2, the step 103 of generating a first directory for assisting compiling a scheduler module according to the extracted scheduler related function includes: 1031: and acquiring a structural body member boundary dividing document corresponding to the first kernel program. 1032: and dividing the document according to the relevant function of the scheduler and the boundary of the structural body member to generate the first directory.
In practical applications, besides the interface function, the internal function and the external function, some public parameters and private parameters are needed to help realize the calling function of the interface function. Specifically, the structure member boundary division document may be acquired based on the first kernel program, or may be configured by a user. The structural body member boundary division document can be displayed to developers to see, but only subsequent developers are allowed to modify the private data. And then, generating a first directory based on the first scheduler correlation function extracted before and the newly acquired structural body member boundary division document. In this first directory, function information and structure member information can be seen, as well as storage path information and corresponding directory names. In turn, the first directory is stored in a kernel code repository.
It should be noted that the first directory is stored in the kernel code repository for the convenience of the scheduler module developer to perform corresponding function development on the scheduler. The developer does not need to go to the bottom code base to search or establish the functions and parameters used for the interface function and related to the interface function. In addition, the boundary information of all the scheduler modules is collected into one first directory, so that the management is convenient, and a scheduler developer can select a proper function from the first directory without allowing the scheduler module developer to add or delete the first directory. Because it is considered that the scheduler module developer may only be responsible for a certain subsystem, but does not know the association relationship between the interface function and other subsystems in certain boundary information, the stability of the scheduler module may be threatened if the interface function is added or deleted.
Further, after the generating the first directory, the method further includes: and acquiring a second kernel program. And executing boundary consistency check based on the second kernel program and the boundary configuration parameters of the scheduler to obtain a consistency version file.
The second kernel program referred to herein may be understood as a kernel program that is to undergo an upgrade of the scheduler module. Before upgrading the scheduler module corresponding to the second kernel program, it needs to be determined that the first kernel program and the second kernel program for generating the first directory are not the same kernel version. Only if the kernel versions are the same can the assurance be that the scheduler module can be upgraded successfully.
A second scheduler related function representing boundary information is included in the second kernel program. The scheduler boundary configuration parameters corresponding to the first kernel program are used to compare the boundary related information with the second kernel program, for example, whether the number and the name of the interface functions are completely the same or not is compared. The alignment process will be specifically exemplified in the following examples.
Of course, the first kernel program and the second kernel program in the present solution may be obtained based on the same kernel version. Therefore, when the consistency comparison is carried out by adopting the scheme, the two versions are consistent, and the upgrading operation of the subsequent scheduler module is facilitated.
Fig. 3 is a flowchart illustrating a method for generating a consistent version file according to an embodiment of the present application. The method comprises the following specific steps:
301: and extracting a second scheduler correlation function from the second kernel program according to the scheduler boundary configuration parameter.
302: and acquiring identifiers corresponding to a plurality of external functions based on the second kernel program.
303: and acquiring public data of the structural body members based on the second kernel program.
304: and acquiring an interface function capable of triggering context switching or sleeping based on the second kernel program.
305: and generating the consistent version file according to the related function of the second scheduler, the identifiers corresponding to the external functions, the public data of the structural body members and the interface function capable of triggering context switching or sleeping.
The configured interface function name is contained in the scheduler boundary configuration parameter, and based on the configured interface function name, a second scheduler related function, a plurality of identifiers corresponding to the external functions (namely, the function names of the external functions), common data of the structural body members, an interface function triggering context switching or sleeping and the like can be extracted from a second kernel program, and a consistent version file is generated together.
Further, detailed comparison is performed based on the consistency version files. Specifically, the method comprises the following steps:
acquiring a locally stored history file; that is, the historical consistency version file stored before, the kernel version corresponding to the historical consistency version file may be the same as or different from the kernel version corresponding to the second kernel program. And generating alarm information when the comparison result has a difference. And updating the history file into the consistent version file when the comparison result is not different.
For ease of understanding, the following is specifically exemplified.
In practical applications, since the consistency version file is generated based on the kernel source code corresponding to the kernel version, when the kernel version changes, the corresponding consistency version file may change accordingly. If such a change is detected, the scheduler developer needs to be prompted to confirm and modify in time.
When performing comparison, the first kernel program source code git version, the second kernel program source code git version, the external function name, the structural body member, and the interface function need to be compared respectively. For example, when comparing the structural member consistency, if the number of structural members in the directory generated by the new boundary partition is found to be larger than that of the directory of the original version boundary partition, the difference information is output. Further, the developer confirms whether or not the increased structure member information is valid, in other words, whether or not the developer has intentionally added the information, and if so, the inconsistent change is considered to be valid. Otherwise, the system is illegal, and developers need to be informed to troubleshoot problems and modify the problems in time.
For another example, when the interface functions are compared in a consistent manner, if it is found that a function originally belongs to an internal function, but is divided into scheduler related functions in a new boundary division directory, the scheduler related functions are used as a part of functions for generating the directory and are stored in the new boundary division directory, the function division type is obviously changed, and warning information is sent to developers for the abnormality. And then the developer verifies the warning information and legally adjusts the response boundary extraction information or the kernel source code. And after the adjustment is finished, updating and storing the consistent version file. Although the scheduler has a lot of functions and data, in the scheme, the consistency calculation is performed on the information related to the boundary division directory, so that the calculation amount can be greatly reduced.
Through the embodiments, it can be known that, when the scheduler needs to be upgraded, the first kernel program and the scheduler boundary configuration parameters are obtained; extracting a first scheduler related function from the kernel program according to the scheduler boundary configuration parameter; and generating a first directory for assisting compiling of a scheduler module according to the extracted first scheduler related function, wherein the scheduler module can be loaded for hot upgrade of a kernel scheduler. By adopting the technical scheme, when the scheduler is upgraded, all functions or parameters contained in the scheduler do not need to be upgraded one by one, but the first directory generated based on the boundary configuration parameters of the scheduler can be upgraded integrally through the scheduler module, so that the upgrading efficiency of the scheduler module can be effectively improved.
Based on the same idea, the embodiment of the application also provides another data processing method. Fig. 4 is a schematic flowchart of another data processing method according to an embodiment of the present application. From fig. 4 it can be seen that the following steps are included:
401: a first directory is obtained, wherein the first directory comprises a first scheduler correlation function.
402: a scheduler module is obtained in response to a scheduler module development operation completed by a user based on the first catalog.
403: and acquiring hot upgrade technology codes of the scheduler.
404: and generating a kernel module for hot upgrading the kernel scheduler according to the scheduler module and the scheduler hot upgrading technology code.
The first directory is generated based on the first kernel program, and the process of generating the first directory may specifically refer to the embodiment corresponding to fig. 1. The first directory contains an interface function, an internal function, an external function and a structure member boundary division document obtained based on the first kernel program.
After obtaining the first catalog, the developer can perform development work for the scheduler module based on the first catalog. The developed scheduler module mainly includes an interface function for replacing the scheduler module, and a related function and parameter.
The scheduler hot upgrade technique code referred to herein includes: an atomic safeguard mechanism code; the function replacement execution code is used for replacing an interface function in the scheduler module in a jump instruction mode; the data synchronously executes the code.
It should be noted that the atomic guarantee mechanism code includes a stop machine related code (stop machine) for stopping all current tasks executed by the CPU when performing a hot upgrade and a security check. And performing security check related code on the stack, such as lightweight stack security check related code. Will be specifically exemplified hereinafter.
It should be noted that the function replacement code described herein is different on different platforms, for example, on the X86 platform, the function header is modified to a jump instruction by clearing the CRO flag bit; and modifying by adopting the fixmap code on the ARM64 platform.
The data synchronization code can be used for automatically synchronizing public data, automatically synchronizing private data and manually synchronizing by developers.
After obtaining the kernel module, the scheduler hot upgrade package needs to be further generated in combination with the obtained conforming relocation tool.
Based on the same idea, the embodiments of the present application provide a data processing method. Fig. 5 is a schematic flowchart of another data processing method according to an embodiment of the present application. From fig. 5 it can be seen that the following steps are included:
501: a kernel module for a hot upgrade kernel scheduler is obtained.
502: and executing the hot upgrade technology code of the scheduler in the kernel module to acquire a first directory which is preset in the kernel module and used for representing the relevant functions of the scheduler.
503: and replacing the first directory for a second directory in the scheduler to be upgraded in a hot state, and executing data synchronization.
In practical application, when the client electronic device or the server device is upgraded, the hot upgrade package of the scheduler is received first. The scheduler hot upgrade package contains a symbol relocation tool and a kernel module, and a required meshing module needs to be extracted through analysis. After the scheduler related functions such as the interface function in the kernel module are relocated to the kernel function to be replaced by using the symbol relocation tool, security check needs to be performed on the process state of the kernel function to be replaced. The inspection process was as follows: and determining a calling path of the function to be replaced of the kernel. And determining a safety check area where the function to be replaced of the kernel is located according to the calling relation of the function to be replaced of the kernel in the calling path. And performing security check on the function to be replaced of the kernel based on the security check area. It is easy to understand that when a function to be replaced of a kernel is upgraded, if a function to be repaired or upgraded is being called by a process and is being forcibly replaced, an error may occur in a system, which affects normal operation of the system, and an adverse effect on system operation is relatively large. Therefore, for security, the kernel function to be replaced needs to be security checked.
In order to facilitate understanding of the scheduler module upgrading process, a brief description of the scheduler module generation process is provided. Fig. 6 is a schematic overall flowchart of a scheduler module according to an embodiment of the present application. The method comprises the following specific steps: firstly, a developer inputs boundary configuration parameters, a scheduler related function, a structural body member boundary division document and the like are extracted from a kernel program according to the boundary configuration parameters, a first directory is generated, a consistency version file is generated based on the scheduler related function, the structural body member boundary division document and the like, consistency check is carried out, and then compiling is carried out based on the first directory to obtain a kernel module. And packaging the kernel module and the relocation tool to obtain a hot upgrade package of the scheduler. The scheduler hot upgrade package is a data package for upgrading the kernel original scheduler.
After the scheduler hot upgrade package is acquired, the kernel module and relocation tool contained therein are further extracted. The kernel module comprises a first directory, wherein the first directory comprises related information such as an interface function and a structure member boundary dividing document for realizing the function of a scheduler. When the kernel scheduler module is upgraded, the interface function can be replaced to realize the upgrade. Specifically, a developer extracts and generates a first directory from a kernel program based on boundary configuration parameters, and the first directory includes related functions and parameters such as an interface function. When upgrading, the whole scheduler module is upgraded, the upgrading mode is simple, and all functions contained in the scheduler do not need to be upgraded one by one. Due to the fact that the scheduler comprises numerous functions and data and is complex in structure, the technical scheme makes it possible to upgrade the whole scheduler modularization, and upgrading efficiency is improved while upgrading reliability is guaranteed.
Based on the same idea, the embodiment of the application further provides a data processing system. Fig. 7 is a schematic structural diagram of a data processing system according to an embodiment of the present application. As can be seen from fig. 7, it includes:
a first client 71, configured to obtain a first kernel program and a scheduler boundary configuration parameter; extracting a first scheduler correlation function from the first kernel program according to the scheduler boundary configuration parameter; generating a first directory for assisting in compiling a scheduler module according to the extracted first scheduler related function, wherein the scheduler module can be loaded for hot upgrade of a kernel scheduler;
a second client 72, configured to obtain a first directory, where the first directory contains a first scheduler correlation function; responding to the development operation of the dispatcher module completed by the user based on the first catalogue, and obtaining the dispatcher module; acquiring a hot upgrade technology code of a scheduler; and generating a kernel module for hot upgrading the kernel scheduler according to the scheduler module and the scheduler hot upgrading technology code.
Based on the same idea, the embodiment of the application also provides another data processing system. Fig. 8 is a schematic structural diagram of a data processing system according to an embodiment of the present application. As can be seen from fig. 8, it includes:
a first client 81, configured to obtain a first kernel program and a scheduler boundary configuration parameter; extracting a first scheduler correlation function from the first kernel program according to the scheduler boundary configuration parameter; generating a first directory for assisting in compiling a scheduler module according to the extracted first scheduler related function, wherein the scheduler module can be loaded for hot upgrade of a kernel scheduler;
the second client 82 is configured to obtain a first directory, where the first directory includes a first scheduler correlation function; responding to the development operation of the dispatcher module completed by the user based on the first catalogue, and obtaining the dispatcher module; acquiring a hot upgrade technology code of a scheduler; and generating a kernel module for hot upgrading the kernel scheduler according to the scheduler module and the scheduler hot upgrading technology code.
The server 83 is used for acquiring a kernel module for the kernel scheduler for hot upgrade; executing a scheduler hot upgrade technology code in the kernel module to obtain a first directory preset in the kernel module and used for representing a scheduler related function; and replacing the first directory for a second directory in the scheduler to be upgraded in a hot state, and executing data synchronization.
An embodiment of the application also provides an electronic device. Fig. 9 is a schematic structural diagram of an electronic device according to an embodiment of the present application. The electronic device comprises a memory 901, a processor 902 and a communication component 903; wherein the content of the first and second substances,
the memory 901 is used for storing programs;
the processor 902, coupled to the memory, is configured to execute the program stored in the memory to:
acquiring a first kernel program and a scheduler boundary configuration parameter; extracting a first scheduler correlation function from the first kernel program according to the scheduler boundary configuration parameter; and generating a first directory for assisting compiling of a scheduler module according to the extracted first scheduler related function, wherein the scheduler module can be loaded for hot upgrade of a kernel scheduler.
The memory 901 may be configured to store various other data to support operations on the electronic device. Examples of such data include instructions for any application or method operating on the electronic device. The memory may be implemented by any type or combination of volatile or non-volatile memory devices, such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks.
Further, the processor 902 in this embodiment may specifically be: and the programmable exchange processing chip is provided with a data copying engine and can copy the received data.
When the processor 902 executes the program in the memory, other functions may be implemented in addition to the above functions, which may be specifically referred to in the description of the foregoing embodiments. Further, as shown in fig. 9, the electronic device further includes: power supply component 904, and the like.
Based on the same idea, the embodiment of the application further provides a data processing device. Fig. 10 is a schematic structural diagram of a data processing apparatus according to an embodiment of the present application. The data processing apparatus includes:
an obtaining module 1001 is configured to obtain a first kernel program and a scheduler boundary configuration parameter.
An extracting module 1002, configured to extract a first scheduler correlation function from the first kernel according to the scheduler boundary configuration parameter.
A generating module 1003, configured to generate a first directory for assisting in compiling a scheduler module according to the extracted first scheduler related function, where the scheduler module can be loaded for hot upgrade of a kernel scheduler.
Further, the extracting module 1002 is further configured to: extracting an interface function from the first kernel program according to the scheduler boundary configuration parameter; extracting an internal function and an external function which have a calling relation with the interface function from the first kernel program based on the interface function; wherein the first scheduler correlation function comprises: and extracting the interface function, the internal function and the external function.
Further, the generating module 1003 is further configured to obtain a structure member boundary division document corresponding to the first kernel program; and dividing the document according to the first scheduler correlation function and the structural body member boundary to generate the first directory.
Further, the system further comprises a consistency comparison module 1004, configured to obtain a second kernel program; and executing boundary consistency check based on the second kernel program and the boundary configuration parameters of the scheduler to obtain a consistency version file.
Further, the consistency comparison module 1004 is further configured to extract a second scheduler correlation function from the second kernel according to the scheduler boundary configuration parameter;
acquiring identifiers corresponding to a plurality of external functions based on the second kernel program;
acquiring public data of the structural body members based on the second kernel program;
acquiring an interface function capable of triggering context switching or sleeping based on the second kernel program;
and generating the consistent version file according to the related function of the second scheduler, the identifiers corresponding to the external functions, the public data of the structural body members and the interface function capable of triggering context switching or sleeping.
Further, the consistency comparison module 1004 is further configured to obtain a locally stored history file;
comparing the consistency version file with the history file;
when the comparison result has a difference, generating alarm information;
and updating the history file into the consistent version file when the comparison result is not different.
An embodiment of the application also provides an electronic device. Fig. 11 is a schematic structural diagram of another electronic device provided in the embodiment of the present application. The electronic device comprises a memory 1101, a processor 1102 and a communication component 1103; wherein the content of the first and second substances,
the memory 1101 is used for storing programs;
the processor 1102, coupled to the memory, is configured to execute the program stored in the memory to:
acquiring a first directory, wherein the first directory contains a first scheduler correlation function;
responding to the development operation of the dispatcher module completed by the user based on the first catalogue, and obtaining the dispatcher module;
acquiring a hot upgrade technology code of a scheduler;
and generating a kernel module for hot upgrading the kernel scheduler according to the scheduler module and the scheduler hot upgrading technology code.
The memory 1101 described above may be configured to store other various data to support operations on the electronic device. Examples of such data include instructions for any application or method operating on the electronic device. The memory may be implemented by any type or combination of volatile or non-volatile memory devices, such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks.
Further, the processor 1102 in this embodiment may specifically be: and the programmable exchange processing chip is provided with a data copying engine and can copy the received data.
The processor 1102 may also perform other functions in addition to the above functions when executing programs in the memory, which is described in the foregoing embodiments. Further, as shown in fig. 11, the electronic apparatus further includes: power supply components 1104, and other components.
Embodiments of the present application further provide a computer program product, which includes a computer program/instruction, when executed by a processor, cause the processor to implement the steps in the data processing method as corresponding to fig. 1.
Based on the same idea, the embodiment of the present application further provides another data processing apparatus. Fig. 12 is a schematic structural diagram of another data processing apparatus according to an embodiment of the present application. The data processing apparatus includes:
an obtaining module 1201, configured to obtain a first directory, where the first directory includes a first scheduler correlation function.
A development module 1202 for obtaining a scheduler module in response to a scheduler module development operation completed by a user based on the first directory.
The obtaining module 1201 is also configured to obtain scheduler hot upgrade technology code.
The generating module 1203 is configured to generate a kernel module for hot-upgrading a kernel scheduler according to the scheduler module and the scheduler hot-upgrade technology code.
Further, the obtaining module 1201 is further configured to obtain a symbol repositioning tool; and generating a hot upgrade package of the scheduler according to the symbol relocation tool and the kernel module.
Further, the scheduler hot upgrade technique code comprises: an atomic safeguard mechanism code; the function replacement execution code is used for replacing an interface function in the scheduler module in a jump instruction mode; the data synchronously executes the code.
Embodiments of the present application further provide a computer program product, which includes a computer program/instruction, and when the computer program/instruction is executed by a processor, the processor is enabled to implement the steps in the data processing method according to fig. 4.
An embodiment of the application also provides an electronic device. Fig. 13 is a schematic structural diagram of another electronic device according to an embodiment of the present application. The electronic device includes a memory 1301, a processor 1302, and a communication component 1303; wherein the content of the first and second substances,
the memory 1301 is used for storing programs;
the processor 1302, coupled to the memory, is configured to execute the program stored in the memory to:
acquiring a kernel module for a hot upgrade kernel scheduler;
executing a scheduler hot upgrade technology code in the kernel module to obtain a first directory preset in the kernel module and used for representing a scheduler related function;
and replacing the first directory for a second directory in the scheduler to be upgraded in a hot state, and executing data synchronization.
The memory 1301 described above may be configured to store other various data to support operations on the electronic device. Examples of such data include instructions for any application or method operating on the electronic device. The memory may be implemented by any type or combination of volatile or non-volatile memory devices, such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks.
Further, the processor 1302 in this embodiment may specifically be: and the programmable exchange processing chip is provided with a data copying engine and can copy the received data.
When the processor 1302 executes the program in the memory, in addition to the above functions, other functions may be implemented, and reference may be specifically made to the description of the foregoing embodiments. Further, as shown in fig. 13, the electronic apparatus further includes: power components 1304, and the like.
Based on the same idea, the embodiment of the application further provides another data processing device. Fig. 14 is a schematic structural diagram of another data processing apparatus according to an embodiment of the present application. The data processing apparatus includes:
an obtaining module 1401, configured to obtain a kernel module for a kernel scheduler for hot upgrade.
An executing module 1402, configured to execute a scheduler hot upgrade technology code in the kernel module, so as to obtain a first directory preset in the kernel module and used for representing a function related to a scheduler;
a replacing module 1403, configured to replace the first directory with a second directory in the scheduler to be upgraded hot and perform data synchronization.
Embodiments of the present application also provide a computer program product, which includes a computer program/instruction, and when the computer program/instruction is executed by a processor, the processor is enabled to implement the steps in the data processing method according to fig. 5.
The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware. With this understanding in mind, the above-described technical solutions may be embodied in the form of a software product, which can be stored in a computer-readable storage medium such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods described in the embodiments or some parts of the embodiments.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions in the embodiments of the present application.

Claims (13)

1. A method of data processing, comprising:
acquiring a first kernel program and a scheduler boundary configuration parameter;
extracting a first scheduler correlation function from the first kernel program according to the scheduler boundary configuration parameter; wherein the scheduler boundary configuration parameter is generated based on a function name of an interface function and a scheduler file;
and generating a first directory for assisting compiling of a scheduler module according to the extracted first scheduler related function, wherein the scheduler module can be loaded for hot upgrade of a kernel scheduler.
2. The method of claim 1, the extracting a first scheduler correlation function from the first kernel according to the scheduler boundary configuration parameter, comprising:
extracting an interface function from the first kernel program according to the scheduler boundary configuration parameter;
extracting an internal function and an external function which have a calling relation with the interface function from the first kernel program based on the interface function;
wherein the first scheduler correlation function comprises: and extracting the interface function, the internal function and the external function.
3. The method of claim 1, wherein generating a first directory for an auxiliary compile scheduler module based on the extracted scheduler correlation function comprises:
acquiring a structural body member boundary division document corresponding to the first kernel program;
and dividing the document according to the first scheduler correlation function and the structural body member boundary to generate the first directory.
4. The method of any of claims 1 to 3, further comprising:
acquiring a second kernel program;
and executing boundary consistency check based on the second kernel program and the boundary configuration parameters of the scheduler to obtain a consistency version file.
5. The method of claim 4, wherein performing a boundary consistency check based on the second kernel program and the scheduler boundary configuration parameters to obtain a consistency version file comprises:
extracting a second scheduler correlation function from the second kernel program according to the scheduler boundary configuration parameter;
acquiring identifiers corresponding to a plurality of external functions based on the second kernel program;
acquiring public data of the structural body members based on the second kernel program;
acquiring an interface function capable of triggering context switching or sleeping based on the second kernel program;
and generating the consistent version file according to the related function of the second scheduler, the identifiers corresponding to the external functions, the public data of the structural body members and the interface function capable of triggering context switching or sleeping.
6. The method of claim 4, further comprising:
acquiring a locally stored history file;
comparing the consistency version file with the history file;
when the comparison result has a difference, generating alarm information;
and updating the history file into the consistent version file when the comparison result is not different.
7. A method of data processing, the method comprising:
acquiring a first directory, wherein the first directory contains a first scheduler correlation function;
responding to the development operation of the dispatcher module completed by the user based on the first catalogue, and obtaining the dispatcher module;
acquiring a hot upgrade technology code of a scheduler;
generating a kernel module for hot upgrading a kernel scheduler according to the scheduler module and the scheduler hot upgrading technology code;
the generation mode of the first directory comprises the following steps: acquiring a structural body member boundary dividing document corresponding to a first kernel program; and dividing the document according to the first scheduler correlation function and the structural body member boundary to generate the first directory.
8. The method of claim 7, further comprising:
obtaining a symbol repositioning tool;
and generating a hot upgrade package of the scheduler according to the symbol relocation tool and the kernel module.
9. The method of claim 7, the scheduler hot upgrade technique code comprising:
an atomic safeguard mechanism code;
the function replacement execution code is used for replacing an interface function in the scheduler module in a jump instruction mode;
the data synchronously executes the code.
10. A method of data processing, the method comprising:
acquiring a kernel module for a hot upgrade kernel scheduler;
executing a scheduler hot upgrade technology code in the kernel module to obtain a first directory preset in the kernel module and used for representing a scheduler related function; the generation mode of the first directory comprises the following steps: acquiring a structural body member boundary dividing document corresponding to a first kernel program; dividing documents according to the relevant functions of the scheduler and the boundaries of the structural body members to generate the first directory;
and replacing the first directory for a second directory in the scheduler to be upgraded in a hot state, and executing data synchronization.
11. A data processing system, the system comprising:
the first client is used for acquiring a first kernel program and a dispatcher boundary configuration parameter; extracting a first scheduler correlation function from the first kernel program according to the scheduler boundary configuration parameter; generating a first directory for assisting in compiling a scheduler module according to the extracted first scheduler related function, wherein the scheduler module can be loaded for hot upgrade of a kernel scheduler; wherein the scheduler boundary configuration parameter is generated based on a function name of an interface function and a scheduler file;
the second client is used for acquiring a first directory, and the first directory contains a first scheduler correlation function; responding to the development operation of the dispatcher module completed by the user based on the first catalogue, and obtaining the dispatcher module; acquiring a hot upgrade technology code of a scheduler; and generating a kernel module for hot upgrading the kernel scheduler according to the scheduler module and the scheduler hot upgrading technology code.
12. A data processing system, the system comprising:
the first client is used for acquiring a first kernel program and a dispatcher boundary configuration parameter; extracting a first scheduler correlation function from the first kernel program according to the scheduler boundary configuration parameter; generating a first directory for assisting in compiling a scheduler module according to the extracted first scheduler related function, wherein the scheduler module can be loaded for hot upgrade of a kernel scheduler; wherein the scheduler boundary configuration parameter is generated based on a function name of an interface function and a scheduler file;
the second client is used for acquiring a first directory, and the first directory contains a first scheduler correlation function; responding to the development operation of the dispatcher module completed by the user based on the first catalogue, and obtaining the dispatcher module; acquiring a hot upgrade technology code of a scheduler; generating a kernel module for hot upgrading a kernel scheduler according to the scheduler module and the scheduler hot upgrading technology code;
the server side is used for acquiring a kernel module for the kernel scheduler for hot upgrade; executing a scheduler hot upgrade technology code in the kernel module to obtain a first directory preset in the kernel module and used for representing a scheduler related function; and replacing the first directory for a second directory in the scheduler to be upgraded in a hot state, and executing data synchronization.
13. An electronic device comprising a memory and a processor; wherein the content of the first and second substances,
the memory is used for storing programs;
the processor, coupled with the memory, for executing the program stored in the memory for implementing the method of any of the preceding claims 1 to 6; or the method of any one of the preceding claims 7 to 9; or a method as claimed in claim 10 above.
CN202111228419.9A 2021-10-21 2021-10-21 Data processing method, system, electronic device and program product Active CN113672269B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111228419.9A CN113672269B (en) 2021-10-21 2021-10-21 Data processing method, system, electronic device and program product

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111228419.9A CN113672269B (en) 2021-10-21 2021-10-21 Data processing method, system, electronic device and program product

Publications (2)

Publication Number Publication Date
CN113672269A CN113672269A (en) 2021-11-19
CN113672269B true CN113672269B (en) 2022-05-06

Family

ID=78550785

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111228419.9A Active CN113672269B (en) 2021-10-21 2021-10-21 Data processing method, system, electronic device and program product

Country Status (1)

Country Link
CN (1) CN113672269B (en)

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103699389B (en) * 2013-12-30 2016-11-16 北京大学 A kind of Linux kernel module relation extracting method based on compiling option
US10176028B2 (en) * 2015-09-25 2019-01-08 International Business Machines Corporation Upgrading a kernel or kernel module with a configured persistent memory unused by the kernel
CN111008152B (en) * 2019-12-26 2022-10-11 中国人民解放军国防科技大学 Kernel module compatibility influence domain analysis method, system and medium based on function dependency graph

Also Published As

Publication number Publication date
CN113672269A (en) 2021-11-19

Similar Documents

Publication Publication Date Title
US10019256B2 (en) Systems and methods for incremental software development
US8954930B2 (en) System and method for reducing test effort by object risk analysis
US9182964B2 (en) System and method for deploying software into a computing environment
US10305731B2 (en) System and method for provisioning cloud services across heterogeneous environments using partitioned provisioning instructions stored on a configuration management server
US11113050B2 (en) Application architecture generation
US11599654B2 (en) Method and apparatus for authority control, computer device and storage medium
EP3447635A1 (en) Application architecture generation
US20160335069A1 (en) Dependency handling for software extensions
US20210089297A1 (en) Automated check for ticket status of merged code
US9760364B2 (en) Checks for software extensions
CN106909434B (en) Method and device for detecting undefined function in executable program
WO2021077916A1 (en) Method and device for acquiring mirror image file
CN109684205B (en) System testing method, device, electronic equipment and storage medium
CN113672269B (en) Data processing method, system, electronic device and program product
US9396239B2 (en) Compiling method, storage medium and compiling apparatus
WO2022120640A1 (en) Electron-based updating method and system
CN113918162A (en) Front-end code automatic checking method based on centralized management mode
EP2503450A2 (en) Version numbering in single development and test environment
US9477447B1 (en) Semantic representations of software extensions
US20240094998A1 (en) Smart contract distribution infrastructure
US20240086157A1 (en) Visual generation of software deployment pipelines using recommendations of development and operations blueprints
CN115543374A (en) Scheme generation method, equipment upgrading method, related device, equipment and medium
EP2503451A2 (en) Metadata for single development test environment
CN117591136A (en) Storage image generation method, device, computer equipment and storage medium
CN114385160A (en) Distributed dynamic component pushing method and device, electronic equipment and medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 40062661

Country of ref document: HK