Software component proxy method and device, electronic equipment and storage medium
By analyzing the proxy documents and communication behavior summary tables generated by the architecture design module, the proxy relationship between the atomic software components and the combined software components is automatically constructed, solving the problem of manual proxy workload and prone to errors, and achieving efficient and accurate proxy relationship construction.
Patent Information
- Application Number
- CN202510378223.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-28
- Publication Date
- 2025-04-29
- Estimated Expiration
- 2045-03-28
AI Technical Summary
In the prior art, the method of manually proxying the ports of atomic software components to the combined software components is relatively laborious and prone to errors, affecting the user experience.
By obtaining the proxy document generated by the preset architecture design module, a port database containing the port information of multiple atomic software components is parsed, and the port to be proxy is determined based on the communication behavior summary table, and a proxy connection between it and the communication port of the combined software components is added.
It realizes the automatic and accurate construction of the proxy relationship between the atomic software components and the combined software components in the controller, reducing manual operations, improving work efficiency and improving user experience.
Smart Images

Figure CN119902747A_ABST
Abstract
Description
Technical Field
[0001] 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
[0002] SOA (Service-Oriented Architecture) is a software design and software architecture pattern that combines different 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. The goal of SOA is to improve the flexibility, scalability, and maintainability of software systems.
[0003] The implementation of application layer functions is realized through Atomic SWC (Atomic Software Componen). Generally, one functional service corresponds to one Atomic Software Component, and the data interaction between the Atomic Software Component and the external server depends on Composition SWC (Composition Software Component). The port of the Atomic Software Component needs to be proxied to the external port of the Composition Software Component so that the Atomic Software Component can directly interact with the external controller through the external port of the Composition Software Component.
[0004] In the related art, when proxying the ports of atomic software components, the architecture design engineer generally performs port checks on each atomic software component after the composite software component is instantiated, and manually proxies the port in the tool by querying the communication behavior of the service in the API (Application Programming Interface) service details table.
[0005] 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 1 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
[0006] The present application provides a software component proxy method, device, electronic device and storage medium to solve the technical problems in the prior art that the method of manually proxying the port of an atomic software component to a combined software component is labor-intensive and prone to errors, thus affecting the user experience.
[0007] 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 a plurality of 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; Acquire 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 proxy is determined from the port database, and a proxy connection is added between the port to be proxy and the communication port of the combined software component, so that the port to be proxy communicates with the other controllers through the communication port.
[0008] As an optional implementation, the proxy document is parsed to obtain a port database containing port information of a plurality of the atomic software components, including: Parsing the proxy document by 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.
[0009] 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 traversed instance, determine the target atomic software component corresponding to the instance according to the reference relationship corresponding to the instance; Determine 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 included in the combined software component, the port database is obtained.
[0010] As an optional implementation, the component information includes proxy connection information of the combined software component, and the proxy connection information includes a port of the atomic software component, a 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, query all current proxy ports 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 a proxy is determined from all the proxy ports.
[0011] As an optional implementation method, a communication behavior summary table is obtained, 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 characterize the relationship between the sender and the receiver between the preset controller and the other controllers in the communication service; A communication behavior summary table is generated according to the communication service and the communication relationship.
[0012] 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, determine the port attribute of the port, the port attribute including the receiver attribute or the sender attribute; Query the name of the communication service to which the port belongs; According to the communication service name, the port attribute, and the controller name of the preset controller, querying the target communication party from the communication behavior summary table; When it is determined that the target communication party is not the preset controller, the port is determined as a proxy port.
[0013] 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 multiple target proxy connection information from the proxy connection information according to the target port attribute; Determine whether the port included in each of the 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.
[0014] 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 label of a communication port corresponding to the proxy port; Writing the communication port label into the proxy document at a first preset position for recording the communication port; generating a proxy connection label between the proxy port and the corresponding communication port; Writing the proxy connection tag into the proxy document at a second preset position 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.
[0015] In a second aspect, the present application provides an agent device for a software component, the device comprising: A first acquisition module is used 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, a plurality of atomic software components included in the preset controller, and proxy connections between the combined software component and some of the atomic software components; A parsing module, used for parsing 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 proxy from the multiple port databases according to the communication behavior summary table, and add a proxy connection between the port to be proxy and the communication port of the combined software component, so that the port to be proxy communicates with the other controllers through the communication port.
[0016] In a third aspect, the present application provides an electronic device, comprising: a processor and a memory, wherein the processor is used 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.
[0017] In a fourth aspect, the present application provides a storage medium storing one or more programs, wherein the one or more programs 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.
[0018] The technical solution provided in 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. After that, 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, so as to build a proxy connection between the ports to be proxied and the combined software component. In this process, the proxy relationship between the atomic software components to be proxied in the controller and the combined software component can be accurately built without involving user operations, thereby realizing the automatic and accurate construction of the proxy relationship between the atomic software components in the controller and the combined software components, thereby improving the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] 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.
[0020] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings required for use in the embodiments or the prior art texts are briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0021] One or more embodiments are exemplarily described by pictures in the corresponding drawings, and these exemplified descriptions do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings represent similar elements, and unless otherwise stated, the figures in the drawings do not constitute proportional limitations.
[0022] Figure 1 A flowchart of an embodiment of a software component proxy method provided in an embodiment of the present application; Figure 2 A flowchart of another software component proxy method provided in an embodiment of the present application; Figure 3 A flowchart of an embodiment of another software component proxy method provided in an embodiment of the present application; Figure 4 A flowchart of an embodiment of a proxy method for a software component provided in an embodiment of the present application; Figure 5A block diagram of an embodiment of an agent device for a software component provided in an embodiment of the present application; Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0023] In order to make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme in the embodiments of the present application will be clearly and completely described in conjunction with the drawings in the embodiments of the present application. Obviously, the embodiments described in the text are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0024] The disclosure below provides many different embodiments or examples to realize the different structures of the present application. In order to simplify the disclosure of the present application, the parts and settings of specific examples are described in detail below. Of course, they are only examples, and the purpose is not to limit the present application. In addition, the present application can repeat reference numbers and / or letters in different examples. This repetition is for the purpose of simplification and clarity, and does not itself indicate the relationship between the various embodiments and / or settings discussed.
[0025] In order to solve the technical problems 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. After that, 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, so as to build 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 built, 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.
[0026] To facilitate understanding of the proxy method of software components provided by this application, the following is an explanation of the professional terms involved in this application: SOA architecture: refers to service-oriented architecture, which is a software design and software architecture pattern that combines different 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. The goal of SOA is to improve the flexibility, scalability, and maintainability of software systems.
[0027] VCU (Vehicle control unit) is the vehicle control unit in the vehicle, also known as the vehicle controller.
[0028] 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).
[0029] Service details communication behavior: describes in detail the service Name, ID (Identity Document) information, network information, deployed server-side controller, received client-side controller information, etc.
[0030] Communication matrix: A table that defines and manages the information exchanged between the 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.).
[0031] SWC (Software Component): used to implement specific Autosar (AUTomotiveOpen System Architecture) application layer functions, and there are many classifications.
[0032] Composition SWC (Combination Software Component): A combined functional module used to combine multiple AtomicSWCs to realize the overall function of the controller.
[0033] Atomic SWC (Atomic Software Component): An independent functional module used to implement specific Autosar application layer functions.
[0034] 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.
[0035] In actual applications, if 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 Atomic SWC needs to be proxied to the external port of Composition SWC, and Composition SWC helps send / receive data from other external controllers.
[0036] The following is a further explanation of 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.
[0037] See also Figure 1 , is a flowchart of an embodiment of a software component proxy method provided in an embodiment of the present application. Figure 1 As shown, the process may include the following steps: 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 a plurality of atomic software components included in the preset controller.
[0038] Step 102: Parse the proxy document to obtain a port database containing port information of multiple atomic software components.
[0039] The following is a unified description of step 101 and step 102: The above-mentioned architecture design module refers to the architecture design tool corresponding to the SOA architecture. The 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 common wiring and proxy wiring for composite software components and atomic software components, and generate corresponding proxy documents.
[0040] 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.
[0041] The above-mentioned proxy connection refers to the proxy mapping relationship between the atomic software component and the combined 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 combined software component.
[0042] 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, which 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.
[0043] The above-mentioned preset controller refers to a controller including an SOA architecture, which may be a vehicle controller of the vehicle or other controllers, and the embodiments of the present application do not impose any restrictions on this.
[0044] 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.
[0045] 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.
[0046] 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 combined 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 combined software combination and the atomic software components.
[0047] Afterwards, a corresponding proxy document may be generated, which 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 the proxy connection between the combined software component and some atomic software components, which is the proxy connection between the combined software component constructed by the automatic proxy connection function and the atomic software component.
[0048] In actual applications, since there are hundreds or thousands of services (atomic software components) that need to be developed in SOA architecture design, and each service has one to dozens or 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 combined software components.
[0049] In this regard, in order to more comprehensively and accurately proxy the ports of each atomic software component to be proxied in the preset controller, the execution subject of the embodiment of the present application can parse the above-mentioned proxy document to obtain a port database containing port information of multiple atomic software components. Among them, through the construction of the port database, the ports of the atomic software components included in the combined software component corresponding to the preset controller can be comprehensively and accurately obtained.
[0050] 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.
[0051] Step 103: Obtain a communication behavior summary table, where the communication behavior summary table includes communication behaviors between the preset controller and other controllers.
[0052] 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.
[0053] 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 controllers. 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.
[0054] 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 receiving data sent by other controllers. The embodiment of the present application does not limit this.
[0055] The above-mentioned proxy port refers to a port that is to establish a proxy connection with the combined software component, that is, the proxy port needs to establish a proxy connection with the port of the combined software component but has not yet established a proxy connection.
[0056] The above-mentioned communication port refers to an external port in the combined software component used for data communication with other controllers.
[0057] 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 embodiments of the present application can obtain a communication behavior summary table between the current preset controller and other controllers, and determine the pending proxy port that needs to be proxied from the above-mentioned port database based on the communication behavior summary table.
[0058] 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.
[0059] As another optional implementation method, the above-mentioned communication behavior summary table may be a constructed table, based on which, the execution subject of the embodiment of the present application may construct the above-mentioned communication behavior summary table.
[0060] As for how to construct the above communication behavior summary table, it can be explained below and will not be described in detail here.
[0061] Afterwards, a proxy connection may be added between the port to be a proxy and the communication port of the combined software component, so that the port to be a proxy can communicate with other controllers through the communication port.
[0062] 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.
[0063] 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 a 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 a 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, so that the port to be proxied can 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. After that, 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, the proxy relationship between the atomic software components to be proxied in the controller and the combined software component can be accurately built without involving user operations, thereby realizing the automatic and accurate construction of the proxy relationship between the atomic software components in the controller and the combined software components, thereby improving the user experience.
[0064] See also Figure 2 , which is a flow chart of an embodiment of another software component proxy method provided in an embodiment of the present application. Figure 2 The process shown in Figure 1 Based on the process shown in FIG. 1 , it describes how to parse the proxy document to obtain a port database containing port information of multiple atomic software components. Figure 2 As shown, the process may include the following steps: 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.
[0065] 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.
[0066] The first parsing algorithm mentioned above refers to an algorithm for parsing the composition software components 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.
[0067] 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 an algorithm pre-stored in a library for parsing XML files that comes with a high-level language.
[0068] 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, and the port attribute 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.
[0069] The above-mentioned port information refers to the relevant information of the ports included in each atomic software component, and the above-mentioned ports may include a sending port for sending data and a receiving port for receiving data.
[0070] 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 embodiments of the present application can obtain a preset parsing algorithm, and parse the proxy document through the parsing algorithm to obtain the component information of the combined software component, and the port corresponding to each atomic software component in all atomic software components.
[0071] 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 through the first parsing algorithm to obtain the component information of the combined software component.
[0072] 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.
[0073] 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 subject 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.
[0074] As an exemplary implementation, after obtaining the above-mentioned proxy document, the execution subject 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.
[0075] The embodiment of the present application does not limit the order of obtaining component information and ports. For example, the proxy document may be parsed by the second parsing algorithm to obtain the port of each atomic software component, and then the proxy document may be parsed by the first parsing algorithm to obtain the component information of the combined software component. For another example, the proxy document may be parsed by the first parsing algorithm and the second parsing algorithm at the same time to obtain the component information of the combined software component and the port corresponding to each atomic software component.
[0076] Step 202: write the port information corresponding to the atomic software component to be proxied into a preset initial port database according to the component information to obtain the port database.
[0077] The above-mentioned atomic software components to be proxied refer to atomic software components with proxy relationships, which may include atomic software components with established proxy connections, and atomic software components with proxy relationships but no established proxy connections.
[0078] 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, and the embodiment of the present application does not limit this.
[0079] The above-mentioned initial port database refers to a database that is pre-established to store the port information of the atomic software components but has not yet stored the port information.
[0080] In some embodiments of the present application, the above-mentioned component information may include each atomic software component instantiated into an instance of a combined software component. Based on this, the execution subject of the embodiments 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.
[0081] 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.
[0082] 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.
[0083] Afterwards, it can be determined whether the target atomic software component has a preset primer tag. The primer tag is used to indicate that the corresponding atomic software component is a virtual component of another controller introduced, and the virtual component cannot establish a proxy relationship with the combined software component.
[0084] 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, and thus the port information of the target atomic software component may be stored in the initial port database.
[0085] 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.
[0086] Finally, according to the above operations, after traversing all instances included in the combined software component, the final port database can be obtained.
[0087] 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 the preset initial port database to obtain the above-mentioned port database. This technical solution, by using the 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 contain the port of each atomic software component to be proxied, thereby realizing a more accurate construction of the port database.
[0088] See also Figure 3 , which is a flow chart of an embodiment of another software component proxy method provided in an embodiment of the present application. Figure 3 The process shown in Figure 2 Based on the process shown in FIG. 1 , it is described how to determine the proxy port from the port database according to the communication behavior summary table when the component information includes the proxy connection information of the combined software component. Figure 3 As shown, the process may include the following steps: Step 301: According to the communication behavior summary table, all current proxy ports are queried from a port database, wherein the proxy ports include ports to be proxied and ports that have been proxied.
[0089] The above-mentioned communication behavior summary table is a summary table including 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.
[0090] 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.
[0091] In another embodiment, the execution subject of the embodiment of the present application may parse the service details table corresponding to the preset controller to obtain the communication service and communication relationship between the preset controller and at least one other controller. The above service details table may describe in detail the service name, ID information, network information, deployed server controller, received client controller information, etc.
[0092] Afterwards, a corresponding communication behavior summary table may be generated according to the above communication services and communication relationships. For example, a communication behavior summary table as shown in Table 1 below may be generated:
[0093] In some embodiments of the present application, when querying all current proxy ports from the port database according to the communication behavior summary table, all ports in the port database can be traversed, and in the traversal process, for each port traversed, the port attribute of the port is determined. The above port attributes include receiver attributes and sender attributes, the above receiver attributes indicate that the port is used to receive data, and the above sender attributes indicate that the port is used to send data.
[0094] Afterwards, you can query the name of the communication service to which the port belongs.
[0095] 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 subject 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.
[0096] 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.
[0097] 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.
[0098] As an optional implementation method, the communication service name, port attribute and preset controller can be used as keywords for query to determine the target communication party corresponding to the port. Taking Table 1 as an example, assuming that the communication service name is AA, the port attribute is the sender (server), and the name of the preset controller is ECU1, then by querying Table 1, the target row with the service name of AA and the server end of ECU1 can be obtained. The client end included in the target row is ECU2, so the target communication party corresponding to the port is ECU2.
[0099] Finally, it can be determined whether the target communication party is the preset controller.
[0100] 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, which is internal communication and does not require a proxy, so it can be determined that the port is not a proxy port.
[0101] 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.
[0102] Optionally, if it is determined that the target communication party is not a 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.
[0103] 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.
[0104] Step 302: According to the above proxy connection information, determine the proxy port to be used from all proxy ports.
[0105] 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.
[0106] The above-mentioned proxy port refers to a port that has a proxy relationship with the combined software component, which may include a port that has established a proxy connection and a port that has not established a proxy connection.
[0107] The above-mentioned ports to be proxied are ports that have a proxy relationship with the combined software component but have not yet established a proxy connection.
[0108] 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 embodiments 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.
[0109] 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 may also include the port attributes of the port of the atomic software component, and the above-mentioned port attributes may include receiver attributes and sender attributes.
[0110] Based on this, when screening the ports to be proxied from all the proxy ports, the target port attribute of each proxy port among all the proxy ports may be determined.
[0111] As an implementation mode, it can be known from the description in step 301 that when a port is determined to be 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.
[0112] Afterwards, a plurality of target proxy connection information may be determined from the above 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.
[0113] Finally, it can be determined whether the port included in each target proxy connection information is the above proxy port.
[0114] Optionally, when it is determined that there is a target proxy connection information including a port that is the above-mentioned proxy port, it means that the proxy port already has connection information, and thus it can be determined that the proxy port is an already proxied port.
[0115] As an exemplary implementation, when a proxied port is determined, in order to distinguish the proxied port, a third preset identifier may be added to the proxied port. The third preset identifier may be the same identifier as the first preset identifier, or may be a different identifier. The embodiment of the present application does not impose any restrictions on this.
[0116] 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 established a proxy connection at this time, and therefore, the proxy port can be determined as a waiting proxy port.
[0117] As an exemplary implementation, 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 may be added to the pending proxy port. The fourth preset identifier may be the same identifier as the second preset identifier, or may be a different identifier. This embodiment of the present application does not impose any limitation on this.
[0118] 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 a second preset identifier and a 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.
[0119] The technical solution provided by the embodiment of the present application queries all current proxy ports from the port database according to the above communication behavior summary table, wherein the above proxy ports include ports to be proxied and proxied ports, and determines the ports to be proxied from all proxy ports according to the above proxy connection information. This technical solution determines the ports with proxy relationships and the ports to be proxied that have proxy relationships but have not yet established proxy relationships according to the two dimensions of the communication behavior summary table containing the communication behaviors between the preset controller and other controllers and the proxy connection information in the combined software component. It can more accurately screen out the ports to be proxied that currently need to establish proxy connections through the two dimensions, thereby realizing accurate determination of the ports to be proxied.
[0120] See also Figure 4 , which is a flow chart of an embodiment of a proxy method for another software component provided in an embodiment of the present application. Figure 4 The process shown in Figure 1 Based on the process shown in FIG. 1 , it is described how to add a proxy connection between the proxy port to be proxied and the communication port of the combined software component. Figure 4 As shown, the process may include the following steps: Step 401: For each proxy port, generate a communication port tag of a communication port corresponding to the proxy port.
[0121] Step 402: Write the communication port tag into the first preset position in the proxy document for recording the communication port.
[0122] The following is a unified description of step 401 and step 402: The communication port label refers to the label of the communication port of the combined software component in the agent document, and 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.
[0123] The first preset position refers to a preset position in the proxy document for recording the communication port information, such as the last line for recording the communication port.
[0124] 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 subject 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.
[0125] Based on this, for each port to be proxied, a communication port label of the communication port corresponding to the port to be proxied can be generated, 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.
[0126] 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 proxy is determined as the name of the communication port.
[0127] After that, the path where the communication port is located can be determined from the pre-parsed interface information, and the path corresponding to the communication port can be generated according to the name of the communication port and the path. For example, if the port name is ZZZ and the parsed path corresponding to the communication port is / SoftwareTypes / Interfaces, then the two can be concatenated to obtain the path corresponding to the communication port as / SoftwareTypes / Interfaces / ZZZ.
[0128] Finally, a communication port label may be generated according to the above UUID, communication port name, and communication port path.
[0129] Step 403: Generate a proxy connection label between the proxy port and the corresponding communication port.
[0130] Step 404: write the proxy connection tag into the proxy document at a second preset position for recording the proxy connection.
[0131] The following is a unified description of step 403 and step 404: 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 agent. 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.
[0132] The second preset position refers to a position for recording proxy connection related information, such as the last line for recording proxy connection information.
[0133] In some embodiments of the present application, after a corresponding communication port for proxying the current port to be proxyed is established, a label for establishing a proxy connection between the two can be generated, and the proxy connection label can be written into the proxy document at a second preset position for recording the proxy connection, so that the architecture design module generates a proxy relationship between the two according to the label.
[0134] As an optional implementation, when generating the corresponding proxy connection label, the UUID of the proxy connection label can be generated using a preset generation library. Afterwards, the names of other proxy connections can be obtained from the proxy connection information of the component information, and a new proxy connection name that is inconsistent with the name of the other proxy connection can be generated based on the name of the other proxy connection. For example, the names of other proxy connections are numbered sequentially.
[0135] 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.
[0136] Afterwards, the path of the communication port corresponding to the port to be proxied can be obtained from the communication port tag.
[0137] 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.
[0138] 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.
[0139] In some embodiments of the present application, after adding the communication port label and the 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 bottom software configuration according to the proxy document, thereby actually constructing the proxy relationship between the port to be proxied and the corresponding communication port.
[0140] The technical solution provided by the embodiment of the present application generates a communication port tag of the communication port corresponding to the proxy port for each port to be proxied, writes the communication port tag into the first preset position 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 into the second preset position in the proxy document for recording the proxy connection, and sends 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 the proxy relationship between the port to be proxied and the communication port of the combined software component according to the proxy document. This technical solution automatically adds the communication port tag and the proxy connection tag corresponding to the port to be proxied in the proxy document, thereby building a proxy relationship between the port to be proxied and the combined software component, thereby realizing the automatic construction of the proxy relationship between the atomic software component and the combined software component.
[0141] See also Figure 5 , is a block diagram of an embodiment of an agent device of a software component provided in an embodiment of the present application. Figure 5 As shown, the device may include: A first acquisition module 51 is used 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 a plurality of atomic software components included in the preset controller; A parsing module 52, used for parsing the proxy document to obtain a port database containing port information of a plurality of the atomic software components; A second acquisition module 53 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; 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 can communicate with the other controllers through the communication port.
[0142] like Figure 6 As shown, it is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application, including a processor 61, a communication interface 62, a memory 63 and a communication bus 64, wherein the processor 61, the communication interface 62, and the memory 63 communicate with each other through the communication bus 64. Memory 63, used for storing computer programs; In one embodiment of the present application, the processor 61 is used to implement the software component proxy method provided by any one of the above method embodiments when executing the 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 a plurality of 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; Acquire 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 proxy is determined from the port database, and a proxy connection is added between the port to be proxy and the communication port of the combined software component, so that the port to be proxy communicates with the other controllers through the communication port.
[0143] An embodiment of the present application further provides a storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of the proxy method for software components provided in any of the aforementioned method embodiments are implemented.
[0144] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the present embodiment.
[0145] Through the text of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a general hardware platform, and of course, by hardware. Based on this understanding, the above technical solution, in essence or in other words, the part that contributes to the relevant technology, can be embodied in the form of a software product, which can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0146] It should be understood that the terms used in the text are only for the purpose of the specific example implementation of the text, and are not intended to be limited. Unless the context clearly indicates otherwise, the singular forms "one", "an" and "said" as used in the text can also be represented to include plural forms. The terms "include", "comprise", "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 their combinations. 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 description, unless the execution order is clearly indicated. It should also be understood that additional or alternative steps can be used.
[0147] The above description is only a specific implementation of the present application, so that those skilled in the art can understand or implement the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest range consistent with the principles and novel features applied for herein.
Claims
1. A software component proxy method, characterized in that: The method comprises: 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 a plurality of 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; Acquire 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 proxy is determined from the port database, and a proxy connection is added between the port to be proxy and the communication port of the combined software component, so that the port to be proxy communicates with the other controllers through the communication port.
2. The method according to claim 1, characterized in that The proxy document is parsed to obtain a port database containing port information of a plurality of the atomic software components, including: Parsing the proxy document by 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.
3. The method according to claim 2, characterized in that 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 traversed instance, determine the target atomic software component corresponding to the instance according to the reference relationship corresponding to the instance; Determine 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 included in the combined software component, the port database is obtained.
4. The method according to claim 2, characterized in that: 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, query all current proxy ports 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 a proxy is determined from all the proxy ports.
5. The method according to claim 4, characterized in that Get a summary of communication behavior, 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 characterize the relationship between the sender and the receiver between the preset controller and the other controllers in the communication service; A communication behavior summary table is generated according to the communication service and the communication relationship.
6. The method according to claim 5, characterized in that 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, determine the port attribute of the port, the port attribute including the receiver attribute or the sender attribute; Query the name of the communication service to which the port belongs; According to the communication service name, the port attribute, and the controller name of the preset controller, querying the target communication party from the communication behavior summary table; When it is determined that the target communication party is not the preset controller, the port is determined as a proxy port.
7. The method according to claim 4, characterized in that The proxy connection information also includes port attributes of the port of the atomic software component, and the port attributes include receiver attributes or sender attributes; 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 multiple target proxy connection information from the proxy connection information according to the target port attribute; Determine whether the port included in each of the 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.
8. The method according to claim 1, characterized in that: 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 label of a communication port corresponding to the proxy port; Writing the communication port label into the proxy document at a first preset position for recording the communication port; generating a proxy connection label between the proxy port and the corresponding communication port; Writing the proxy connection tag into the proxy document at a second preset position 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.
9. A software component agent device, characterized in that: The device comprises: A first acquisition module is used 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 a plurality of atomic software components included in the preset controller; A parsing module, used for parsing 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 proxy from the multiple port databases according to the communication behavior summary table, and add a proxy connection between the port to be proxy and the communication port of the combined software component, so that the port to be proxy communicates with the other controllers through the communication port.
10. An electronic device, characterized in that: include: A processor and a memory, wherein the processor is used to execute an agent program of a software component stored in the memory to implement the agent method of a software component according to any one of claims 1 to 8.
11. A storage medium, characterized in that: The storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the agent method of the software component described in any one of claims 1 to 8.
Citation Information
Patent Citations
Automatic run-time environment (RTE) code generating method for automobile system architecture (AUTOSAR)
CN102214099A
Proxy apparatus and method for data collection
CN110476154A
Mapping relation generation method and device and storage medium
CN116324721A
Vehicle data processing method, device and equipment based on service-oriented architecture
CN117082102A
Mapping relationship generation method and apparatus, and storage medium
WO2023201558A1