Implementation Method for Lightweight Client Data Interaction Structure of Video Fusion Platform
By adopting hierarchical structure design and packaging technology in the PC client of the video convergence platform, the problems of high maintenance costs, complex structure and redundancy are solved, and the rapid iteration and efficient maintenance of the system are achieved.
Patent Information
- Application Number
- CN202411765671.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-04
- Publication Date
- 2025-06-13
- Estimated Expiration
- 2044-12-04
AI Technical Summary
The PC clients of existing video convergence platforms have problems such as high maintenance costs, high coupling, structural redundancy, unclear module responsibilities and difficulty in rapid iteration in terms of design and maintenance.
A lightweight client designed with a hierarchical structure is used to divide the client into a user layer and an intermediate layer, and encapsulate each layer of structure into an independent library, optimize the communication mechanism, strip the communication data and create the encapsulation library independently, thereby achieving rapid iteration and functional deployment.
It significantly improves the maintainability, flexibility and scalability of the system, reduces the difficulty and workload of modification, avoids the chain reaction caused by local changes, and supports rapid iteration and continuous integration.
Smart Images

Figure CN119232986B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of client design in the video surveillance industry, and particularly relates to a method for implementing a lightweight client data interaction structure of a video fusion platform. Background Art
[0002] As a PC client of a video fusion platform, once its design is finalized, modifying its functions or styles again will face the challenges of long cycle and high workload, which is almost equivalent to reconstructing the entire client. In the existing related technologies, the design of the PC client mixes multiple links such as UI input, data encapsulation, and communication together, making each module an independent entity. Therefore, if it is necessary to replace the style of the client, it is necessary to redesign the UI interface, repackage the data, and adjust the relevant communication data to ensure the coordination of the entire system.
[0003] If you want to modify the functions and styles of the client, since the client mixes all the processes together, the existing related technologies have at least the following deficiencies:
[0004] 1. High maintenance cost: From the perspective of maintenance cost, due to the high correlation of the client design, any minor modification to the UI may trigger a comprehensive adjustment of the entire system, including multiple aspects such as styles, data processing, and communication. This characteristic of "pulling one hair and moving the whole body" not only increases the workload of modification but also improves the difficulty of modification;
[0005] 2. Bulky structure: There is a problem with the bulky structure of the client. The high coupling and low cohesion of data lead to unclear system layering. Various functions such as UI design, data processing, and communication are often mixed between modules, resulting in a high coupling degree between modules;
[0006] 3. Structural redundancy: There is a problem of structural redundancy in the existing client structure. For example, Module A implements a communication method TA according to the business, and Module B also implements a communication method TB according to the business. TA and TB have something in common, but they are implemented separately, reinventing the wheel. Just due to the distinction of the business, they cannot be unified. Although more code is written, the structure is very redundant. Due to the fact that similar communication methods may be adopted between different modules but no unified standard is implemented, the code duplication degree is high and the structure is redundant;
[0007] 4. In terms of adding new module functions, due to the high coupling between existing modules, it is very difficult to isolate a certain module and reuse it in other scenarios. This requires developers to make comprehensive modifications from top to bottom when adding new functions, increasing the complexity and cost of development;
[0008] 5. The division of responsibilities among modules is also unclear. Some modules may undertake multiple unrelated responsibilities, making the purpose and function of the modules ambiguous. This not only reduces the maintainability of the system but also increases the risk of system failures.
[0009] In summary, there are many challenges and problems in the design and maintenance of the existing PC clients of video fusion platforms. Therefore, it is necessary for technical personnel to provide a new solution to reconstruct and optimize the design of aspects such as the client communication method, and improve the maintainability, scalability, and performance of the system. Summary of the Invention
[0010] In view of the limitations of the prior art, the present invention proposes a method for implementing a lightweight client data interaction structure of a video fusion platform. The client designed by this method adopts a hierarchical structure, and only needs to modify some parts of the corresponding layer without comprehensive adjustment, so as to achieve rapid iteration. This method solves problems such as high maintenance costs, complex and redundant structures, and difficulties in adding new modules of traditional clients. Through the implementation method of the present invention, innovative encapsulation technologies are provided, significantly improving the maintainability, flexibility, and scalability of the system.
[0011] To achieve the above object, the technical solution adopted by the present invention is: A method for implementing a lightweight client data interaction structure of a video fusion platform, characterized in that it includes the following steps:
[0012] Design a hierarchical structure for the client to achieve hierarchical structure;
[0013] Encapsulate each layer of the structure to form an independent encapsulation library;
[0014] Optimize the communication mechanism inside the client, strip the communication data, and independently create an encapsulation library for data communication; make the client itself lighter, so as to achieve rapid function iteration;
[0015] If it is necessary to modify a certain layer of the structure, the independent data communication encapsulation library can be used for communication, replace and / or modify the encapsulation library of this layer of the structure, without changing other structures in the client.
[0016] Further, the hierarchical structure of the client at least includes a user layer and an intermediate layer; among which
[0017] The user layer at least includes a UI layer, a data management layer, and a data request layer; among which
[0018] The UI layer is used for interacting with users. Users can input information and obtain the information that has been returned. The UI layer can display the returned information; the data management layer is used to manage the data input by users, construct a data structure to store user data, and process the data returned from the server; the data request layer is used to call the interface information of the middle layer and establish a connection bridge with the middle layer;
[0019] The middle layer at least includes a communication data management layer and a communication layer; among them
[0020] The communication data management layer: unifies the data in xml format to facilitate the transmission and parsing of network data;
[0021] The communication layer is a bridge for communicating with the server; the communication layer includes a small data volume communication layer and a large data volume communication layer.
[0022] Furthermore, the client with a layered structure design at least includes the following data interaction methods:
[0023] Users input data through the UI layer, and the UI layer transmits the user input data to the data management layer;
[0024] The data management layer saves the user data in the data management layer and sends the request data to the data request layer;
[0025] The data request layer makes a data request call to the communication data management layer in the middle layer;
[0026] If it is a user data request, the communication data management layer sends the user data request to the small data volume communication layer in xml format, and then sends the request data to the server through the small data volume communication layer;
[0027] If it is a video data request, the communication data management layer sends the video data request to the large data volume communication layer in xml format, and then sends the request data to the server through the large data volume communication layer;
[0028] The server returns the data layer by layer to the data management layer, and after passing through the data management layer, it is presented to the UI layer.
[0029] Furthermore, the specific implementation methods at least include the following:
[0030] The UI layer, the data management layer, the data request layer, the communication data management layer, and the communication layer are all encapsulated into libraries;
[0031] The UI layer loads the library of the data management layer DataManager and calls the interface DataManagerFunA() provided by the data management layer;
[0032] The data management layer loads the library of the data request layer DataRequest and calls the interface DataRequestFunB() provided by the data request layer;
[0033] The data request layer loads the library of the communication data management layer ComDataManger and calls the interface ComDataMangerFunC() provided by the communication data management layer;
[0034] The communication data management layer loads the library of the communication layer ComData and calls the interface ComDataFunD() provided by the data communication layer;
[0035] After each layer is independently encapsulated into a library, if a certain layer needs to be adjusted, only corresponding modifications need to be made through the communication data management library layer; this method ensures that only the corresponding independently encapsulated library needs to be modified, without the need to comprehensively adjust the entire client, achieving the effect of rapid iteration.
[0036] Furthermore, the implementation method of the new module at least includes the following steps:
[0037] New module UI design: When there is a new module requirement, first perform UI design, and then implement the corresponding interface according to the UI design;
[0038] Implementation of the UI interface: The implementation of the UI interface is at least divided into the UI level and the UI data management level for separate implementation, where
[0039] The UI level part is responsible for presenting the interface display content for the user to view, and it does not involve the data information generated by user interaction; including in the login module, there will be interface elements such as an account input box and a password input box, but it is only an interface shown to the user for operation and does not contain the data actually input by the user;
[0040] The role of the UI data management layer is to uniformly manage the data input by the user; including the account and / or password information input by the user, which is uniformly controlled by this layer;
[0041] After the relevant work at the UI level and the UI data management level is completed, the interfaces of other layers can be called to perform data transmission and data requests.
[0042] The present invention adopts the above technical solutions and has at least the following beneficial effects:
[0043] 1. In the existing technology environment, due to the tight coupling of the client, any minor change, such as the modification of the UI interface, may trigger a comprehensive adjustment to the overall architecture, style, data processing, and communication process; every place where the design needs to be modified requires a format modification. This extensive modification requirement not only significantly increases the workload but also greatly enhances the difficulty of modification;
[0044] To address this issue, the present invention brings innovation to the software development process. By introducing the concept of structural hierarchical design, the present invention allows developers to make adjustments only to specific layers or modules when facing modification requirements, without the need for large-scale adjustments to the entire system. Thus, large-scale work is avoided. This design strategy significantly improves the maintainability and scalability of the software, provides the development team with the ability to flexibly respond to changing requirements, and supports the realization of rapid iteration and continuous integration;
[0045] Specifically, the hierarchical structure ensures that the entire requirement can be completed by modifying only one library. There is no need to modify the entire client, which is convenient for maintenance, has a lightweight structure, and no redundant data. It effectively curbs the phenomenon of "pulling one hair and moving the whole body" and avoids the chain reaction caused by local changes. This feature greatly shortens the modification cycle, improves the development efficiency, makes the software development process smoother, and can better meet the rapidly changing needs of the market and users.
[0046] 2. During the implementation of the present invention, the processing logic of communication data is separated from the client and independently developed into a dedicated encapsulation library. Such a design not only makes the client itself more lightweight but also greatly improves the speed of function iteration. Since the communication logic is encapsulated in an independent library, other parts of the client do not need to be modified to achieve the rapid deployment and update of new functions. This design method effectively isolates the dependency relationships between functional modules, enabling the client to focus more on optimizing the user interface and interaction logic without worrying about changes in the underlying communication mechanism.
[0047] 3. The introduction of the encapsulation library significantly improves the overall efficiency of software development. When developers use the encapsulation library, they only need to call the interface functions provided by the library without delving into the internal implementation details. This approach avoids the duplication of developing the same functional code, that is, the so-called "reinventing the wheel", thus saving a large amount of development time and resources. In addition, the modular design of the encapsulation library simplifies the code maintenance work and reduces the maintenance cost. When the encapsulation library needs to be updated or upgraded, developers can choose a suitable version for replacement without affecting other code parts that depend on the library. This flexibility and maintainability provide a solid foundation for the long-term development of the software. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the accompanying drawings required for the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other accompanying drawings can be obtained based on these drawings.
[0049] Figure 1 It is the implementation flowchart of the lightweight client data interaction structure of the present invention.
[0050] Figure 2 It is the schematic diagram of the client hierarchical structure of the present invention.
[0051] Figure 3 It is the data interaction schematic diagram after the present invention adopts the hierarchical structure.
[0052] Figure 4 It is the schematic diagram of the existing client data interaction.
[0053] Figure 5 It is the schematic diagram of the client data interaction adopting the present invention. Detailed implementation manners
[0054] Here, the exemplary embodiments will be described in detail, and the examples are shown in the accompanying drawings. When the following description involves the accompanying drawings, unless otherwise indicated, the same numbers in different accompanying drawings represent the same or similar elements. The implementation manners described in the following exemplary embodiments do not represent all implementation manners consistent with the present invention. On the contrary, they are only examples of the devices and methods consistent with some aspects of the present invention as detailed in the appended claims.
[0055] Please refer to Figure 1 , this embodiment provides a method for implementing a lightweight client data interaction structure of a video fusion platform, which is characterized in that it includes the following steps:
[0056] Design the hierarchical structure of the client to achieve the hierarchicalization of the structure;
[0057] Package each layer of the structure to form an independent package library;
[0058] Optimize the communication mechanism inside the client, strip the communication data, and independently create a package library for data communication; make the client itself lighter, so as to achieve rapid function iteration;
[0059] If it is necessary to modify a certain layer of the structure, the independent data communication package library can be used for communication, replace and / or modify the package library of this layer of the structure, without changing other structures in the client.
[0060] Such asFigure 2 As shown in Figure 2 , as an implementation, the hierarchical structure of the client in this embodiment at least includes a user layer and an intermediate layer; among them
[0061] The user layer at least includes a UI layer, a data management layer, and a data request layer; among them
[0062] The UI layer is used to interact with the user. The user can input information and obtain the returned information. The UI layer can display the returned information; the data management layer is used to manage the data input by the user, construct a data structure to store user data, and process the data returned from the server; the data request layer is used to call the interface information of the intermediate layer and establish a connection bridge with the intermediate layer;
[0063] The intermediate layer at least includes a communication data management layer and a communication layer; among them
[0064] The communication data management layer: unifies the data in xml format to facilitate the transmission and parsing of network data;
[0065] The communication layer is a bridge for communicating with the server; the communication layer includes a small data volume communication layer and a large data volume communication layer.
[0066] The communication layer is divided into two levels. This is to address the possible problems caused by excessive interaction data volume, that is, the client may experience delays in receiving data, which may lead to data loss. In this embodiment, the communication layer with a smaller data volume involves the data information for interacting with the user, such as the input of account and password. And the communication layer with a larger data volume involves continuous large data interactions such as video streams.
[0067] Such as Figure 2 and Figure 3 As shown in Figure 2 and Figure 3 , as an implementation, the client with a hierarchical structure design in this embodiment at least has the following steps:
[0068] The user inputs data through the UI layer, and the UI layer transmits the user input data to the data management layer;
[0069] The data management layer saves the user data in the data management layer and sends the request data to the data request layer;
[0070] The data request layer makes a data request call to the communication data management layer in the intermediate layer;
[0071] If it is a user data request, the communication data management layer sends the user data request to the small data volume communication layer in xml format, and then sends the request data to the server through the small data volume communication layer;
[0072] If it is a video data request, the communication data management layer sends the video data request to the large data volume communication layer in the format of xml, and then sends the request data to the server through the large data volume communication layer;
[0073] The server returns data layer by layer to the data management layer, and after passing through the data management layer, it is presented to the UI layer.
[0074] In the client structure provided in this embodiment, if there is a change in the corresponding layer, the encapsulation library of the corresponding layer is directly replaced, and other structures do not need to be touched.
[0075] As Figure 5 shown, the specific implementation methods in this embodiment at least include the following:
[0076] The UI layer, data management layer, data request layer, communication data management layer, and communication layer are all encapsulated into libraries;
[0077] The UI layer loads the library of the data management layer DataManager and calls the interface DataManagerFunA() provided by the data management layer;
[0078] The data management layer loads the library of the data request layer DataRequest and calls the interface DataRequestFunB() provided by the data request layer;
[0079] The data request layer loads the library of the communication data management layer ComDataManger and calls the interface ComDataMangerFunC() provided by the communication data management layer;
[0080] The communication data management layer loads the library of the communication layer ComData and calls the interface ComDataFunD() provided by the data communication layer;
[0081] After each layer is independently encapsulated into a library, if a certain layer needs to be adjusted, only corresponding modifications need to be made through the communication data management library layer; this method ensures that only one library needs to be modified to meet the overall requirements, and there is no need to make comprehensive adjustments to the entire client, achieving the effect of rapid iteration.
[0082] Application scenario 1: Due to a certain requirement, the server changes the original data parsing and encapsulation format from XML format to Json format. In order for the client to be able to use it normally, the data encapsulation format of the client also needs to be changed from XML format to Json format.
[0083] As Figure 4 shown, if the old framework implementation method is adopted: for the data input from the UI, the interface of each piece of data needs to change XML to Json structure. An example of the client's login situation is given in this scenario:
[0084] Example: Login status of the client
[0085] Account password: <UserName= Arges, Password=123456>. First, it needs to be modified from XML format to json format: Account password: {UserName: Arges, Password: 123456}. Then, the server receives the account password signaling sent by the client and parses it.
[0086] Graphic verification code: <PicCode = 1234>. First, it needs to be modified from XML format to json format: Graphic verification code {PicCode: 1234}. Then, the server receives the graphic verification code signaling sent by the client and parses it.
[0087] SMS verification code <SMSCode = 654321>. First, it needs to be modified from XML format to json format: SMS verification code {SMSCode: 654321}. Then, the server receives the SMS verification code signaling sent by the client and parses it.
[0088] According to the appendix Figure 4 and the above text description, it can be clearly seen that the existing implementation method of the old framework requires a format adjustment at each place that needs to be modified. Given the architectural characteristics of the existing client, any modification to the UI will cause a global chain reaction. Therefore, once the user interface needs to be changed, the entire system must be comprehensively updated. This includes various aspects such as styles, data processing, and communication processes. Such modifications not only involve a huge amount of work but also increase the complexity of the modification.
[0089] It should be noted in this embodiment that the data related to the interaction with the backend, such as the account, password, and SMS verification mentioned in the previous embodiment, all need to be adjusted one by one in the old client. In the existing processing method, all data related to the communication between the client and the backend must be modified one by one.
[0090] For example Figure 5 As shown, also for the needs of Application Scenario 1, the client implemented using the lightweight client data interaction structure of the present invention is implemented in the following manner
[0091] The client provided in this embodiment internally adopts a new communication mechanism to strip the communication data and independently create a packaging library for data communication; making the client itself lighter, thereby enabling rapid function iteration; if a certain layer structure needs to be modified, the independently created data communication packaging library can be used for communication, replacing and / or modifying the packaging library of that layer structure, without the need to modify other structures in the client.
[0092] The UI layer loads the library of the data management layer DataManager and calls the interface DataManagerFunA() provided by the data management layer; for example: DataManagerFunA(UserName, Password, PicCode, SMSCode);
[0093] The data management layer loads the library of the data request layer DataRequest and calls the interface DataRequestFunB() provided by the data request layer; for example: DataRequestFunB(UserName, Password, PicCode, SMSCode);
[0094] The data request layer loads the library of the communication data management layer ComDataManger and calls the interface ComDataMangerFunC() provided by the communication data management layer; for example: ComDataMangerFunC(UserName, Password, PicCode, SMSCode);
[0095] The communication data management layer loads the library of the communication layer ComData and calls the interface ComDataFunD() provided by the data communication layer; for example: ComDataFunD(UserName, Password, PicCode, SMSCode);
[0096] After each layer is independently encapsulated into a library, if a certain layer needs to be adjusted, only the corresponding modification needs to be made through the communication data management library layer; this method ensures that only the corresponding independently encapsulated library needs to be modified, and there is no need to make a comprehensive adjustment to the entire client, achieving the effect of rapid iteration.
[0097] Call the management library of the data management layer:
[0098] ComDataMangerFunC(UserName, Password, PicCode, SMSCode)
[0099] {
[0100] <UserName = Arges, Password = 123456>
[0101] <PicCode = 1234>
[0102] <SMSCode = 654321>
[0103] }
[0104] After modification:
[0105] ComDataMangerFunC(UserName, Password, PicCode, SMSCode)
[0106] {
[0107] {UserName: Arges, Password: 123456}
[0108] {PicCode: 1234}
[0109] {SMSCode: 654321}
[0110] }}。
[0111] Before modification, it was in XML format:
[0112] <UserName= rges,Password=123456>
[0113] <PicCode = 1234>
[0114] <SMSCode = 654321>
[0115] After modification, it is in Json format:
[0116] {UserName : Arges,Password : 123456}
[0117] {PicCode : 1234}
[0118] {SMSCode : 654321}
[0119] The server receives the account password signaling, graphic verification code signaling, and SMS verification code signaling transmitted by the client for parsing.
[0120] In the Figure 5 explanation, it clearly points out an efficient and structured data management method: that is, encapsulating the data at each level into an independent library. When facing the need for format change, such as converting from XML format to Json format, only the communication data management library needs to be adjusted accordingly, without touching the code logic of the upper or lower layers. This design strategy significantly simplifies the change process, only focusing on the modification of a single library to meet the overall requirements, thus avoiding extensive and complex adjustments to the entire client. This not only improves the maintainability of the system but also ensures the compactness of the structure and the simplicity of the data, effectively preventing the occurrence of data redundancy.
[0121] Although the embodiments of the present invention have been shown and described above, it can be understood that the above embodiments are exemplary and should not be construed as limiting the present invention. Those of ordinary skill in the art can make changes, modifications, substitutions, and variations to the above embodiments within the scope of the present invention.
Claims
1. A method for implementing a lightweight client data interaction structure of a video fusion platform, characterized in that: The steps include: Design a hierarchical structure for the client to achieve hierarchical structure; Encapsulate each layer of structure to form an independent encapsulation library; Optimize the communication mechanism within the client, strip the communication data, and independently create a package library for data communication; make the client itself lighter, thereby achieving rapid function iteration; If a certain layer structure needs to be modified, an independent data communication encapsulation library can be used for communication to replace and / or modify the encapsulation library of the layer structure without changing other structures in the client; The hierarchical structure of the client includes at least a user layer and an intermediate layer; in The user layer at least includes a UI layer, a data management layer and a data request layer; in The UI layer is used to interact with users, and users input information and obtain the returned information. The UI layer can display the returned information; the data management layer is used to manage the data input by users, construct data structures to store user data, and process the data returned from the server; the data request layer is used to call the interface information of the middle layer and establish a connection bridge with the middle layer; The intermediate layer at least includes a communication data management layer and a communication layer; wherein The communication data management layer: unifies data in XML format to facilitate the transmission and analysis of network data; The communication layer is a bridge for communicating with the server; the communication layer includes a small data volume communication layer and a large data volume communication layer; Encapsulate the data of each level into an independent library; when faced with the need to change the format, convert from XML format to Json format, and only make corresponding adjustments to the communication data management library without touching the code logic of the upper or lower layers; The client of the layered structure design includes at least the following data interaction methods: The user inputs data through the UI layer, and the UI layer transmits the user input data to the data management layer; The data management layer stores user data in the data management layer and sends the request data to the data request layer; The data request layer makes a data request call interface to the communication data management layer in the middle layer; If it is a user data request, the communication data management layer sends the user data request in XML format to the small data communication layer, and then sends the request data to the server through the small data communication layer; If it is a video data request, the communication data management layer sends the video data request in XML format to the large data volume communication layer, and then sends the request data to the server through the large data volume communication layer; The server returns data to the data management layer by layer, and then presents it to the UI layer through the data management layer. The communication layer is divided into two layers to deal with the problem caused by large amounts of interactive data, that is, the client experiences delays when receiving data, which in turn causes data loss; The communication layer with small data volume involves data information that interacts with users; Including account and password input; while the large data communication layer involves continuous large amounts of data interaction; including video stream data interaction; The specific implementation methods include at least the following: The UI layer, data management layer, data request layer, communication data management layer, and communication layer are each encapsulated into libraries; The UI layer loads the library of the data management layer DataManager and calls the interface DataManagerFunA() provided by the data management layer; The data management layer loads the library of the data request layer DataRequest and calls the interface DataRequestFunB() provided by the data request layer; The data request layer loads the library of the communication data management layer ComDataManger and calls the interface ComDataMangerFunC() provided by the communication data management layer; The communication data management layer loads the library of the communication layer ComData and calls the interface ComDataFunD() provided by the communication layer; After each layer is independently encapsulated into a library, if a certain layer needs to be adjusted, it is only necessary to make corresponding modifications through the communication data management library layer; this method ensures that only the corresponding independent packaged library needs to be modified, and there is no need to make comprehensive adjustments to the entire client, thereby achieving the effect of rapid iteration.
2. The method according to claim 1, characterized in that: The implementation of the new module includes at least the following steps: New module UI design: When there is a new module requirement, first carry out UI design, and then implement the corresponding interface based on the UI design; Implementation of UI interface: The implementation of UI interface is divided into at least UI level and UI data management level. The UI layer is responsible for presenting the interface content to the user, and does not involve the data information generated by user interaction; Including in the login module, there will be interface elements such as account input box and password input box, which are only displayed to the user for operation and do not contain the data actually entered by the user; The UI data management layer is responsible for the unified management of the data input by users, including the account and / or password information input by users. After the relevant work at the UI layer and UI data management layer is completed, the interfaces of other layers are called to perform data transmission and data request.
Citation Information
Patent Citations
Achievement method of client side platform and client side platform
CN103036917A
File transmission method and device, storage medium and electronic equipment
CN116233937A
Unified gateway access method and device for APIs of multiple social media platforms and electronic equipment
CN118890392A