Communication method and device based on entity component system and electronic equipment
By processing component data changes and encapsulating communication headers in the Entity Component System (ECS) framework, the problem of low development efficiency in the existing technology is solved, an efficient communication process is achieved, and communication protocols and data processing are simplified.
Patent Information
- Application Number
- CN202410878655.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-02
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2044-07-02
AI Technical Summary
When the existing technology uses simple strings, JSON strings or key-value communication methods, the strings or key values between functions are different, causing developers to repeatedly read documents and repeatedly develop the same communication code, resulting in low development efficiency. .
By obtaining component data change information according to user interaction instructions in the Entity Component System (ECS) framework, modifying the component data of the target rendering model, loading it into the communication body, encapsulating the matching communication header, and sending it to the receiving end for analysis .
There is no need to repeatedly develop a large amount of code. Secondary developers only need to understand the communication header, which significantly improves development efficiency, simplifies communication protocols, and improves the consistency and efficiency of data processing.
Smart Images

Figure CN118860342A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of communications, and in particular to a communication method, device and electronic equipment based on a physical component system. Background Art
[0002] Cloud rendering allows users to process complex graphics rendering tasks on a remote server, and then transmit the rendering results to the user's terminal device through the network, greatly reducing the burden on local hardware and achieving high-quality visual effects and smooth interactive experience.
[0003] As an advanced software architecture pattern, Entity Component System (ECS) is widely used in game development and complex system simulation. It achieves highly modular and data-driven design by decomposing objects into basic entities, components, and systems, greatly improving development efficiency and runtime performance.
[0004] The disadvantage of traditional plain strings, JSON strings or key-value communication methods that are unrelated to the entity component system is that different strings or key values in different functions require each new function to be defined by the developer, and there is no direct surface connection between the key value in the communication and the specific function in the function implementation. That is, the existing technology requires secondary developers to read the document to understand the meaning of the corresponding string or key value defined by the primary developer, and the secondary developers also need to repeatedly develop the same communication code, which is inefficient. Summary of the invention
[0005] In view of the above problems, the present invention provides a communication method, device and electronic device based on a physical component system, which overcome the above problems or at least partially solve the above problems.
[0006] In a first aspect, a communication method based on an entity component system comprises:
[0007] According to user interaction instructions, obtain component data change information in the ECS framework;
[0008] The component data of the corresponding component in the target rendering model is changed to the component data change information to obtain new component data, wherein the component data and the component data change information both correspond to the same ECS component and are both stored in the front end;
[0009] Loading the new component data into a communication body, and encapsulating a matching communication header for the communication body, wherein the type of the communication header matches the new component data;
[0010] The encapsulated communication body is sent to a receiving end, so that the receiving end can parse the communication header and the component data based on the ECS framework.
[0011] Optionally, in some optional implementations, before obtaining component data change information in the ECS framework according to the user interaction instruction, the method further includes:
[0012] Obtain the user interaction instructions entered by the user in the front-end interactive interface.
[0013] Optionally, in some optional implementations, obtaining component data change information in the ECS framework according to the user interaction instruction includes:
[0014] Determining, according to the user interaction instruction, a user demand corresponding to the user interaction instruction;
[0015] Component data change information in the ECS framework corresponding to the user demand is determined, wherein the user demand is a user's rendering demand for an ECS component of a target rendering model, and the component data change information reflects a change target of component data of the corresponding ECS component.
[0016] Optionally, in some optional implementations, changing the component data of the corresponding component in the target rendering model to the component data change information to obtain new component data includes:
[0017] According to the demand information, query and determine the component data of the ECS component of the corresponding target rendering model;
[0018] The component data obtained by the query is modified into the component data change information to change the component data of the ECS component of the target rendering model, and obtain new component data of the ECS component of the target rendering model.
[0019] Optionally, in some optional implementations, loading the new component data into a communication body and encapsulating a matching communication header for the communication body includes:
[0020] Loading the new component data into the communication body;
[0021] A matching communication header is selected and encapsulated according to the new component data, wherein the communication header is a communication header of a physical node change type or a component information change type.
[0022] Optionally, in some optional implementations, sending the encapsulated communication body to a receiving end so that the receiving end can parse the communication header and the component data based on the ECS framework includes:
[0023] Sending the encapsulated communication body to a receiving end;
[0024] The receiving end parses the communication header in the communication body to determine the target function operation corresponding to the communication header;
[0025] The receiving end parses the new component data in the communication body to determine the data used by the corresponding ECS component to perform the target function operation.
[0026] Optionally, in some optional implementations, after the receiving end parses the new component data in the communication body and determines the data used by the corresponding ECS component to perform the target function operation, the method further includes:
[0027] The receiving end executes the target function operation through the corresponding ECS component according to the new component data to perform rendering corresponding to the target function operation.
[0028] Optionally, in some optional implementations, after the receiving end completes the target functional operation through the corresponding ECS component according to the new component data to perform rendering corresponding to the target functional operation, the method further includes:
[0029] After executing the target function operation, the receiving end updates the component data of the corresponding ECS component stored in the background;
[0030] The receiving end returns the rendering result of the target function operation to the sending end of the communication body.
[0031] In a second aspect, a communication device based on an entity component system includes: a change information obtaining unit, a component information changing unit, a communication body constructing unit, and a communication body sending unit;
[0032] The change information obtaining unit is used to obtain component data change information in the ECS framework according to the user interaction instruction;
[0033] The component information changing unit is used to change the component data of the corresponding component in the target rendering model to the component data change information to obtain new component data, wherein the component data and the component data change information both correspond to the same ECS component and are both stored in the front end;
[0034] The communication body construction unit is used to load the new component data into the communication body and encapsulate a matching communication header for the communication body, wherein the type of the communication header matches the new component data;
[0035] The communication body sending unit is used to send the encapsulated communication body to the receiving end, so that the receiving end can parse the communication header and the component data based on the ECS framework.
[0036] In a third aspect, a computer-readable storage medium stores a program, wherein when the program is executed by a processor, the communication method based on the entity component system described in any one of the above items is implemented.
[0037] In a fourth aspect, an electronic device comprises at least one processor, and at least one memory and a bus connected to the processor; wherein the processor and the memory communicate with each other via the bus; and the processor is used to call program instructions in the memory to execute any one of the above-mentioned communication methods based on the entity component system.
[0038] By means of the above technical scheme, the present invention provides a communication method, device and electronic device based on the entity component system, which can obtain component data change information in the ECS framework according to user interaction instructions; change the component data of the corresponding component in the target rendering model to the component data change information to obtain new component data, wherein the component data and the component data change information correspond to the same ECS component and are stored in the front end; load the new component data into the communication body, and encapsulate a matching communication header for the communication body, wherein the type of the communication header matches the new component data; send the encapsulated communication body to the receiving end, so that the receiving end can parse the communication header and the component data based on the ECS framework. It can be seen from this that the present invention only modifies the component data and encapsulates the corresponding communication header when communicating, without the need to repeatedly develop a large amount of code, and only requires secondary developers to understand the communication header, without having to read the document defined by the primary developer, which is more convenient and has higher development efficiency.
[0039] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented according to the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present invention. Moreover, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:
[0041] Figure 1 A flow chart of a communication method based on an entity component system provided by the present invention is shown;
[0042] Figure 2 A schematic structural diagram of a communication device based on an entity component system provided by the present invention is shown;
[0043] Figure 3 A structural schematic diagram of an electronic device provided by the present invention is shown. DETAILED DESCRIPTION
[0044] The exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present invention are shown in the accompanying drawings, it should be understood that the present invention can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided in order to enable a more thorough understanding of the present invention and to enable the scope of the present invention to be fully communicated to those skilled in the art.
[0045] like Figure 1 As shown, the present invention provides a communication method based on an entity component system, including: S100, S200, S300 and S400;
[0046] S100, obtaining component data change information in the ECS framework according to user interaction instructions;
[0047] Optionally, the present invention can be applied to the communication part of a cross-platform 3D visualization and real-time rendering system. Existing communication methods use strings, key-value formats or traditional API communications, which are highly customized and require a large amount of development and maintenance work. To this end, the present invention improves the communication part of a cross-platform 3D visualization and real-time rendering system. The ECS architecture concept is introduced into the communication data to achieve unified processing of communication data and local data, thereby improving development efficiency and system performance. In addition, due to the use of the innovative communication body data format based on the ECS concept, the data formats of all functions will be unified, which simplifies the communication protocol compared to the existing key-value communication data and strings, and improves the consistency and efficiency of data processing.
[0048] That is, when developing local functions, all user requirements are converted into component data changes of the ECS system. Specifically, the present invention generally converts into three entity node changes (adding nodes, deleting nodes, and node data changes) and three component information changes (node adding components, node deleting components, and node component changes); the format is unified in that the data carried by the communication body is consistent with the ECS data changes generated by the aforementioned local functions, that is, from the perspective of the functional subsystem, there is no need to distinguish whether it is a communication instruction or a local instruction.
[0049] Optionally, the front end of the present invention may obtain a user interaction instruction, and then obtain corresponding component data change information according to the user interaction instruction.
[0050] That is, in some optional embodiments, before S100, the method further includes: step 1.1;
[0051] Step 1.1: Obtain the user interaction instruction input by the user in the front-end interaction interface.
[0052] Optionally, in some optional embodiments, the S100 includes: step 2.1 and step 2.2;
[0053] Step 2.1: determining the user demand corresponding to the user interaction instruction according to the user interaction instruction;
[0054] Step 2.2: Determine component data change information in the ECS framework corresponding to the user demand, wherein the user demand is the user's rendering demand for the ECS component of the target rendering model, and the component data change information reflects the change target of the component data of the corresponding ECS component.
[0055] Optionally, the present invention may design and implement a user interaction interface at the front end, including but not limited to a view display area, user input controls, and necessary feedback prompts.
[0056] For example, the present invention uses the model focus function in three interactive places: double-clicking the corresponding model in the model organization tree, clicking the focus button in the model properties, and double-clicking the corresponding model in the three-dimensional view. These three operations at the front end will generate user needs for "model focus", that is, the corresponding component data change information can be "need to focus", and the present invention does not limit this.
[0057] S200, changing the component data of the corresponding component in the target rendering model to the component data change information to obtain new component data;
[0058] Wherein, the component data and the component data change information both correspond to the same ECS component and are both stored in the front end;
[0059] Optionally, in some optional embodiments, the S200 includes: step 3.1 and step 3.2;
[0060] Step 3.1, query and determine the component data of the ECS component of the corresponding target rendering model according to the demand information;
[0061] Step 3.2: modify the component data obtained by the query into the component data change information to change the component data of the ECS component of the target rendering model, and obtain new component data of the ECS component of the target rendering model.
[0062] Optionally, as mentioned above, after the front end generates a user demand for "model focus", the present invention can query the corresponding model information (including component data) in the front-end data, and then modify the component data of the model focus component in the model information to "need to focus", and the present invention does not impose any restrictions on this.
[0063] Specifically, the present invention can query the model focus component carried by the model entity node in the front-end tree data structure according to the model uuid corresponding to the "model focus" requirement, and the present invention does not impose any limitation on this.
[0064] Optional, Model: is a three-dimensional model, composed of vertices and patches in computer graphics, and usually also includes materials and reactions to light, etc. The model is presented on the user's screen through rendering.
[0065] Model UUID: It is the unique code of each model in the system. It remains unchanged after the system is restarted. The UUID will also change after the model is changed.
[0066] Model entity node: The model tree is a method for organizing models in this system. The model tree is composed of nodes. Nodes are divided into conceptual nodes and entity nodes. Entity nodes with model components are called model entity nodes. For example, a community scene is organized according to tree logic. The public area is a node. Under the public area, there are nodes such as greening, lighting, and fire protection. These nodes are all conceptual nodes. However, the fire hydrant No. xx under the fire protection node and the model component of this fire hydrant is a model entity node.
[0067] Model Focus Component: Model Focus Component is a type of component. Other common components include Transformation Component, etc.
[0068] Optionally, the present invention can maintain a tree data structure for an entity component system at the front end (i.e., the aforementioned front end data), and the tree data structure includes the tree relationship of entities and the component types and component data carried by each entity. When the front end needs to communicate, the present invention can use a new communication format optimized based on the ECS concept - adding a communication header in front of part of the tree data structure. Please check the subsequent process for details.
[0069] S300, loading the new component data into a communication body, and encapsulating a matching communication header for the communication body;
[0070] wherein the type of the communication header matches the new component data;
[0071] Optionally, in some optional implementations, the S300 includes: step 4.1 and step 4.2;
[0072] Step 4.1, loading the new component data into the communication body;
[0073] Step 4.2: Select and encapsulate a matching communication header according to the new component data, wherein the communication header is a communication header of a physical node change type or a component information change type.
[0074] Optionally, the present invention can load new component data into the communication body and then send it to the receiving end together with a suitable communication header. Taking the above-mentioned user demand of "model focus" as an example, the "need to focus" is transferred into the communication body and then sent to the receiving end together with a communication header of the type of node component change.
[0075] It should be noted that the present invention does not impose specific restrictions on the type of communication header, and it can be set according to actual needs. For example, it can be generally divided into communication headers such as entity node change type, component information change type, communication establishment type, survival confirmation type, active and passive disconnection type, and initialization communication type. The entity node change type can be further subdivided into adding nodes, deleting nodes, and node data changes. The component information change type can be further subdivided into node adding components, node deleting components, and node component changes. The initialization communication type can be further subdivided into scene (model tree) creation and scene (model tree) removal, and the present invention does not impose any restrictions on this.
[0076] S400: Send the encapsulated communication body to a receiving end, so that the receiving end can parse the communication header and the component data based on the ECS framework.
[0077] Optionally, in some optional implementations, the S400 includes: step 5.1, step 5.2 and step 5.3;
[0078] Step 5.1, sending the encapsulated communication body to the receiving end;
[0079] Step 5.2, the receiving end parses the communication header in the communication body to determine the target function operation corresponding to the communication header;
[0080] Step 5.3: The receiving end parses the new component data in the communication body to determine the data used by the corresponding ECS component to perform the target function operation.
[0081] Optionally, after receiving the communication body, the backend (i.e., the receiving end) can select a corresponding parsing method according to the communication header. For example, as in the above example, for the communication body of node component change (ComponentChanged) + need to focus (UEModel), the parsing result is the component change of the UEModel functional subsystem, and the present invention does not limit this.
[0082] Specifically, the present invention can parse the communication type according to the type in the communication header. According to the type in the data of the corresponding communication type, the specific functional operation can be parsed. For example, in the above example, type: "ComponentChanged" indicates component data change, and type: "UEModel" indicates the task of the UEModel functional system. The UEModel functional system implements the model focus function according to focus = true.
[0083] Optionally, after parsing the communication header, the backend may forward the data to a shared ECS data center for subsequent processing according to the instructions of the communication header, and the present invention does not impose any limitation on this.
[0084] Optionally, in certain optional embodiments, after step 5.3, the method further comprises: step 6.1;
[0085] Step 6.1: The receiving end executes the target function operation through the corresponding ECS component according to the new component data to perform rendering corresponding to the target function operation.
[0086] Optionally, after the ECS component executes the target function operation, component data of the ECS component after the target function operation is completed is generated, and then a corresponding rendering task is executed, which is not limited in the present invention.
[0087] Optionally, in certain optional embodiments, after step 6.1, the method further comprises: step 7.1 and step 7.2;
[0088] Step 7.1, after executing the target function operation, the receiving end updates the component data of the corresponding ECS component stored in the background;
[0089] Step 7.2: The receiving end returns the rendering result of the target function operation to the sending end of the communication body.
[0090] Optionally, after the target function operation of the present invention is completed, the receiving end can update the component data of the ECS component and return the rendering result to the front end through the same communication channel as when it came. The front end receives the data and the rendering result for display, completing an interactive closed loop.
[0091] Optionally, the relevant functional subsystem may have subsequent actions after completing the rendering task. For example, in this example, after completing the model focusing, the focus value will be set to false again. The present invention does not impose any limitation on this.
[0092] In summary, the whole process of the present invention is roughly as follows: the user generates an intention, the front end generates data (such as data A), sends it to the back end, the back end parses and forwards it to the functional module, the focusing functional module parses and executes the focus, generates the component data of the executed ECS component (corresponding to data A), generates and executes the rendering task, the component data result (corresponding to data A) is returned to the front end, and the rendering result is returned to the front end. The user performs the operation and finally obtains the rendering result. The ECS data is in the background and is generally not visible to the user.
[0093] Optionally, the present invention borrows the idea of ECS to unify and summarize the component data used in the system, and innovatively improves the ECS system so that its component data is used for communication, thereby achieving corresponding beneficial effects:
[0094] Compared with the traditional string or key-value communication format, which requires one or more keys to be newly defined for each function, the present invention uses a unified communication format for all functional data, greatly reducing the amount of development. Because the system and communication are based on the ECS conceptual architecture, the data can be interoperable through simple transformations, so that the communication data and local instructions are completed by the same execution unit, decoupling the communication system and the functional system, thereby improving the reusability and maintainability of the code. Make full use of the rich development tools of the front-end user interaction interface and the powerful rendering capabilities of the back-end or cloud, each performing its own duties, and compared with the back-end user interaction interface, it is clearer and more beautiful most of the time and under most conditions.
[0095] like Figure 2 As shown, the present invention provides a communication device based on an entity component system, comprising: a change information obtaining unit 100, a component information changing unit 200, a communication body constructing unit 300 and a communication body sending unit 400;
[0096] The change information obtaining unit 100 is used to obtain component data change information in the ECS framework according to a user interaction instruction;
[0097] The component information changing unit 200 is used to change the component data of the corresponding component in the target rendering model to the component data change information to obtain new component data, wherein the component data and the component data change information both correspond to the same ECS component and are stored in the front end;
[0098] The communication body construction unit 300 is used to load the new component data into the communication body and encapsulate a matching communication header for the communication body, wherein the type of the communication header matches the new component data;
[0099] The communication body sending unit 400 is used to send the encapsulated communication body to the receiving end, so that the receiving end can parse the communication header and the component data based on the ECS framework.
[0100] Optionally, in certain optional embodiments, the apparatus further comprises: an instruction obtaining unit;
[0101] The instruction obtaining unit is used to obtain the user interaction instruction input by the user in the front-end interaction interface before obtaining the component data change information in the ECS framework according to the user interaction instruction.
[0102] Optionally, in some optional implementations, the change information obtaining unit 100 includes: a demand determination subunit and a change information determination subunit;
[0103] The demand determination subunit is used to determine the user demand corresponding to the user interaction instruction according to the user interaction instruction;
[0104] The change information determination subunit is used to determine the component data change information in the ECS framework corresponding to the user demand, wherein the user demand is the user's rendering demand for the ECS component of the target rendering model, and the component data change information reflects the change target of the component data of the corresponding ECS component.
[0105] Optionally, in some optional implementations, the component information changing unit 200 includes: a component data query subunit and a component information changing subunit;
[0106] The component data query subunit is used to query and determine the component data of the ECS component of the corresponding target rendering model according to the demand information;
[0107] The component information changing subunit is used to modify the component data obtained by querying into the component data change information to change the component data of the ECS component of the target rendering model and obtain new component data of the ECS component of the target rendering model.
[0108] Optionally, in some optional implementations, the communication body construction unit 300 includes: a data loading subunit and a data encapsulation subunit;
[0109] The data loading subunit is used to load the new component data into the communication body;
[0110] The data encapsulation subunit is used to select and encapsulate a matching communication header according to the new component data, wherein the communication header is a communication header of a physical node change type or a component information change type.
[0111] Optionally, in some optional implementations, the communication body sending unit 400 includes: an information sending subunit, a communication header parsing subunit and a data parsing subunit;
[0112] The information sending subunit is used to send the encapsulated communication body to the receiving end;
[0113] The communication header parsing subunit is used for the receiving end to parse the communication header in the communication body and determine the target function operation corresponding to the communication header;
[0114] The data parsing subunit is used for the receiving end to parse the new component data in the communication body and determine the data used by the corresponding ECS component to perform the target function operation.
[0115] Optionally, in some optional implementations, the apparatus further comprises: a rendering unit;
[0116] The rendering unit is used to parse the new component data in the communication body at the receiving end, determine the data used by the corresponding ECS component to perform the target function operation, and then execute the target function operation through the corresponding ECS component according to the new component data to perform rendering corresponding to the target function operation.
[0117] Optionally, in certain optional embodiments, the device further comprises: a data updating unit and a result returning unit;
[0118] The data updating unit is used to complete the target function operation through the corresponding ECS component at the receiving end according to the new component data to perform rendering corresponding to the target function operation, and after executing the target function operation, update the component data of the corresponding ECS component stored in the background;
[0119] The result returning unit is used to return the rendering result of the target function operation to the sending end of the communication body.
[0120] The present invention provides a computer-readable storage medium on which a program is stored. When the program is executed by a processor, the communication method based on the entity component system described in any one of the above items is implemented.
[0121] like Figure 3 As shown, the present invention provides an electronic device 70, which includes at least one processor 701, and at least one memory 702 and a bus 703 connected to the processor 701; wherein the processor 701 and the memory 702 communicate with each other through the bus 703; the processor 701 is used to call the program instructions in the memory 702 to execute any of the above-mentioned communication methods based on the entity component system.
[0122] In the present invention, relational terms such as first and second, etc. are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprise", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0123] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0124] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined in the present invention may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown in the present invention, but will conform to the widest scope consistent with the principles and novel features disclosed in the present invention.
[0125] The above description is only a preferred embodiment of the present invention and is not intended to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.
Claims
1. A communication method based on an entity component system, characterized in that: include: According to user interaction instructions, obtain component data change information in the ECS framework; The component data of the corresponding component in the target rendering model is changed to the component data change information to obtain new component data, wherein the component data and the component data change information both correspond to the same ECS component and are both stored in the front end; Loading the new component data into a communication body, and encapsulating a matching communication header for the communication body, wherein the type of the communication header matches the new component data; The encapsulated communication body is sent to a receiving end, so that the receiving end can parse the communication header and the component data based on the ECS framework.
2. The method according to claim 1, characterized in that Before obtaining component data change information in the ECS framework according to the user interaction instruction, the method further includes: Obtain the user interaction instructions entered by the user in the front-end interactive interface.
3. The method according to claim 2, characterized in that The component data change information in the ECS framework is obtained according to the user interaction instruction, including: Determining, according to the user interaction instruction, a user demand corresponding to the user interaction instruction; Component data change information in the ECS framework corresponding to the user demand is determined, wherein the user demand is a user's rendering demand for an ECS component of a target rendering model, and the component data change information reflects a change target of component data of the corresponding ECS component.
4. The method according to claim 3, characterized in that The step of changing the component data of the corresponding component in the target rendering model to the component data change information to obtain new component data includes: According to the demand information, query and determine the component data of the ECS component of the corresponding target rendering model; The component data obtained by the query is modified into the component data change information to change the component data of the ECS component of the target rendering model, and obtain new component data of the ECS component of the target rendering model.
5. The method according to claim 1, characterized in that The step of loading the new component data into a communication body and encapsulating a matching communication header for the communication body comprises: Loading the new component data into the communication body; A matching communication header is selected and encapsulated according to the new component data, wherein the communication header is a communication header of a physical node change type or a component information change type.
6. The method according to claim 1, characterized in that The step of sending the encapsulated communication body to a receiving end so that the receiving end can parse the communication header and the component data based on the ECS framework includes: Sending the encapsulated communication body to a receiving end; The receiving end parses the communication header in the communication body to determine the target function operation corresponding to the communication header; The receiving end parses the new component data in the communication body to determine the data used by the corresponding ECS component to perform the target function operation.
7. The method according to claim 6, characterized in that After the receiving end parses the new component data in the communication body and determines the data used by the corresponding ECS component to perform the target function operation, the method further includes: The receiving end executes the target function operation through the corresponding ECS component according to the new component data to perform rendering corresponding to the target function operation.
8. The method according to claim 7, characterized in that After the receiving end completes the target function operation through the corresponding ECS component according to the new component data to perform rendering corresponding to the target function operation, the method further includes: After executing the target function operation, the receiving end updates the component data of the corresponding ECS component stored in the background; The receiving end returns the rendering result of the target function operation to the sending end of the communication body.
9. A communication device based on an entity component system, characterized in that: include: A change information obtaining unit, a component information changing unit, a communication body constructing unit and a communication body sending unit; The change information obtaining unit is used to obtain component data change information in the ECS framework according to the user interaction instruction; The component information changing unit is used to change the component data of the corresponding component in the target rendering model to the component data change information to obtain new component data, wherein the component data and the component data change information both correspond to the same ECS component and are both stored in the front end; The communication body construction unit is used to load the new component data into the communication body and encapsulate a matching communication header for the communication body, wherein the type of the communication header matches the new component data; The communication body sending unit is used to send the encapsulated communication body to the receiving end, so that the receiving end can parse the communication header and the component data based on the ECS framework.
10. An electronic device, characterized in that: The electronic device includes at least one processor, and at least one memory and a bus connected to the processor; wherein the processor and the memory communicate with each other via the bus; the processor is used to call program instructions in the memory to execute the communication method based on the entity component system as described in any one of claims 1 to 8.
Citation Information
Patent Citations
Web front end message bus system
CN107291523A
Method and system for supporting massive entities in large scene based on grid technology
CN116737388A
Component display method and device based on data large screen, equipment and medium
CN118131949A
Data distribution system based on asynchronous message exchange.
EP2549715A1
Method and system for improved performance of a video game engine
US20190377672A1
