A method and apparatus for sharing terminal data in a local area network, and a storage medium

By creating HTTP servers and databases on each terminal within the local area network, synchronizing data on the main terminal, and distributing the processing load among the slave terminals, the stability issues caused by high memory pressure on the main terminal are resolved, resulting in higher local area network stability.

CN117714438BActive Publication Date: 2025-12-26FUJIAN STAR NET EVIDEO INFORMATION SYST CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311686932.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-12-11
Publication Date
2025-12-26
Estimated Expiration
2043-12-11

AI Technical Summary

Technical Problem

In a multi-terminal LAN built on Android devices, excessive memory pressure on the main terminal leads to low stability, especially when there are many slave terminals, the main terminal is prone to service interruption due to memory overrun.

Method used

Within the local area network, each terminal creates an HTTP server and a database. The master terminal is responsible for data synchronization, and each slave terminal shares the business processing flow. The generated business data is written to the master database by the master terminal and synchronized to the slave terminals, and the slave terminals update their local databases.

Benefits of technology

The memory requirements of the main terminal have been reduced, memory usage exceeding limits has been minimized, and the operational stability of the local area network has been improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117714438B_ABST
    Figure CN117714438B_ABST
Patent Text Reader

Abstract

The application discloses a LAN terminal data sharing method and device and a storage medium, and comprises the following steps: setting configuration information of each terminal in a local area network, wherein the configuration information comprises an IP address and a terminal type of the terminal, and the terminal type comprises a master terminal and a slave terminal; each terminal creates an Http server; the master terminal establishes a communication connection with the slave terminal; the slave terminal generates service data and transmits the service data to the master terminal through the local area network; the master terminal writes the received service data into a master database of the master terminal, and sends the service data successfully written into the master database to all slave terminals in the local area network; and the slave terminal updates a local slave database according to the service data. The application reduces the memory occupation in the master terminal by optimizing the data processing mode of the master terminal and the slave terminal, so that the system termination caused by excessive memory occupation is avoided, and the operation stability of the local area network is improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of computer local area network, in particular to a local area network terminal data sharing method, device and storage medium. BACKGROUND

[0002] In a multi-terminal local area network built by Android terminals, in order to ensure data consistency, the local area network is usually set to master-slave mode: at least one terminal is set as a master terminal, and the master terminal builds an Http server to provide data storage and access services for other terminals (i.e. slave terminals). In this way, all business data processing, data query, access and communication operations need to be executed through the master terminal, thereby increasing the memory pressure of the master terminal. The more slave terminals, the more memory of the master terminal occupied by communication, and the greater the memory pressure of the master terminal, eventually leading to the termination of the master terminal application process due to excessive memory occupation, and service interruption. SUMMARY

[0003] In view of the above problems, the present application provides a local area network terminal data sharing method to solve the technical problems of high memory requirement for the master terminal, low stability of the local area network and dependence of data processing on the master terminal.

[0004] To achieve the above purpose, the inventors provide a local area network terminal data sharing method, comprising the following steps:

[0005] Setting configuration information of each terminal in the local area network, the configuration information including IP address of the terminal and terminal type, and the terminal type including master terminal and slave terminal;

[0006] Each terminal creates an Http server;

[0007] The master terminal establishes a communication connection with the slave terminal;

[0008] The slave terminal generates business data and transmits it to the master terminal through the local area network;

[0009] The master terminal writes the received business data into the master database of the master terminal, and sends the business data successfully written into the master database to all slave terminals in the local area network;

[0010] The slave terminal updates the local slave database according to the business data.

[0011] Further, after the slave terminal updates the local slave database according to the business data, it further comprises the following steps:

[0012] The master terminal sends control parameters for refreshing the database to each slave terminal;

[0013] The slave terminal updates the received service data on the display interface of the slave terminal after receiving the control parameter.

[0014] Further, after the master terminal sends the service data to all the slave terminals in the local area network, the method further comprises the step of:

[0015] The master terminal controls the slave terminal to transmit the service data to a plurality of different application programs in the slave terminal through an Android interface definition language.

[0016] Further, the method further comprises the step of:

[0017] The slave terminal accesses the slave database locally stored in the slave terminal to retrieve data when receiving the query data instruction.

[0018] Further, before the master terminal writes the received service data into the master database of the master terminal, the method further comprises the step of:

[0019] The master terminal verifies the uniqueness of the service data and assigns a unique identifier to the service data that passes the verification.

[0020] Further, the configuration information further comprises database information, and the slave database is a mobile database; the method further comprises the step of:

[0021] The slave terminal accesses the master database and downloads the service data in the master database to the slave database of the slave terminal through FTP.

[0022] Further, each terminal creates an Http server, comprising the step of:

[0023] Each terminal creates a terminal service program, and mounts a service on the terminal service program;

[0024] Setting the communication port and IP address of each terminal;

[0025] Starting the Http server in the service.

[0026] Further, the master terminal and the slave terminal establishing a communication connection comprises:

[0027] The master terminal and the slave terminal are in communication connection through the Http server;

[0028] Or the master terminal and the slave terminal establishing a communication connection comprises:

[0029] The Tcp Socket is used to listen to the port of the master terminal and the port of the slave terminal, and the communication connection between the master terminal and the slave terminal is constructed through the agreed protocol.

[0030] A terminal data sharing device in a local area network comprises:

[0031] A configuration module is configured to set configuration information of each terminal in the local area network, wherein the configuration information comprises IP of the terminal and a terminal type, and the terminal type comprises a master terminal and a slave terminal.

[0032] A communication module is configured to create an Http server for each terminal, and establish a communication connection between the master terminal and the slave terminal.

[0033] A service generation module is configured to generate service data by the slave terminal, and transmit the service data to the master terminal through the local area network.

[0034] A master processing module is configured to write the received service data into a master database of the master terminal, and send the service data successfully written into the master database to all slave terminals in the local area network.

[0035] A slave processing module is configured to control the slave terminal to update a local slave database according to the service data.

[0036] To solve the above technical problems, the application further provides another technical solution:

[0037] A computer readable storage medium has a computer program stored therein, and the computer program is run by a processor to execute the terminal data sharing method in the local area network according to any one of the above technical solutions.

[0038] Compared with the prior art, in the terminal data sharing method in the local area network, each terminal in the local area network creates an Http server and is provided with a database, service processing can be generated and stored in each terminal, the master terminal is mainly responsible for the synchronization of internal data in the local area network, and all data access, query and other operations do not need to be processed by the master terminal, each slave terminal shares the memory consumption generated in the service processing flow and the resources occupied by the slave terminal Http query, thereby reducing the memory requirement of the master terminal, reducing the problem of memory occupation exceeding the limit and being terminated, and improving the stability of the local area network.

[0039] The above summary related to the invention is only a summary of the technical solutions of the present application. In order to enable those skilled in the art to more clearly understand the technical solutions of the present application, and then implement the same according to the contents of the description and the drawings, and in order to enable the above and other purposes, characteristics and advantages of the present application to be more easily understood, the following will be described in combination with the specific embodiments of the present application and the accompanying drawings. BRIEF DESCRIPTION OF DRAWINGS

[0040] The accompanying drawings are only used to show the principles, implementation manners, applications, characteristics and effects of the specific embodiments of the present application and other related contents, and cannot be considered as limitations to the present application.

[0041] In the drawings of the specification:

[0042] Figure 1 Flow chart of the terminal data sharing method in the local area network according to the specific embodiments;

[0043] Figure 2 Flow chart of the terminal creating an Http server according to the specific embodiments;

[0044] Figure 3 Flow chart of the service data writing into the main database according to the specific embodiments;

[0045] Figure 4 Module block diagram of the terminal data sharing device in the local area network according to the specific embodiments;

[0046] Figure 5 Schematic diagram of the computer readable storage medium according to the specific embodiments;

[0047] The reference signs involved in the above drawings are explained as follows:

[0048] 400, terminal data sharing device in the local area network; 401, configuration module; 402, communication module;

[0049] 403, service generation module; 404, main processing module; 405, slave processing module;

[0050] 500, computer readable storage medium; DETAILED DESCRIPTION

[0051] In order to explain the possible application scenarios, technical principles, implementable specific solutions, and the purposes and effects that can be achieved of the present application in detail, the following will be described in combination with the specific embodiments listed and the accompanying drawings. The embodiments described in the present document are only used to more clearly explain the technical solutions of the present application, and therefore only serve as examples, and cannot limit the protection scope of the present application.

[0052] The term "embodiment" is mentioned herein means that the specific features, structures, or characteristics described in connection with the embodiment can be included in at least one embodiment of the present application. The term "embodiment" appearing in various places in the specification does not necessarily refer to the same embodiment, nor does it particularly limit the independence or association between other embodiments. In principle, in the present application, as long as there is no technical contradiction or conflict, each technical feature mentioned in each embodiment can be combined in any way to form a corresponding implementable technical solution.

[0053] Unless otherwise defined, the meanings of the technical terms used herein are the same as those commonly understood by those skilled in the art to which the present application belongs; the use of related terms herein is only for the purpose of describing specific embodiments, and is not intended to limit the present application.

[0054] In the description of the present application, the phrase "and / or" is a description of the logical relationship between the objects, which means that there can be three relationships, for example, A and / or B, which means that there are three cases: A exists, B exists, and A and B exist at the same time. In addition, the character " / " herein generally represents that the associated objects before and after are a "or" logical relationship.

[0055] In the present application, the terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual quantity, primary and secondary or order relationship between the entities or operations.

[0056] In the present application, without more limitation, the "includes", "contains", "has" or other similar open expressions used in the sentence are intended to cover non-exclusive inclusion, and these expressions do not exclude the presence of other elements in the process, method or product including the described elements, so that the process, method or product including a series of elements can not only include those limited elements, but also include other elements not explicitly listed, or also include the elements inherent to such process, method or product.

[0057] As the same as the understanding in the "Guidelines for Examination", in the present application, the expressions such as "greater than", "less than", "exceed" are understood as not including the number; the expressions such as "above", "below", "within" are understood as including the number. In addition, in the description of the embodiments of the present application, the meaning of "multiple" is more than two (including two), and similar expressions related to "multiple" are also understood in this way, for example, "multiple groups", "multiple times", etc., unless otherwise explicitly limited.

[0058] In the description of the embodiments of the present application, the spatially relative terms, such as "central", "longitudinal", "transverse", "length", "width", "thickness", "upper", "lower", "front", "back", "left", "right", "vertical", "horizontal", "vertical", "top", "bottom", "inner", "outer", "clockwise", "counterclockwise", "axial", "radial", "circumferential", and the like, indicate the orientation or positional relationship based on the orientation or position relationship shown in the specific embodiment or the accompanying drawings, and are only used to facilitate the description of the specific embodiments of the present application or to facilitate the understanding of the reader, and do not indicate or imply that the indicated device or component must have a particular position, a particular orientation, or be constructed or operated in a particular orientation, and therefore cannot be understood as a limitation on the embodiments of the present application.

[0059] Unless otherwise expressly specified or limited, the terms "mount", "connect", "connection", "fixed", "set", and the like used in the description of the embodiments of the present application should be interpreted broadly. For example, the "connection" can be a fixed connection, or a detachable connection, or an integral set; it can be a mechanical connection, or an electrical connection, or a communication connection; it can be a direct connection, or an indirect connection through an intermediate medium; it can be a communication or interaction between two elements. For those skilled in the art of the present application, the specific meaning of the above terms in the embodiments of the present application can be understood according to the specific circumstances.

[0060] In the related art, in order to ensure the consistency of data in the local area network, the local area network usually adopts a master-slave mode, and the master terminal in the local area network performs centralized processing such as storage and access of each data. However, the master-slave mode will cause the data processing pressure of the master terminal to be large, the memory requirement to be high, and the master terminal to be easily interrupted due to memory overrun.

[0061] Therefore, to solve the above problems, the present embodiment provides a terminal data sharing method in a local area network, which optimizes the communication pressure and memory occupation of the master terminal, and avoids the termination of the service program due to the memory overrun of the master terminal. In this method, the master terminal and the slave terminal in the local area network both establish an Http server and a database, wherein the database of the master terminal is the master database, and the database of the slave terminal is the slave database; each terminal generates business data, and the business data is written into the master database by the master terminal and is synchronized to each slave terminal by the master terminal through the Http service, and is stored in the corresponding slave database by each slave terminal. Therefore, not only the consistency of the data can be ensured, but also each terminal can perform data query and other operations by accessing its local database, greatly reducing the communication pressure of the local area network and the memory consumption of each slave terminal in the business processing flow, and improving the stability of the local area network.

[0062] Please refer to Figure 1The embodiment provides a terminal data sharing method in a local area network.

[0063] S101, configuration information of each terminal in the local area network is set, the configuration information comprising an IP address of the terminal and a terminal type, the terminal type comprising a master terminal and a slave terminal;

[0064] S102, each terminal creates an Http server;

[0065] S103, the master terminal establishes a communication connection with the slave terminal;

[0066] S104, the slave terminal generates service data and transmits the service data to the master terminal through the local area network;

[0067] S105, the master terminal writes the received service data into a master database of the master terminal, and sends the service data successfully written into the master database to all slave terminals in the local area network;

[0068] S106, the slave terminal updates a local slave database according to the service data.

[0069] For example, service data submitted by a slave terminal A to a master terminal is a personnel information, comprising a personnel account and a personnel name. When the service data is submitted to the master terminal, the master terminal creates a new primary key according to a personnel table information primary key in a current master database to record the personnel information. After the personnel information: ID primary key, personnel account and personnel name are written into the master database successfully, all slave terminals are informed to write the personnel information into local databases through a protocol. Finally, the master-slave data consistency is ensured. The unique data (i.e. the ID primary key) must be managed by the master terminal.

[0070] In the embodiment, the local area network can be a multi-terminal local area network built by an Android system, i.e. each terminal in the local area network is an Android operating system terminal, and the Android operating system terminal comprises an Android mobile phone, an Android tablet computer, an Android smart bracelet and the like.

[0071] In the embodiment, each terminal in the local area network creates an Http server and is provided with a database, service processing can be generated and stored in each terminal, the master terminal is mainly responsible for synchronization of internal data in the local area network, all data access, query and other operations do not need to be processed by the master terminal, each slave terminal shares memory consumption generated in a service processing flow and resources occupied by slave terminal Http query, so that the memory requirement of the master terminal is reduced, the problem of memory occupation exceeding a limit and being terminated is reduced, and the stability of the local area network operation is improved.

[0072] In step S101, the configuration information is used to configure the local area network. The IP address of the terminal is also called an intranet IP address. The terminals in the local area network can access the Internet through a public gateway by using a NAT (Network Address Translation) protocol. Therefore, the terminals in the local area network can send a connection request to other devices on the Internet by using the IP address. The terminal type includes a master terminal and a slave terminal. More than one master terminal can be set in a local area network, and other terminals are slave terminals. The master terminal and the slave terminal are relatively functional in the local area network. They can be the same in hardware. The master terminal and the slave terminal can communicate in the local area network. The master terminal is mainly responsible for the transmission of business data in the local area network and the consistency of business data of the slave terminals in the local area network. When the configuration is performed, the master terminal needs to configure the communication address of each slave terminal, and each slave terminal needs to configure the communication address of the master terminal. Since each terminal in the local area network is provided with a database, in some embodiments, the configuration information further includes the database, specifically, the name, access address, database type and the like of the database. The database of the master terminal is a master database, and the database of the slave terminal is a slave database. The master database and the slave database can be the same type of database. In this embodiment, the master terminal synchronizes the business data to each slave terminal. Therefore, the business data stored in the slave database of each slave terminal is the same as the business data stored in the master database. Of course, the present application does not exclude that other data is stored in the master database in addition to the slave database.

[0073] In step S102, each terminal (including the master terminal and the slave terminal) in the local area network establishes an Http server. Http refers to Hypertext Transfer Protocol (HTTP). Http is a simple request-response protocol. The Http server refers to a server that implements the Hypertext Transfer Protocol. That is, each terminal in the local area network is provided with a Hypertext Transfer Protocol service program. Therefore, the Http server can realize the communication connection between the master terminal and the slave terminal, and the operation of business data query. As shown in FIG. 2, in an embodiment, the step of creating the Http server by each terminal includes: Figure 2

[0074] S201, each terminal creates a terminal service program, and mounts a service on the terminal service program;

[0075] S202, a communication port and an IP address of each terminal are set;

[0076] S203, an Http server is started in the service.

[0077] ​In the embodiment, the terminal can create a terminal service program, mount a background service through the Service mode of the Android system, and then start the Http server in the service. In the embodiment, the AndServer can be used to build the Http server, and the communication port and IP address of the terminal are set, and then the Http server is started.

[0078] In step S103, the master terminal and the slave terminals start the Http server, establish the LAN connection, and ensure the normal communication between the master terminal and the slave terminals. In other embodiments, the master terminal and the slave terminals in the LAN can use the TcpSocket service, and establish the LAN connection between the master terminal and the slave terminals through the Http Api interface or the Socket transmission protocol, to ensure the normal communication between the master terminal and the slave terminals.

[0079] In step S104, the slave terminals verify the final business data, and upload the business data to the master terminal. The slave terminal can submit the business data to be added to the master database to the master terminal through the Http Api interface or the socket transmission protocol. In some embodiments, if the business data is generated by the master terminal, the business data does not need to be uploaded, and is directly updated to the slave terminals by the master terminal through steps S105 and S106.

[0080] In step S105, in order to manage the business data in the LAN and verify the authenticity of the business data, the master terminal performs the uniqueness verification on the business data after receiving the business data, adds the uniqueness identifier, and then writes the business data into the database. In some embodiments, before the master terminal writes the received business data into the master database of the master terminal, the master terminal further performs the following steps: verifying the uniqueness of the business data, and assigning the unique identifier to the business data that passes the uniqueness verification.

[0081] Specifically, as shown in FIG. 4, the master terminal receiving the business data sent by the slave terminal and writing the business data into the master database includes the following steps: Figure 3

[0082] S301, the slave terminal generates the business data, and transmits the business data to the master terminal through the LAN;

[0083] S302, the master terminal verifies the uniqueness of the business data; if the uniqueness verification fails, the process jumps to step S303; if the uniqueness verification passes, the process jumps to step S304;

[0084] S303, the uniqueness verification failure is returned to the slave terminal, and the business data is discarded, that is, the business data is not written into the master database; ​

[0085] S304, assigning a unique identifier to the service data verified to be passed, each piece of service data in the local area network has a unique identifier, which is equivalent to the identity card number of the service data, and is used to distinguish other service data.

[0086] S305, writing the received service data into the main database.

[0087] In some embodiments, after the slave terminal updates the local slave database according to the service data, the method further comprises the steps of:

[0088] The master terminal sends control parameters for refreshing the database to each slave terminal.

[0089] After receiving the control parameters, the slave terminal updates the received service data on the display interface of the slave terminal. Therefore, through the embodiment, the service data can be transmitted and updated to the interface of the slave terminal in a timely manner.

[0090] In some embodiments, after the master terminal sends the service data to all slave terminals in the local area network, the method further comprises the steps of:

[0091] The master terminal controls the slave terminal to transmit the service data to multiple different application programs in the slave terminal through an Android Interface Definition Language (AIDL).

[0092] In some embodiments, the terminal data sharing method in the local area network further comprises the steps of:

[0093] When receiving the query data instruction, the slave terminal accesses the slave database locally to retrieve data.

[0094] In the above embodiments, the data stored in the slave database (i.e. the local database of the slave terminal) of each slave terminal is consistent with the main database (the main database may also store other additional data), so data retrieval can be directly performed according to the local slave database, without the need for data retrieval through the master terminal, thereby greatly reducing the occupation of communication resources of the local area network by data retrieval and other operations.

[0095] In some embodiments, the configuration information further comprises database information, and the slave database is a mobile database; the method further comprises the steps of:

[0096] The slave terminal accesses the main database and downloads the service data in the main database to the slave database of the slave terminal through FTP.

[0097] The mobile database is a database using mobile data technology. For example, in the embodiment, the database uses Realm mobile database technology, each database is a realm file, and the master terminal database file can be downloaded from the terminal through FTP (file transfer protocol) technology, so that the slave terminal can manually synchronize data.

[0098] As shown in Figure 4 In another embodiment, a terminal data sharing device 400 in a local area network is provided. The terminal data sharing device 400 in the local area network includes a configuration module 401, a communication module 402, a service generation module 403, a master processing module 404, and a slave processing module 405. Among them,

[0099] The configuration module 401 is configured to set the configuration information of each terminal in the local area network, and the configuration information includes the IP of the terminal and the type of the terminal, and the type of the terminal includes the master terminal and the slave terminal.

[0100] The communication module 402 is configured to create an Http server for each terminal, and establish a communication connection between the master terminal and the slave terminal.

[0101] The service generation module 403 is configured to generate service data by the slave terminal, and transmit the service data to the master terminal through the local area network.

[0102] The master processing module 404 is configured to write the received service data into the master database of the master terminal, and send the service data successfully written into the master database to all slave terminals in the local area network.

[0103] The slave processing module 405 is configured to control the slave terminal to update the local slave database according to the service data.

[0104] As shown in Figure 5 In another embodiment, a computer readable storage medium 500 is provided, and the computer readable storage medium 500 stores a computer program. When the computer program is run by a processor, the computer program performs the terminal data sharing method in the local area network in any one of the above embodiments.

[0105] In the above embodiment, in the method for sharing data of terminals in a local area network, each terminal in the local area network creates an Http server and is provided with a database, service processing can be generated and stored in each terminal, the main terminal is mainly responsible for synchronizing the data in the local area network, without concentrating all data access, query and other operations to be processed by the main terminal, each slave terminal shares the memory consumption generated in the service processing flow and the resources occupied by the slave terminal Http query, thereby reducing the memory requirement of the main terminal, and also reducing the problem of memory occupation exceeding the limit and being terminated, and improving the stability of the local area network operation.

[0106] Finally, it should be noted that although the above embodiments have been described in the specification and drawings of the present application, the patent protection scope of the present application should not be limited. Any technical solution obtained by replacing or modifying the equivalent structure or equivalent flow based on the essential concept of the present application, using the content described in the specification and drawings of the present application, and directly or indirectly implementing the technical solutions of the above embodiments in other related technical fields, etc., are all included in the patent protection scope of the present application.

Claims

1. A method for sharing data among terminals in a local area network, characterized by, The method comprises the following steps: Setting configuration information of each terminal in a local area network, the configuration information comprising an IP address of the terminal and a terminal type, the terminal type comprising a master terminal and a slave terminal; Each terminal creating an Http server; The master terminal establishing a communication connection with the slave terminal; The slave terminal generating service data and transmitting the service data to the master terminal through the local area network; The master terminal writing the received service data into a master database of the master terminal and sending the service data successfully written into the master database to all slave terminals in the local area network; The slave terminal updating a local slave database according to the service data; Each terminal creating an Http server, comprising the following steps: Each terminal creating a terminal service program, and mounting a service on the terminal service program; Setting a communication port and an IP address of each terminal; Starting an Http server in the service.

2. The LAN terminal data sharing method of claim 1, wherein, After the slave terminal updates the local slave database according to the service data, the method further comprises the following steps: The master terminal sending a control parameter for refreshing the database to each slave terminal; The slave terminal updating the received service data on a display interface of the slave terminal after receiving the control parameter.

3. The method of claim 1 or 2, wherein After the master terminal sends the service data to all slave terminals in the local area network, the method further comprises the following steps: The master terminal controlling the slave terminal to transmit the service data to a plurality of different application programs in the slave terminal through an Android Interface Definition Language.

4. The LAN terminal data sharing method of claim 1, wherein, The method further comprises the following steps: The slave terminal accessing the slave database locally to retrieve data when receiving a query data instruction.

5. The LAN terminal data sharing method of claim 1, wherein, Before the master terminal writes the received service data into the master database of the master terminal, the method further comprises the following steps: The master terminal verifying uniqueness of the service data and assigning a unique identifier to the service data that passes the verification.

6. The LAN terminal data sharing method of claim 1, wherein, The configuration information further comprises database information, and the slave database is a mobile database; the method further comprises the following steps: The slave terminal accessing the master database and downloading service data in the master database into the slave database of the slave terminal through FTP.

7. The LAN terminal data sharing method of claim 1, wherein, The master terminal establishing a communication connection with the slave terminal comprises: The master terminal and the slave terminal being in communication connection through the Http server; Or the master terminal establishing a communication connection with the slave terminal comprises: Using Tcp Socket to listen to a port of the master terminal and a port of the slave terminal, and constructing a communication connection between the master terminal and the slave terminal through a protocol.

8. A terminal data sharing apparatus in a local area network, characterized by comprising: The method comprises: A configuration module for setting configuration information of each terminal in a local area network, the configuration information comprising an IP address of the terminal and a terminal type, the terminal type comprising a master terminal and a slave terminal; A communication module for each terminal creating an Http server and establishing a communication connection between the master terminal and the slave terminal; A service generation module for the slave terminal generating service data and transmitting the service data to the master terminal through the local area network; The main processing module is used for writing the service data received by the main terminal into a main database of the main terminal, and sending the service data successfully written into the main database to all the slave terminals in the local area network. The slave processing module is used for controlling the slave terminal to update a local slave database according to the service data. Each terminal creates an Http server, including the steps of: Each terminal creates a terminal service program, and mounts a service on the terminal service program. The communication port and IP address of each terminal are set. The Http server is started in the service.

9. A computer readable storage medium having stored therein a computer program, characterized in that, The computer program is run by a processor, and executes the terminal data sharing method in the local area network in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Local area network communication method, system and terminal, and information sharing device

    CN104661191A

  • Method and system for terminal to share network

    CN105515996A