Communication method and battery cell water content testing system
By adopting a request-response model and key-value pair storage mechanism on the server side, the problem of data communication packet loss during battery production was solved, and the reliability and speed of data transmission were improved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CONTEMPORARY AMPEREX TECHNOLOGY CO LTD
- Filing Date
- 2025-01-23
- Publication Date
- 2026-07-24
AI Technical Summary
During battery production, when the amount of data exceeds the server's resource capacity, packet loss can easily occur, resulting in poor data transmission reliability.
The request-response model is adopted. The server first stores and then processes the client's request message and generates a response message. Data is stored and transmitted in a key-value pair manner through the event receiving, processing and sending threads to ensure data integrity.
It reduces the risk of data packet loss, improves the reliability and communication speed of data transmission, simplifies communication code, and enhances code readability and maintainability.
Smart Images

Figure CN122457571A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of battery manufacturing technology, and in particular to a communication method and system. Background Technology
[0002] In the battery manufacturing process, production data often needs to be tested and analyzed to determine if the products meet standards. For example, after the cell baking process, water content test data is often required to verify if the cells meet standards. During the testing and analysis process, relevant data needs to be communicated between the client and the server. However, when a large amount of data is transmitted in the data stream, if the data volume exceeds the server's resource capacity, there may be a risk of data packet loss, resulting in poor data transmission reliability. Summary of the Invention
[0003] This application provides a communication method and system that can reduce the risk of packet loss during data communication and improve the reliability of data transmission.
[0004] In a first aspect, embodiments of this application provide a communication method executed by a server, the method comprising:
[0005] When at least one client establishes a communication connection with the server, the system receives request messages from at least one client through the event receiving thread.
[0006] Storage request message;
[0007] The stored request messages are processed by the event processing thread to obtain the processed data.
[0008] Store and process data;
[0009] The event thread sends a response message, which is generated based on the stored processing data.
[0010] In this embodiment, the server and client can adopt a request-response model. Upon receiving a request message, the request message is first stored and then processed; the processed data is also first stored and then sent. This ensures data integrity, reduces the risk of data loss, and improves the reliability of data transmission.
[0011] In some embodiments, the request message includes:
[0012] The message header carries a client object, which represents the client that sent the request message and includes the client's Internet Protocol address and port.
[0013] The request reads / writes a data field, which includes an instruction identifier, a service number, and data content. The service number represents the data type, and the data content represents multiple data items corresponding to each data type.
[0014] In this embodiment, the request message may include a message header and a request read / write data field. The request read / write data field may include an instruction identifier, a service number, and data content, which can clearly specify the server's execution instruction and the execution target, thereby ensuring the accuracy of the data and laying the foundation for data communication.
[0015] In some embodiments, the data content includes at least one structure, which is parsed according to a pre-configured structure definition;
[0016] Each business number corresponds to a structure definition, and the structure definition represents the correspondence between multiple structures and at least one piece of data corresponding to each data type.
[0017] In this embodiment, different structure definitions can be pre-configured so that the data content can encapsulate related data together to form a whole structure, which simplifies the communication code and improves the readability and maintainability of the code.
[0018] In some embodiments, the structure includes a primary structure and a secondary structure;
[0019] The structure definition represents the correspondence between multiple first-level structures and at least one second-level structure, as well as the correspondence between multiple second-level structures and at least one data corresponding to each data type.
[0020] In this embodiment, the structure may include a first-level structure and a second-level structure. The structure definition can represent the correspondence between multiple first-level structures and at least one second-level structure, as well as the correspondence between multiple second-level structures and at least one data corresponding to each data type, thereby improving the flexibility of data composition and further enhancing the readability and maintainability of the code.
[0021] In some embodiments, the storage request message includes:
[0022] Parse the request message to obtain the client's Internet Protocol address and port, as well as the requested read / write data fields;
[0023] The client's Internet Protocol address and port are used as keys, and the requested read / write data fields are used as values, stored in a dictionary.
[0024] In this embodiment, request messages can be stored in a dictionary using key-value pairs. Subsequent event processing threads do not need to call the data additionally, which reduces the risk of data loss and improves communication speed.
[0025] In some embodiments, the dictionary includes a receive queue;
[0026] The client's Internet Protocol address and port are used as keys, and the requested read / write data fields are used as values, stored in a dictionary, including:
[0027] Using the client's Internet Protocol address and port as the key and the requested read / write data field as the value, the first key-value pair is added to the tail of the receive queue.
[0028] By processing the event thread, the stored request messages are processed to obtain the processed data, including:
[0029] The event processing thread processes the request read / write data field of the first key-value pair at the head of the receive queue to obtain the processed data.
[0030] In this embodiment, the data can be directly added to the tail of the receiving queue as key-value pairs and processed automatically according to the order in the queue, without the need to call data, thus improving the communication speed.
[0031] In some embodiments, storing processing data includes:
[0032] The client's Internet Protocol address and port are used as keys, and the processed data is used as values, stored in a dictionary.
[0033] In this embodiment, the processing data can be stored in a dictionary using key-value pairs. Subsequent event sending threads do not need to call the data additionally, which reduces the risk of data loss and improves the communication rate.
[0034] In some embodiments, the dictionary includes a send queue;
[0035] The client's internet protocol address and port are used as keys, and the processed data is used as values, stored in a dictionary, including:
[0036] The client's Internet Protocol address and port are used as keys, and the processed data is used as values to obtain a second key-value pair, which is then added to the tail of the sending queue.
[0037] The event thread sends a response message, including:
[0038] The event sending thread generates a response message based on the second key-value pair at the head of the sending queue. The response message header includes the client's Internet Protocol address and port from the second key-value pair at the head of the sending queue, and the response message's request read / write data field includes the processing data from the second key-value pair at the head of the sending queue.
[0039] Send a response message.
[0040] In this embodiment, the data can be added directly to the tail of the sending queue as key-value pairs and sent automatically according to the order in the queue, without the need to call data, thus improving the communication speed.
[0041] In some embodiments, the request message includes an encrypted request read / write data field;
[0042] The storage request message includes:
[0043] The request message is decrypted to obtain the plaintext request read / write data field;
[0044] Store requests to read and write data fields.
[0045] In this embodiment, the request message can be encrypted, which can improve the security of communication.
[0046] In some embodiments, the request message is obtained by hashing the request read / write data field using a hash algorithm key;
[0047] The request message is decrypted to obtain the plaintext request read / write data field, including:
[0048] The request message is decrypted using a hash algorithm key to obtain the plaintext request read / write data field.
[0049] In this embodiment, symmetric encryption can be used to encrypt the request message, making the encryption and decryption process more convenient and further improving the communication speed.
[0050] In some embodiments, a response message is sent via an event thread, including:
[0051] By sending an event thread, the stored processed data is encrypted to obtain encrypted data;
[0052] Generate a response message based on encrypted data;
[0053] Send a response message.
[0054] In this embodiment, the processed data can be encrypted to obtain an encrypted response message, which can improve the security of communication.
[0055] In some embodiments, the stored processing data is encrypted to obtain encrypted data, including:
[0056] The stored processed data is hashed using the key of the hash algorithm to obtain encrypted data.
[0057] In this embodiment, symmetric encryption can be used to encrypt the processed data, making the encryption and decryption process more convenient and further improving the communication speed.
[0058] In some embodiments, before receiving a request message from at least one client, the method further includes:
[0059] Receive handshake requests from clients, including the client object corresponding to the client.
[0060] In response to the handshake request, the client object corresponding to the client is added to the connection list so that the client and the server can establish a communication connection.
[0061] In this embodiment, a handshake can be performed before the server and client communicate to establish a communication connection, thereby improving the security of data transmission.
[0062] Secondly, embodiments of this application provide a communication method executed by a client, the method comprising:
[0063] Send a request message to the server;
[0064] Receive the response message returned by the server; the response message is generated by the server based on the already stored processing data, which is the processing data obtained and stored by the server after processing the already stored request message.
[0065] In this embodiment, the server and client can adopt a request-response model. Upon receiving a request message, the request message is first stored and then processed; the processed data is also first stored and then sent. This ensures data integrity, reduces the risk of data loss, and improves the reliability of data transmission.
[0066] In some embodiments, the request message includes:
[0067] The message header carries a client object, which represents the client that sent the request message and includes the client's Internet Protocol address and port.
[0068] The request reads / writes a data field, which includes an instruction identifier, a service number, and data content. The service number represents the data type, and the data content represents multiple data items corresponding to each data type.
[0069] In this embodiment, the request message may include a message header and a request read / write data field. The request read / write data field may include an instruction identifier, a service number, and data content, which can clearly specify the server's execution instruction and the execution target, thereby ensuring the accuracy of the data and laying the foundation for data communication.
[0070] In some embodiments, the data content includes at least one structure, which is parsed according to a pre-configured structure definition;
[0071] Each business number corresponds to a structure definition, and the structure definition represents the correspondence between multiple structures and at least one piece of data corresponding to each data type.
[0072] In this embodiment, different structure definitions can be pre-configured so that the data content can encapsulate related data together to form a whole structure, which simplifies the communication code and improves the readability and maintainability of the code.
[0073] In some embodiments, the structure includes a primary structure and a secondary structure;
[0074] The structure definition represents the correspondence between multiple first-level structures and at least one second-level structure, as well as the correspondence between multiple second-level structures and at least one data corresponding to each data type.
[0075] In this embodiment, the structure may include a first-level structure and a second-level structure. The structure definition can represent the correspondence between multiple first-level structures and at least one second-level structure, as well as the correspondence between multiple second-level structures and at least one data corresponding to each data type, thereby improving the flexibility of data composition and further enhancing the readability and maintainability of the code.
[0076] In some embodiments, before sending a request message to the server, the method further includes:
[0077] When displaying an interactive interface, which includes a first control, the system receives a first input to the interactive interface, which includes input to configure the server port number and input to the first control.
[0078] In response to the first input, a handshake request is sent to the server corresponding to the server port number; the handshake request includes the client object corresponding to the client.
[0079] Receive the handshake result returned by the server and display it on the interactive interface; the handshake result is generated when the server adds the client object to the connection list according to the handshake request.
[0080] In this embodiment, a handshake operation with the server can be performed based on the client's interactive interface to establish a communication connection and improve the security of data transmission.
[0081] In some embodiments, the request message includes a request test message;
[0082] Send a request message to the server, including:
[0083] When displaying an interactive interface, which includes a second control, receive a second input to the second control;
[0084] In response to the second input, a request test message is sent to the server so that the server can obtain and store the data of the data type corresponding to the service number of the request test message.
[0085] In this embodiment, a request test message can be generated based on the client's interactive interface, so that the server can obtain and store the data of the data type corresponding to the service number of the request test message.
[0086] In some embodiments, a request message includes a data acquisition message;
[0087] Send a request message to the server, including:
[0088] When displaying an interactive interface, which includes a third control, receive third input to the third control;
[0089] In response to the third input, a data retrieval message is sent to the server, so that the server returns a response message based on the data retrieval message.
[0090] Specifically, if the server stores data of the data type corresponding to the business number of the data acquisition message, the response message is generated based on the data of the data type corresponding to the business number of the data acquisition message; if the server does not store data of the data type corresponding to the business number of the data acquisition message, the response message is the data acquisition message.
[0091] In this embodiment, a data acquisition message can be generated based on the client's interactive interface, so that the client can obtain the stored relevant data from the server.
[0092] In some embodiments, the request message includes a remove data message, and the interactive interface includes a fourth control;
[0093] Send a request message to the server, including:
[0094] Upon receiving a response message from the server, and if the response message is generated based on data of the data type corresponding to the business number of the data acquisition message, the fourth input to the fourth control is received.
[0095] In response to the fourth input, a Remove Data Message is sent to the server so that the server can delete the data of the data type corresponding to the service number in the Remove Data Message.
[0096] In this embodiment, a data removal message can be generated based on the client's interactive interface, so that the server can delete the corresponding stored related data. On the one hand, this can avoid different clients processing the same type of data, reducing the risk of resource waste. On the other hand, for data with errors, it is easier for the server to retrieve the data again, improving the accuracy of the data.
[0097] Thirdly, embodiments of this application provide a battery cell water content testing system, the system comprising:
[0098] Baking equipment for baking battery cells to adjust the water content of the battery cells;
[0099] The server is configured to, when at least one client establishes a communication connection with the server, receive request messages from at least one client via a receiving event thread. The request message includes a request read / write data field, which comprises an instruction identifier, a service number, and data content. The service number represents the category of water content test data, and the data content includes multiple data points from the water content test data corresponding to the service number category. The server then stores the request read / write data field; processes the stored request read / write data field via a processing event thread to obtain processed data; stores the processed data; and sends a response message via a sending event thread, the response message being generated based on the stored processed data.
[0100] The client establishes a communication connection with the server, sending request messages to the server and receiving response messages returned by the server.
[0101] In this embodiment, for the communication of water content test data during the cell water content testing process, the server and client can adopt a request-response mode. Upon receiving a request message, the request message is first stored and then processed; the processed data is also first stored and then sent. This ensures the integrity of the water content test data, reduces the risk of data loss, and improves the reliability of water content test data transmission.
[0102] In some embodiments, the baking apparatus includes at least one baking oven body, and each baking oven body is numbered.
[0103] The service numbers corresponding to the water content test data of different baking ovens are different, and the service number corresponding to the water content test data of the first baking oven is generated based on the number of the first baking oven. The first baking oven is any one of at least one baking oven.
[0104] In this embodiment, the water content test data of the battery cells can be classified according to different baking ovens. This allows for the generation of corresponding service numbers based on the numbers of different baking ovens, enabling point-to-point communication and analysis of water content test data from different baking ovens, thereby improving the convenience and accuracy of battery cell water content testing.
[0105] In some embodiments, the baking equipment further includes a programmable logic controller (PLC), wherein the service number corresponding to the data of the PLC is different from the service number corresponding to the water content test data of at least one baking oven body.
[0106] In this embodiment, the water content test data of different categories may also include PLC data. The PLC data can be communicated and analyzed based on the service number corresponding to the PLC data, thereby improving the comprehensiveness of the battery cell water content test.
[0107] The above description is only an overview of the technical solution of this application. In order to better understand the technical means of this application and to implement it in accordance with the contents of the specification, and to make the above and other objects, features and advantages of this application more obvious and understandable, the following are specific embodiments of this application. Attached Figure Description
[0108] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the embodiments of this application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on the drawings without creative effort.
[0109] Figure 1 A schematic diagram of the communication system provided in the embodiments of this application;
[0110] Figure 2 One of the schematic diagrams of the communication method provided in the embodiments of this application;
[0111] Figure 3 A second schematic diagram illustrating the communication method provided in an embodiment of this application;
[0112] Figure 4 A third schematic diagram illustrating the communication method provided in an embodiment of this application;
[0113] Figure 5 A fourth schematic diagram illustrating the communication method provided in the embodiments of this application;
[0114] Figure 6 Fifth schematic diagram of the communication method provided in the embodiments of this application;
[0115] Figure 7 A schematic diagram of the communication method provided in the embodiments of this application;
[0116] Figure 8 Seventh schematic diagram of the communication method provided in the embodiments of this application;
[0117] Figure 9 Eighth schematic diagram of the communication method provided in the embodiments of this application;
[0118] Figure 10 Schematic diagram nine of the communication methods provided in the embodiments of this application;
[0119] Figure 11 A schematic diagram of the client's interactive interface in the communication method provided in the embodiments of this application;
[0120] Figure 12 A schematic diagram of the communication method provided in the embodiments of this application (Figure 10).
[0121] Figure 13 Schematic diagram eleven of the communication methods provided in the embodiments of this application;
[0122] Figure 14 Schematic diagram 12 of the communication method provided in the embodiments of this application;
[0123] Figure 15 This is a schematic diagram of a battery cell water content testing system provided in an embodiment of this application.
[0124] The accompanying drawings are not drawn to scale. Detailed Implementation
[0125] The embodiments of this application will be described in further detail below with reference to the accompanying drawings and examples. The detailed description of the following embodiments and the accompanying drawings are used to illustrate the principles of this application by way of example, but should not be used to limit the scope of this application, that is, this application is not limited to the described embodiments.
[0126] In the description of this application, it should be noted that, unless otherwise stated, "a plurality of" means two or more; the terms "upper," "lower," "left," "right," "inner," and "outer," etc., indicating orientation or positional relationships, are only for the convenience of describing this application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation on this application. Furthermore, the terms "first," "second," and "third," etc., are used for descriptive purposes only and should not be construed as indicating or implying relative importance. "Vertical" is not vertical in the strict sense, but within the allowable tolerance range. "Parallel" is not parallel in the strict sense, but within the allowable tolerance range.
[0127] In this application, the reference to "embodiment" means that a specific feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a mutually exclusive, independent, or alternative embodiment. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described in this application can be combined with other embodiments.
[0128] Unless otherwise specified, all embodiments and optional embodiments of this application can be combined to form new technical solutions.
[0129] Unless otherwise specified, all technical features and optional technical features of this application may be combined to form new technical solutions.
[0130] Unless otherwise specified, all steps of this application may be performed sequentially or randomly, preferably sequentially. For example, the method includes steps (a) and (b), indicating that the method may include steps (a) and (b) performed sequentially, or it may include steps (b) and (a) performed sequentially. For example, the mention that the method may also include step (c) indicates that step (c) may be added to the method in any order; for example, the method may include steps (a), (b), and (c), or it may include steps (a), (c), and (b), or it may include steps (c), (a), and (b), etc.
[0131] During battery production, after the cell baking process, it is often necessary to obtain water content test data to verify whether the cell meets standards. Currently, when the client and server communicate regarding water content test data, the data is usually stored in a data stream. In situations where many data packets are received or sent simultaneously, there is a risk that data in the data stream may not be received or sent in a timely manner, potentially leading to data loss and poor data transmission reliability.
[0132] This application provides a communication method and system to solve the above-mentioned technical problems. The communication system provided in this application is described below.
[0133] Please see Figure 1 This application provides a communication system that may include a server 110 and a client 120. Both the server 110 and the client 120 may include an application object 130 and a route object 140. The route object is used for communication, and the application object can be used to execute corresponding requests based on received messages.
[0134] The server 110 and the client 120 can communicate using a request-response pattern. For example, the client 120 can send a request message to the server 110, the server 110 can process the request message and return a corresponding response message to the client 120.
[0135] To reduce the risk of data packet loss during communication, the event receiving thread, event processing thread, and event sending thread in the communication process can adopt a method of storing relevant data first and then executing the corresponding operations to complete the communication. Thus, this application embodiment provides a communication method that can ensure data integrity, reduce the risk of data packet loss, and improve the reliability of data transmission.
[0136] The communication method provided in the embodiments of this application is described below.
[0137] like Figure 2 As shown in the embodiment of this application, a communication method is provided, executed by a server, and the method may include:
[0138] Step 201: If at least one client has established a communication connection with the server, receive request messages from at least one client through the event receiving thread.
[0139] In step 201, the server can establish a communication connection with one or more clients. When establishing the communication connection, the server can use the client object corresponding to the client to add the received event, processed event and sent event to the thread pool queue, thereby obtaining the event receiving thread, event processing thread and event sending thread.
[0140] Once a communication connection is established between the client and the server, the client's request messages can be received in sequence through the event receiving thread.
[0141] In some embodiments, the request message may include:
[0142] The message header carries a client object, which represents the client that sent the request message and includes the client's Internet Protocol address and port.
[0143] The request reads / writes a data field, which includes an instruction identifier, a service number, and data content. The service number represents the data type, and the data content represents multiple data items corresponding to each data type.
[0144] It is understandable that a client object can include identification information for a particular client, indicating that the client is different for different clients. For example, a client object can include the client's Internet Protocol address, port, version number, and other configuration parameters.
[0145] The message header may carry a client object. For example, the message header may directly include the client object corresponding to the client that sent the request message, or it may include an identifier corresponding to the client object that sent the request message, which can be used to identify the client object.
[0146] The message header may also include a transaction metadata identifier, which can include a client object to associate a request message sent by the client corresponding to that client object with the corresponding response message. During data transmission, the transaction metadata identifier ensures data integrity and consistency, preventing data transmission and reception errors. The message header may also include components such as protocol identifiers, length, and unit identifiers.
[0147] The request to read / write data field may include an instruction identifier, a service number, and data content. It is understood that in the message format of this application embodiment, the instruction identifier may include a success instruction identifier and a failure instruction identifier. The success instruction identifier may correspond to a read data instruction or a write data instruction, and the failure instruction identifier may indicate the reason for the exception. Generally, for a request message, the instruction identifier may include a success instruction identifier; for a response message, the instruction identifier may include either a success instruction identifier or a failure instruction identifier.
[0148] For example, the success command identifier can be shown in Table 1:
[0149] Table 1
[0150] Success instruction flag Instruction type describe 0×03 Read data command Read data 0×16 Write data command Write data
[0151] For example, failure instruction identifiers can be shown in Table 2:
[0152] Table 2
[0153]
[0154]
[0155] A service number can represent a data type, serving as the encoding for different data types requested. For example, taking water content test data as an example, different service numbers can correspond to different categories of water content test data. As shown in Table 3, service numbers can be exemplified as follows:
[0156] Table 3
[0157] Business Number describe 0×00A1 A1 Furnace Body Moisture Content Test Data 0×00A2 A2 Furnace Body Moisture Content Test Data 0×00B1 B1 Furnace Body Moisture Content Test Data 0×00B2 B2 Furnace Body Moisture Content Test Data 0×00C1 C1 Furnace Body Water Content Test Data 0×00C2 C2 furnace body water content test data 0×00D1 D1 Furnace Body Moisture Content Test Data 0×00D2 D2 Furnace Body Moisture Content Test Data 0×0031 PLC data
[0158] Data content can represent multiple data points corresponding to each data type. Taking water content test data as an example, it can be understood that the water content test data for each furnace body can include multiple data points. The data content can indicate all the data points in the water content test data corresponding to a business number, or it can indicate a portion of the data points in the water content test data corresponding to a business number.
[0159] For example, if a client wants to read data 1 to data 10 from the water content test data of furnace body A1, the indicator identifier in the request message sent by the client can be "0x03", the service number can be "0x00A1", and the data content can be "the identifier or code corresponding to data 1, the identifier or code corresponding to data 2, ... the identifier or code corresponding to data 10".
[0160] In this embodiment, the request message may include a message header and a request read / write data field. The request read / write data field may include an instruction identifier, a service number, and data content, which can clearly specify the server's execution instruction and the execution target, thereby ensuring the accuracy of the data and laying the foundation for data communication.
[0161] In some embodiments, the data content includes at least one structure, which is parsed according to a pre-configured structure definition;
[0162] Each business number corresponds to a structure definition, and the structure definition represents the correspondence between multiple structures and at least one piece of data corresponding to each data type.
[0163] In this embodiment, multiple different structure definitions can be pre-configured. For example, multiple structure definitions can be characterized as follows: structure 1 corresponds to data 1 to data 10, structure 2 corresponds to data 1 to data 20, structure 3 corresponds to data 1 to data 30, and structure 4 corresponds to data 11 to data 30.
[0164] If the client wants to read data 1 through 10, the data content can be "the code corresponding to structure 1". If the client wants to read data 1 through 30, the data content can be "the code corresponding to structure 3". Subsequently, parsing can be performed based on the pre-configured structure definitions to obtain at least one data item corresponding to the structure included in the data content.
[0165] In this way, the data content does not need to include the identifier or code corresponding to each piece of data. Specific data combinations can be combined to create a new structure, preventing data errors. Communication code can be simplified; the server and client only need to assign values to the structure definition, and sending and receiving messages calls the pre-configured structure definition for data parsing, making accessing and modifying complex data simpler and more intuitive. New members can be added to the structure definition to adapt to changes in program requirements; this process does not require modification of read / write instructions or data parsing methods.
[0166] In this embodiment, different structure definitions can be pre-configured so that the data content can encapsulate related data together to form a whole structure, which simplifies the communication code and improves the readability and maintainability of the code.
[0167] In some embodiments, the structure includes a primary structure and a secondary structure;
[0168] The structure definition represents the correspondence between multiple first-level structures and at least one second-level structure, as well as the correspondence between multiple second-level structures and at least one data corresponding to each data type.
[0169] In this embodiment, for the same data segment used by multiple structures simultaneously, a secondary structure can be created. The secondary structure can be referenced by the primary structure, further reducing the amount of code.
[0170] For example, a structure definition can be represented as follows: structure a corresponds to data 1 to data 10, structure b corresponds to data 11 to data 20, and structure c corresponds to data 21 to data 30. Structure A can include structure a and structure c, and structure B can include structure a, structure b, and structure c.
[0171] If the client wants to read data 1 to 10 and data 21 to 30, the data content can be "the code corresponding to structure A". If the client wants to read data 1 to 30, the data content can be "the code corresponding to structure B". Subsequently, parsing can be performed based on the pre-configured structure definitions to obtain at least one piece of data corresponding to the structure included in the data content.
[0172] In this embodiment, the structure may include a first-level structure and a second-level structure. The structure definition can represent the correspondence between multiple first-level structures and at least one second-level structure, as well as the correspondence between multiple second-level structures and at least one data corresponding to each data type, thereby improving the flexibility of data composition and further enhancing the readability and maintainability of the code.
[0173] Understandably, when reading and writing data, Marshal.PtrToStructure can be used to convert the data content communicated between the server and the client into a structure.
[0174] In some examples, the request read / write data field may also include request length and read / write length. The request length can be the sum of the business number length, read / write length, and data content length.
[0175] Step 202: Store the request message.
[0176] In step 202, after receiving the request message, it can be parsed to obtain the client's Internet Protocol address and port, as well as the requested read / write data field, and stored in key-value pairs.
[0177] For example, storage request messages can be stored in the server's database. When processing a request, the corresponding read / write data field can be retrieved from the database, and relevant processing can be performed on that data field. Storage request messages can also be stored directly in the program's memory, such as in a dictionary, and then queued and processed directly in the dictionary.
[0178] Step 203: Process the stored request messages through the event processing thread to obtain the processed data.
[0179] In step 203, the event processing thread can determine the request message with the highest priority in the current order of the stored request messages, and process it according to its instruction identifier, service number and data content to obtain the processed data.
[0180] For example, taking water content test data as an example. If the instruction identifier, service number, and data content indicate that the client wants to read data 1 to data 10 from the water content test data of furnace A1, the server can query data 1 to data 10 from the stored water content test data of furnace A1 and use data 1 to data 10 from the water content test data of furnace A1 as the processed data.
[0181] If the instruction identifier, service number, and data content indicate that the client wants to test the water content test data of the B1 furnace body, the server can obtain the water content test data of the B1 furnace body, store the water content test data of the B1 furnace body in the database, and generate processing data indicating that the test has been successfully completed.
[0182] If the instruction identifier, service number, and data content indicate that the client wants to remove the B1 furnace water content test data, the server can query the already stored B1 furnace water content test data, delete the B1 furnace water content test data from the database, and generate processing data indicating that the deletion has been successfully completed.
[0183] Step 204: Store and process the data.
[0184] In step 204, after obtaining the processed data, it can be stored. For example, the processed data can be stored in the server's database. When a response message needs to be sent, the processed data corresponding to the response message can be retrieved from the database, the response message can be generated, and then sent.
[0185] Data can also be stored directly in the program's memory, for example, in a dictionary, and then sent directly from the dictionary queue.
[0186] Step 205: Send a response message through the event sending thread. The response message is generated based on the stored processing data.
[0187] In step 205, the event sending thread can determine the currently prioritized processing data from the stored processing data, generate a response message, and send it. It is understood that the message format of the response message is the same as that of the request message, and will not be elaborated upon here.
[0188] The response message may include a header, which may carry the client object. In some examples, the header may also include a transaction metadata identifier, which can be copied from the corresponding request message, effectively preventing transmission and reception errors.
[0189] In this embodiment, the server and client can adopt a request-response model. Upon receiving a request message, the request message is first stored and then processed; the processed data is also first stored and then sent. This ensures data integrity, reduces the risk of data loss, and improves the reliability of data transmission.
[0190] In some embodiments, such as Figure 3 As shown, a storage request message may include:
[0191] Step 301: Parse the request message to obtain the client's Internet Protocol address and port, as well as the requested read / write data field;
[0192] Step 302: Store the client's Internet Protocol address and port as keys and the requested read / write data fields as values in a dictionary.
[0193] In this implementation, as described above, the request message may include a message header and a request read / write data field. The message header may carry a client object, which may include information such as the client's Internet Protocol address and port.
[0194] Based on this, the request message can be parsed to obtain the client's Internet Protocol address and port, as well as the requested read / write data field.
[0195] The client's internet protocol address and port can be used as the key, and the requested read / write data field as the value, resulting in key-value pairs. These key-value pairs are then stored in a dictionary. In the dictionary data structure, the "value" acts as the element in the key-value pair, carrying specific data information. The corresponding value can be found using the "key," thus efficiently storing and accessing data. For example, the key-value pairs to be processed can be identified from the dictionary, and the requested read / write data field within the key-value pairs can be processed.
[0196] In this embodiment, request messages can be stored in a dictionary using key-value pairs. Subsequent event processing threads do not need to call the data additionally, which reduces the risk of data loss and improves communication speed.
[0197] In some embodiments, the dictionary may include a receive queue;
[0198] The dictionary stores the client's internet protocol address and port as keys, and the requested read / write data fields as values. This dictionary can include:
[0199] Using the client's Internet Protocol address and port as the key and the requested read / write data field as the value, the first key-value pair is added to the tail of the receive queue.
[0200] By processing the event thread, the stored request messages are processed to obtain the processed data, including:
[0201] The event processing thread processes the request read / write data field of the first key-value pair at the head of the receive queue to obtain the processed data.
[0202] In this embodiment, the client's Internet Protocol address and port can be used as the key, and the requested read / write data field can be used as the value to obtain the first key-value pair.
[0203] The first key-value pair can be added to the tail of the receive queue and wait for the queue to process it.
[0204] When a first key-value pair is at the head of the receive queue, the request read / write data field in that first key-value pair can be processed, and after processing, the first key-value pair can be removed from the receive queue.
[0205] In this embodiment, the data can be directly added to the tail of the receiving queue as key-value pairs and processed automatically according to the order in the queue, without the need to call data, thus improving the communication speed.
[0206] In some embodiments, such as Figure 4 As shown, the data to be stored and processed may include:
[0207] Step 401: Store the client's Internet Protocol address and port as keys and the processed data as values in a dictionary.
[0208] The client's Internet Protocol address and port can be used as keys, and the processed data as values to create key-value pairs, which are then stored in a dictionary. In this dictionary data structure, the "value" acts as the element within the key-value pair, carrying the specific data information. The corresponding value can be looked up using the "key," thus efficiently storing and accessing data. For example, the key-value pair to be sent can be determined from the dictionary, and a response message can be generated and sent based on the processed data in that key-value pair. It is understood that the header of the response message can also include the client's Internet Protocol address and port from the key-value pair to limit the clients that can receive the response message.
[0209] In this embodiment, the processing data can be stored in a dictionary using key-value pairs. Subsequent event sending threads do not need to call the data additionally, which reduces the risk of data loss and improves the communication rate.
[0210] In some embodiments, the dictionary may include a sending queue; storing the client's Internet Protocol address and port as keys and the processed data as values in the dictionary may include:
[0211] The client's Internet Protocol address and port are used as keys, and the processed data is used as values to obtain a second key-value pair, which is then added to the tail of the sending queue.
[0212] The event thread sends a response message, including:
[0213] The event sending thread generates a response message based on the second key-value pair at the head of the sending queue. The response message header includes the client's Internet Protocol address and port from the second key-value pair at the head of the sending queue, and the response message's request read / write data field includes the processing data from the second key-value pair at the head of the sending queue.
[0214] Send a response message.
[0215] In this embodiment, the client's Internet Protocol address and port can be used as the key, and the processed data as the value, to obtain a second key-value pair. This second key-value pair can be added to the tail of the sending queue, awaiting transmission.
[0216] When a second key-value pair is at the head of the sending queue, it can be removed from the sending queue and returned. Then, the processed data in the second key-value pair can be used to generate a response message and sent asynchronously.
[0217] In this embodiment, the data can be added directly to the tail of the sending queue as key-value pairs and sent automatically according to the order in the queue, without the need to call data, thus improving the communication speed.
[0218] In some embodiments, such as Figure 5 As shown, the request message includes an encrypted request read / write data field;
[0219] A storage request message may include:
[0220] Step 501: Decrypt the request message to obtain the plaintext request read / write data field;
[0221] Step 502: Request to read / write data fields.
[0222] In this embodiment, the request message can be an encrypted message. For example, the request read / write data field can be symmetrically encrypted using a preset key, and the encrypted request read / write data field can be used to generate a request message. Alternatively, the request read / write data field can be asymmetrically encrypted using the client's private key, and the encrypted request read / write data field can be used to generate a request message.
[0223] Upon receiving a request message, the server can decrypt it to obtain the requested read / write data field. For example, if the request message is obtained through symmetric encryption using a preset key, the server can use that key to decrypt it, obtaining the plaintext request read / write data field. If the request message is obtained through asymmetric encryption using the client's private key, it can be decrypted using the client's public key, obtaining the plaintext request read / write data field.
[0224] Plaintext requests for reading and writing data can be stored in the data field.
[0225] In this embodiment, the request message can be encrypted, which can improve the security of communication.
[0226] In some embodiments, the request message is obtained by hashing the request read / write data field using a hash algorithm key;
[0227] The request message is decrypted to obtain the plaintext request read / write data field, which may include:
[0228] The request message is decrypted using a hash algorithm key to obtain the plaintext request read / write data field.
[0229] In this embodiment, the client can obtain a preset hash algorithm key, use the hash algorithm key to perform a hash operation on the requested read / write data field, and then obtain a symmetrically encrypted request message. During decryption, the server can use the same key to decrypt and obtain the plaintext requested read / write data field.
[0230] In this embodiment, symmetric encryption can be used to encrypt the request message, making the encryption and decryption process more convenient and further improving the communication speed.
[0231] In some embodiments, such as Figure 6 As shown, sending a response message via the event sending thread can include:
[0232] Step 601: Encrypt the stored processing data by sending an event thread to obtain encrypted data;
[0233] Step 602: Generate a response message based on the encrypted data;
[0234] Step 603: Send a response message.
[0235] In this embodiment, the first processed data can be encrypted by sending an event thread to obtain encrypted data. For example, the first processed data can be symmetrically encrypted using a preset key to obtain encrypted data. Alternatively, the server's private key can be used to perform asymmetric encryption on the first processed data to obtain encrypted data.
[0236] Response messages can be generated based on encrypted data. For example, the header of the response message can be obtained from the header of the corresponding request message. Combining this header with the encrypted data can generate a response message. In other words, the request message and its corresponding response message carry the same client object in their headers.
[0237] The server can send a response message to the corresponding client. The client can decrypt the response message to obtain the processed data and store it. For example, if the response message is obtained through symmetric encryption using a preset key, the client can use that key to decrypt it and obtain the plaintext first processed data. If the response message is obtained through asymmetric encryption using the server's private key, it can be decrypted using the server's public key to obtain the plaintext first processed data.
[0238] In this embodiment, the processed data can be encrypted to obtain an encrypted response message, which can improve the security of communication.
[0239] In some embodiments, such as Figure 7 As shown, encrypting already stored processed data to obtain encrypted data can include:
[0240] Step 701: Use the hash algorithm key to perform a hash operation on the stored processed data to obtain encrypted data.
[0241] In this embodiment, the server can obtain a preset hash algorithm key and use the hash algorithm key to perform a hash operation on the stored processed data to obtain symmetric encrypted data.
[0242] In this embodiment, symmetric encryption can be used to encrypt the processed data, making the encryption and decryption process more convenient and further improving the communication speed.
[0243] In some embodiments, such as Figure 8 As shown, before receiving a request message from at least one client, the method may further include:
[0244] Step 801: Receive the handshake request from the client. The handshake request includes the client object corresponding to the client.
[0245] Step 802: In response to the handshake request, add the client object corresponding to the client to the connection list so that the client and the server can establish a communication connection.
[0246] In this embodiment, the server can start an independent listening thread and declare three delegated events: a thread task receive event, a thread task send event, and a thread task process event. The listening thread refers to the server's ability to listen for and confirm whether it has received a request message from the client.
[0247] When the listening thread is started, the server's connection list (List) is initialized. <tcpclient>The `AcceptTcpClient` method can be used to wait for client connections. `AcceptTcpClient` is typically used in server-side network programming. When the server needs to accept connection requests from clients, it can call this method. It blocks the current thread until a client connects to the server. Once a client connects, this method returns a `TcpClient` object, which the server can use to communicate with the client.
[0248] For example, a server can receive a handshake request from a client, which may include the client's corresponding client object. In response to this handshake request, the server can add three delegate events to the thread pool queue using the `QueueUserWorkItem` method of the client object. `QueueUserWorkItem` allows adding a method to be executed in the thread pool and executing it when an idle thread becomes available. By adding tasks to the thread pool queue, creating new threads is avoided, thus improving performance and reducing resource consumption. Using `QueueUserWorkItem`, time-consuming operations can be performed without blocking the main thread, which is very useful for handling background tasks, parallel processing, and asynchronous programming.
[0249] You can add the client object to the connection list (List). <tcpclient>This ensures that both parties can successfully shake hands. In this way, a single server can communicate with multiple clients to guarantee correct data transmission and prevent mistransmissions.
[0250] In this embodiment, a handshake can be performed before the server and client communicate to establish a communication connection, thereby improving the security of data transmission.
[0251] This application also provides a communication method, executed by a client, such as... Figure 9 As shown, the method may include:
[0252] Step 901: Send a request message to the server;
[0253] Step 902: Receive the response message returned by the server; wherein the response message is generated by the server based on the already stored processing data, and the already stored processing data is the processing data obtained and stored by the server after processing the already stored request message.
[0254] In this embodiment, after the client successfully hands over with the server, it can create a sending event thread, add the request messages to be sent to the sending event thread's sending queue, remove and return the request messages at the head of the sending queue in sequence, and send the request messages to the server.
[0255] In some embodiments, the request message may include:
[0256] The message header carries a client object, which represents the client that sent the request message and includes the client's Internet Protocol address and port.
[0257] The request reads / writes a data field, which includes an instruction identifier, a service number, and data content. The service number represents the data type, and the data content represents multiple data items corresponding to each data type.
[0258] In this embodiment, the request message may include a message header and a request read / write data field. The request read / write data field may include an instruction identifier, a service number, and data content, which can clearly specify the server's execution instruction and the execution target, thereby ensuring the accuracy of the data and laying the foundation for data communication.
[0259] In some embodiments, the data content may include at least one structure, which is parsed according to a pre-configured structure definition;
[0260] Each business number corresponds to a structure definition, and the structure definition represents the correspondence between multiple structures and at least one piece of data corresponding to each data type.
[0261] In this embodiment, different structure definitions can be pre-configured so that the data content can encapsulate related data together to form a whole structure, which simplifies the communication code and improves the readability and maintainability of the code.
[0262] In some embodiments, a structure may include a primary structure and a secondary structure;
[0263] The structure definition represents the correspondence between multiple first-level structures and at least one second-level structure, as well as the correspondence between multiple second-level structures and at least one data corresponding to each data type.
[0264] In this embodiment, the structure may include a first-level structure and a second-level structure. The structure definition can represent the correspondence between multiple first-level structures and at least one second-level structure, as well as the correspondence between multiple second-level structures and at least one data corresponding to each data type, thereby improving the flexibility of data composition and further enhancing the readability and maintainability of the code.
[0265] In some examples, the relevant instructions can be encrypted and then the encrypted request message can be sent to the server asynchronously.
[0266] Upon receiving a request message, the server can store the request message, process the stored request message to obtain processed data, store the processed data, and generate a response message based on the stored processed data to return to the client.
[0267] The client can receive the response message returned by the server, parse it, store the parsed data in the client's dictionary, call the corresponding data retrieval method, retrieve the data corresponding to each request from the dictionary, assign it to the structure corresponding to each request, and remove it from the dictionary, thus completing the entire data interaction process.
[0268] In this embodiment, the server and client can adopt a request-response model. Upon receiving a request message, the request message is first stored and then processed; the processed data is also first stored and then sent. This ensures data integrity, reduces the risk of data loss, and improves the reliability of data transmission.
[0269] In some embodiments, such as Figure 10 As shown, before sending the request message to the server, the method also includes:
[0270] Step 1001: When displaying the interactive interface, which includes a first control, receive a first input to the interactive interface, the first input including input to configure the server port number and input to the first control;
[0271] Step 1002: In response to the first input, send a handshake request to the server corresponding to the server port number; the handshake request includes the client object corresponding to the client.
[0272] Step 1003: Receive the handshake result returned by the server and display it on the interactive interface; wherein, the handshake result is generated when the server adds the client object to the connection list according to the handshake request.
[0273] In this embodiment, as Figure 11 As shown, the client can display an interactive interface 1100, which may include a first control 1101, such as a "connect" control.
[0274] Users can enter the server port number of the server they want to connect to in the interactive interface, and then click the "Connect" control to send a handshake request to the server.
[0275] After receiving a handshake request, the server can process it, adding the client object to the connection list and generating a handshake result to return to the client. The client can receive the handshake result returned by the server and display it in the interactive interface. For example, the interactive interface can display "Connection successful" to indicate that the client and server have established a communication connection.
[0276] In this embodiment, a handshake operation with the server can be performed based on the client's interactive interface to establish a communication connection and improve the security of data transmission.
[0277] In some embodiments, such as Figure 12 As shown, the request message includes a request test message;
[0278] Sending a request message to the server may include:
[0279] Step 1201: When displaying an interactive interface, which includes a second control, receive a second input to the second control.
[0280] Step 1202: In response to the second input, a request test message is sent to the server so that the server can obtain and store the data of the data type corresponding to the service number of the request test message.
[0281] In this embodiment, the interactive interface 1100 may also include a second control 1102, for example, the second control 1102 may be a "Request Test" control.
[0282] You can enter the cell barcode, process start time, fixture number, wire number, and other information to be tested in the interactive interface. After filling in the information, click the "Request Test" control to generate the corresponding request test message and send it to the server.
[0283] Upon receiving a test request message, the server can retrieve and store the data of the data type corresponding to the service number in the test request message.
[0284] In this embodiment, a request test message can be generated based on the client's interactive interface, so that the server can obtain and store the data of the data type corresponding to the service number of the request test message.
[0285] In some embodiments, such as Figure 13 As shown, the request message includes a data acquisition message;
[0286] Sending a request message to the server may include:
[0287] Step 1301: When displaying an interactive interface, if the interactive interface includes a third control, receive a third input to the third control;
[0288] Step 1302: In response to the third input, a data acquisition message is sent to the server so that the server returns a response message based on the data acquisition message;
[0289] Specifically, if the server stores data of the data type corresponding to the business number of the data acquisition message, the response message is generated based on the data of the data type corresponding to the business number of the data acquisition message; if the server does not store data of the data type corresponding to the business number of the data acquisition message, the response message is the data acquisition message.
[0290] In this embodiment, the interactive interface 1100 may also include a third control 1103, for example, the third control 1103 may be a "get data" control.
[0291] You can click the "Get Data" control to generate the corresponding data acquisition message and send it to the server.
[0292] When the server receives a data retrieval message, if it already has test results (i.e., it has stored data of the data type corresponding to the service number in the data retrieval message), it can generate a response message based on that data type and return it to the client. If the server does not yet have test results, it will directly return the data retrieval message to the client, prompting the client to first send a test request message to the server to obtain the test results.
[0293] In this embodiment, a data acquisition message can be generated based on the client's interactive interface, so that the client can obtain the stored relevant data from the server.
[0294] In some embodiments, such as Figure 14 As shown, the request message includes a remove data message, and the interactive interface includes a fourth control;
[0295] Sending a request message to the server may include:
[0296] Step 1401: Upon receiving a response message from the server, and if the response message is generated based on data of the data type corresponding to the service number of the data acquisition message, receive the fourth input to the fourth control.
[0297] Step 1402: In response to the fourth input, a remove data message is sent to the server so that the server deletes the data of the data type corresponding to the service number of the remove data message.
[0298] In this embodiment, the interactive interface 1100 may also include a fourth control 1104, for example, the fourth control 1104 may be a "Remove Data" control.
[0299] If a client has already obtained data of a certain data type and performed relevant tests, in order to prevent other clients from performing duplicate tests on the same data, or if the client obtains data of a certain data type and finds that the data may be erroneous and needs to be retested, the client can click the "Remove Data" control to generate the corresponding data removal message and send it to the server.
[0300] Upon receiving a data packet to be removed, the server can delete the data of the data type corresponding to the service number in the data packet.
[0301] In this embodiment, a data removal message can be generated based on the client's interactive interface, so that the server can delete the corresponding stored related data. On the one hand, this can avoid different clients processing the same type of data, reducing the risk of resource waste. On the other hand, for data with errors, it is easier for the server to retrieve the data again, improving the accuracy of the data.
[0302] This application embodiment can also provide a battery cell water content testing system, such as Figure 15 As shown, the system may include:
[0303] Baking equipment 1501 is used to bake the battery cells to adjust the water content of the battery cells;
[0304] Server 1502 is configured to, when at least one client establishes a communication connection with the server, receive request messages from at least one client via a receiving event thread. The request message includes a request read / write data field, which includes an instruction identifier, a service number, and data content. The service number represents the category of water content test data, and the data content includes multiple data points from the water content test data of the category corresponding to the service number. Server 1502 is further configured to: store the request read / write data field; process the stored request read / write data field via a processing event thread to obtain processed data; store the processed data; and send a response message via a sending event thread, the response message being generated based on the stored processed data.
[0305] Client 1503 establishes a communication connection with the server, used to send request messages to the server and receive response messages returned by the server.
[0306] In this embodiment, the client can establish a communication connection with the server and send a request message to the server. The request message may include a request to read or write data field, which may include an instruction identifier, a service number, and data content.
[0307] The business number can represent the category of water content test data, and the data content includes multiple data points in the water content test data of the category corresponding to the business number.
[0308] After receiving a request message, the server can store the requested read / write data fields and process them using an event processing thread to obtain processed data. The server then stores the processed data and sends a response message via a sending event thread. The response message can be generated based on the stored processed data. The specific implementation is as described above and will not be repeated here.
[0309] In this embodiment, for the communication of water content test data during the cell water content testing process, the server and client can adopt a request-response mode. Upon receiving a request message, the request message is first stored and then processed; the processed data is also first stored and then sent. This ensures the integrity of the water content test data, reduces the risk of data loss, and improves the reliability of water content test data transmission.
[0310] In some embodiments, the baking apparatus 1501 may include at least one baking oven body, and each baking oven body is numbered accordingly;
[0311] The service numbers corresponding to the water content test data of different baking ovens are different, and the service number corresponding to the water content test data of the first baking oven is generated based on the number of the first baking oven. The first baking oven is any one of at least one baking oven.
[0312] In this embodiment, the baking equipment 1501 may include at least one baking oven body, and each baking oven body has a corresponding number, which may include "A1, A2, B1, B2, etc."
[0313] As shown in Table 3 above, all water content test data of the baking equipment can be classified according to different baking ovens, and a business number corresponding to the water content test data of the baking oven can be generated based on the oven number. For example, the business number "0×00A1" can correspond to "Water content test data of oven A1", that is, the water content test data of baking oven A1.
[0314] During the cell water content testing process, multiple clients can obtain water content test data for different baking ovens from the server according to different business numbers for analysis, achieving the purpose of collaborative testing. This eliminates the need for unified testing and analysis of all water content test data, improving water content testing efficiency and avoiding the risk of inaccurate water content test data for some baking ovens affecting the overall test results and requiring retesting of all water content test data.
[0315] In this embodiment, the water content test data of the battery cells can be classified according to different baking ovens. This allows for the generation of corresponding service numbers based on the numbers of different baking ovens, enabling point-to-point communication and analysis of water content test data from different baking ovens, thereby improving the convenience and accuracy of battery cell water content testing.
[0316] In some embodiments, the baking equipment 1501 may further include a programmable logic controller (PLC), wherein the service number corresponding to the data of the PLC is different from the service number corresponding to the water content test data of at least one baking oven body.
[0317] In this embodiment, the baking equipment 1501 may also include a PLC. The data of the PLC may include relevant baking parameter data controlled by the PLC during the operation of the baking oven, such as baking temperature and baking time.
[0318] As shown in Table 3 above, PLC data can be classified as a category of water content test data, each corresponding to a service number distinct from the water content test data of at least one baking oven. For example, service number "0x0031" can correspond to "PLC data". During the cell water content test, the client can retrieve "PLC data" from the server based on service number "0x0031" for test analysis.
[0319] In this embodiment, the water content test data of different categories may also include PLC data. The PLC data can be communicated and analyzed based on the service number corresponding to the PLC data, thereby improving the comprehensiveness of the battery cell water content test.
[0320] The aspects of this disclosure have been described above with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and program products according to embodiments of this disclosure. It should be understood that each block in the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by a computer program or instructions. These programs or instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine such that these instructions, executable via the processor of the computer or other programmable data processing apparatus, enable the implementation of the functions / actions specified in one or more blocks of the flowchart illustrations and / or block diagrams. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor, or a field-programmable logic circuit. It is also understood that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can also be implemented by special-purpose hardware performing the specified functions or actions, or can be implemented by a combination of special-purpose hardware and computer instructions.
[0321] Although this application has been described with reference to preferred embodiments, various modifications can be made thereto and components can be replaced with equivalents without departing from the scope of this application. In particular, the technical features mentioned in the various embodiments can be combined in any manner, provided there is no structural conflict. This application is not limited to the specific embodiments disclosed herein, but includes all technical solutions falling within the scope of the claims.< / tcpclient> < / tcpclient>
Claims
1. A communication method, characterized in that, The method, executed by the server, includes: When at least one client establishes a communication connection with the server, the request message from the at least one client is received through the event receiving thread. Store the request message; The stored request messages are processed by the event processing thread to obtain the processed data. Store the processed data; A response message is sent via an event thread, the response message being generated based on the already stored processing data.
2. The method according to claim 1, characterized in that, The request message includes: The message header carries a client object, which represents the client that sent the request message, and includes the client's Internet Protocol address and port. The request read / write data field includes an instruction identifier, a service number, and data content. The service number represents the data type, and the data content represents multiple data corresponding to each data type.
3. The method according to claim 2, characterized in that, The data content includes at least one structure, which is parsed according to a pre-configured structure definition; Each of the business numbers corresponds to one of the structure definitions, and the structure definition represents the correspondence between multiple structures and at least one piece of data corresponding to each data type.
4. The method according to claim 3, characterized in that, The structure includes a primary structure and a secondary structure; The structure definition represents the correspondence between multiple first-level structures and at least one second-level structure, as well as the correspondence between multiple second-level structures and at least one data corresponding to each data type.
5. The method according to any one of claims 2 to 4, characterized in that, The storage of the request message includes: Parse the request message to obtain the client's Internet Protocol address and port, as well as the request read / write data field; The client's Internet Protocol address and port are used as keys, and the requested read / write data field is used as the value, stored in a dictionary.
6. The method according to claim 5, characterized in that, The dictionary includes a receive queue; The step of storing the client's Internet Protocol address and port as keys and the requested read / write data field as values in a dictionary includes: Using the client's Internet Protocol address and port as the key and the requested read / write data field as the value, a first key-value pair is obtained and added to the tail of the receiving queue. The process involves using an event processing thread to process stored request messages and obtain processed data, including: The event processing thread processes the request read / write data field of the first key-value pair located at the head of the receiving queue to obtain the processed data.
7. The method according to any one of claims 2 to 6, characterized in that, The storage of the processed data includes: The client's Internet Protocol address and port are used as keys, and the processed data is used as values, stored in a dictionary.
8. The method according to claim 7, characterized in that, The dictionary includes a sending queue; The step of storing the client's Internet Protocol address and port as keys and the processed data as values in a dictionary includes: Using the client's Internet Protocol address and port as the key and the processed data as the value, a second key-value pair is obtained and added to the tail of the sending queue; The step of sending a response message via an event thread includes: The event sending thread generates a response message based on the second key-value pair located at the head of the sending queue; wherein the header of the response message includes the client's Internet Protocol address and port in the second key-value pair located at the head of the sending queue, and the request read / write data field of the response message includes the processing data in the second key-value pair located at the head of the sending queue. Send the response message.
9. The method according to any one of claims 1 to 8, characterized in that, The request message includes an encrypted request read / write data field; The storage of the request message includes: The request message is decrypted to obtain the plaintext request read / write data field; Store the requested read / write data field.
10. The method according to claim 9, characterized in that, The request message is obtained by performing a hash operation on the request read / write data field using a hash algorithm key; The process of decrypting the request message to obtain the plaintext request read / write data field includes: The request message is decrypted using the key of the hash algorithm to obtain the plaintext request read / write data field.
11. The method according to any one of claims 1 to 10, characterized in that, The step of sending a response message via an event thread includes: By sending an event thread, the stored processed data is encrypted to obtain encrypted data; A response message is generated based on the encrypted data; Send the response message.
12. The method according to claim 11, characterized in that, The step of encrypting the already stored processed data to obtain encrypted data includes: The stored processed data is hashed using the key of the hash algorithm to obtain encrypted data.
13. The method according to any one of claims 1 to 12, characterized in that, Before receiving the request message from the at least one client, the method further includes: Receive a handshake request from a client, the handshake request including the client object corresponding to the client; In response to the handshake request, the client object corresponding to the client is added to the connection list so that the client can establish a communication connection with the server.
14. A communication method, characterized in that, The method, executed by the client, includes: Send a request message to the server; Receive a response message returned by the server; wherein the response message is generated by the server based on the stored processing data, and the stored processing data is the processing data obtained and stored by the server after processing the stored request message.
15. The method according to claim 14, characterized in that, The request message includes: The message header carries a client object, which represents the client that sent the request message, and includes the client's Internet Protocol address and port. The request read / write data field includes an instruction identifier, a service number, and data content. The service number represents the data type, and the data content represents multiple data corresponding to each data type.
16. The method according to claim 15, characterized in that, The data content includes at least one structure, which is parsed according to a pre-configured structure definition; Each of the business numbers corresponds to one of the structure definitions, and the structure definition represents the correspondence between multiple structures and at least one piece of data corresponding to each data type.
17. The method according to claim 16, characterized in that, The structure includes a primary structure and a secondary structure; The structure definition represents the correspondence between multiple first-level structures and at least one second-level structure, as well as the correspondence between multiple second-level structures and at least one data corresponding to each data type.
18. The method according to any one of claims 15 to 17, characterized in that, Before sending the request message to the server, the method further includes: When displaying an interactive interface, which includes a first control, a first input to the interactive interface is received, the first input including input to configure the server port number and input to the first control. In response to the first input, a handshake request is sent to the server corresponding to the server port number; the handshake request includes the client object corresponding to the client. The handshake result returned by the server is received and displayed on the interactive interface; wherein the handshake result is generated when the server adds the client object to the connection list according to the handshake request.
19. The method according to any one of claims 15 to 18, characterized in that, The request message includes a request test message; Sending the request message to the server includes: When displaying an interactive interface, which includes a second control, a second input to the second control is received. In response to the second input, the request test message is sent to the server so that the server can obtain and store the data of the data type corresponding to the service number of the request test message.
20. The method according to any one of claims 15 to 19, characterized in that, The request message includes a data acquisition message; Sending the request message to the server includes: When displaying an interactive interface, which includes a third control, a third input to the third control is received; In response to the third input, the data acquisition message is sent to the server so that the server returns a response message based on the data acquisition message. Wherein, if the server stores data of the data type corresponding to the service number of the data acquisition message, the response message is generated based on the data of the data type corresponding to the service number of the data acquisition message; if the server does not store data of the data type corresponding to the service number of the data acquisition message, the response message is the data acquisition message.
21. The method according to claim 20, characterized in that, The request message includes a remove data message, and the interactive interface includes a fourth control; Sending the request message to the server includes: Upon receiving a response message returned by the server, and the response message being generated based on data of the data type corresponding to the service number of the acquired data message, a fourth input to the fourth control is received. In response to the fourth input, the server sends the removal data message to the server so that the server deletes the data of the data type corresponding to the service number of the removal data message.
22. A battery cell water content testing system, characterized in that, The system includes: Baking equipment for baking battery cells to adjust the water content of the battery cells; The server, communicatively connected to the baking equipment, is configured to, when at least one client establishes a communication connection with the server, receive request messages from the at least one client via a receiving event thread. The request message includes a request read / write data field, which includes an instruction identifier, a service number, and data content. The service number represents the category of water content test data, and the data content includes multiple data points from the water content test data within the category corresponding to the service number. The server stores the request read / write data field. It then processes the stored request read / write data field via a processing event thread to obtain processed data. Finally, it stores the processed data. Finally, it sends a response message via a sending event thread, the response message being generated based on the stored processed data. The client establishes a communication connection with the server to send request messages to the server and receive response messages returned by the server.
23. The system according to claim 22, characterized in that, The baking equipment includes at least one baking oven body, and each baking oven body is numbered. The service numbers corresponding to the water content test data of different baking ovens are different, and the service number corresponding to the water content test data of the first baking oven is generated based on the number of the first baking oven. The first baking oven is any one of the at least one baking ovens.
24. The system according to claim 23, characterized in that, The baking equipment also includes a programmable logic controller (PLC), and the service number corresponding to the data of the PLC is different from the service number corresponding to the water content test data of the at least one baking oven body.