Keywords

1 Introduction

With the development of Internet 5G, instant messaging applications have become more important in personal and corporate communications. Compared with the current instant messaging, the traditional short message service has high communication costs and can support less data types to be transmitted. At the same time, the infrastructure requirements for building SMS services are high, and it is difficult to achieve full coverage because the signal is not good and the communication quality is poor. Therefore, more and more people choose to use instant messaging to communicate. Using instant messaging software to communicate can reduce the cost of mass communication. Nowadays, the software that people mainly use to chat with friends in my country are instant messaging tools such as WeChat and QQ. For personal communication, WeChat and QQ have been able to meet our basic needs. In today’s mobile Internet era, enterprises need to have an instant communication tool that can meet the security of their own enterprise information and meet the needs of employees within the enterprise, so as to improve the work efficiency between employees. Due to the greater risk of enterprise data leakage and the greater loss of leakage, considering the data security of enterprises, many enterprises cannot use communication tools developed by third parties, especially between Internet companies that are not in the same camp, for the internal Important business information, if the use of third-party instant messaging software, will undoubtedly increase the risk of leaking the company’s business secrets, and will bring certain crisis to the enterprise.

Instant messaging is one of the important factors that affect the efficiency of enterprise operation. The main functions of the communication system include user registration, login, sending messages, and displaying online users. The system can make the notification release more timely and the work arrangement more detailed, thereby improving the work efficiency of employees. How to design a convenient system is a difficult problem for many small and medium-sized enterprises, because they are limited in technology and do not have enough funds to support the design of the system. The survey found that existing systems can address the basic needs of businesses, although they have many problems. First of all, most programs are written in programming languages such as C, Java, and Python. The compilation speed of the system is relatively slow, and users often experience lag when using them. Second, they are less real-time and cannot better meet the requirements of enterprises. In addition, with the development of the times, the performance of enterprise servers and user devices has been greatly improved, but some systems do not support large concurrency very well, resulting in delay or failure of message sending. Based on the above analysis, we consider using Go language to design the system. Go language has the advantages of fast compilation and running of C language, as well as easy understanding of python language and convenient code writing. In addition, the Go language has some unique advantages, such as the ability to specify the number of cores to be used, and the automatic garbage collection function. The Go language does not allow the code to contain unused variables, function names, etc., which increases the system to a certain extent. Security.

With the development of 5G technology, information technology is also developing rapidly. With the impact of the epidemic, enterprises have to achieve informatization of offices. There is an urgent need for information-based office facilities. The application of a user-friendly instant messaging system can make the affairs of enterprises more convenient. The system is also a vital driving force in promoting the development of productive forces in enterprises. In this article, we mainly share the following:

  1. (1)

    Through market research and analysis, this paper proposes a user instant messaging system based on the Go language to ensure efficient communication and quick message processing and forwarding capabilities.

  2. (2)

    In the system’s design, the Go language is used for development, and TCP socket programming is used to ensure the reliability of message transmission.

2 Related Work

Ye [1] uses HBuilder tool to develop client, uses MUI and H5Plus to develop mobile application client, realizes one-time development to generate mobile applications running on Android, iOS and applet. The main functions of the system are chat, address book, scan The functions of scanning, adding friends, uploading avatars and modifying personal information have certain reference for the construction of instant messaging systems. Ke [2] designed a distributed communication system, using a distributed architecture design, Linux Release as the operating system, and divided the system into a four-layer architecture of client, gateway, server, and distributed management, to achieve a large number of users. It can ensure the stable and efficient operation of the system. Li [3] designed a user communication system based on the Kylin system. The system is developed based on the Linux kernel, using the oracle database and RSA encryption technology, which can not only solve the problem of instant communication under the Kylin system, but also ensure the security of communication. Wang [4] designed an enterprise-oriented user communication system, considering both system security and system stability, and used the spring MVC framework to design the system. Section [5] analyzes synchronization and asynchrony, blocking and non-blocking in the development of network communication, and introduces the most widely used asynchronous and non-blocking network communication method. Zhang [6] designed a communication system based on WebRTC, analyzed the differences and commonalities between various signaling, and analyzed and designed audio and video processing. Enterprises should conform to the trend of informatization, keep pace with the development of the times, establish an intelligent enterprise platform, and improve enterprise efficiency. The conclusion shows that the user’s instant messaging system is an important factor affecting the survival and development of enterprises.

3 Requirement Analysis

Through practical testing, this article summarizes the following functional requirements flowchart, as shown in Fig. 1.

Fig. 1.
figure 1

Functional Requirements.

3.1 The Problem with Traditional Workflow

Please note that the first paragraph of a section or subsection is not indented. The first paragraphs that follows a table, figure, equation etc. does not have an indent, either.

Subsequent paragraphs, however, are indented.

Traditional corporate communication has the following problems:

  1. (1)

    Traditional corporate communication generally uses internal telephone calls or conferences, requiring employees to be in the workplace. At the same time, if the employee has something to delay, it cannot be carried out typically. Because of the need for negotiation, the whole process must last for a long time, which will seriously affect the working hours of other employees and hinder the company’s production efficiency.

  2. (2)

    Traditional methods need to collect employees’ phone numbers, work content, etc., which leads to enterprises needing to manage and update employee information on schedule. Collecting requires dedicated personnel to maintain and some experience. An error in the work process may lead to severe impacts such as lack of notification or non-assignment of work.

  3. (3)

    With the rapid development of 5G, our network speed has been increased, network latency has been significantly reduced, and the network coverage area is also expanding. Still, the traditional enterprise communication methods have not kept pace with the development of the times. First, informatization and intelligence have entered various fields, and enterprises’ working mode is also changing. Secondly, the size of the enterprise is gradually getting more extensive, the number of employees is also increasing rapidly, and the use of traditional methods will significantly reduce the real-time and reliability of messages. Finally, with the improvement of the average level of education in our country, everyone will use computers to work to some extent.

3.2 Functional Requirement

Many researchers have recently proposed different technical solutions to implement user instant messaging systems. Combined with the actual needs of enterprises and the excellent ideas of other authors, we have summarized an online communication system with functions such as user registration, login, sending messages, displaying online user lists, and user withdrawal. When users use these functions, the system must ensure reliability in every message processing. In addition, to ensure the system’s real-time, high reliability and high concurrency, it is also necessary to ensure the system’s stability when multiple users are using it simultaneously. In this system, after the user has registered, they can log in, and then they can send a message and view the list of online users (employees who are working). Finally, after the employee finishes work, the system will exit. During this period, to improve the processing power, the working computer can run a terminal command to join the communication system, and the system has low memory requirements. It does not need to occupy too much storage space.

4 Requirement Analysis

4.1 Client Model

The client’s task is to communicate between users, which is simple, flexible and reliable. The client’s primary functions are registration, login, sending messages, displaying a list of online users, and exiting the system. When the client registers, first, it will send a connection request to the server. Second, the client will wait for the connection establishment result returned by the server. Third, send the registration information to the server after establishing the connection. Finally, the client waits for the server’s processing result. If you receive the registration success message, then you can log in. The login and registration processes are similar. Both require a connection to be established and wait for the result of the server processing. While the login is successful, the user can use the other functions, and server processing is required when using each different function. When the user wants to exit the system, send an exit command and remove the connection established at the login time.

4.2 Server Model

The task of the server is to process the request submitted by the user and return the processing result to the client. It mainly handles registration requests, login requests, message forwarding processing, online user lists, and listening for connection requests. When the server starts, the port will always be in the listening state. When the user’s connection request is heard, the server will authenticate the request. If the link is correct, the connection will be established. And then the next step is to process the request processing message from the client sent. If it is a registration message, it will access the database and return the processing result of the database to the client. A login request is also established, similar to a registration request. If a message forwarding request is made, the server will check the current online user and forward the message to the corresponding user. When the user wants to query the online user list, the server can directly send the user list maintained by itself to the user.

4.3 Database Model

The database is mainly used to store user data. When the user registers, it will check whether the registration information already exists in the database. Then send the query result to the server. When the user logs in, the user login information will be compared with the information in the database. The details of the system data sheet are shown in Tables 1, 2 and 3.

Table 1. User Info
Table 2. Friend Information
Table 3. Chat message

5 System Design

5.1 System Functional Design

The system is a user instant messaging system based on Go language. Initially, according to the different functions, the system can be divided into client-side and server-side. Then, each module is specifically divided, and the specific division of each module is shown in Fig. 2.

Fig. 2.
figure 2

System Function Design.

5.2 Register Design

This section focuses on the registration process. When each user uses the system for the first time, since the database does not have the user information, he needs to register. Generally, the registered account is the employee number, and the password is set by himself. Before user registration, the user must first send a connection establishment request to the server. After the connection is established successfully, the client can send the user registration information to the server. The server will compare the received registration information with the information in the database. If there is no such information, it means that the registration is successful, and the server will return the successful registration result to the user. After the registration is successful, the user can proceed to the next step. The specific process is as shown in Fig. 3.

Fig. 3.
figure 3

Registration Process.

5.3 Login Design

This section mainly introduces the login process. Each user will use the previously registered account and password to log in. When a user logs in, a connection needs to be established first. After the establishment is successful, the login message will be sent to the server. The server will compare the login message with the account in the database. If the password is correct, the verification is successful, and the server will send the login success result. To the user, after a successful login, the information will be loaded into the cache, speeding up the system for other operations. The specific process is shown in Fig. 4.

Fig. 4.
figure 4

Login Process.

5.4 Displays the Online User List Design

After the user logs in successfully, if you want to send a message, you can select the send message command and then send the message that you want to send to the server. After the server receives it, it will query the online user list and send the message.

5.5 Send Message Design

After the user logs in successfully, if you want to send a message, you can select the send message command, and then send the message you want to send to the server. After the server receives it, it will query the online user list and send the message.

6 Conclusion

This paper uses Go language and TCP socket for programming, and proposes an efficient and reliable design method. Compared with some existing designs, it has high concurrency, ensures work efficiency and process plasticity, and chooses a mature technical framework to greatly shorten the development time. After relevant discussions, the design is conducive to the collaborative work between employees of the enterprise and improves work efficiency.