Object-oriented function calling method and device, equipment and storage medium
Through object-oriented function call methods, functional requirements are extracted into standard functional classes, solving the problem of poor reusability and inheritance of function definitions in the prior art, and achieving efficient reuse and flexible iteration of functions.
Patent Information
- Application Number
- CN202411736372.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-29
- Publication Date
- 2025-04-11
AI Technical Summary
The existing automotive function definition methods lead to poor performance and inheritance of functions, and the inability to effectively perform iterative optimization and upgrading, limiting the reusability of functions and the iterative development of projects.
An object-oriented function calling method is proposed. By inputting functional requirements into the target functional feature class, extracting and classifying functional features, forming a well-defined functional class, and encapsulating it into a standard functional class through abstraction, including functional features, actions and calling interfaces for entering and exiting functional steps.
It improves the reusability and inheritance of function definitions, provides convenience for iterative optimization and upgrade of functions, and makes the function implementation more flexible and efficient.
Smart Images

Figure CN119806685A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of automobile function design, and in particular to an object-oriented function calling method, apparatus, device and storage medium. Background Art
[0002] With the rapid development of automobile products, users' functional requirements for automobile products are growing and diversified. In order to meet these requirements, automobile manufacturers need to use concise language to express the functions of automobile products based on demand analysis, and decompose them into various components of automobile products from top to bottom, while specifying the restrictions on the use of functions. This process is called function definition, which is process-oriented and aims to realize the steps for users to achieve operation results.
[0003] At present, different projects have different methods for defining functions and analyzing requirements. After forming a function implementation plan, due to the large discreteness between similar functions and the different granularity of the components, the function is not easy to inherit and inherit, and it is impossible to perform effective iterative optimization and upgrade. This decentralized and non-uniform function definition method limits the reusability of functions and the iterative development of projects.
[0004] Due to the limitations of existing function definition methods, the compatibility and inheritance between function implementation schemes are poor, making it difficult to reuse functions between different projects. This problem not only increases development costs, but also limits the innovation and improvement of product functions. Therefore, how to improve the reusability of function definition has become an urgent problem to be solved. Summary of the invention
[0005] The purpose of this application is to provide an object-oriented function calling method, apparatus, device and storage medium, aiming to solve the technical problem of how to improve the reusability of function definition.
[0006] To achieve the above objectives, the present application proposes an object-oriented function calling method, the method comprising:
[0007] Input the functional requirements into the target functional feature class extraction model, extract and classify the functional features of the functional requirements, obtain an ordered feature graph reflecting the functional feature class, and form a functional class;
[0008] According to the function class, encapsulate it through abstraction to form a standard function class, wherein the standard function class at least includes functional characteristics of entering and exiting corresponding function steps, actions for implementing corresponding function steps, and a calling interface;
[0009] When the standard function class needs to be used, the standard function class is directly called through the calling interface, and the implementation method corresponding to the standard function class is transferred through the calling interface.
[0010] In one embodiment, the standard function class includes: based on the user demand analysis, defining the standard function class, wherein the defined standard function class at least includes the user usage scenario, the operation under the user usage scenario, the result of the operation and the corresponding restriction conditions.
[0011] In one embodiment, the functional requirements are input into the target functional feature class extraction model, and the functional features of the functional requirements are extracted and classified to obtain an ordered feature graph reflecting the functional feature class, forming a functional class, including:
[0012] According to the functional requirements input into the target functional feature class extraction model, individual neurons of the input layer are obtained, and the number of individual neurons of the input layer is equal to the number of the functional requirements;
[0013] According to the response of the individual neurons of the input layer to the functional requirements, the individual neuron regions of the input layer are obtained;
[0014] According to the individual neuron regions of the input layer, an ordered feature map reflecting the functional feature class is obtained to form a functional class.
[0015] In one embodiment, an ordered feature map reflecting the functional feature class is obtained according to the individual neuron region of the input layer to form a functional class, including:
[0016] Obtaining a target weight vector of a reference individual neuron for an output layer, wherein the reference individual neuron is a neuron in an individual neuron region of the input layer;
[0017] Obtaining a winning neuron based on the target weight vector and the reference individual neuron;
[0018] According to the position of the winning neuron and the position of the target individual neuron, an ordered feature map reflecting the functional feature class is obtained to form a functional class, and the target individual neuron is a neuron in the output layer that is close to the position of the winning neuron.
[0019] In one embodiment, the target function feature class extraction model includes: an input layer and an output layer, wherein the input layer is a pooling layer, the output layer is a competition layer, and the input layer obtains the winning neuron of the output layer through a weight vector; the function requirements are input into the target function feature class extraction model, and the function requirements are extracted and classified to obtain an ordered feature graph reflecting the function feature class. Before forming the function class, it also includes:
[0020] Acquire functional requirements and an initial functional feature class extraction model, and construct input layer neurons based on the number of functional requirements, wherein the number of input layer neurons is the same as the number of functional requirements;
[0021] Obtaining an initial weight vector according to the response characteristics of the input layer neurons to the functional requirements;
[0022] Based on the input layer neurons and the initial weight vector, initial winning neurons are obtained to form an orderly arrangement of initial neurons;
[0023] The initial weight vector is adjusted according to the orderly arrangement of the initial neurons to obtain a target functional feature class extraction model.
[0024] In one embodiment, adjusting the initial weight vector according to the orderly arrangement of the initial neurons to obtain a target function feature class extraction model includes:
[0025] Taking the initial winning neuron as the center, obtaining the output layer range neurons according to the preset radius;
[0026] Obtaining a target weight vector according to the distance between the output layer range neuron and the initial winning neuron, the preset radius and the preset weight vector adjustment coefficient;
[0027] Using the target weight vector as the center vector of the orderly arrangement of the initial neurons;
[0028] Based on the central vector and the initial functional feature class extraction model, a target functional feature class extraction model is obtained.
[0029] In one embodiment, when the standard function class needs to be used, the standard function class is directly called through the calling interface, and the implementation method corresponding to the standard function class is transmitted through the calling interface, including:
[0030] Acquiring input data, wherein the input data includes sensor data and user instructions;
[0031] Based on the standard function class, obtain function attributes and function methods;
[0032] Based on the input data and the standard function class, an output result is obtained, wherein the output result includes an operation result and a status report;
[0033] Based on the input data, the function attributes, the function method and the output result, a calling interface is obtained;
[0034] The implementation method corresponding to the standard function class is transmitted through the calling interface.
[0035] In addition, to achieve the above purpose, the present application also proposes an object-oriented function calling device, the device comprising:
[0036] The extraction module is used to input the functional requirements into the target functional feature class extraction model, extract and classify the functional features of the functional requirements, obtain an ordered feature graph reflecting the functional feature class, and form a functional class;
[0037] An encapsulation module, used to encapsulate the function class to form a standard function class through abstraction, wherein the standard function class at least includes functional features for entering and exiting corresponding function steps, actions for implementing corresponding function steps, and a calling interface;
[0038] The calling module is used to directly call the standard function class through the calling interface when the standard function class needs to be used, and to transfer the implementation method corresponding to the standard function class through the calling interface.
[0039] In addition, to achieve the above-mentioned purpose, the present application also proposes an object-oriented function calling device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, and the computer program is configured to implement the steps of the object-oriented function calling method described above.
[0040] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the object-oriented function calling method described above are implemented.
[0041] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, it implements the steps of the object-oriented function calling method described above.
[0042] One or more technical solutions proposed in this application have at least the following technical effects:
[0043] This application obtains an ordered feature graph by inputting the functional requirements into the target functional feature class extraction model, reflecting different functional feature classes, thereby helping to form clearly defined functional classes. Then, based on these functional classes, they are encapsulated into standard functional classes through abstract methods. These standard functional classes not only include the functional features required to enter and exit specific functional steps, but also cover the specific actions required to implement these functional steps, as well as the standard interfaces for calling these functions. Ultimately, when it is necessary to implement specific functions, the corresponding standard functional classes are called directly through these interfaces, and the corresponding implementation methods are passed to ensure efficient execution and flexible application of the functions. This application not only improves the reusability and inheritance of functions, but also facilitates the iterative optimization and upgrading of functions, making functional implementation more flexible and efficient. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0045] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0046] Figure 1 A flowchart diagram of the first embodiment of the object-oriented function calling method of the present application is provided;
[0047] Figure 2 This is an object-oriented function calling method of this application-a target function feature class extraction model architecture diagram;
[0048] Figure 3 A flowchart diagram of the second embodiment of the object-oriented function calling method of the present application is provided;
[0049] Figure 4 This is a schematic diagram of the module structure of the object-oriented function calling device according to an embodiment of the present application;
[0050] Figure 5 A schematic diagram of the device structure of the hardware operating environment involved in the object-oriented function calling method in the embodiment of the present application.
[0051] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0052] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.
[0053] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.
[0054] With the development of the automotive industry, users' demands for automotive functions continue to increase and change. Based on demand analysis, automobile manufacturers clearly define the functions of the car, break them down into individual components, and set functional restrictions. However, currently each project independently defines functions, resulting in poor consistency and inheritance between functions, making it difficult to achieve iterative optimization. This situation limits function reuse, increases development costs, and hinders innovation. It is urgent to improve the reusability of function definitions.
[0055] The main solution of the embodiment of the present application is: this embodiment obtains an ordered feature graph by inputting the functional requirements into the target functional feature class extraction model, reflecting different functional feature classes, thereby helping to form clearly defined functional classes. Then, based on these functional classes, they are encapsulated into standard functional classes through abstract methods. These standard functional classes not only include the functional features required to enter and exit specific functional steps, but also cover the specific actions required to implement these functional steps, as well as the standard interfaces for calling these functions. Ultimately, when it is necessary to implement a specific function, the corresponding standard functional classes are directly called through these interfaces, and the corresponding implementation methods are passed, thereby ensuring efficient execution and flexible application of the functions. This embodiment not only improves the reusability and inheritance of functions, but also provides convenience for iterative optimization and upgrading of functions, making functional implementation more flexible and efficient.
[0056] It should be noted that the execution subject of the embodiment of the present application may be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or an electronic device capable of realizing the above functions, an electronic control unit, etc. The following takes the electronic control unit as an example to illustrate this embodiment and the following embodiments.
[0057] Based on this, the embodiment of the present application provides an object-oriented function calling method, referring to Figure 1 , Figure 1 This is a flowchart of the first embodiment of the object-oriented function calling method of the present application.
[0058] In this embodiment, the object-oriented function calling method includes steps S10 to S30:
[0059] Step S10, inputting the functional requirements into the target functional feature class extraction model, extracting and classifying the functional features of the functional requirements, obtaining an ordered feature graph reflecting the functional feature class, and forming a functional class;
[0060] It should be noted that the functional requirements can be a description of the specific functions and performances expected by the user or system for the automotive product or other system. These requirements are usually based on the user's operation scenario, the expected operation results, and the operating constraints, such as turning on the performance mode. The target functional feature class extraction model can be a model built using a neural network or other machine learning technology, the purpose of which is to extract and identify key features in the functional requirements and classify these features to better understand and implement the functional requirements. Functional feature extraction can be the process of identifying key features and attributes from functional requirements. Functional feature classification can be grouping these extracted features into different categories based on their similarity or correlation to form meaningful functional feature classes. An ordered feature graph can be a visual representation generated during the functional feature extraction and classification process, which shows the relationship and structure between different functional feature classes. This graph can help developers understand the complexity of functional requirements and their mutual relationships. Functional classes can be a set of functions with similar characteristics formed according to the results of functional feature extraction and classification. These functional classes can be used as basic modules for building system or product functions, which helps to achieve functional reuse, inheritance and iterative optimization. By analyzing, understanding and implementing complex functional requirements through these operating systems, the modularization and standardization of functions can be improved, thereby improving development efficiency and product quality.
[0061] It can be understood that the specific functional and performance expectations of users or systems for products or services are input into a specially designed model, which analyzes the input functional requirements by applying neural networks or other machine learning techniques, identifies key functional features, and classifies these features according to certain logic and relationships. Through this process, an ordered feature graph is generated, which clearly shows the associations and hierarchical structures between different functional features. Ultimately, these ordered features are organized into functional classes, providing standardized and modular building blocks for subsequent functional implementation and system design. This approach helps to improve the reusability, reliability and ease of iterative optimization of functions, thereby optimizing the product development process and improving product quality.
[0062] As an example, the target function feature class extraction model includes: an input layer and an output layer, wherein the input layer is a pooling layer, the output layer is a competition layer, and the input layer obtains the winning neuron of the output layer through a weight vector; the function requirements are input into the target function feature class extraction model, and the function features are extracted and classified for the function requirements to obtain an ordered feature graph reflecting the function feature class, and before forming the function class, it also includes: obtaining the function requirements and the initial function feature class extraction model, and constructing input layer neurons based on the number of the function requirements, and the number of the input layer neurons is the same as the number of the function requirements; obtaining an initial weight vector based on the response characteristics of the input layer neurons to the function requirements; obtaining an initial winning neuron based on the input layer neurons and the initial weight vector to form an ordered arrangement of initial neurons; adjusting the initial weight vector based on the initial ordered arrangement of neurons to obtain the target function feature class extraction model.
[0063] The input layer is the first layer of the neural network model, which receives external input signals, namely functional requirements. The output layer is the last layer of the neural network, which is responsible for generating the final output, namely the classification results of functional features. The initial functional feature class extraction model can be a neural network model built based on functional requirements before starting the functional feature extraction process. This model is the starting point of the extraction process, and it will be continuously adjusted and optimized as the learning process proceeds. The architecture of the functional feature class extraction model can be seen in Figure 2 . The initial weight vector can be the weight vector connecting the input layer and the output layer of the neural network, and these weights are assigned initial values when the model is initialized. These weights will be adjusted according to the responses during the learning process to optimize the extraction and classification of functional features. The initial winning neuron can be the neuron in the output layer of the neural network that is selected as the most sensitive to the current functional requirements based on the initial weight vector and the response of the input layer neurons. This neuron "wins" the competition and represents the main features of the current functional requirements. Among them, the winning neuron can be obtained by the formula:
[0064] Z i,j =max(X i Y j )
[0065] Where X i refers to the input layer neurons, Y jRefers to the weight vector of the output layer for the input layer neurons. The initial orderly arrangement of neurons can refer to the arrangement order of neurons in the output layer, which is formed according to the position of the initial winning neurons and the response to the functional requirements. This arrangement reflects the sensitivity and relevance of neurons to the functional requirements and is the basis for the subsequent adjustment of the weight vector. The individual neurons of the input layer can be a single processing unit that constitutes the input layer in the neural network model. These neurons receive external input signals, i.e., functional requirements, and pass these signals to the next layer of the network. Each individual neuron in the input layer corresponds to a specific functional requirement, and the number of individual neurons in the input layer is the same as the number of functional requirements.
[0066] Specifically, the target functional feature class extraction model is a neural network structure including an input layer and an output layer, in which the input layer is used as a collection layer to receive functional requirements, and the output layer is used as a competition layer to determine which neurons are most sensitive to these requirements. Before the functional requirements are input into the model for feature extraction and classification, it is first necessary to construct input layer neurons equal to the number of functional requirements. Then, based on the responses of these neurons to the functional requirements, an initial weight vector is generated. Using these weight vectors and the responses of the input layer neurons, the model determines an initial winning neuron that is most sensitive to the current functional requirement in the output layer. Next, the model forms an initial orderly arrangement of neurons based on the position of the winning neuron and the responses of other neurons. Finally, the initial weight vector is adjusted according to this orderly arrangement to optimize the model, thereby obtaining a target functional feature class extraction model that can more accurately reflect the functional feature class and form the functional class. This process is iterative, and as the model receives and processes more functional requirements, it will continue to learn and adjust to improve the accuracy and efficiency of its extraction and classification functions.
[0067] As an example, the initial weight vector is adjusted according to the orderly arrangement of the initial neurons to obtain a target functional feature class extraction model, including: taking the initial winning neuron as the center, obtaining the output layer range neurons according to a preset radius; obtaining the target weight vector according to the distance between the output layer range neurons and the initial winning neuron, the preset radius and the preset weight vector adjustment coefficient; using the target weight vector as the center vector of the orderly arrangement of the initial neurons; and obtaining the target functional feature class extraction model based on the center vector and the initial functional feature class extraction model.
[0068] Among them, the preset radius can be the range of neurons in a circular area determined with the winning neuron as the center in the output layer of the neural network. This radius is used to define the influence range of the winning neuron, that is, which other neurons it affects the weight adjustment. The output layer range neurons can be all output layer neurons within the preset radius. These neurons are affected by the winning neuron, and their weights will be adjusted according to the distance from the winning neuron. The preset weight vector adjustment coefficient can be a parameter for adjusting the weight, which determines the amplitude of the weight adjustment. This coefficient, together with the distance between neurons and the preset radius, determines the intensity of the weight adjustment. The target weight vector can be a new weight vector calculated based on the distance between the output layer range neurons and the initial winning neuron, the preset radius and the preset weight vector adjustment coefficient. This weight vector reflects the adjusted weight and is used to optimize the performance of the neural network. The center vector can be a weight vector used to represent a specific functional feature class in the output layer of the neural network. In this case, the target weight vector becomes the center vector of the orderly arrangement of the initial neurons, which represents the core features of the functional feature class. The weight vector is adjusted by drawing a circle with a set radius with the winning neuron as the center. All neurons within the area have their weights adjusted to varying degrees according to their distance from the winning neuron. At the beginning of the extraction phase, the initial value of this radius is large, and its value continues to shrink as the number of learning increases, eventually shrinking to a radius of zero. The formula can be:
[0069] Y j , =Y j δ(r i,j )
[0070] where Y j , is the adjusted target weight vector, M i,j is the preset radius, r i,j is the distance between the output layer range neuron and the initial winning neuron, δ is the weight vector adjustment coefficient related to r, which is a monotonic function. The smaller r is, the larger δ is.
[0071] Specifically, during the training process of the neural network model, an initial winning neuron is first determined, which has the most significant response to a specific functional requirement in the output layer. Then, with this initial winning neuron as the center, a preset radius is set to determine the range of neurons affected in the output layer, namely, the output layer range neurons. Next, a new weight vector, namely, the target weight vector, is calculated based on the distance between these neurons and the initial winning neuron, the preset radius, and a preset weight vector adjustment coefficient. This target weight vector reflects the adjustment of the initial weight vector, aiming to optimize the network's recognition and classification of functional features. Subsequently, this target weight vector is used as the center vector of the orderly arrangement of neurons in the output layer, which means that it represents the core features of the functional feature class. Finally, this center vector is combined with the initial functional feature class extraction model to form a new, optimized target functional feature class extraction model. This model can extract and classify functional requirements more accurately, thereby improving the performance and efficiency of the entire system. In this way, the neural network can adaptively learn and adjust to better meet the complexity and diversity of functional requirements.
[0072] Step S20, encapsulating the function class through abstraction to form a standard function class, wherein the standard function class at least includes functional features for entering and exiting a corresponding function step, actions for implementing the corresponding function step, and a calling interface;
[0073] It should be noted that a standard function class can be a general and reusable function module extracted from a function class through an abstract method. It is designed to be reused in different projects or systems to achieve specific functional requirements. A standard function class usually contains all the elements required to implement a certain function, making it an independent and manageable functional unit. Functional features can be the basic attributes and conditions that constitute a function class, which define the behavior and performance of the function. In a standard function class, functional features include the conditions for entering and exiting the corresponding functional steps, which determine when the function is activated or terminated. A call interface can be a convention or contract that allows external systems or modules to interact with a standard function class. It defines how to access and use the functions defined in a standard function class, including passing necessary parameters, methods for triggering function execution, and mechanisms for receiving function execution results. The call interface is the key to achieving functional modularization and decoupling, which enables different function classes to be developed and maintained independently while ensuring that they can be seamlessly integrated into a larger system. By encapsulating function classes into standard function classes and defining clear functional features and call interfaces, the modularity, maintainability, and scalability of software systems can be improved. This approach facilitates rapid development, testing, and deployment of functions, while also supporting function reuse and iterative optimization of the system.
[0074] It can be understood that according to specific functional requirements, the function classes are encapsulated into standardized function modules through the abstraction process, which are called standard function classes. Each standard function class contains clearly defined functional characteristics, which specify when the function is activated (entry conditions) and when it is completed (exit conditions). In addition, the standard function class also contains the specific actions or operation steps required to implement these functions, as well as the calling interface for interacting with the outside world. Such encapsulation not only ensures the consistency and predictability of the functions, but also enables these function classes to be easily reused and integrated in different systems or applications by providing standardized interfaces.
[0075] As an example, a standard function class includes: based on user demand analysis, defining a standard function class, wherein the defined standard function class includes at least user usage scenarios, operations under the user usage scenarios, results of operations and corresponding restrictions.
[0076] Among them, user usage scenarios can be specific situations in which users interact with products or systems. These scenarios describe under what circumstances users will use specific functions, including users' activities, goals, environments, and contexts. Operations in user usage scenarios can be specific actions or behaviors performed by users in specific usage scenarios. These operations are the interaction steps that users perform to achieve a certain goal or complete a certain task. The results of the operation can be the state or output that users expect to achieve after performing the operation. This includes how the product or system responds to the user's operations and what functions or goals the user can achieve through these operations. Constraints can be various constraints that may affect the execution or results of operations in user usage scenarios. These conditions may include technical limitations, resource limitations, environmental factors, safety requirements, etc. When defining standard function classes, considering these elements helps ensure that the function classes can meet the actual needs of users, while taking into account possible limitations and constraints during the design and implementation process. This approach helps create more user-friendly, practical and reliable functions, while also supporting the standardization and modularization of functions for easy reuse in different projects and systems. For example, a user usage scenario may be "starting the car on a winter morning." In this scenario, the user needs to start the car and start driving in a low-temperature environment. The operations in the user scenario may include inserting the key, turning the ignition switch, pressing the clutch (if it is a manual transmission car), starting the engine, etc. The result of the operation may be that the car can start smoothly, the engine runs smoothly, the vehicle is ready to drive, and the vehicle system (such as the heating system) starts to work to increase the temperature inside the car. The corresponding restrictions may include sufficient battery power, engine lubricant viscosity suitable for low temperatures, effective antifreeze, and the external temperature is not lower than the minimum temperature limit for starting the car.
[0077] Specifically, based on an in-depth analysis of user needs, a series of standard functional classes are defined, which describe in detail the specific scenarios when using the product or system, including the operations to be performed in these scenarios, the expected results, and the restrictions that need to be followed during the operation. Such a definition ensures that the functional classes can accurately reflect the actual needs and usage environment, while taking into account the constraints of technology and other aspects, thus providing clear guidance for developing functions that are both in line with expectations and feasible.
[0078] Step S30: when the standard function class needs to be used, the standard function class is directly called through the calling interface, and the implementation method corresponding to the standard function class is transmitted through the calling interface.
[0079] It is understandable that when a system or application needs to perform a specific function, it calls the corresponding standard function class through a predefined interface. This interface acts as a communication bridge, not only triggering the execution of the function class, but also passing all necessary information and parameters, which determine the specific implementation of the function class. For example, in a car's navigation system, when a user requests route guidance, the system calls the navigation function class through an interface and passes the starting point, end point, and other relevant parameters to implement customized navigation services. This design allows the function class to be reused in different ways in different contexts, while keeping the code modular and easy to maintain.
[0080] As an example, when the standard function class needs to be used, the standard function class is directly called through the calling interface, and the implementation method corresponding to the standard function class is delivered through the calling interface, including: obtaining input data, the input data including sensor data and user instructions; based on the standard function class, obtaining function attributes and function methods; based on the input data and the standard function class, obtaining output results, the output results including operation results and status reports; based on the input data, the function attributes, the function methods and the output results, obtaining a calling interface; and delivering the implementation method corresponding to the standard function class through the calling interface.
[0081] Among them, input data can be information to be processed in a car or other automated system, and input data usually includes various sensor data and user instructions. Sensor data can be information collected by sensors inside and outside the vehicle, such as speed, temperature, position, pressure, etc., which reflect the real-time status and environmental conditions of the vehicle. User instructions can be commands or requests issued by users through various interfaces (such as buttons, touch screens, voice commands, etc.), such as start, stop, accelerate, decelerate, etc. Function attributes can be attributes defined in standard function classes, which describe the characteristics and behaviors of functions, such as the name, purpose, input parameters, output parameters, etc. of the function. Function methods can be operations or processes defined in standard function classes, which describe how to implement functions, including execution steps, logic, algorithms, etc. Output results can be results generated based on the definition of input data and function classes. These results reflect the effect and status of function execution. Operation results can be specific results after the function is executed, such as the response of the vehicle, the completion of the task, etc. Status reports can be detailed information about the status provided after the function is executed, such as error codes, warning information, performance indicators, etc.
[0082] Specifically, firstly, data from various sensors and user instructions are collected, which constitute the input data of the system. Then, the predefined standard function classes are used to determine the properties and methods required to implement specific functions. Then, the corresponding functions are executed and output results are generated by combining the input data and the standard function classes. These results include specific operation results and system status reports. Finally, according to the input data, function attributes, function methods, and output results, the specific implementation methods of how to pass these functions by calling the interface are determined. Such a design responds to user instructions and sensor data in a standardized and modular way, ensuring the accurate execution of functions and the effective transmission of information.
[0083] The present embodiment provides an object-oriented function calling method, which obtains an ordered feature graph by inputting the function requirements into the target function feature class extraction model, reflecting different function feature classes, thereby helping to form clearly defined function classes. Then, based on these function classes, they are encapsulated into standard function classes through an abstract method. These standard function classes not only include the functional features required to enter and exit specific function steps, but also cover the specific actions required to implement these function steps, as well as the standard interfaces for calling these functions. Finally, when it is necessary to implement a specific function, the corresponding standard function classes are directly called through these interfaces, and the corresponding implementation methods are passed, thereby ensuring efficient execution and flexible application of the function. The present embodiment not only improves the reusability and inheritance of the function, but also provides convenience for iterative optimization and upgrading of the function, making the function implementation more flexible and efficient.
[0084] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as those in the above-mentioned embodiment 1 can refer to the above introduction, and will not be repeated later. Figure 3 , Figure 3 This is a flow chart of the second embodiment of the object-oriented function calling method of the present application. Step S10 of the object-oriented function calling method includes steps S11 to S13:
[0085] Step S11, obtaining individual neurons of the input layer according to the functional requirements input into the target functional feature class extraction model, wherein the number of individual neurons of the input layer is equal to the number of the functional requirements;
[0086] It can be understood that in the target functional feature class extraction model, the individual neurons in the input layer are the starting point of the model, and each neuron corresponds to a specific functional requirement. This means that if N functional requirements are input into the model, then there will be N individual neurons in the input layer. The role of these neurons is to receive and represent functional requirements, providing a basis for the subsequent feature extraction and classification process of the model. In this way, the model is able to map each functional requirement to a neuron, thus providing a structured approach to understanding and processing complex functional requirements.
[0087] Step S12, obtaining an input layer individual neuron region according to the response of the input layer individual neurons to the functional requirement;
[0088] It should be noted that the input layer individual neuron region can be a group of neurons in the input layer that respond to specific functional requirements. These neurons are divided into a region based on their response characteristics to the input signal, and the neurons in this region show similar behaviors or activation patterns when processing and responding to functional requirements. In the process of functional feature extraction, each individual neuron in the input layer will produce a certain response to the input functional requirements. According to the intensity and pattern of these responses, neurons with similar response characteristics can be classified into the same region. Such regional division helps the subsequent neuron competition and feature classification process, so that the model can more effectively identify and abstract the key features of functional requirements, and then form an ordered feature map and functional class.
[0089] It can be understood that in the neural network model, the input layer individual neuron region refers to a group of neurons that have similar responses to specific functional requirements. Based on the response patterns of these neurons, the model is able to generate an ordered feature map that shows the interrelationships and organizational structures between different functional features. By analyzing this ordered feature map, functional requirements with common characteristics can be identified and functional classes can be formed accordingly. These functional classes are high-level abstractions of functional requirements, which summarize a group of functions with similar properties and behaviors, thereby providing standardized and modular building blocks for subsequent functional implementation and system design. This approach helps to improve the reusability, maintainability and scalability of functions.
[0090] Step S13, obtaining an ordered feature map reflecting the functional feature class according to the individual neuron regions of the input layer to form a functional class.
[0091] It can be understood that in the process of extracting functional features from a neural network, the individual neuron regions of the input layer represent populations of neurons that have similar responses to specific functional requirements. By analyzing the response patterns of these neurons, the model is able to construct an ordered feature graph that maps the associations and hierarchical structures between different functional features. This ordered feature graph is further used to form functional classes, i.e., grouping functional requirements with common characteristics into one category, thus providing a structured and systematic approach to the design and implementation of functions. This approach helps to standardize functional modules and improve their reusability and adaptability in different applications.
[0092] As an example, a target weight vector of a reference individual neuron for an output layer is obtained, wherein the reference individual neuron is a neuron in an individual neuron region of the input layer; a winning neuron is obtained based on the target weight vector and the reference individual neuron; and an ordered feature map reflecting a functional feature class is obtained according to a position of the winning neuron and a position of a target individual neuron to form a functional class, wherein the target individual neuron is a neuron in the output layer that is close to a position of the winning neuron.
[0093] Among them, the target weight vector can be a weight vector used for comparison and competition in the output layer, representing a potential response pattern of the functional requirement in the neural network, which is formed in the process of learning and adjusting the model and is used to guide the extraction and classification of functional features. The reference individual neurons can be neurons in the input layer that respond to specific functional requirements, and they constitute the input layer individual neuron region. The response characteristics of these neurons are used to compare with the target weight vector of the output layer to help determine the output layer neurons that are most relevant to the current functional requirements. The winning neuron can be the neuron in the output layer that best matches the response pattern of the reference individual neuron in the input layer. This matching process usually involves calculating the similarity or distance between the input layer and the output layer neurons. The winning neuron is the neuron that "wins" in this competition and represents the main characteristics of the current functional requirements. The target individual neurons can refer to neurons in the output layer that are close to the winning neurons in the position, and they together with the winning neurons constitute the representation of the functional feature class in the ordered feature map. The weight vector adjustment of these neurons is affected by the winning neurons, and they together form an ordered feature map reflecting specific functional characteristics. Through this process, the neural network can identify and classify functional requirements, form an ordered feature map, and then construct functional classes that can reflect functional characteristics. These functional classes can be used for further system design and functional implementation, improving the modularity and reusability of the system.
[0094] Specifically, in the process of extracting functional features of neural networks, neurons in the input layer that respond to specific functional requirements are first identified. These neurons constitute the individual neuron region of the input layer. Then, these reference individual neurons are compared with the target weight vector of the output layer to determine which output layer neuron best matches the reference neuron of the input layer. This best matching output layer neuron is called the winning neuron. Next, based on the position of the winning neuron, neurons in the output layer that are close to its position are identified. These neurons are called target individual neurons. Finally, by analyzing the distribution and relationship between the winning neurons and the target individual neurons, an ordered feature graph is constructed, which reflects the structure and organization of different functional feature classes. In this way, a functional class that can represent specific functional requirements is formed, which provides a basis for subsequent functional implementation and system design.
[0095] This embodiment first takes the functional requirements as input, and each functional requirement corresponds to an individual neuron in the input layer. Therefore, the number of neurons in the input layer is equal to the number of functional requirements, ensuring that the model can receive and allocate an independent processing unit for each functional requirement. Then, the model identifies the neuron group with similar response patterns based on the response of the individual neurons in the input layer to the functional requirements, forming the individual neuron region of the input layer. These regions represent the preliminary classification of functional requirements in the neural network and are the basis for subsequent feature extraction. Finally, based on these individual neuron regions in the input layer, the model constructs an ordered feature map that reflects the relationship and structure between different functional feature classes. Through this ordered feature map, the model can form functional classes and classify functional requirements with common characteristics into one class, thereby realizing the standardization and modular abstraction of functions. This embodiment maps the functional requirements to the input layer of the neural network, and then divides the regions according to the response patterns of the neurons, and finally constructs an ordered feature map and forms functional classes. This process realizes the conversion from specific functional requirements to abstract functional features, and provides a systematic method for the design, implementation and reuse of functions, which helps to improve the modularization and standardization of functions, thereby optimizing the product development process and improving product quality.
[0096] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the object-oriented function calling method of the present application. More simple transformations based on this technical concept are all within the scope of protection of the present application.
[0097] This application also provides an object-oriented function calling device, please refer to Figure 4 , the object-oriented function calling device comprises:
[0098] The extraction module 10 is used to input the functional requirements into the target functional feature class extraction model, extract and classify the functional features of the functional requirements, obtain an ordered feature graph reflecting the functional feature class, and form a functional class;
[0099] The encapsulation module 20 is used to encapsulate the function class to form a standard function class through abstraction, wherein the standard function class at least includes functional characteristics of entering and exiting corresponding function steps, actions for implementing corresponding function steps, and a calling interface;
[0100] The calling module 30 is used to directly call the standard function class through the calling interface when the standard function class needs to be used, and to transfer the implementation method corresponding to the standard function class through the calling interface.
[0101] The object-oriented function calling device provided by the present application adopts the object-oriented function calling method in the above embodiment, which can solve the technical problem of how to improve the reusability of function definition. Compared with the prior art, the beneficial effects of the object-oriented function calling device provided by the present application are the same as the beneficial effects of the object-oriented function calling method provided by the above embodiment, and other technical features in the object-oriented function calling device are the same as the features disclosed in the above embodiment method, which will not be repeated here.
[0102] The present application provides an object-oriented function calling device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the object-oriented function calling method in the above-mentioned embodiment 1.
[0103] Reference below Figure 5 , which shows a schematic diagram of the structure of an object-oriented function calling device suitable for implementing the embodiment of the present application. The object-oriented function calling device in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 5 The object-oriented function calling device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0104] like Figure 5As shown, the object-oriented function call device may include a processing device 1001 (e.g., a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the object-oriented function call device are also stored. The processing device 1001, ROM1002, and RAM1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the object-oriented function calling device to communicate with other devices wirelessly or by wire to exchange data. Although the figure shows an object-oriented function calling device with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or provided instead.
[0105] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.
[0106] The object-oriented function calling device provided by the present application adopts the object-oriented function calling method in the above embodiment, which can solve the technical problem of how to improve the reusability of function definition. Compared with the prior art, the beneficial effects of the object-oriented function calling device provided by the present application are the same as the beneficial effects of the object-oriented function calling method provided by the above embodiment, and other technical features in the object-oriented function calling device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.
[0107] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.
[0108] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
[0109] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, wherein the computer-readable program instructions are used to execute the object-oriented function calling method in the above-mentioned embodiment.
[0110] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the above.
[0111] The computer-readable storage medium may be included in the object-oriented function calling device; or may exist independently without being assembled into the object-oriented function calling device.
[0112] The above-mentioned computer-readable storage medium carries one or more programs. When the above-mentioned one or more programs are executed by an object-oriented function calling device, the object-oriented function calling device: inputs the function requirements into the target function feature class extraction model, extracts and classifies the function requirements, obtains an ordered feature graph reflecting the function feature class, and forms a function class; based on the function class, encapsulates it through abstraction to form a standard function class, and the standard function class at least includes the function features of entering and exiting the corresponding function steps, the actions of implementing the corresponding function steps, and a calling interface; when the standard function class needs to be used, the standard function class is directly called through the calling interface, and the implementation method corresponding to the standard function class is transmitted through the calling interface.
[0113] Computer program code for performing the operations of the present application may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0114] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0115] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.
[0116] The readable storage medium provided by the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned object-oriented function calling method, and can solve the technical problem of how to improve the reusability of function definition. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided by the present application are the same as the beneficial effects of the object-oriented function calling method provided by the above-mentioned embodiment, and will not be repeated here.
[0117] The present application also provides a computer program product, including a computer program, which implements the steps of the above-mentioned object-oriented function calling method when executed by a processor.
[0118] The computer program product provided by the present application can solve the technical problem of how to improve the reusability of function definition. Compared with the prior art, the beneficial effects of the computer program product provided by the present application are the same as the beneficial effects of the object-oriented function calling method provided by the above embodiment, which will not be repeated here.
[0119] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.
Claims
1. An object-oriented function calling method, characterized in that: The method comprises: Input the functional requirements into the target functional feature class extraction model, extract and classify the functional features of the functional requirements, obtain an ordered feature graph reflecting the functional feature class, and form a functional class; According to the function class, encapsulate it through abstraction to form a standard function class, wherein the standard function class at least includes functional characteristics of entering and exiting corresponding function steps, actions for implementing corresponding function steps, and a calling interface; When the standard function class needs to be used, the standard function class is directly called through the calling interface, and the implementation method corresponding to the standard function class is transferred through the calling interface.
2. The method according to claim 1, characterized in that The standard function class includes: defining the standard function class based on user demand analysis, wherein the defined standard function class at least includes user usage scenarios, operations under the user usage scenarios, results of operations and corresponding restriction conditions.
3. The method according to claim 1, characterized in that The function requirement is input into the target function feature class extraction model, and the function feature is extracted and classified for the function requirement to obtain an ordered feature graph reflecting the function feature class, thereby forming a function class, including: According to the functional requirements input into the target functional feature class extraction model, individual neurons of the input layer are obtained, and the number of individual neurons of the input layer is equal to the number of the functional requirements; According to the response of the individual neurons of the input layer to the functional requirements, the individual neuron regions of the input layer are obtained; According to the individual neuron regions of the input layer, an ordered feature map reflecting the functional feature class is obtained to form a functional class.
4. The method according to claim 3, characterized in that The step of obtaining an ordered feature map reflecting the functional feature class based on the individual neuron regions of the input layer to form a functional class includes: Obtaining a target weight vector of a reference individual neuron for an output layer, wherein the reference individual neuron is a neuron in an individual neuron region of the input layer; Obtaining a winning neuron based on the target weight vector and the reference individual neuron; According to the position of the winning neuron and the position of the target individual neuron, an ordered feature map reflecting the functional feature class is obtained to form a functional class, and the target individual neuron is a neuron in the output layer that is close to the position of the winning neuron.
5. The method according to claim 1, characterized in that The target function feature class extraction model includes: an input layer and an output layer, wherein the input layer is a pooling layer, the output layer is a competition layer, and the input layer obtains the winning neuron of the output layer through the weight vector; the function requirements are input into the target function feature class extraction model, and the function requirements are extracted and classified to obtain an ordered feature graph reflecting the function feature class. Before forming the function class, it also includes: Acquire functional requirements and an initial functional feature class extraction model, and construct input layer neurons based on the number of functional requirements, wherein the number of input layer neurons is the same as the number of functional requirements; Obtaining an initial weight vector according to the response characteristics of the input layer neurons to the functional requirements; Based on the input layer neurons and the initial weight vector, initial winning neurons are obtained to form an orderly arrangement of initial neurons; The initial weight vector is adjusted according to the orderly arrangement of the initial neurons to obtain a target functional feature class extraction model.
6. The method according to claim 5, characterized in that The step of adjusting the initial weight vector according to the orderly arrangement of the initial neurons to obtain a target function feature class extraction model includes: Taking the initial winning neuron as the center, obtaining the output layer range neurons according to the preset radius; Obtaining a target weight vector according to the distance between the output layer range neuron and the initial winning neuron, the preset radius and the preset weight vector adjustment coefficient; Using the target weight vector as the center vector of the orderly arrangement of the initial neurons; Based on the central vector and the initial functional feature class extraction model, a target functional feature class extraction model is obtained.
7. The method according to claim 1, characterized in that When the standard function class needs to be used, the standard function class is directly called through the calling interface, and the implementation method corresponding to the standard function class is transmitted through the calling interface, including: Acquiring input data, wherein the input data includes sensor data and user instructions; Based on the standard function class, obtain function attributes and function methods; Based on the input data and the standard function class, an output result is obtained, wherein the output result includes an operation result and a status report; Based on the input data, the function attributes, the function method and the output result, a calling interface is obtained; The implementation method corresponding to the standard function class is transmitted through the calling interface.
8. An object-oriented function calling device, characterized in that: The device comprises: An extraction module is used to input the functional requirements into the target functional feature class extraction model, extract and classify the functional features of the functional requirements, obtain an ordered feature graph reflecting the functional feature class, and form a functional class; An encapsulation module, used to encapsulate the function class through abstraction to form a standard function class, wherein the standard function class at least includes functional features for entering and exiting corresponding function steps, actions for implementing corresponding function steps, and a calling interface; The calling module is used to directly call the standard function class through the calling interface when the standard function class needs to be used, and to transfer the implementation method corresponding to the standard function class through the calling interface.
9. An object-oriented function calling device, characterized in that: The device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the object-oriented function calling method according to any one of claims 1 to 7.
10. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the object-oriented function calling method according to any one of claims 1 to 7 are implemented.