CN119902747B - Proxy method and device of software component, electronic equipment and storage medium - Google Patents
Proxy method and device of software component, electronic equipment and storage mediumInfo
- Publication number
- CN119902747B CN119902747B CN202510378223.XA CN202510378223A CN119902747B CN 119902747 B CN119902747 B CN 119902747B CN 202510378223 A CN202510378223 A CN 202510378223A CN 119902747 B CN119902747 B CN 119902747B
- Authority
- CN
- China
- Prior art keywords
- port
- proxy
- communication
- software component
- proxied
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/20—Software design
- G06F8/24—Object-oriented
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/25—Integrating or interfacing systems involving database management systems
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/70—Software maintenance or management
- G06F8/73—Program documentation
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/54—Interprogram communication
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Software Systems (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Databases & Information Systems (AREA)
- Data Mining & Analysis (AREA)
- Library & Information Science (AREA)
- Computer And Data Communications (AREA)
- Stored Programmes (AREA)
Abstract
Description
技术领域Technical Field
本申请涉及车辆软件架构技术领域,尤其涉及一种软件组件的代理方法、装置、电子设备及存储介质。The present application relates to the technical field of vehicle software architecture, and in particular to a software component proxy method, device, electronic device, and storage medium.
背景技术Background Art
SOA(Service-Oriented Architecture,面向服务的架构)是一种软件设计和软件架构模式,它将应用程序的不同服务通过定义良好的接口和协议进行组合。这些服务是独立的、可重用的,它们可以跨多个系统和组织进行交互。SOA的目标是提高软件系统的灵活性、可扩展性和可维护性。SOA (Service-Oriented Architecture) is a software design and architecture pattern that combines an application's diverse services through well-defined interfaces and protocols. These services are independent, reusable, and can interact across multiple systems and organizations. SOA aims to improve the flexibility, scalability, and maintainability of software systems.
其中,对于应用层功能的实现,其通过Atomic SWC(Atomic Software Componen,原子软件组件)实现,一般一个功能服务可对应一个原子软件组件,而该原子软件组件与外部服务器的数据交互则依赖于Composition SWC(组合软件组件)。其中,需要将原子软件组件的端口代理到组合软件组件外部端口,以使原子软件组件直接通过该组合软件组件的外部端口与外部控制器进行数据交互。Application-layer functions are implemented through Atomic Software Components (Atomic SWCs). Generally, one functional service corresponds to one Atomic SWC, while data exchange between the Atomic SWC and external servers relies on Composition SWCs. The Atomic SWC's port must be proxied to the Composition SWC's external port, allowing the Atomic SWC to directly exchange data with external controllers through the Composition SWC's external port.
相关技术中,在对原子软件组件的端口进行代理时,一般由架构设计工程师对每一个在组合软件组件实例化后的原子软件组件进行端口检查,通过查询API(ApplicationProgramming Interface,应用程序编程接口)服务详表中服务的通信行为来对该端口在工具中进行手动代理。In related technologies, when proxying the ports of atomic software components, architecture design engineers generally perform port checks on each atomic software component after the composite software component is instantiated, and manually proxy the port in the tool by querying the communication behavior of the service in the API (Application Programming Interface) service details table.
然而,上述手动代理的方式整个过程虽然是有可行性的,但是SOA架构设计需要开发的服务有成百上千个,每个服务又有1到几十上百个不等的端口,因此在代理工作中,其工作量较为庞大,且容易出现失误,影响用户体验。However, although the entire process of the above manual proxy method is feasible, the SOA architecture design requires the development of hundreds of services, and each service has one to dozens or hundreds of ports. Therefore, the workload in the proxy work is relatively large and it is easy to make mistakes, affecting the user experience.
发明内容Summary of the Invention
本申请提供了一种软件组件的代理方法、装置、电子设备及存储介质,以解决现有技术中手动将原子软件组件的端口代理至组合软件组件的方法工作量较为庞大,且容易出现失误,影响用户体验的技术问题。The present application provides a software component proxy method, device, electronic device and storage medium to solve the technical problems in the prior art of manually proxying the ports of atomic software components to combined software components, which is labor-intensive, prone to errors and affects user experience.
第一方面,本申请提供了一种软件组件的代理方法,所述方法包括:In a first aspect, the present application provides a software component proxy method, the method comprising:
获取预设的架构设计模组生成的代理文档,所述代理文档包括预设控制器对应的组合软件组件、所述预设控制器包括的多个原子软件组件;Obtaining a proxy document generated by a preset architecture design module, wherein the proxy document includes a combined software component corresponding to a preset controller and multiple atomic software components included in the preset controller;
对所述代理文档进行解析,得到包含多个所述原子软件组件的端口信息的端口数据库;Parsing the proxy document to obtain a port database containing port information of a plurality of the atomic software components;
获取通信行为汇总表,所述通信行为汇总表包括所述预设控制器与其他控制器之间的通信行为;Obtaining a communication behavior summary table, wherein the communication behavior summary table includes communication behaviors between the preset controller and other controllers;
根据所述通信行为汇总表,从所述端口数据库中确定待代理端口,并为所述待代理端口增加与所述组合软件组件的通信端口之间的代理连线,以使所述待代理端口通过所述通信端口与所述其他控制器进行通信。According to the communication behavior summary table, a port to be proxied is determined from the port database, and a proxy connection is added between the port to be proxied and the communication port of the combined software component, so that the port to be proxied communicates with the other controllers through the communication port.
作为一种可选的实现方式,对所述代理文档进行解析,得到包含多个所述原子软件组件的端口信息的端口数据库,包括:As an optional implementation, the proxy document is parsed to obtain a port database containing port information of multiple atomic software components, including:
通过预设的解析算法对所述代理文档进行解析,得到所述组合软件组件的组件信息,以及全部所述原子软件组件中,每一所述原子软件组件对应的端口信息;Parsing the proxy document using a preset parsing algorithm to obtain component information of the combined software component and port information corresponding to each of the atomic software components in all the atomic software components;
根据所述组件信息,将待代理的原子软件组件对应的端口信息写入预设的初始端口数据库,得到所述端口数据库。According to the component information, the port information corresponding to the atomic software component to be proxied is written into a preset initial port database to obtain the port database.
作为一种可选的实现方式,所述组件信息包括每一原子软件组件对应的实例,以及所述实例与所述原子软件组件之间的引用关系;As an optional implementation, the component information includes an instance corresponding to each atomic software component, and a reference relationship between the instance and the atomic software component;
根据所述组件信息,将待代理的原子软件组件对应的端口信息写入预设的初始端口数据库,得到所述端口数据库,包括:According to the component information, the port information corresponding to the atomic software component to be proxied is written into a preset initial port database to obtain the port database, including:
根据所述组件信息,遍历所述组合软件组件包括的每一实例;According to the component information, traverse each instance included in the combined software component;
针对遍历到的每一实例,根据所述实例对应的引用关系确定所述实例对应的目标原子软件组件;For each instance traversed, determine the target atomic software component corresponding to the instance according to the reference relationship corresponding to the instance;
确定所述目标原子软件组件是否存在预设的引子标签,所述引子标签用于表征对应的原子软件组件为引入的其他控制器的虚拟组件;Determining whether the target atomic software component has a preset introduction tag, where the introduction tag is used to indicate that the corresponding atomic software component is a virtual component of another controller introduced;
在确定所述目标原子软件组件不存在所述引子标签的情况下,将所述目标原子软件组件的端口信息存储至所述初始端口数据库;When it is determined that the target atomic software component does not have the primer tag, storing the port information of the target atomic software component in the initial port database;
在对所述组合软件组件包括的全部实例遍历完成后,得到所述端口数据库。After traversing all instances of the combined software component, the port database is obtained.
作为一种可选的实现方式,所述组件信息包括所述组合软件组件的代理连线信息,所述代理连线信息包括所述原子软件组件的端口、所述组合软件组件的通信端口,以及两者之间的代理信息;As an optional implementation, the component information includes proxy connection information of the combined software component, and the proxy connection information includes the port of the atomic software component, the communication port of the combined software component, and proxy information between the two;
根据所述通信行为汇总表,从所述端口数据库中确定待代理端口,包括:Determining the port to be proxied from the port database according to the communication behavior summary table includes:
根据所述通信行为汇总表,从所述端口数据库中查询当前的全部代理端口;其中,所述代理端口包括待代理端口和已代理端口;According to the communication behavior summary table, all current proxy ports are searched from the port database; wherein the proxy ports include ports to be proxied and ports that have been proxied;
根据所述代理连线信息,从全部所述代理端口中,确定待代理端口。According to the proxy connection information, a port to be proxyed is determined from all the proxy ports.
作为一种可选的实现方式,获取通信行为汇总表,包括:As an optional implementation method, obtain a communication behavior summary table, including:
对所述预设控制器对应的服务详情表进行解析,得到所述预设控制器与至少一个所述其他控制器之间的通信服务和通信关系;其中,所述通信关系用于表征在所述通信服务中所述预设控制器与所述其他控制器之间的发送方和接收方之间的关系;Parsing the service details table corresponding to the preset controller to obtain a communication service and a communication relationship between the preset controller and at least one of the other controllers; wherein the communication relationship is used to represent the relationship between the sender and the receiver between the preset controller and the other controller in the communication service;
根据所述通信服务和所述通信关系,生成通信行为汇总表。A communication behavior summary table is generated according to the communication service and the communication relationship.
作为一种可选的实现方式,根据所述通信行为汇总表,从所述端口数据库中查询当前的全部代理端口,包括:As an optional implementation, according to the communication behavior summary table, all current proxy ports are queried from the port database, including:
遍历所述端口数据库中的全部端口;Traversing all ports in the port database;
针对遍历到的每一端口,确定所述端口的端口属性,所述端口属性包括接收方属性或发送方属性;For each port traversed, determining a port attribute of the port, the port attribute including a receiver attribute or a sender attribute;
查询所述端口所属的通信服务名称;Query the name of the communication service to which the port belongs;
根据所述通信服务名称、所述端口属性,以及所述预设控制器的控制器名称,从所述通信行为汇总表中查询目标通信方;querying a target communication party from the communication behavior summary table according to the communication service name, the port attribute, and the controller name of the preset controller;
在确定所述目标通信方非所述预设控制器的情况下,将所述端口确定为代理端口。When it is determined that the target communication party is not the preset controller, the port is determined as a proxy port.
作为一种可选的实现方式,所述代理连线信息还包括所述原子软件组件的端口的端口属性,所述端口属性包括接收方属性或发送方属性;As an optional implementation, the proxy connection information further includes a port attribute of the port of the atomic software component, and the port attribute includes a receiver attribute or a sender attribute;
根据所述代理连线信息,从全部所述代理端口中,确定待代理端口,包括:Determining a port to be a proxy from all the proxy ports according to the proxy connection information includes:
针对每一所述代理端口,确定所述代理端口的目标端口属性;For each of the proxy ports, determining a target port attribute of the proxy port;
根据所述目标端口属性,从所述代理连线信息中确定多个目标代理连线信息;determining a plurality of target proxy connection information from the proxy connection information according to the target port attribute;
确定每一所述目标代理连线信息包括的端口是否为所述代理端口;Determining whether the port included in each target proxy connection information is the proxy port;
在确定全部所述目标代理连线信息包括的端口均非所述代理端口的情况下,将所述代理端口确定为待代理端口。When it is determined that all ports included in the target proxy connection information are not the proxy port, the proxy port is determined as the to-be-proxy port.
作为一种可选的实现方式,为所述待代理端口增加与所述组合软件组件的通信端口之间的代理连线,包括:As an optional implementation, adding a proxy connection between the to-be-proxy port and the communication port of the combined software component includes:
针对每一所述待代理端口,生成所述代理端口对应通信端口的通信端口标签;For each of the ports to be proxied, generating a communication port tag of the communication port corresponding to the proxy port;
将所述通信端口标签写入所述代理文档中用于记录通信端口的第一预设位置处;Writing the communication port label into the first preset position for recording the communication port in the proxy document;
生成所述代理端口和对应所述通信端口之间的代理连线标签;generating a proxy connection label between the proxy port and the corresponding communication port;
将所述代理连线标签写入所述代理文档中用于记录代理连线的第二预设位置处;Writing the proxy connection tag into a second preset location in the proxy document for recording the proxy connection;
所述方法还包括:The method further comprises:
将增加所述待代理端口与所述组合软件组件的通信端口之间的代理连线后的代理文档发送至所述架构设计模组,以使所述架构设计模组根据所述代理文档生成所述待代理端口与所述组合软件组件的通信端口之间的代理关系。The proxy document after adding the proxy connection between the port to be proxied and the communication port of the combined software component is sent to the architecture design module, so that the architecture design module generates a proxy relationship between the port to be proxied and the communication port of the combined software component according to the proxy document.
第二方面,本申请提供了一种软件组件的代理装置,所述装置包括:In a second aspect, the present application provides a software component agent device, the device comprising:
第一获取模块,用于获取预设的架构设计模组生成的代理文档,所述代理文档包括预设控制器对应的组合软件组件、所述预设控制器包括的多个原子软件组件,以及所述组合软件组件与部分所述原子软件组件之间的代理连线;A first acquisition module is configured to acquire a proxy document generated by a preset architecture design module, wherein the proxy document includes a composite software component corresponding to a preset controller, multiple atomic software components included in the preset controller, and proxy connections between the composite software component and some of the atomic software components;
解析模块,用于对所述代理文档进行解析,得到包含多个所述原子软件组件的端口信息的端口数据库;A parsing module, configured to parse the proxy document to obtain a port database containing port information of a plurality of the atomic software components;
第二获取模块,用于获取通信行为汇总表,所述通信行为汇总表包括所述预设控制器与其他控制器之间的通信行为;A second acquisition module is used to acquire a communication behavior summary table, wherein the communication behavior summary table includes communication behaviors between the preset controller and other controllers;
确定模块,用于根据所述通信行为汇总表,从多个所述端口数据库中确定待代理端口,并为所述待代理端口增加与所述组合软件组件的通信端口之间的代理连线,以使所述待代理端口通过所述通信端口与所述其他控制器进行通信。A determination module is used to determine the port to be proxied from the multiple port databases according to the communication behavior summary table, and add a proxy connection between the port to be proxied and the communication port of the combined software component, so that the port to be proxied communicates with the other controllers through the communication port.
第三方面,本申请提供了一种电子设备,包括:处理器和存储器,所述处理器用于执行所述存储器中存储的软件组件的代理程序,以实现第一方面中任一项所述的软件组件的代理方法。In a third aspect, the present application provides an electronic device comprising: a processor and a memory, wherein the processor is configured to execute an agent program of a software component stored in the memory to implement the agent method of the software component described in any one of the first aspects.
第四方面,本申请提供了一种存储介质,所述存储介质存储有一个或者多个程序,所述一个或者多个程序可被一个或者多个处理器执行,以实现第一方面中任一项所述的软件组件的代理方法。In a fourth aspect, the present application provides a storage medium storing one or more programs, which can be executed by one or more processors to implement the proxy method of the software component described in any one of the first aspects.
本申请实施例提供的技术方案,通过对架构设计模组针对预设控制器生成的代理文档进行解析,以获取预设控制器内多个原子软件组件的端口,并将端口写入端口数据库,之后,可根据该预设控制器与其他控制器之间的通信行为准确筛选端口数据库中需要代理且还未与组合软件组件构成代理连线的待代理端口,从而为该待代理端口构建与组合软件组件之间的代理连线,该过程中在不涉及用户操作的情况下,可以准确为控制器中待代理的原子软件组件构建与组合软件组件之间的代理关系,实现了自动且准确地构建控制器中的原子软件组件构建与组合软件组件之间的代理关系,提升用户体验。The technical solution provided by the embodiment of the present application parses the proxy document generated by the architecture design module for the preset controller to obtain the ports of multiple atomic software components in the preset controller, and writes the ports into the port database. Afterwards, the ports to be proxied in the port database that need to be proxied and have not yet formed a proxy connection with the combined software component can be accurately screened according to the communication behavior between the preset controller and other controllers, thereby building a proxy connection between the ports to be proxied and the combined software component. In this process, without involving user operation, the proxy relationship between the atomic software components to be proxied in the controller and the combined software component can be accurately built, thereby realizing the automatic and accurate construction of the proxy relationship between the atomic software components in the controller and the combined software component, thereby improving the user experience.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本申请的实施例,并与说明书一起用于解释本申请的原理。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.
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术文本中所需要使用的附图作简单地介绍,显而易见地,对于本领域普通技术人员而言,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the prior art texts. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
一个或多个实施例通过与之对应的附图中的图片进行示例性说明,这些示例性说明并不构成对实施例的限定,附图中具有相同参考数字标号的元件表示为类似的元件,除非有特别申明,附图中的图不构成比例限制。One or more embodiments are exemplarily illustrated by pictures in the corresponding drawings. These exemplifications do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings are represented as similar elements. Unless otherwise stated, the figures in the drawings do not constitute proportional limitations.
图1为本申请实施例提供的一种软件组件的代理方法的实施例流程图;FIG1 is a flow chart of an embodiment of a software component proxy method provided in an embodiment of the present application;
图2为本申请实施例提供的另一种软件组件的代理方法的实施例流程图;FIG2 is a flow chart of another embodiment of a software component proxy method provided in an embodiment of the present application;
图3为本申请实施例提供的又一种软件组件的代理方法的实施例流程图;FIG3 is a flow chart of an embodiment of another software component proxy method provided in an embodiment of the present application;
图4为本申请实施例提供的再一种软件组件的代理方法的实施例流程图;FIG4 is a flow chart of an embodiment of another software component proxy method provided in an embodiment of the present application;
图5为本申请实施例提供的一种软件组件的代理装置的实施例框图;FIG5 is a block diagram of an embodiment of an agent device for a software component provided in an embodiment of the present application;
图6为本申请实施例提供的一种电子设备的结构示意图。FIG6 is a schematic structural diagram of an electronic device provided in an embodiment of the present application.
具体实施方式DETAILED DESCRIPTION
为使本申请实施例的目的、技术方案和优点更加清楚,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地文本,显然,所文本的实施例是本申请的一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动的前提下所获得的所有其他实施例,都属于本申请保护的范围。To make the purpose, technical solutions, and advantages of the embodiments of this application more clear, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the embodiments described are part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
下文的公开提供了许多不同的实施例或例子用来实现本申请的不同结构。为了简化本申请的公开,下文中对特定例子的部件和设置进行文本。当然,它们仅仅为示例,并且目的不在于限制本申请。此外,本申请可以在不同例子中重复参考数字和/或字母。这种重复是为了简化和清楚的目的,其本身不指示所讨论各种实施例和/或设置之间的关系。The disclosure below provides many different embodiments or examples for implementing different structures of the present application. In order to simplify the disclosure of the present application, the components and settings of specific examples are described in detail below. Of course, these are merely examples and are not intended to limit the present application. In addition, the present application may repeat reference numbers and/or letters in different examples. Such repetition is for the purpose of simplicity and clarity and does not in itself indicate the relationship between the various embodiments and/or settings discussed.
为了解决现有技术中手动将原子软件组件的端口代理至组合软件组件的方法工作量较为庞大,且容易出现失误,影响用户体验的技术问题,本申请提供了一种软件组件的代理方法、装置、电子设备及存储介质,能通过对架构设计模组针对预设控制器生成的代理文档进行解析,以获取预设控制器内多个原子软件组件的端口,并将端口写入端口数据库,之后,可根据该预设控制器与其他控制器之间的通信行为准确筛选端口数据库中需要代理且还未与组合软件组件构成代理连线的待代理端口,从而为该待代理端口构建与组合软件组件之间的代理连线,该过程中在不涉及用户操作的情况下,可以准确为控制器中待代理的原子软件组件构建与组合软件组件之间的代理关系,实现了自动且准确地构建控制器中的原子软件组件构建与组合软件组件之间的代理关系,提升用户体验。In order to solve the technical problem in the prior art that the method of manually proxying the port of the atomic software component to the combined software component is labor-intensive, prone to errors, and affects the user experience, the present application provides a software component proxy method, device, electronic device and storage medium, which can parse the proxy document generated by the architecture design module for the preset controller to obtain the ports of multiple atomic software components in the preset controller, and write the ports into the port database. Afterwards, the ports to be proxied in the port database that need to be proxied and have not yet formed a proxy connection with the combined software component can be accurately screened according to the communication behavior between the preset controller and other controllers, thereby building a proxy connection between the port to be proxied and the combined software component. In this process, without involving user operation, the proxy relationship between the atomic software component to be proxied in the controller and the combined software component can be accurately constructed, thereby realizing the automatic and accurate construction of the proxy relationship between the atomic software component in the controller and the combined software component, thereby improving the user experience.
为便于理解本申请提供的软件组件的代理方法,以下先对本申请涉及的专业名词进行解释:To facilitate understanding of the software component proxy method provided in this application, the following is an explanation of the professional terms involved in this application:
SOA架构:指面向服务的架构,其是一种软件设计和软件架构模式,它将应用程序的不同功能单元(服务)通过定义良好的接口和协议进行组合。这些服务是独立的、可重用的,它们可以跨多个系统和组织进行交互。SOA的目标是提高软件系统的灵活性、可扩展性和可维护性。SOA (Service-Oriented Architecture) is a software design and architecture pattern that combines the functional units (services) of an application through well-defined interfaces and protocols. These services are independent and reusable, and they can interact across multiple systems and organizations. SOA aims to improve the flexibility, scalability, and maintainability of software systems.
VCU(Vehicle control unit,车辆控制单元),其为车辆中的整车控制单元,也即整车控制器。VCU (Vehicle Control Unit) is the vehicle control unit in the vehicle, also known as the vehicle controller.
API服务详表:详细定义SOA架构中各服务详细信息的表(包括原子服务,跨域服务,增强服务,组合服务)。API service details table: A table that defines the detailed information of each service in the SOA architecture (including atomic services, cross-domain services, enhanced services, and composite services).
服务详表通信行为:详细描述服务的service Name(服务名称)、ID(IdentityDocument,身份识别号)信息、网络信息,部署的server端控制器,接收的Client端控制器信息等。Service details communication behavior: Detailed description of the service name, ID (Identity Document) information, network information, deployed server-side controller, received client-side controller information, etc.
通信矩阵:定义和管理汽车内各ECU(Electronic Control Unit,电子控制器)之间通过车载网络(如CAN(Controller Area Network,控制器局域网总线)、LIN(LocalInterconnect Network,局域互联网络)、FlexRay(汽车通信协议)、Ethernet(以太网)等)交换的信息的表。Communication matrix: A table that defines and manages the information exchanged between the various ECUs (Electronic Control Units) in the car through the vehicle network (such as CAN (Controller Area Network), LIN (Local Interconnect Network), FlexRay (Automotive Communication Protocol), Ethernet, etc.).
SWC(Software Component,软件组件):用于实现特定的Autosar(AUTomotiveOpen System Architecture,汽车开放系统架构)应用层功能,有许多种分类。SWC (Software Component): used to implement specific Autosar (AUTomotiveOpen System Architecture) application layer functions, and there are many classifications.
Composition SWC(组合软件组件):一个组合的功能模块,用于组合多个AtomicSWC,实现控制器整体功能。Composition SWC (Combination Software Component): A combined functional module used to combine multiple AtomicSWCs to implement the overall function of the controller.
Atomic SWC(原子软件组件):一个独立的功能模块,用于实现特定的Autosar应用层功能。Atomic SWC (Atomic Software Component): An independent functional module used to implement specific Autosar application layer functions.
代理,将Atomic SWC实例化到Composition SWC之后,将Atomic SWC上的端口代理到Composition SWC外部端口的行为称为代理。Proxy. After instantiating Atomic SWC to Composition SWC, the act of proxying the port on Atomic SWC to the external port of Composition SWC is called proxy.
实际应用中,若Atomic SWC需要通过以太网络SOME/IP(Scalable Service-Oriented Middleware over IP,基于IP面向服务的可扩展中间件)协议将对应端口中的数据发送到其他外部控制器或者接收来自其他外部控制器的数据,则需要将Atomic SWC上的端口代理到Composition SWC外部端口,由Composition SWC帮助发送/接收其他外部控制器的数据。In actual applications, if the Atomic SWC needs to send data in the corresponding port to other external controllers or receive data from other external controllers through the Ethernet SOME/IP (Scalable Service-Oriented Middleware over IP) protocol, the port on the Atomic SWC needs to be proxied to the external port of the Composition SWC, and the Composition SWC will help send/receive data from other external controllers.
下面结合附图以具体实施例对本申请提供的软件组件的代理方法做进一步的解释说明,实施例并不构成对本申请实施例的限定。The following further explains the software component proxy method provided by the present application with reference to specific embodiments in conjunction with the accompanying drawings. The embodiments do not constitute a limitation on the embodiments of the present application.
参见图1,为本申请实施例提供的一种软件组件的代理方法的实施例流程图。如图1所示,该流程可包括以下步骤:Refer to Figure 1, which is a flow chart of an embodiment of a software component proxy method provided in an embodiment of the present application. As shown in Figure 1, the process may include the following steps:
步骤101、获取预设的架构设计模组生成的代理文档,上述代理文档包括预设控制器对应的组合软件组件、预设控制器包括的多个原子软件组件。Step 101: Obtain a proxy document generated by a preset architecture design module, wherein the proxy document includes a combined software component corresponding to a preset controller and multiple atomic software components included in the preset controller.
步骤102、对代理文档进行解析,得到包含多个原子软件组件的端口信息的端口数据库。Step 102: Parse the proxy document to obtain a port database containing port information of multiple atomic software components.
以下对步骤101和步骤102进行统一说明:The following is a unified description of step 101 and step 102:
上述架构设计模组,指SOA架构对应的架构设计工具,该架构设计模组可完成组合软件组件(个数=1)的创建,以及在其中完成原子软件组件的实例化后,利用自动连线和代理连线功能,对组合软件组件和原子软件组件完成自动普通连线和代理连线,并生成对应的代理文档。The above-mentioned architecture design module refers to the architecture design tool corresponding to the SOA architecture. This architecture design module can complete the creation of composite software components (number = 1), and after completing the instantiation of atomic software components therein, use the automatic wiring and proxy wiring functions to complete automatic normal wiring and proxy wiring for composite software components and atomic software components, and generate corresponding proxy documents.
上述普通连线,指预设控制器内的原子软件组件之间的通信连接关系,也即,位于同一控制器的原子软件组件之间可以直接通过端口进行通信。The above-mentioned common connection refers to the communication connection relationship between the atomic software components in the preset controller, that is, the atomic software components located in the same controller can communicate directly through the port.
上述代理连线,指原子软件组件与组合软件组件之间的代理映射关系,通过该代理连线可建立两者之间的代理关系,通过该代理关系,原子软件组合可以通过组合软件组件的端口与其他控制器进行数据传输。The above-mentioned proxy connection refers to the proxy mapping relationship between the atomic software component and the composite software component. Through the proxy connection, a proxy relationship between the two can be established. Through this proxy relationship, the atomic software combination can transmit data with other controllers through the port of the composite software component.
上述代理文档,指上述架构设计模组生成的组合软件组件的通信关系的文档,其可为ARXML(AUTOSAR EXtensible Markup Language,汽车开放系统架构可扩展标记语言)文档,该文档是一种基于XML(eXtensible Markup Language,可扩展标记语言)的文件格式,专门用于描述AUTOSAR(AUTomotive Open System ARchitecture,汽车开放系统架构)标准下的汽车电子系统的软件和硬件架构。The above-mentioned proxy document refers to the document of the communication relationship of the combined software components generated by the above-mentioned architecture design module, which can be an ARXML (AUTOSAR EXtensible Markup Language) document. This document is an XML (eXtensible Markup Language)-based file format specifically used to describe the software and hardware architecture of automotive electronic systems under the AUTOSAR (AUTomotive Open System ARchitecture) standard.
上述预设控制器,指包括SOA架构的控制器,其可为车辆的整车控制器,也可为其他控制器,本申请实施例对此不做限制。The above-mentioned preset controller refers to a controller including an SOA architecture, which can be a vehicle controller of a vehicle or other controllers. The embodiment of the present application does not impose any restrictions on this.
上述端口信息,指原子软件组件的端口对应的相关信息,其可为包括但不限于:端口的名称和属性等。The above-mentioned port information refers to the relevant information corresponding to the port of the atomic software component, which may include but is not limited to: the name and attributes of the port, etc.
上述端口数据库,为用于存储原子软件组件的端口信息的数据库,本申请实施例对该数据库的类型和大小不做限制。The above-mentioned port database is a database used to store port information of atomic software components. The embodiment of the present application does not limit the type and size of the database.
本申请的一些实施例中,本申请实施例的执行主体可先利用预设的架构设计模组构建预设控制器的组合软件组件,并利用该架构设计模组的自动普通连线功能构建不同原子软件组件之间的普通连线,以及利用自动代理连线功能构建组合软件组合与原子软件组件之间的代理连线。In some embodiments of the present application, the executing entity of the embodiments of the present application may first use a preset architecture design module to construct a combination software component of a preset controller, and use the automatic ordinary connection function of the architecture design module to construct ordinary connections between different atomic software components, and use the automatic proxy connection function to construct proxy connections between the combination software combination and the atomic software components.
之后,可生成对应的代理文档,该代理文档可包括上述预设控制器对应的组合软件组件、预设控制器包括的多个原子软件组件。其中,该代理文档中还可包括上述组合软件组件和部分原子软件组件之间的代理连线,该代理连线则为上述利用自动代理连线功能所构建的组合软件组合与原子软件组件之间的代理连线。Afterwards, a corresponding proxy document can be generated. This proxy document may include the combined software component corresponding to the preset controller and the multiple atomic software components included in the preset controller. The proxy document may also include proxy connections between the combined software component and some of the atomic software components. These proxy connections are the proxy connections between the combined software component constructed using the automatic proxy connection function and the atomic software components.
实际应用中,由于SOA架构设计需要开发的服务(原子软件组件)有成百上千个,且每个服务又有1到几十上百个不等的端口,因此,通过该架构设计模组的自动代理连线功能无法准确且全面地完成全部待代理的原子软件组件的端口与组合软件组件的端口之间的代理连线。In actual applications, since SOA architecture design requires the development of hundreds or thousands of services (atomic software components), and each service has one to dozens or even hundreds of ports, the automatic proxy connection function of the architecture design module cannot accurately and comprehensively complete the proxy connection between the ports of all atomic software components to be proxied and the ports of composite software components.
对此,为了更加全面且准确地对预设控制器内每一待代理的原子软件组件的端口进行代理连线,本申请实施例的执行主体可对上述代理文档进行解析,以得到包含多个原子软件组件的端口信息的端口数据库。其中,通过该端口数据库的构建,可以全面且准确地获取到该预设控制器对应组合软件组件包括的原子软件组件的端口。To more comprehensively and accurately proxy the ports of each atomic software component to be proxied within the preset controller, the execution subject of the embodiment of the present application can parse the proxy document to obtain a port database containing port information of multiple atomic software components. By constructing this port database, the ports of the atomic software components included in the corresponding combined software component of the preset controller can be comprehensively and accurately obtained.
至于具体是如何对代理文档进行解析,得到上述端口数据库的,可在下文进行说明,这里先不详述。As for how to parse the proxy document to obtain the above-mentioned port database, it can be explained below and will not be described in detail here.
步骤103、获取通信行为汇总表,上述通信行为汇总表包括预设控制器与其他控制器之间的通信行为。Step 103: Obtain a communication behavior summary table, where the communication behavior summary table includes communication behaviors between the preset controller and other controllers.
步骤104、根据上述通信行为汇总表,从上述端口数据库中确定待代理端口,并为上述待代理端口增加与组合软件组件的通信端口之间的代理连线,以使上述待代理端口通过上述通信端口与其他控制器进行通信。Step 104: Determine the proxy port from the port database according to the communication behavior summary table, and add a proxy connection between the proxy port and the communication port of the combined software component, so that the proxy port can communicate with other controllers through the communication port.
以下对步骤103和步骤104进行统一说明:The following is a unified description of step 103 and step 104:
上述其他控制器,指与上述预设控制器存在通信行为的控制器,例如当上述预设控制器为整车控制器时,该其他控制器可包括但不限于:发动机控制器、制动系统控制器,以及转向系统控制器等。The above-mentioned other controllers refer to controllers that communicate with the above-mentioned preset controller. For example, when the above-mentioned preset controller is a vehicle controller, the other controllers may include but are not limited to: an engine controller, a braking system controller, and a steering system controller, etc.
上述通信行为汇总表,用于记录上述预设控制器与其他控制器之间的通信行为,该通信行为可为预设控制器向其他控制器发送数据的发送数据行为,也可为预设控制器接收其他控制器发送的数据的接收数据行为,本申请实施例对此不做限制。The above-mentioned communication behavior summary table is used to record the communication behavior between the above-mentioned preset controller and other controllers. The communication behavior may be the sending data behavior of the preset controller to other controllers, or the receiving data behavior of the preset controller to receive data sent by other controllers. The embodiment of the present application does not limit this.
上述待代理端口,指待与组合软件组件建立代理连线的端口,也即,该待代理端口需要与组合软件组件的端口建立代理连线但是此时还未建立代理连线的端口。The aforementioned port to be proxy refers to a port to establish a proxy connection with the combined software component, that is, the port to be proxy needs to establish a proxy connection with the port of the combined software component but has not yet established a proxy connection.
上述通信端口,指组合软件组件中用于与其他控制器进行数据通信的外部端口。The above-mentioned communication port refers to the external port in the combined software component used for data communication with other controllers.
本申请的一些实施例中,为了确定端口数据库中的每一端口是否为需要与组合软件组件建立代理关系的待代理端口,本申请实施例的执行主体可获取当前的预设控制器与其他控制器之间的通信行为汇总表,并根据该通信行为汇总表,从上述端口数据库中确定需要代理的待代理端口。In some embodiments of the present application, in order to determine whether each port in the port database is a pending proxy port that needs to establish a proxy relationship with the combined software component, the execution entity of the embodiment of the present application can obtain a communication behavior summary table between the current preset controller and other controllers, and based on the communication behavior summary table, determine the pending proxy port that needs to be proxied from the above-mentioned port database.
作为一种可选的实现方式,上述通信行为汇总表可为预先存储的,基于此,本申请实施例的执行主体可从预设的存储介质中获取预先存储的上述通信行为汇总表。As an optional implementation method, the above-mentioned communication behavior summary table may be pre-stored. Based on this, the execution subject of the embodiment of the present application may obtain the pre-stored communication behavior summary table from a preset storage medium.
作为另一种可选的实现方式,上述通信行为汇总表可为构建的表格,基于此,本申请实施例的执行主体可构建上述通信行为汇总表。As another optional implementation method, the above-mentioned communication behavior summary table may be a constructed table. Based on this, the execution entity of the embodiment of the present application may construct the above-mentioned communication behavior summary table.
至于具体是如何构建上述通信行为汇总表的,可在下文进行说明这里先不详述。As for how to construct the above communication behavior summary table, it can be explained below and will not be described in detail here.
之后,可为该待代理端口增加与组合软件组件的通信端口之间的代理连线,以使该待代理端口通过上述通信端口与其他控制器进行通信。Afterwards, a proxy connection may be added between the port to be proxied and the communication port of the combined software component, so that the port to be proxied can communicate with other controllers through the communication port.
至于具体是如何根据上述通信行为汇总表,从上述端口数据库中确定待代理端口的,可在下文进行说明,这里先不详述。As for how to determine the port to be proxied from the above-mentioned port database based on the above-mentioned communication behavior summary table, it can be explained below and will not be described in detail here.
本申请实施例提供的技术方案,通过获取预设的架构设计模组生成的代理文档,上述代理文档包括预设控制器对应的组合软件组件、预设控制器包括的多个原子软件组件,对代理文档进行解析,得到包含多个原子软件组件的端口信息的端口数据库,获取通信行为汇总表,上述通信行为汇总表包括预设控制器与其他控制器之间的通信行为,根据上述通信行为汇总表,从上述端口数据库中确定待代理端口,并为上述待代理端口增加与组合软件组件的通信端口之间的代理连线,以使上述待代理端口通过上述通信端口与其他控制器进行通信。这一技术方案,通过对架构设计模组针对预设控制器生成的代理文档进行解析,以获取预设控制器内多个原子软件组件的端口,并将端口写入端口数据库,之后,可根据该预设控制器与其他控制器之间的通信行为准确筛选端口数据库中需要代理且还未与组合软件组件构成代理连线的待代理端口,从而为该待代理端口构建与组合软件组件之间的代理连线,该过程中在不涉及用户操作的情况下,可以准确为控制器中待代理的原子软件组件构建与组合软件组件之间的代理关系,实现了自动且准确地构建控制器中的原子软件组件构建与组合软件组件之间的代理关系,提升用户体验。The technical solution provided by the embodiment of the present application is to obtain a proxy document generated by a preset architecture design module, wherein the proxy document includes a combined software component corresponding to the preset controller and multiple atomic software components included in the preset controller, parse the proxy document, obtain a port database containing port information of multiple atomic software components, obtain a communication behavior summary table, wherein the communication behavior summary table includes communication behaviors between the preset controller and other controllers, determine the port to be proxied from the port database according to the communication behavior summary table, and add a proxy connection between the port to be proxied and the communication port of the combined software component to enable the port to be proxied to communicate with other controllers through the communication port. This technical solution parses the proxy document generated by the architecture design module for the preset controller to obtain the ports of multiple atomic software components in the preset controller and writes the ports into the port database. Afterwards, the ports to be proxied in the port database that need to be proxied and have not yet formed a proxy connection with the combined software component can be accurately screened according to the communication behavior between the preset controller and other controllers, thereby building a proxy connection between the ports to be proxied and the combined software component. In this process, without involving user operation, the proxy relationship between the atomic software components to be proxied in the controller and the combined software component can be accurately built, thereby realizing the automatic and accurate construction of the proxy relationship between the atomic software components in the controller and the combined software component, thereby improving the user experience.
参见图2,为本申请实施例提供的另一种软件组件的代理方法的实施例流程图。图2所示流程在图1所示流程的基础上,描述了具体是如何对代理文档进行解析,得到包含多个原子软件组件的端口信息的端口数据库的。如图2所示,该流程可包括以下步骤:See Figure 2, which is a flowchart of another embodiment of a software component proxy method provided by an embodiment of the present application. The process shown in Figure 2, based on the process shown in Figure 1, describes how to parse the proxy document to obtain a port database containing port information of multiple atomic software components. As shown in Figure 2, the process may include the following steps:
步骤201、通过预设的解析算法对上述代理文档进行解析,得到组合软件组件的组件信息,以及全部原子软件组件中,每一原子软件组件对应的端口信息。Step 201: Parse the proxy document using a preset parsing algorithm to obtain component information of the combined software component and port information corresponding to each atomic software component in all the atomic software components.
上述解析算法,指可以对代理文档进行解析的算法,由于该代理文档中可包括组合软件组件的组件信息,以及原子软件组件的组件信息,因此,该解析算法可包括第一解析算法和第二解析算法。The above-mentioned parsing algorithm refers to an algorithm that can parse the proxy document. Since the proxy document may include component information of the composite software component and component information of the atomic software component, the parsing algorithm may include a first parsing algorithm and a second parsing algorithm.
其中,上述第一解析算法,指用于对代理文档中组合软件组件进行解析的算法,例如Composition SWC Arxml解析算法,该算法为高级语言自带解析XML文件的库中预先存储的算法。The first parsing algorithm mentioned above refers to an algorithm for parsing the composition software component in the proxy document, such as the Composition SWC Arxml parsing algorithm, which is an algorithm pre-stored in a library for parsing XML files that comes with a high-level language.
上述第二解析算法,指用于对代理文档中原子软件组件进行解析的算法,例如Atomic SWC解析算法,该算法为高级语言自带解析XML文件的库中预先存储的算法。The second parsing algorithm mentioned above refers to an algorithm for parsing atomic software components in a proxy document, such as an Atomic SWC parsing algorithm, which is a pre-stored algorithm in a library for parsing XML files provided by a high-level language.
上述组件信息,指与组合软件组件相关的信息,其可包括但不限于:该组合软件组件包含的实例(该实例为原子软件组件实例化后得到)、端口信息(该端口信息可包括端口的端口属性,该端口属性表征该端口为向外发送数据的端口还是接收数据的端口,例如RPort(Receive Port,接收端口)和PPort(Provided Port,发送端口)),以及连线信息(该连线信息可包括代理连线信息和普通连线信息)等。The above-mentioned component information refers to information related to the combined software component, which may include but is not limited to: the instance contained in the combined software component (the instance is obtained after the atomic software component is instantiated), port information (the port information may include the port attribute of the port, which indicates whether the port is a port for sending data outward or a port for receiving data, such as RPort (Receive Port) and PPort (Provided Port)), and connection information (the connection information may include proxy connection information and ordinary connection information), etc.
上述端口信息,指每一原子软件组件所包含的端口的相关信息,上述端口可包括用于发送数据的发送端口,以及用于接收数据的接收端口。The port information refers to the relevant information of the ports included in each atomic software component. The ports may include a sending port for sending data and a receiving port for receiving data.
本申请的一些实施例中,为了从代理文档中获取当前的组合软件组件的相关信息,本申请实施例的执行主体可获取预设的解析算法,并通过该解析算法对代理文档进行解析,以得到组合软件组件的组件信息,以及全部原子软件组件中每一原子软件组件对应的端口。In some embodiments of the present application, in order to obtain relevant information of the current combined software component from the proxy document, the execution entity of the embodiment of the present application can obtain a preset parsing algorithm and parse the proxy document through the parsing algorithm to obtain component information of the combined software component and the port corresponding to each atomic software component in all atomic software components.
作为一种可选的实现方式,本申请实施例的执行主体可获取预设的第一解析算法,并通过该第一解析算法对该代理文档进行解析,得到该组合软件组件的组件信息。As an optional implementation method, the execution subject of the embodiment of the present application may obtain a preset first parsing algorithm, and parse the proxy document using the first parsing algorithm to obtain component information of the combined software component.
作为一示例性的实施方式,本申请实施例的执行主体在获取到上述代理文档后,可从预设的算法库获取用于解析组合软件组件的第一解析算法,并利用该第一解析算法对代理文档进行解析,以得到该组合软件组件的组件信息。As an exemplary implementation, after obtaining the above-mentioned proxy document, the execution subject of the embodiment of the present application can obtain a first parsing algorithm for parsing the combined software component from a preset algorithm library, and use the first parsing algorithm to parse the proxy document to obtain component information of the combined software component.
作为一种可选的实现方式,为了从代理文档中获取当前的组合软件组件包含的原子软件组件的端口,本申请实施例的执行主体可获取预设的第二解析算法,并通过该第二解析算法对代理文档进行解析,得到每一原子软件组件包含的端口。As an optional implementation method, in order to obtain the ports of the atomic software components contained in the current combined software component from the proxy document, the execution entity of the embodiment of the present application can obtain a preset second parsing algorithm, and parse the proxy document through the second parsing algorithm to obtain the ports contained in each atomic software component.
作为一示例性的实施方式,申请实施例的执行主体在获取到上述代理文档后,可从预设的算法库获取用于解析原子软件组件的第二解析算法,并利用该第二解析算法对代理文档进行解析,以得到该组合软件组件包含的每一原子软件组件的端口。As an exemplary implementation, after obtaining the above-mentioned proxy document, the executing entity of the application embodiment can obtain a second parsing algorithm for parsing atomic software components from a preset algorithm library, and use the second parsing algorithm to parse the proxy document to obtain the port of each atomic software component contained in the combined software component.
其中,本申请实施例对组件信息和端口的获取顺序不做限制,例如也可先通过第二解析算法对代理文档进行解析,获取每一原子软件组件的端口,然后再通过第一解析算法对代理文档进行解析,获取组合软件组件的组件信息。又例如,还可同时通过第一解析算法和第二解析算法对代理文档进行解析,得到上述组合软件组件的组件信息和每一原子软件组件对应的端口。The present embodiment does not restrict the order in which component information and ports are obtained. For example, the proxy document may be parsed using the second parsing algorithm first to obtain the ports of each atomic software component, and then the proxy document may be parsed using the first parsing algorithm to obtain the component information of the combined software component. For another example, the proxy document may be parsed using both the first and second parsing algorithms simultaneously to obtain the component information of the combined software component and the ports corresponding to each atomic software component.
步骤202、根据上述组件信息,将待代理的原子软件组件对应的端口信息写入预设的初始端口数据库,得到上述端口数据库。Step 202: Based on the component information, write the port information corresponding to the atomic software component to be proxied into a preset initial port database to obtain the port database.
上述待代理的原子软件组件,指存在代理关系的原子软件组件,其可包括已经建立代理连线的原子软件组件,以及存在代理关系但是未建立代理连线的原子软件组件。The aforementioned atomic software components to be proxied refer to atomic software components with existing proxy relationships, which may include atomic software components with established proxy connections and atomic software components with existing proxy relationships but without established proxy connections.
上述端口信息,指待代理的原子软件组件的端口的相关信息,其可为端口名称,也可为端口的唯一标识,本申请实施例对此不做限制。The above-mentioned port information refers to the relevant information of the port of the atomic software component to be proxied, which can be the port name or the unique identifier of the port. The embodiment of the present application does not limit this.
上述初始端口数据库,指预先建立的用于存储原子软件组件的端口信息,但还未存储端口信息的数据库。The aforementioned initial port database refers to a database that is pre-established to store port information of atomic software components but does not yet store port information.
本申请的一些实施例中,上述组件信息可包括每一原子软件组件实例化到组合软件组件的实例,基于此,本申请实施例的执行主体可根据上述组件信息,确定待代理的原子软件组件,并将待代理的原子软件组件对应的端口信息写入预设的初始端口数据库,得到上述端口数据库。In some embodiments of the present application, the above-mentioned component information may include an instance of each atomic software component instantiated into a composite software component. Based on this, the execution subject of the embodiment of the present application can determine the atomic software component to be proxied according to the above-mentioned component information, and write the port information corresponding to the atomic software component to be proxied into a preset initial port database to obtain the above-mentioned port database.
作为一种可选的实现方式,上述组件信息除了包括每一原子软件组件对应的实例外,还包括每一实例与原子软件组件之间的引用关系。基于此,本申请实施例的执行主体可根据上述组件信息,遍历组合软件组件包括的每一实例。As an optional implementation, the component information includes not only the instance corresponding to each atomic software component, but also the reference relationship between each instance and the atomic software component. Based on this, the execution subject of the embodiment of the present application can traverse each instance included in the combined software component according to the component information.
其中,在遍历每一实例的过程中,可针对遍历到的每一实例,根据该实例对应的引用关系,确定该实例对应的目标原子软件组件,也即生成该实例的原子软件组件。In the process of traversing each instance, for each traversed instance, the target atomic software component corresponding to the instance can be determined according to the reference relationship corresponding to the instance, that is, the atomic software component of the instance can be generated.
之后,可确定该目标原子软件组件是否存在预设的引子标签。上述引子标签,用于表征对应的原子软件组件为引入的其他控制器的虚拟组件,该虚拟组件则无法与组合软件组件建立代理关系。Afterwards, it can be determined whether the target atomic software component has a preset introduction tag. The introduction tag is used to indicate that the corresponding atomic software component is a virtual component introduced by another controller, and the virtual component cannot establish a proxy relationship with the composite software component.
可选的,在确定该目标原子软件组件不存在该引子标签的情况下,说明该目标原子软件组件并非虚拟组件,其为待代理的原子软件组件,因此可将该目标原子软件组件的端口信息存储至初始端口数据库。Optionally, when it is determined that the target atomic software component does not have the primer tag, it indicates that the target atomic software component is not a virtual component but an atomic software component to be proxied. Therefore, the port information of the target atomic software component can be stored in the initial port database.
可选的,在确定该目标原子软件组件存在该引子标签的情况下,说明该目标原子软件组件为虚拟组件,其并非待代理的原子软件组件,而虚拟组件无法与组合软件组件建立代理关系,因此可不将该目标原子软件组件的端口信息写入上述初始端口数据库。Optionally, when it is determined that the target atomic software component has the primer tag, it means that the target atomic software component is a virtual component, which is not the atomic software component to be proxied, and the virtual component cannot establish a proxy relationship with the combined software component. Therefore, the port information of the target atomic software component may not be written into the above-mentioned initial port database.
最后,按照上述操作,在对组合软件组件包括的全部实例遍历完成后,可得到最终的端口数据库。Finally, according to the above operations, after traversing all instances included in the combined software component, the final port database can be obtained.
本申请实施例提供的技术方案,提出了通过预设的解析算法对上述代理文档进行解析,得到组合软件组件的组件信息,以及全部原子软件组件中,每一原子软件组件对应的端口,根据上述组件信息,将待代理的原子软件组件对应的端口信息写入预设的初始端口数据库,得到上述端口数据库。这一技术方案,通过利用解析算法分别解析代理文档包括的组合软件组件的组件信息以及确定待代理的原子软件组件的端口,从而结合组件信息确定预设控制器中待代理的原子软件组件,并并将该待代理的原子软件组件的端口信息写入端口数据库,由于端口数据库的构建参考了组合软件组件的组件信息,因此该端口数据库可更加准确且全面地包含每一待代理的原子软件组件的端口,实现了更加准确地构建端口数据库。The technical solution provided by the embodiment of the present application proposes to parse the above-mentioned proxy document through a preset parsing algorithm to obtain the component information of the combined software component and the port corresponding to each atomic software component in all the atomic software components. According to the above-mentioned component information, the port information corresponding to the atomic software component to be proxied is written into a preset initial port database to obtain the above-mentioned port database. This technical solution uses a parsing algorithm to respectively parse the component information of the combined software component included in the proxy document and determine the port of the atomic software component to be proxied, thereby determining the atomic software component to be proxied in the preset controller in combination with the component information, and writing the port information of the atomic software component to be proxied into the port database. Since the construction of the port database refers to the component information of the combined software component, the port database can more accurately and comprehensively include the port of each atomic software component to be proxied, thereby achieving a more accurate construction of the port database.
参见图3,为本申请实施例提供的又一种软件组件的代理方法的实施例流程图。图3所示流程在图2所示流程的基础上,描述了在组件信息包括组合软件组件的代理连线信息的情况下,具体是如何根据通信行为汇总表,从端口数据库中确定待代理端口的。如图3所示,该流程可包括以下步骤:See Figure 3, which is a flowchart of another embodiment of a software component proxy method provided by an embodiment of the present application. The process shown in Figure 3 is based on the process shown in Figure 2 and describes how to determine the port to be proxied from the port database based on the communication behavior summary table when the component information includes proxy connection information of the combined software component. As shown in Figure 3, the process may include the following steps:
步骤301、根据上述通信行为汇总表,从端口数据库中查询当前的全部代理端口,其中,上述代理端口包括待代理端口和已代理端口。Step 301: According to the communication behavior summary table, all current proxy ports are searched from the port database, wherein the proxy ports include ports to be proxied and ports that have been proxied.
上述通信行为汇总表,为包括预设控制器与其他控制器之间的通信服务和通信关系的汇总表格,上述通信关系可用于表征在通信服务中预设控制器与其他控制器之间的发送方和接收方之间的关系,也即预设控制器是作为发送数据的一方,例如服务端,还是接收数据的一方,例如客户端。The above-mentioned communication behavior summary table is a summary table including the communication services and communication relationships between the preset controller and other controllers. The above-mentioned communication relationship can be used to characterize the relationship between the sender and the receiver between the preset controller and other controllers in the communication service, that is, whether the preset controller is the party sending data, such as the server, or the party receiving data, such as the client.
在一实施例中,本申请实施例的执行主体可从预设的存储介质中获取预先存储的通信行为汇总表。In one embodiment, the execution subject of the embodiment of the present application may obtain a pre-stored communication behavior summary table from a preset storage medium.
在另一实施例中,本申请实施例的执行主体可对预设控制器对应的服务详情表进行解析,得到该预设控制器与至少一个其他控制器之间的通信服务和通信关系。上述服务详情表可详细描述服务的服务名称、ID信息、网络信息,部署的server(服务器)端控制器,接收的Client(客户)端控制器信息等。In another embodiment, the execution entity of the present invention may parse the service details table corresponding to the preset controller to obtain the communication services and communication relationships between the preset controller and at least one other controller. The service details table may include a detailed description of the service name, ID information, network information, deployed server controller, and received client controller information.
之后,可根据上述通信服务和通信关系,生成对应的通信行为汇总表。例如可生成下表1所示的通信行为汇总表:Afterwards, a corresponding communication behavior summary table may be generated based on the above communication services and communication relationships. For example, the communication behavior summary table shown in Table 1 below may be generated:
本申请的一些实施例中,在根据通信行为汇总表,从端口数据库中查询当前的全部代理端口时,可遍历端口数据库中的全部端口,并在遍历的过程中,针对遍历到的每一端口,确定该端口的端口属性。上述端口属性包括接收方属性和发送方属性,上述接收方属性表征该端口用于接收数据,上述发送方属性表征该端口用于发送数据。In some embodiments of the present application, when querying all current proxy ports from a port database based on a communication behavior summary table, all ports in the port database may be traversed, and during the traversal process, for each port traversed, the port attributes of the port are determined. The port attributes include receiver attributes and sender attributes. The receiver attributes indicate that the port is used to receive data, and the sender attributes indicate that the port is used to send data.
之后,可查询该端口所属的通信服务名称。Afterwards, you can query the name of the communication service to which the port belongs.
作为一种可选的实现方式,可预先存储端口名称与通信服务名称之间的对应关系,基于此,本申请实施例的执行主体可根据该端口的端口名称确定该端口所属的通信服务的通信服务名称。As an optional implementation method, the correspondence between the port name and the communication service name can be pre-stored. Based on this, the execution entity of the embodiment of the present application can determine the communication service name of the communication service to which the port belongs according to the port name of the port.
举个例子,端口名称可基于通信服务名称命名,那么在得到上述端口名称后,可直接按照命名规则得到对应的通信服务名称,例如端口名称为服务器名称+预设字符串,那么在得到端口名称后,可将端口名称截取掉上述预设字符串,便可得到对应的服务器名称。For example, the port name can be named based on the communication service name. After obtaining the above port name, the corresponding communication service name can be directly obtained according to the naming rules. For example, the port name is the server name + preset string. After obtaining the port name, the port name can be truncated with the above preset string to obtain the corresponding server name.
再之后,可根据上述通信服务名称、端口属性,以及预设控制器的控制器名称,从上述通信行为汇总表中查询目标通信方。Afterwards, the target communication party may be queried from the communication behavior summary table according to the communication service name, port attributes, and the controller name of the preset controller.
作为一可选的实现方式,可以该通信服务名称、端口属性以及预设控制器为关键字进行查询,确定该端口对应的目标通信方。以表1为例,假设通信服务名称为AA,端口属性为发送方(服务器),且预设控制器的名称为ECU1,那么通过查询表1,可得到服务名称为AA,Server端为ECU1的目标行,该目标行包括的Client端为ECU2,因此,该端口对应的目标通信方为ECU2。As an optional implementation, you can query the communication service name, port attribute, and pre-set controller as keywords to determine the target communication party corresponding to the port. Taking Table 1 as an example, assuming the communication service name is AA, the port attribute is sender (server), and the pre-set controller name is ECU1, then by querying Table 1, you can obtain a target row with a service name of AA and a server end of ECU1. This target row includes a client end of ECU2. Therefore, the target communication party corresponding to this port is ECU2.
最后,可确定该目标通信方是否为该预设控制器。Finally, it can be determined whether the target communication party is the preset controller.
可选的,若确定该目标通信方为预设控制器,则说明该端口的通信对象为同属预设控制器的其他原子软件组件,其为内部通信,无需代理,因此可确定该端口非代理端口。Optionally, if it is determined that the target communication party is the preset controller, it means that the communication object of the port is other atomic software components belonging to the preset controller. It is internal communication and does not require a proxy. Therefore, it can be determined that the port is not a proxy port.
作为一示例性的实施方式,为了区分上述非代理端口,可将端口数据库中对应非代理端口增加第一预设符号,以表征该端口为非代理端口。As an exemplary implementation, in order to distinguish the non-proxy port, a first preset symbol may be added to the corresponding non-proxy port in the port database to indicate that the port is a non-proxy port.
可选的,若确定该目标通信方非预设控制器,则说明该端口的通信对象为其他控制器,需要代理,因此,可将该端口确定为代理端口。Optionally, if it is determined that the target communication party is not the preset controller, it means that the communication object of the port is another controller and a proxy is required. Therefore, the port can be determined as a proxy port.
作为一示例性的实施方式,为了区分上述代理端口,可将端口数据库中对应代理端口增加第二预设符号,以表征该端口为代理端口。As an exemplary implementation, in order to distinguish the above-mentioned proxy port, a second preset symbol may be added to the corresponding proxy port in the port database to indicate that the port is a proxy port.
步骤302、根据上述代理连线信息,从全部代理端口中,确定待代理端口。Step 302: Determine the proxy port to be used from all proxy ports based on the proxy connection information.
上述代理连线信息,指组合软件组件当前的包括的代理连线,该代理连线信息可包括原子软件组件的端口、组合软件组件的通信端口,以及两者之间的代理关系。The above-mentioned proxy connection information refers to the proxy connection currently included in the combined software component. The proxy connection information may include the port of the atomic software component, the communication port of the combined software component, and the proxy relationship between the two.
上述代理端口,指与组合软件组件存在代理关系的端口,其可包括已经建立代理连线的端口和未建立代理连线的端口。The above-mentioned proxy port refers to a port that has a proxy relationship with the combined software component, which may include a port with a proxy connection established and a port without a proxy connection established.
上述待代理端口,则为与组合软件组件存在代理关系,但还未建立代理连线的端口。The aforementioned ports to be proxied are ports that have a proxy relationship with the combined software component but have not yet established a proxy connection.
本申请的一些实施例中,由于该代理连线信息表征了组合软件组件中的代理连线,因此,本申请实施例的执行主体可根据上述代理连线信息,从全部代理端口中筛选出已经建立代理连线的已代理端口,从而得到待代理端口。In some embodiments of the present application, since the proxy connection information represents the proxy connection in the combined software component, the execution subject of the embodiment of the present application can filter out the proxied ports that have established proxy connections from all proxy ports based on the above proxy connection information, thereby obtaining the ports to be proxied.
作为一种可选的实现方式,由于原子软件组件的端口存在对应的端口属性,也即分为发送方属性和接收方属性,因此上述代理连线信息中还可包括原子软件组件的端口的端口属性,上述端口属性可包括接收方属性和发送方属性。As an optional implementation method, since the port of the atomic software component has corresponding port attributes, which are divided into sender attributes and receiver attributes, the above-mentioned proxy connection information can also include the port attributes of the port of the atomic software component, and the above-mentioned port attributes can include receiver attributes and sender attributes.
基于此,在从全部代理端口中筛选待代理端口时,可针对全部代理端口中的每一代理端口,确定该代理端口的目标端口属性。Based on this, when screening the proxy ports to be proxy ports from all proxy ports, the target port attribute of each proxy port in all proxy ports may be determined.
作为一实施方式,由步骤301中的描述可知,在确定端口为代理端口时,可为该代理端口增加第二预设符号,因此,可将存在第二预设符号的端口确定为代理端口,并针对每一存在第二预设符号的代理端口,确定该代理端口的目标端口属性。As one embodiment, as can be seen from the description in step 301, when determining that a port is a proxy port, a second preset symbol can be added to the proxy port. Therefore, the port with the second preset symbol can be determined as a proxy port, and for each proxy port with the second preset symbol, the target port attribute of the proxy port is determined.
之后,可根据该目标端口属性,从上述代理连线信息中确定多个目标代理连线信息。该目标代理连线信息则为目标端口属性对应端口的代理连线信息。Afterwards, a plurality of target proxy connection information may be determined from the proxy connection information according to the target port attribute. The target proxy connection information is the proxy connection information of the port corresponding to the target port attribute.
最后,可确定每一目标代理连线信息包括的端口是否为上述代理端口。Finally, it can be determined whether the port included in each target proxy connection information is the above-mentioned proxy port.
可选的,在确定存在一个目标代理连线信息包括的端口为上述代理端口的情况下,说明该代理端口已经存在连线信息,因此可确定该代理端口为已代理端口。Optionally, when it is determined that there is a target proxy connection information including a port that is the proxy port, it means that connection information already exists for the proxy port, and thus the proxy port can be determined to be an already proxied port.
作为一示例性的实施方式,在确定出已代理端口的情况下,为了区分该已代理端口,可为该已代理端口增加第三预设标识,该第三预设标识可为与第一预设标识相同的标识,也可为不同的标识,本申请实施例对此不做限制。As an exemplary embodiment, when a proxied port is determined, in order to distinguish the proxied port, a third preset identifier can be added to the proxied port. The third preset identifier can be the same identifier as the first preset identifier or a different identifier. This embodiment of the present application does not limit this.
可选的,在确定全部目标代理连线信息包括的端口均非上述代理端口的情况下,说明此时该代理端口还未建立代理连线,因此,可确定该代理端口为待代理端口。Optionally, when it is determined that all ports included in the target proxy connection information are not the above-mentioned proxy ports, it means that the proxy port has not yet established a proxy connection. Therefore, the proxy port can be determined as a waiting proxy port.
作为一示例性的实施方式,在确定该代理端口为待代理端口的情况下,为了区分该待代理端口,可为该待代理端口增加第四预设标识,该第四预设标识可为与第二预设标识相同的标识,也可为不同的标识,本申请实施例对此不做限制。As an exemplary embodiment, when it is determined that the proxy port is a pending proxy port, in order to distinguish the pending proxy port, a fourth preset identifier can be added to the pending proxy port. The fourth preset identifier can be the same identifier as the second preset identifier or a different identifier. This embodiment of the present application does not limit this.
基于上述描述,本申请实施例的执行主体在从端口数据库中确定待代理端口时,可确定每一端口是否存在第二预设标识和第四预设标识,并将同时存在第二预设标识和第四预设标识的端口确定为待代理端口。Based on the above description, when the executing entity of the embodiment of the present application determines the ports to be proxied from the port database, it can determine whether each port has the second preset identifier and the fourth preset identifier, and determine the ports that have both the second preset identifier and the fourth preset identifier as the ports to be proxied.
本申请实施例提供的技术方案,通过根据上述通信行为汇总表,从端口数据库中查询当前的全部代理端口,其中,上述代理端口包括待代理端口和已代理端口,根据上述代理连线信息,从全部代理端口中,确定待代理端口。这一技术方案,通过根据包含预设控制器与其他控制器之间的通信行为的通信行为汇总表和组合软件组件中的代理连线信息两个维度分别确定存在代理关系的端口和存在代理关系还未建立代理关系待代理端口,其通过两个维度可以更加准确地筛选出当前需要建立代理连线的待代理端口,实现了准确确定待代理端口。The technical solution provided by the embodiment of the present application queries all current proxy ports from the port database based on the communication behavior summary table, wherein the proxy ports include ports to be proxied and ports already proxied, and determines the ports to be proxied from all proxy ports based on the proxy connection information. This technical solution determines ports with existing proxy relationships and ports with existing proxy relationships but not yet established proxy relationships based on two dimensions: a communication behavior summary table containing communication behaviors between a preset controller and other controllers, and proxy connection information in a combined software component. This two-dimensional approach can more accurately screen out ports to be proxied that currently require proxy connections, thereby achieving accurate determination of ports to be proxied.
参见图4,为本申请实施例提供的再一种软件组件的代理方法的实施例流程图。图4所示流程在图1所示流程的基础上,描述了具体是如何为待代理端口增加与组合软件组件的通信端口之间的代理连线的。如图4所示,该流程可包括以下步骤:See Figure 4, which is a flowchart of another embodiment of a software component proxy method provided in an embodiment of the present application. The process shown in Figure 4, based on the process shown in Figure 1, describes how to add a proxy connection between the port to be proxied and the communication port of the combined software component. As shown in Figure 4, the process may include the following steps:
步骤401、针对每一待代理端口,生成该代理端口对应通信端口的通信端口标签。Step 401: For each proxy port, generate a communication port tag corresponding to the proxy port.
步骤402、将上述通信端口标签写入代理文档中用于记录通信端口的第一预设位置处。Step 402: Write the communication port tag into a first preset position in the proxy document for recording the communication port.
以下对步骤401和步骤402进行统一说明:The following is a unified description of step 401 and step 402:
上述通信端口标签,指组合软件组件的通信端口在代理文档中的标签,该标签可包括通信端口的UUID(Universally Unique Identifier,通用唯一识别码)、通信端口的名称,以及通信端口的路径等。The communication port label refers to the label of the communication port of the combined software component in the agent document. The label may include the UUID (Universally Unique Identifier) of the communication port, the name of the communication port, and the path of the communication port.
上述第一预设位置,指代理文档中用于记录通信端口信息的预设位置处,例如用于记录通信端口的最后一行。The first preset position mentioned above refers to a preset position in the proxy document for recording the communication port information, for example, the last line for recording the communication port.
本申请的一些实施例中,由于待代理端口为需求代理但是还未建立代理连线,也即未形成代理映射关系的端口,因此,为了待代理端口建立代理连线,本申请实施例的执行主体可针对每一待代理端口,为该待代理端口生成对应的通信端口,该通信端口为位于组合软件组件的外部端口。In some embodiments of the present application, since the port to be proxied is a demand proxy but a proxy connection has not yet been established, that is, a port for which a proxy mapping relationship has not been formed, in order to establish a proxy connection for the port to be proxied, the execution entity of the embodiment of the present application can generate a corresponding communication port for each port to be proxied, and the communication port is an external port located in the combined software component.
基于此,可针对每一待代理端口,生成该待代理端口对应通信端口的通信端口标签,并将该通信端口标签写入代理文档中用于记录通信端口的第一预设位置处,以使后续架构涉及模组可以根据根据该第一预设位置处的标签为组合软件组件生成对应的通信端口。Based on this, a communication port label corresponding to the communication port to be proxied can be generated for each port to be proxied, and the communication port label can be written into the first preset position in the proxy document for recording the communication port, so that the subsequent architecture-related modules can generate a corresponding communication port for the combined software component according to the label at the first preset position.
作为一种可选的实现方式,在生成该通信端口标签时,可先利用预设的生成库生成该通信端口的UUID,并将待代理端口的名称确定为该通信端口的名称。As an optional implementation, when generating the communication port label, a preset generation library may be used to generate the UUID of the communication port, and the name of the port to be proxied may be determined as the name of the communication port.
之后,可从预先解析的接口信息中,确定通信端口所在的路径,并根据通信端口的名称和该路径,生成该通信端口对应的路径。例如端口名称为ZZZ,解析出的通信端口对应路径为/SoftwareTypes/Interfaces,那么将两者进行拼接,可得到通信端口对应的路径为/SoftwareTypes/Interfaces/ZZZ。After that, the path of the communication port can be determined from the pre-parsed interface information. Based on the communication port name and the path, the path corresponding to the communication port can be generated. For example, if the port name is ZZZ and the parsed communication port path is /SoftwareTypes/Interfaces, then the path corresponding to the communication port can be obtained by concatenating the two to /SoftwareTypes/Interfaces/ZZZ.
最后,可根据上述UUID、通信端口名称、通信端口的路径,生成通信端口标签。Finally, a communication port label may be generated based on the aforementioned UUID, communication port name, and communication port path.
步骤403、生成该代理端口与对应通信端口之间的代理连线标签。Step 403: Generate a proxy connection label between the proxy port and the corresponding communication port.
步骤404、将上述代理连线标签写入代理文档中用于记录代理连线的第二预设位置处。Step 404: Write the proxy connection tag into the second preset location in the proxy document for recording the proxy connection.
以下对步骤403和步骤404进行统一说明:The following is a unified description of step 403 and step 404:
上述代理连线标签,指待代理端口与对应代理的通信端口之间的代理连线对应的标签,架构设计模组可通过代理文档中该代理连线标签生成待代理端口与通信端口之间的代理关系,该代理连线标签可包括但不限于:代理连线标签的UUID、代理连线标签的名称、待代理端口所在原子软件组件的路径、待代理端口的路径,以及待代理端口对应通信端口的路径等。The above-mentioned proxy connection label refers to the label corresponding to the proxy connection between the port to be proxied and the communication port of the corresponding proxy. The architecture design module can generate the proxy relationship between the port to be proxied and the communication port through the proxy connection label in the proxy document. The proxy connection label may include but is not limited to: the UUID of the proxy connection label, the name of the proxy connection label, the path of the atomic software component where the port to be proxied is located, the path of the port to be proxied, and the path of the communication port corresponding to the port to be proxied, etc.
上述第二预设位置,指用于记录代理连线相关信息的位置处,例如用于记录代理连线信息的最后一行。The second preset position refers to a position for recording proxy connection related information, such as the last row for recording proxy connection information.
本申请的一些实施例中,在为当前的待代理端口建立对应的用于代理该待代理端口的通信端口后,可生成建立两者之间代理连线的标签,并将该代理连线标签写入代理文档中用于记录代理连线的第二预设位置处,从而使得架构设计模组根据该标签生成两者之间的代理关系。In some embodiments of the present application, after establishing a corresponding communication port for the current port to be proxied, a label for establishing a proxy connection between the two can be generated, and the proxy connection label can be written into the second preset position in the proxy document for recording the proxy connection, so that the architecture design module generates a proxy relationship between the two based on the label.
作为一种可选的实现方式,在生成对应的代理连线标签时,可先利用预设的生成库生成该代理连线标签的UUID。之后,可从组件信息的代理连线信息中获取其他代理连线的名称,并根据其他代理连线的名称生成一个新的与其他代理连线的名称不一致的代理连线名称。例如按照其他代理连线的名称进行顺序编号。As an optional implementation, when generating the corresponding proxy connection label, you can first use a preset generation library to generate the proxy connection label's UUID. Then, you can obtain the names of other proxy connections from the proxy connection information in the component information and generate a new proxy connection name based on the other proxy connection names. For example, you can sequentially number the proxy connections according to the names of the other proxy connections.
再之后,可对代理文档进行解析,获取待代理端口所在原子软件组件的路径,以及待代理端口的路径。Afterwards, the proxy document may be parsed to obtain the path of the atomic software component where the port to be proxied is located, and the path of the port to be proxied.
再之后,可从上述通信端口标签中获取该待代理端口对应通信端口的路径。Afterwards, the path of the communication port corresponding to the to-be-proxy port can be obtained from the communication port tag.
最后,可根据上述UUID、代理连线名称、原子软件组件的路径、待代理端口的路径,以及通信端口的路径,生成对应的代理连线标签。Finally, a corresponding proxy connection label may be generated according to the above UUID, the proxy connection name, the path of the atomic software component, the path of the port to be proxied, and the path of the communication port.
步骤405、将增加待代理端口与组合软件组件的通信端口之间的代理连线后的代理文档发送至架构设计模组,以使架构设计模组根据代理文档生成待代理端口与组合软件组件的通信端口之间的代理关系。Step 405: Send the proxy document after adding the proxy connection between the port to be proxied and the communication port of the combined software component to the architecture design module, so that the architecture design module generates a proxy relationship between the port to be proxied and the communication port of the combined software component according to the proxy document.
本申请的一些实施例中,在添加完对每一待代理端口对应的通信端口标签和代理连线标签后,可保存对应的代理文档,并将增加了待代理端口与组合软件组件的通信端口之间的代理连线后的代理文档发送至架构设计模组,该架构设计模组可根据该代理文档进行下一步代理关系映射和底软配置等,从而实际构建待代理端口与对应通信端口之间的代理关系。In some embodiments of the present application, after adding the communication port label and proxy connection label corresponding to each port to be proxied, the corresponding proxy document can be saved, and the proxy document with the proxy connection added between the port to be proxied and the communication port of the combined software component can be sent to the architecture design module. The architecture design module can perform the next step of proxy relationship mapping and underlying software configuration based on the proxy document, thereby actually constructing the proxy relationship between the port to be proxied and the corresponding communication port.
本申请实施例提供的技术方案,通过针对每一待代理端口,生成该代理端口对应通信端口的通信端口标签,将上述通信端口标签写入代理文档中用于记录通信端口的第一预设位置处,生成该代理端口与对应通信端口之间的代理连线标签,将上述代理连线标签写入代理文档中用于记录代理连线的第二预设位置处,将增加待代理端口与组合软件组件的通信端口之间的代理连线后的代理文档发送至架构设计模组,以使架构设计模组根据代理文档生成待代理端口与组合软件组件的通信端口之间的代理关系。这一技术方案,通过自动在代理文档中增加待代理端口对应的通信端口标签和代理连线标签,从而使得为待代理端口构建与组合软件组件之间的代理关系,实现了自动构建原子软件组件与组合软件组件之间的代理关系。The technical solution provided by the embodiments of the present application generates, for each port to be proxied, a communication port tag corresponding to the communication port of the proxy port, writes the communication port tag to a first preset location in the proxy document for recording the communication port, generates a proxy connection tag between the proxy port and the corresponding communication port, writes the proxy connection tag to a second preset location in the proxy document for recording the proxy connection, and sends the proxy document with the proxy connection added between the port to be proxied and the communication port of the combined software component to the architecture design module, so that the architecture design module generates a proxy relationship between the port to be proxied and the communication port of the combined software component based on the proxy document. This technical solution automatically establishes a proxy relationship between the port to be proxied and the combined software component by automatically adding the communication port tag and proxy connection tag corresponding to the port to be proxied in the proxy document.
参见图5,为本申请实施例提供的一种软件组件的代理装置的实施例框图。如图5所示,该装置可包括:Refer to Figure 5, which is a block diagram of an embodiment of a software component agent device provided in an embodiment of the present application. As shown in Figure 5, the device may include:
第一获取模块51,用于获取预设的架构设计模组生成的代理文档,所述代理文档包括预设控制器对应的组合软件组件、所述预设控制器包括的多个原子软件组件;A first acquisition module 51 is configured to acquire a proxy document generated by a preset architecture design module, wherein the proxy document includes a combined software component corresponding to a preset controller and multiple atomic software components included in the preset controller;
解析模块52,用于对所述代理文档进行解析,得到包含多个所述原子软件组件的端口信息的端口数据库;A parsing module 52 is configured to parse the proxy document to obtain a port database containing port information of a plurality of the atomic software components;
第二获取模块53,用于获取通信行为汇总表,所述通信行为汇总表包括所述预设控制器与其他控制器之间的通信行为;A second acquisition module 53 is configured to acquire a communication behavior summary table, wherein the communication behavior summary table includes communication behaviors between the preset controller and other controllers;
确定模块54,用于根据所述通信行为汇总表,从多个所述端口数据库中确定待代理端口,并为所述待代理端口增加与所述组合软件组件的通信端口之间的代理连线,以使所述待代理端口通过所述通信端口与所述其他控制器进行通信。The determination module 54 is used to determine the port to be proxied from the multiple port databases according to the communication behavior summary table, and add a proxy connection between the port to be proxied and the communication port of the combined software component, so that the port to be proxied communicates with the other controllers through the communication port.
如图6所示,为本申请实施例提供的一种电子设备的结构示意图,包括处理器61、通信接口62、存储器63和通信总线64,其中,处理器61,通信接口62,存储器63通过通信总线64完成相互间的通信,As shown in FIG6 , a schematic diagram of the structure of an electronic device provided in an embodiment of the present application includes a processor 61, a communication interface 62, a memory 63, and a communication bus 64. The processor 61, the communication interface 62, and the memory 63 communicate with each other through the communication bus 64.
存储器63,用于存放计算机程序;Memory 63, for storing computer programs;
在本申请一个实施例中,处理器61,用于执行存储器63上所存放的程序时,实现前述任意一个方法实施例提供的软件组件的代理方法,包括:In one embodiment of the present application, the processor 61 is configured to implement the software component proxy method provided by any one of the aforementioned method embodiments when executing a program stored in the memory 63, including:
获取预设的架构设计模组生成的代理文档,所述代理文档包括预设控制器对应的组合软件组件、所述预设控制器包括的多个原子软件组件;Obtaining a proxy document generated by a preset architecture design module, wherein the proxy document includes a combined software component corresponding to a preset controller and multiple atomic software components included in the preset controller;
对所述代理文档进行解析,得到包含多个所述原子软件组件的端口信息的端口数据库;Parsing the proxy document to obtain a port database containing port information of a plurality of the atomic software components;
获取通信行为汇总表,所述通信行为汇总表包括所述预设控制器与其他控制器之间的通信行为;Obtaining a communication behavior summary table, wherein the communication behavior summary table includes communication behaviors between the preset controller and other controllers;
根据所述通信行为汇总表,从所述端口数据库中确定待代理端口,并为所述待代理端口增加与所述组合软件组件的通信端口之间的代理连线,以使所述待代理端口通过所述通信端口与所述其他控制器进行通信。According to the communication behavior summary table, a port to be proxied is determined from the port database, and a proxy connection is added between the port to be proxied and the communication port of the combined software component, so that the port to be proxied communicates with the other controllers through the communication port.
本申请实施例还提供了一种存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现如前述任意一个方法实施例提供的软件组件的代理方法的步骤。An embodiment of the present application further provides a storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the software component proxy method provided in any of the aforementioned method embodiments.
以上所文本的装置实施例仅仅是示意性的,其中所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, i.e., they may be located in one place or distributed across multiple network units. Some or all of the modules may be selected based on actual needs to achieve the objectives of this embodiment.
通过以上的实施方式的文本,本领域的技术人员可以清楚地了解到各实施方式可借助软件加通用硬件平台的方式来实现,当然也可以通过硬件。基于这样的理解,上述技术方案本质上或者说对相关技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品可以存储在计算机可读存储介质中,如ROM/RAM、磁碟、光盘等,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行各个实施例或者实施例的某些部分所述的方法。Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented using software plus a general-purpose hardware platform, or alternatively, hardware. Based on this understanding, the essence of the above technical solution, or the portion that contributes to the relevant technology, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM/RAM, a magnetic disk, or an optical disk, and includes a number of instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute the methods described in each embodiment or certain portions of the embodiments.
应理解的是,文中使用的术语仅出于文本特定示例实施方式的目的,而无意于进行限制。除非上下文另外明确地指出,否则如文中使用的单数形式“一”、“一个”以及“所述”也可以表示包括复数形式。术语“包括”、“包含”、“含有”以及“具有”是包含性的,并且因此指明所陈述的特征、步骤、操作、元件和/或部件的存在,但并不排除存在或者添加一个或多个其它特征、步骤、操作、元件、部件、和/或它们的组合。文中文本的方法步骤、过程、以及操作不解释为必须要求它们以所文本或说明的特定顺序执行,除非明确指出执行顺序。还应当理解,可以使用另外或者替代的步骤。It should be understood that the terms used in the text are only for the purpose of the specific example embodiments of the text, and are not intended to be limiting. Unless the context clearly indicates otherwise, the singular forms "one", "an" and "said" as used in the text may also be meant to include plural forms. The terms "comprise", "include", "contain" and "have" are inclusive and therefore specify the existence of the stated features, steps, operations, elements and/or parts, but do not exclude the existence or addition of one or more other features, steps, operations, elements, parts, and/or combinations thereof. The method steps, processes, and operations of the text in the text are not interpreted as necessarily requiring them to be performed in the specific order of the text or instructions, unless the execution order is clearly indicated. It should also be understood that additional or alternative steps can be used.
以上所述仅是本申请的具体实施方式,使本领域技术人员能够理解或实现本申请。对这些实施例的多种修改对本领域的技术人员来说将是显而易见的,本文中所定义的一般原理可以在不脱离本申请的精神或范围的情况下,在其它实施例中实现。因此,本申请将不会被限制于本文所示的这些实施例,而是要符合与本文所申请的原理和新颖特点相一致的最宽的范围。The foregoing is merely a list of specific embodiments of the present application, intended to enable those skilled in the art to understand or implement the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application is not limited to the embodiments shown herein, but is intended to conform to the broadest scope consistent with the principles and novel features of the present application.
Claims (10)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202510378223.XA CN119902747B (en) | 2025-03-28 | 2025-03-28 | Proxy method and device of software component, electronic equipment and storage medium |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202510378223.XA CN119902747B (en) | 2025-03-28 | 2025-03-28 | Proxy method and device of software component, electronic equipment and storage medium |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN119902747A CN119902747A (en) | 2025-04-29 |
| CN119902747B true CN119902747B (en) | 2025-08-15 |
Family
ID=95468519
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202510378223.XA Active CN119902747B (en) | 2025-03-28 | 2025-03-28 | Proxy method and device of software component, electronic equipment and storage medium |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN119902747B (en) |
Citations (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN102214099A (en) * | 2011-06-16 | 2011-10-12 | 浙江大学 | Automatic run-time environment (RTE) code generating method for automobile system architecture (AUTOSAR) |
| CN110476154A (en) * | 2017-04-12 | 2019-11-19 | 华为技术有限公司 | Proxy server device and method for data collection |
Family Cites Families (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| WO2023065218A1 (en) * | 2021-10-21 | 2023-04-27 | 华为技术有限公司 | Mapping relationship generation method and apparatus and storage medium |
| CN117280320A (en) * | 2022-04-20 | 2023-12-22 | 华为技术有限公司 | Mapping relation generation method, device and storage medium |
| CN117082102A (en) * | 2023-09-11 | 2023-11-17 | 岚图汽车科技有限公司 | Vehicle data processing methods, devices and equipment based on service-oriented architecture |
-
2025
- 2025-03-28 CN CN202510378223.XA patent/CN119902747B/en active Active
Patent Citations (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN102214099A (en) * | 2011-06-16 | 2011-10-12 | 浙江大学 | Automatic run-time environment (RTE) code generating method for automobile system architecture (AUTOSAR) |
| CN110476154A (en) * | 2017-04-12 | 2019-11-19 | 华为技术有限公司 | Proxy server device and method for data collection |
Also Published As
| Publication number | Publication date |
|---|---|
| CN119902747A (en) | 2025-04-29 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US20200117486A1 (en) | Method and Apparatus for Composite User Interface Creation | |
| EP1960899B1 (en) | Conforming web services to an updated contract | |
| US7673029B2 (en) | Grid automation bus to integrate management frameworks for dynamic grid management | |
| US8751626B2 (en) | Model-based composite application platform | |
| US8392567B2 (en) | Discovering and identifying manageable information technology resources | |
| US20090165021A1 (en) | Model-Based Composite Application Platform | |
| JPH0962523A (en) | Method and system for controlling event in dispersed operating environment | |
| US7934218B2 (en) | Interprocess communication management using a socket layer | |
| CN110413418A (en) | Cache synchronization device and method, cache synchronization system, electronic equipment | |
| US11552868B1 (en) | Collect and forward | |
| US8739184B2 (en) | System and method for aggregating data from multiple sources to provide a single CIM object | |
| CN116974906A (en) | Code verification method, device, computer equipment and storage medium | |
| CN119557055A (en) | Cross-Kubernetes cluster service access method, device, computer equipment and storage medium | |
| US7907619B2 (en) | Method, system and program product for adapting to protocol changes | |
| CN119902747B (en) | Proxy method and device of software component, electronic equipment and storage medium | |
| CN118796504A (en) | A middleware communication system, method, vehicle-mounted terminal and storage medium | |
| CN108696559A (en) | Method for stream processing and device | |
| CN115225645B (en) | A service update method, device, system and storage medium | |
| US9537736B2 (en) | Methods and systems to generate reports including report references for navigation | |
| US11546405B2 (en) | Methods for exposing mainframe data as a web service and devices thereof | |
| CN120185935B (en) | System resource access method and device and computer equipment | |
| CN118631872A (en) | Cross-domain service control method, device, electronic device and storage medium | |
| Garg | Definition and evaluation of an onboard vehicle API concept | |
| CN120263892A (en) | Method, system, device and medium for synchronizing address books | |
| CN118175173A (en) | Distributed service registration method, device, computer equipment and storage medium |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant |