A software entity management method, system and storage medium

By abstracting modules in the storage system into entities and constructing a management layer, a business layer, and a driver layer, the applicability problem caused by frequent changes in the storage system platform is solved, achieving highly cohesive and loosely coupled module management and good scalability.

CN114996038BActive Publication Date: 2026-02-17INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210758873.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-29
Publication Date
2026-02-17
Estimated Expiration
2042-06-29

AI Technical Summary

Technical Problem

The frequent changes in existing storage system platforms have led to applicability issues for software and hardware during storage, and the complex coupling relationships between modules make them difficult to expand.

Method used

The modules in the software are abstracted into entities, the entry address of the management layer entity is constructed, the business layer entity structure template is defined, and the driver layer entity is constructed in combination with the hardware platform functions to support the transmission of broadcast events, thereby realizing a management method with high cohesion and low coupling.

Benefits of technology

It achieves good scalability and event broadcast response capabilities on multiple hardware platforms, simplifies module management, and reduces the complexity of module expansion.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114996038B_ABST
    Figure CN114996038B_ABST
Patent Text Reader

Abstract

The application discloses a kind of management method, system and storage medium of software entity, it is related to storage technical field, comprising: constructing management layer entity;According to business type, construct business layer entity;Management layer entity is according to structure template, the function of business layer entity is called;Combining hardware platform function constructs the drive layer entity corresponding to each business layer entity;The drive method corresponding to drive layer entity is obtained, and drive collection is logically composed, and the method corresponding to drive layer entity is called from drive collection according to the entry function of drive layer entity.The application can abstract the module in software as entity, and the entity is used as a separate component, with high cohesion, low coupling characteristics, and the management method in the application can support more than ten specific hardware platforms, with good scalability.Through the entity managed by the method, when one of the entities needs to send an event, a broadcast event can be sent to achieve the effect of a broadcast event.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of storage, in particular to a software entity management method and system and a storage medium. BACKGROUND

[0002] The storage field needs to manage the changes of software and hardware. The software involves many modules, and the interaction between the modules is complex. In actual engineering, the software is required to be one track, that is, a set of software code can adapt to various hardware platforms, and as time goes on, it can support the expansion of various new hardware platforms. This poses a challenge to the relationship between modules and scalability in software design. If the traditional method is followed, the coupling relationship between modules is complex. If there is no good method to manage the modules, when a module needs to be expanded later, as the number of modules grows, the interfaces and the relationship between the modules need to be considered more and more, and the complexity will increase exponentially.

[0003] Moreover, the platform of the existing storage system is changing rapidly, so that the architecture originally applied to this storage platform may become unsuitable in the update and change of the platform, causing problems in the storage of software and hardware. Therefore, there is an urgent need for a method for managing software entities, which can abstract the modules in software engineering into an entity and manage the entity as a separate component. SUMMARY

[0004] To solve at least one problem mentioned in the background, the present application provides a software entity management method, system and storage medium, which abstracts the modules in software into entities and manages the entities as a separate component, has the characteristics of high cohesion and low coupling, and the management method in the present application can support more than ten specific hardware platforms and has good scalability. When one of the entities needs to send an event, the entity can send a broadcast event, and other entities respond as needed to achieve the effect of a broadcast event.

[0005] The specific technical solutions provided by the embodiments of the present application are as follows:

[0006] In a first aspect, a software entity management method is provided, which includes:

[0007] A management layer entity is constructed, which is used to manage the entry address of other entities;

[0008] A business layer entity is constructed according to the business type;

[0009] The management layer entity calls the function of the business layer entity according to the structure template;

[0010] constructing a driving layer entity corresponding to each of the service layer entities in combination with a hardware platform function;

[0011] acquiring a driving method corresponding to the driving layer entity to logically constitute a driving collection, and calling a method corresponding to the driving layer entity from the driving collection according to an entry function of the driving layer entity.

[0012] In one specific embodiment, the method further comprises:

[0013] After the software is run, the driving layer entity dynamically identifies a corresponding hardware driver according to a feature of the hardware platform.

[0014] In one specific embodiment, the method further comprises:

[0015] When one of the service layer entities needs to send an event, the service layer entity calls an interface of the management layer entity for sending the event;

[0016] After the management layer entity receives the event, the management layer entity finds an entry address of each of the service layer entities, and broadcasts the event to all the service layer entities through the entry address.

[0017] In one specific embodiment, the method further comprises:

[0018] defining a method interface in a header file of each of the service layer entities;

[0019] According to the method interface, mutual calling of at least two of the service layer entities is realized.

[0020] In one specific embodiment, the service layer entity is constructed according to a service type, and then a structure template of the entity is defined, and the structure template specifically comprises:

[0021] a starting logic, which is used to start an initialization operation performed by the entity;

[0022] a response logic, which is used to determine whether to respond to an event according to a function of the entity;

[0023] a method logic, which is used to realize the function of the entity;

[0024] an ending logic, which is used to end a cleaning operation performed by the entity.

[0025] In one specific embodiment, the constructing of the driving layer entity corresponding to each of the service layer entities in combination with the hardware platform function specifically comprises:

[0026] acquiring a specific function of the hardware platform, and formatting the specific function of the hardware platform into a unified function;

[0027] According to the unified function of the hardware platform and the structural template of the entity, a driving layer entity corresponding to each business layer entity is constructed.

[0028] In a specific embodiment, a driving method logic corresponding to the driving layer entity is acquired to form a driving collection, and a method corresponding to the driving layer entity is called from the driving collection according to an entry function of the driving layer entity, and specifically includes the following steps.

[0029] The driving method logic corresponding to the driving layer entity is acquired according to the function of the hardware platform;

[0030] The driving method logic corresponding to the driving layer entity is acquired according to the function of the hardware platform;

[0031] An entry function of all the driving layer entities is acquired;

[0032] The method corresponding to the driving layer entity is called from the driving collection according to the entry function.

[0033] In a second aspect, a management system of a software entity is provided, and the system includes the following components.

[0034] A first construction module is configured to construct a management layer entity, and the management layer entity is configured to manage entry addresses of other entities.

[0035] A second construction module is configured to construct a business layer entity according to a business type.

[0036] An application module is configured to enable the management layer entity to call a function of the business layer entity according to a structural template of the entity.

[0037] A third construction module is configured to construct a driving layer entity corresponding to each business layer entity in combination with a function of a hardware platform.

[0038] A calling module is configured to acquire a driving method logic corresponding to the driving layer entity to form a driving collection, and call a method corresponding to the driving layer entity from the driving collection according to an entry function of the driving layer entity.

[0039] In a third aspect, a computer device is provided, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements the following steps when executing the computer program.

[0040] Step A: constructing a management layer entity, and the management layer entity is configured to manage entry addresses of other entities.

[0041] Step B: constructing a business layer entity according to a business type.

[0042] Step C: the management layer entity invokes the function of the service layer entity according to the structure template;

[0043] Step D: a driving layer entity corresponding to each service layer entity is constructed in combination with the function of the hardware platform;

[0044] Step E: a driving collection is formed by acquiring the driving method logic corresponding to the driving layer entity, and the method corresponding to the driving layer entity is invoked from the driving collection according to the entry function of the driving layer entity.

[0045] In a fourth aspect, a computer readable storage medium is provided, and a computer program is stored on the computer readable storage medium, and the computer program is executed by a processor to implement the following steps:

[0046] Step A: a management layer entity is constructed, and the management layer entity is used to manage the entry address of other entities;

[0047] Step B: a service layer entity is constructed according to a service type;

[0048] Step C: the management layer entity invokes the function of the service layer entity according to the structure template;

[0049] Step D: a driving layer entity corresponding to each service layer entity is constructed in combination with the function of the hardware platform;

[0050] Step E: a driving collection is formed by acquiring the driving method logic corresponding to the driving layer entity, and the method corresponding to the driving layer entity is invoked from the driving collection according to the entry function of the driving layer entity.

[0051] The embodiments of the present application have the following beneficial effects:

[0052] 1. The embodiments of the present application provide a first layer management layer entity, the management layer entity is used to manage the entry address of other entities, then a second layer entity, i.e., a service layer entity, is constructed according to a service type, and a structure template of the entity is defined, the management layer entity can invoke the function of the service layer entity according to the structure template of the entity, a driving layer entity corresponding to each service layer entity is constructed in combination with the function of the hardware platform, a driving collection is formed by acquiring the driving method logic corresponding to the driving layer entity, and the method corresponding to the driving layer entity is invoked from the driving collection according to the entry function of the driving layer entity, the module in the software is abstracted as an entity, the entity is taken as a separate component, has the characteristics of high cohesion and low coupling, and the management method in the present application can support more than ten specific hardware platforms and has good scalability. When one of the entities needs to send an event, the entity can send a broadcast event, and other entities respond as needed to achieve the effect of the broadcast event. BRIEF DESCRIPTION OF DRAWINGS

[0053] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiments description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without any creative effort on the basis of these drawings.

[0054] Figure 1 A schematic diagram of the management method of the software entity according to the present application is shown.

[0055] Figure 2 A schematic diagram of event broadcasting by the management layer entity according to the present application is shown.

[0056] Figure 3 A schematic diagram of the management system of the software entity according to the present application is shown.

[0057] Figure 4 A schematic diagram of the computer device in the present application is shown. DETAILED DESCRIPTION

[0058] In order to make the purposes, technical solutions and advantages of the present application more clear, the technical solutions in the embodiments of the present application will be described clearly and completely in the following with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some embodiments of the present application, but not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without any creative effort belong to the scope of protection of the present application.

[0059] At present, the storage field needs to manage the changes of software and hardware, and many modules are involved on the software, and the interaction between the modules is complex. In actual work, the platform of the existing storage system is changing day by day, so that the architecture originally applied to this storage platform may become inapplicable in the update and change of the platform, causing problems in the storage process of software and hardware. Based on the above problems, the present application proposes a software entity management method, system and storage medium.

[0060] Among them, the entity, namely manager, Manager is a management object abstracted by business or software for its sub-modules, including a management layer entity (admin manager) managing all entities, functional objects sensor manager, power manager, dump manager, fnr manager, ipport manager, etc.; service objects platform manager, ipc manager, service manager, exec manager, etc.

[0061] Drive manager, the drive manager is a sub-module object in the management entity module, wherein the sensor manager manages 12 drive managers, and the power manager manages 6 drive managers.

[0062] A pointer to a function, a pointer to a function has a physical memory address that can be assigned to the pointer, and the function name of a function is a pointer, which is used to point to the code of the function.

[0063] Embodiment one

[0064] A management method of a software entity is provided, as shown in the following steps. Figure 1 The management method comprises the following steps:

[0065] Step S1: Constructing a management layer entity, the management layer entity is used to manage the entry address of other entities.

[0066] According to software logic, the software entity is layered, the first layer is a management layer entity, the management layer entity is used to manage other entities, mainly including the entry address of other entities, when other entities need to be accessed, the entry address can be used for access. In addition, the management layer entity also includes a "trc log record" and a time management module, etc., also includes an event response mechanism, provides an interface for other entities to send time, and broadcasts to all entities.

[0067] Step S2: Constructing a business layer entity according to the business type.

[0068] Specifically, the second layer entity, i.e. the business layer entity, is divided according to the business module, and the structure template of each entity is defined, and the structure module specifically includes startup, end, event and method, and specifically includes: startup logic, the startup logic is used to start the initialization operation of the entity; response logic, the response logic is used to determine whether to respond to the event according to the function of the entity; method logic, the method logic is used to realize the function of the entity, i.e. including the specific implementation function of the entity is realized through a structure body, and the structure body member is a pointer to a function; end logic, the end logic is used to end the cleaning operation of the entity.

[0069] In a specific embodiment, the business layer entity includes a platform entity, a power entity, a dump entity, a sensor entity, an ipport entity, a service entity and an fnr entity.

[0070] In one specific embodiment, the start logic is a pointer to a function "typedef bool (*start_fn) (void)", the end logic is a pointer to a function "typedef bool (*stop_fn) (void)", the corresponding logic is event logic, and the corresponding pointer to a function is "typedef void (*eep_fn) (event_e event, manager_id id)". The method logic includes a function table, and the method logic is implemented by a pointer to a structure. The pointer to a function of method one is "typedef void (*fn_1) (arg)", the pointer to a function of method two is "typedef void (*fn_2) (arg)", the pointer to a function of method three is "typedef void (*fn_3) (arg)", and the pointer to a function of method "n-1" is "typedef void (*fn_n-1) (arg)", and the pointer to a function of method "n" is "typedef void (*fn_n) (arg)".

[0071] As shown in Figure 2 When one of the service layer entities needs to send an event to other service layer entities, the service layer entity first calls an interface of the external management layer entity for sending an event, transmits information of the event to the management layer entity through the interface, and the management layer entity receives the event and finds an entry address of each service layer entity to broadcast the event to all service layer entities through the entry address. Specifically, when the "power entity" needs to send an event, the "power entity" calls an interface of the "admin entity" for sending an event, the "admin entity" receives the event, finds an entry address of each service layer entity, calls an event method of the service layer entity, and broadcasts the event to all service layer entities to achieve the effect of broadcasting the event.

[0072] When the service layer entities are constructed, an interface of each method logic is defined in a header file, each entity is an independent component module, and each entity is an independent structure in logic. The entities can call each other, and two service layer entities can call each other according to interfaces of the two service layer entities when the two service layer entities need to communicate. Specifically, when the "dump entity" needs to communicate with the "senosr entity", the "dump entity" and the "senosr entity" call each other through interfaces of the "dump entity" and the "senosr entity".

[0073] The inside of the entity is void fn_1(arg) { / / method 1 implementation}, void fn_2(arg) { / / method 2 implementation}... void fn_n-1(arg) { / / method n-1 implementation} void fn_n(arg) { / / method n implementation}. The external interface of the entity includes, method 1 interface: #define FN_1(arg); query mep(admin meps, SENSOR_ID) -> fn_1(arg); method 2 interface: #define FN_2(arg); query mep(admin meps, SENSOR ID) -> fn 2(arg); method "n-1" interface: #define FN_n-1(arg); query mep(admin meps, SENSOR ID) -> fn_n-1(arg); method "n" interface: #define FN_n(arg),

[0074] Query mep(admin meps, SENSOR_ID), the implementation logic of the management layer entity, input the ID of the current entity, output the method logic of the current entity or the function table address of the current method logic.

[0075] Through the above setting, when a certain entity needs to send an event to other multiple entities, the event can be sent to the management layer entity, broadcast to all entities by the management layer entity, and other entities decide whether to respond according to the requirement, to achieve the effect of broadcasting the event.

[0076] Step S3: The management layer entity calls the function of the business layer entity according to the structure template.

[0077] Specifically, the structure template includes: start logic, response logic, method logic and end logic, when the management layer entity is initialized, the start function of each entity is called according to the structure module, thereby realizing the start of all business layer entities through the management layer entity.

[0078] Step S4: Combine the hardware platform function to build the drive layer entity corresponding to each business layer entity.

[0079] Specifically, according to the hardware platform to be adapted, such as a lamp, temperature, gpio, i2c, etc., since different hardware platforms have different functions, the corresponding driver layer entity needs to be constructed according to the functions of the specific hardware platform, specifically including: obtaining the specific functions of the hardware platform, formatting the specific functions of the hardware platform into unified functions, and then combining the unified functions and structure templates of the hardware platform to construct the driver layer entity corresponding to each business layer entity.

[0080] In a specific embodiment, the specific functions of each hardware platform are abstracted into unified functions, such as the main logic included in the structure template: start logic, end logic, response logic, and method logic. Then the driver layer entity of each specific hardware platform is constructed according to the structure template, and the implementation of each driver layer entity is based on the hardware platform.

[0081] Through the above settings, the driver layer entity can configure all hardware platforms, and can construct specific entities according to the entity template. At the same time, the driver layer entity abstracts all specific methods, and does not need to perceive which platform is running. When the product needs to be expanded later, only the specific entity needs to be added according to the template, which has good scalability. Moreover, when the function of a certain entity changes, a new entity function can be implemented, and the entity can be replaced at this time.

[0082] Step S5: obtaining the driver method logic corresponding to the driver layer entity to form a driver collection, and calling the method corresponding to the driver layer entity from the driver collection according to the entry function of the driver layer entity.

[0083] In a specific embodiment, during the calling of the method corresponding to the driver layer entity in the driver collection through the entry function, it is not perceived which hardware platform the software is running on. It can be implemented that the management method in the present application is applicable to different software platforms, and when the software is running, the driver layer entity dynamically identifies the corresponding hardware driver according to the characteristics of the hardware.

[0084] In a specific embodiment, obtaining the driver method logic corresponding to the driver layer entity to form a driver collection, and calling the method corresponding to the driver layer entity from the driver collection according to the entry function of the driver layer entity, specifically including: obtaining the driver method logic corresponding to the driver layer entity according to the hardware platform function; a plurality of driver method logics form a driver collection; obtaining the entry function of all the driver layer entities; and calling the method corresponding to the driver layer entity from the driver collection according to the entry function. Wherein, the driver collection has summarized all the method logic steps required to run by all hardware entities, and is applicable to different hardware platforms.

[0085] In a specific embodiment, when the "Sensor entity" needs to adapt to a specific hardware platform, each hardware platform uses the method of constructing an entity to be layered, abstracts the specific functions of each hardware platform into unified functions, and then constructs a specific entity according to the structure template of the entity. The specific entity includes: an SVC entity, a GEM entity, an ITE entity, a TB4 entity, a VM1 entity, a BFN entity, a TMS entity, a TB5 entity, an FB1 entity, an XML entity, an FB2 entity, and a FAKE entity. The corresponding hardware driver in the FB2 entity includes: VPD, HD moniter elemnt, HD moniter, led, thermal, i2C, and gpio.

[0086] In a specific embodiment, the method logic of each entity is equivalent to a function pointer table. When replacement is needed, only the specific implementation needs to be replaced, and the function of independent component replacement can be achieved.

[0087] The functions of each entity are implemented according to a specific hardware platform, the corresponding driving method logic of the driving layer entity is obtained according to the hardware platform function, a driving collection is formed by a plurality of driving methods, and the driving collection includes the methods in all entities. When the method in the entity needs to be called, the entry function of the driving layer entity "Sensor entity" is obtained, and the entry function is provided to the driving collection. The driving collection calls the corresponding abstract method in the driving collection according to the entry function, and the specific hardware platform does not need to be confirmed during the calling. When the software is running, the driving layer entity dynamically identifies which drive needs to be specifically run according to the characteristics of the hardware, such as the version number of the basic input and output system or the name of the circuit board. For example, it is identified that the software runs on the FB2 entity drive through the version number of the basic input and output system.

[0088] Moreover, when the software runs on a new hardware platform, a new hardware drive may appear. At this time, only a new entity needs to be added according to the template. The entity does not need to be added in the driving collection because the driving collection includes the methods corresponding to all entities.

[0089] Through the above settings, the modules in the software are abstracted into entities, the entities are taken as a separate component, have the characteristics of high cohesion and low coupling, the management method in the present application can support more than ten specific hardware platforms, and has good scalability. When one of the entities managed by the method needs to send an event, the other entities can respond as needed to achieve the effect of a broadcast event.

[0090] Embodiment two

[0091] Corresponding to the above embodiment, the present application provides a software entity management system, which comprises:Figure 3 The system comprises:

[0092] A first constructing module, which is used to construct a management layer entity for managing the entry addresses of other entities;

[0093] A second constructing module, which is used to construct a service layer entity according to a service type;

[0094] An application module, which is used for the management layer entity to call the functions of the service layer entity according to a structure template;

[0095] A third constructing module, which is used to construct a driver layer entity corresponding to each service layer entity in combination with the functions of a hardware platform;

[0096] A calling module, which is used to obtain a driver collection composed of driver method logics corresponding to the driver layer entity, and call the method corresponding to the driver layer entity from the driver collection according to an entry function of the driver layer entity.

[0097] In a specific embodiment, the system further comprises an identification system, which is used for the driver layer entity to dynamically identify the corresponding hardware driver according to the characteristics of the hardware after the software is run.

[0098] In a specific embodiment, the second constructing module further comprises that when one of the service layer entities needs to send an event, the service layer entity calls an interface of the management layer entity for sending the event; after the management layer entity receives the event, the management layer entity looks up the entry address of each service layer entity and broadcasts the event to all the service layer entities through the entry address.

[0099] In a specific embodiment, the second constructing module further comprises that a method interface is defined in the header file of each service layer entity; and the method interface is used to realize the mutual calling of at least two service layer entities.

[0100] In a specific embodiment, the system further comprises an entity definition module, which is used to define a structure template of the entity after the service layer entity is constructed according to the service type, and the structure template specifically comprises: a starting logic, which is used to start the initialization operation of the entity; a response logic, which is used to determine whether to respond to the event according to the function of the entity; a method logic, which is used to realize the function of the entity; and an ending logic, which is used to end the cleaning operation of the entity.

[0101] In one specific embodiment, the third constructing module comprises obtaining specific functions of the hardware platform, formatting the specific functions of the hardware platform into unified functions, and constructing the driving layer entity corresponding to each of the service layer entities in combination with the unified functions of the hardware platform and the structural template.

[0102] In one specific embodiment, the calling module comprises specifically comprising: obtaining the driving method logic corresponding to the driving layer entity according to the functions of the hardware platform; composing a driving collection with a plurality of the driving method logics; obtaining the entry function of all the driving layer entities; and calling the method corresponding to the driving layer entity from the driving collection according to the entry function.

[0103] Embodiment three

[0104] A computer device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements the following steps when executing the computer program:

[0105] Step 101: constructing a management layer entity, which is used to manage the entry addresses of other entities;

[0106] Step 102: constructing a service layer entity according to a service type;

[0107] Step 103: the management layer entity calling the functions of the service layer entity according to a structural template;

[0108] Step 104: constructing a driving layer entity corresponding to each of the service layer entities in combination with the functions of a hardware platform;

[0109] Step 105: obtaining the driving method logic corresponding to the driving layer entity to compose a driving collection, and calling the method corresponding to the driving layer entity from the driving collection according to the entry function of the driving layer entity.

[0110] In one specific embodiment, after step 105, the driving layer entity dynamically identifies the corresponding hardware driver according to the characteristics of the hardware after the software is run.

[0111] In one specific embodiment, step 102 further comprises, when one of the service layer entities needs to send an event, the service layer entity calling the interface of the management layer entity for sending the event; after the management layer entity receives the sending event, the management layer entity finds the entry address of each of the service layer entities, and broadcasts the sending event to all the service layer entities through the entry address.

[0112] In one specific embodiment, in addition, step 102 comprises defining a method interface in a header file of each of the service layer entities; and implementing mutual calling of at least two of the service layer entities according to the method interface.

[0113] In one specific embodiment, further comprising defining a structure template of the entity after constructing the service layer entity according to the service type, the structure template comprising: start logic for starting an initialization operation performed by the entity; response logic for determining whether to respond to an event according to a function of the entity; method logic for implementing the function of the entity; and end logic for ending a cleaning operation performed by the entity.

[0114] In one specific embodiment, step 104 comprises obtaining specific functions of the hardware platform, formatting the specific functions of the hardware platform into unified functions; and constructing a driving layer entity corresponding to each of the service layer entities in combination of the unified functions of the hardware platform and the structure template.

[0115] In one specific embodiment, the driving method logic corresponding to the driving layer entity is obtained according to the functions of the hardware platform; a plurality of the driving method logic constitutes a driving collection; an entry function of all the driving layer entities is obtained; and a method corresponding to the driving layer entity is called from the driving collection according to the entry function.

[0116] In one embodiment, a computer device is provided, which can be a server, and an internal structure diagram of the computer device can be as shown in Figure 4 The computer device comprises a processor, a memory, a network interface and a database connected through a system bus. The processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for running of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is configured to store entity template data. The network interface of the computer device is configured to communicate with an external terminal through a network connection. The computer program is executed by the processor to implement a software entity management method.

[0117] Those skilled in the art can understand that Figure 4 The structure shown in the figure is only a block diagram of part of the structure related to the scheme of the present application, and does not constitute a limitation on the computer device to which the scheme of the present application is applied. The specific computer device can comprise more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0118] Embodiment Four

[0119] In one embodiment, a computer readable storage medium is provided, and the computer readable storage medium stores a computer program, and the computer program is executed by a processor to implement the following steps:

[0120] Step 201: constructing a management layer entity, the management layer entity is used to manage the entry address of other entities;

[0121] Step 202: constructing a service layer entity according to the service type;

[0122] Step 203: the management layer entity calls the function of the service layer entity according to the structure template;

[0123] Step 204: constructing a driver layer entity corresponding to each service layer entity in combination with the function of the hardware platform;

[0124] Step 205: obtaining the driver method corresponding to the driver layer entity to logically constitute a driver collection, and calling the method corresponding to the driver layer entity from the driver collection according to the entry function of the driver layer entity.

[0125] In one specific embodiment, after step 205, the driver layer entity dynamically identifies the corresponding hardware driver according to the characteristics of the hardware after the software is running.

[0126] In one specific embodiment, step 202 further includes that when one of the service layer entities needs to send an event, the service layer entity calls the interface of the management layer entity for sending the event; after the management layer entity receives the sending event, the management layer entity finds the entry address of each service layer entity, and broadcasts the sending event to all service layer entities through the entry address.

[0127] In one specific embodiment, in addition, step 202 includes defining a method interface in the header file of each service layer entity; and the method interface is used to realize the mutual calling of at least two service layer entities.

[0128] In one specific embodiment, after constructing the service layer entity according to the service type, the structure template of the entity is defined, and the structure template specifically includes: start logic, the start logic is used to start the initialization operation of the entity; response logic, the response logic is used to determine whether to respond to the event according to the function of the entity; method logic, the method logic is used to realize the function of the entity; and end logic, the end logic is used to end the cleaning operation of the entity.

[0129] In one specific embodiment, the step 204 comprises obtaining specific functions of the hardware platform, formatting the specific functions of the hardware platform into unified functions, and constructing the driving layer entity corresponding to each of the service layer entities in combination with the unified functions of the hardware platform and the structural template.

[0130] In one specific embodiment, the driving method logic corresponding to the driving layer entity is obtained according to the functions of the hardware platform; the driving method logics constitute a driving collection; the entry function of all the driving layer entities is obtained; and the method corresponding to the driving layer entity is called from the driving collection according to the entry function.

[0131] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be completed by a computer program instructing related hardware, and the computer program can be stored in a non-volatile computer readable storage medium. When the computer program is executed, the processes of the above-mentioned embodiments can be included. Any reference to memory, storage, database or other medium used in the embodiments provided by the present application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration but not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0132] Although the preferred embodiments in the embodiments of the present application have been described, those skilled in the art can make additional changes and modifications to the embodiments once they know the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications falling within the scope of the embodiments of the present application.

[0133] Obviously, those skilled in the art can make various modifications and variations to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalent technologies, the present application also intends to include these modifications and variations.

Claims

1. A management method of software entities, characterized in that, The method comprises: Layering software entities based on software logic, constructing a first layer entity as a management layer entity, the management layer entity being used to manage the entry addresses of other entities and providing an interface for other entities to send events and broadcast to all entities; Constructing a second layer entity as a business layer entity according to a business type; The management layer entity calling the function of the business layer entity according to a structure template; Combining hardware platform functions to construct a driving layer entity corresponding to each business layer entity, comprising: obtaining the specific functions of the hardware platform, formatting the specific functions of the hardware platform into unified functions, combining the unified functions of the hardware platform and the structure template to construct the driving layer entity corresponding to each business layer entity; Obtaining the driving method logic corresponding to the driving layer entity to form a driving collection, and calling the method corresponding to the driving layer entity from the driving collection according to the entry function of the driving layer entity, comprising: obtaining the driving method logic corresponding to the driving layer entity according to the hardware platform functions, a plurality of driving method logics forming a driving collection, obtaining the entry function of all driving layer entities, and calling the method corresponding to the driving layer entity from the driving collection according to the entry function.

2. The management method of software entities according to claim 1, characterized in that, The method further comprises: After the software runs, the driving layer entity dynamically identifies the corresponding hardware driver according to the characteristics of the hardware platform.

3. The management method of software entities according to claim 2, characterized in that, The method further comprises: When one of the business layer entities needs to send an event, the business layer entity calls the interface of the management layer entity for sending events and sends the event to the management layer entity; After the management layer entity receives the event, the management layer entity finds the entry address of each business layer entity and broadcasts the event to all business layer entities according to the entry address.

4. The management method of software entities according to claim 3, characterized in that, The method further comprises: Defining a method interface in the header file of each business layer entity; Realizing the mutual calling of at least two business layer entities according to the method interface.

5. The management method of software entities according to claim 4, characterized in that, Constructing a business layer entity according to a business type, and then comprising defining a structure template of the entity, the structure template specifically comprising: A startup logic used to start the initialization operation of the entity; A response logic used to determine whether to respond to an event according to the function of the entity; A method logic used to realize the function of the entity; An end logic used to end the cleaning operation of the entity.

6. A management system of software entities, characterized in that The system for realizing the method of any one of claims 1-5 comprises: A first construction module used to construct a management layer entity, the management layer entity being used to manage the entry addresses of other entities; A second construction module used to construct a business layer entity according to a business type; An application module used for the management layer entity to call the function of the business layer entity according to a structure template; A third construction module used to combine hardware platform functions to construct a driving layer entity corresponding to each business layer entity; A calling module used to obtain the driving method logic corresponding to the driving layer entity to form a driving collection, and call the method corresponding to the driving layer entity from the driving collection according to the entry function of the driving layer entity.

7. A computer device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The computer program is executed by the processor to implement the steps of the method of any one of claims 1-5.

8. A computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the method of any one of claims 1-5.

Citation Information

Patent Citations

  • Hardware driving device and method, chip and non-transient computer readable storage medium

    CN109871244A

  • Modularized construction method and device, electronic equipment and storage medium

    CN110399119A