A communication protocol optimization method and system for smart watches
By building cross-platform interface data and test cases of smart watches, the problem of different protocol support and function implementation of smart watches on different platforms is solved, the consistency and correctness of functions are achieved, and the product quality is improved.
Patent Information
- Application Number
- CN202411337818.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-25
- Publication Date
- 2025-05-02
- Estimated Expiration
- 2044-09-25
AI Technical Summary
There are differences in the protocol support and function implementation of smartwatches on different platforms, resulting in some features requiring additional work or not being fully implemented.
By collecting the communication protocol set by the user, we can determine whether the platform differences are detected. If so, obtain the content of user requirements, build cross-platform interface data, divide interface information, select development frameworks, generate test cases, conduct automated testing, identify and correct logical errors, and ensure the consistency and correctness of functions on different platforms.
It realizes the consistency and correctness of the functionalities of smart watches on different platforms, reduces the problems caused by platform differences, and improves product quality and user satisfaction.
Smart Images

Figure CN119182829B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of protocol data processing, and in particular to a communication protocol optimization method and system for a smart watch. Background Art
[0002] At present, with the widespread application of smart watches in the market, the improvement of their functions and performance has put forward higher requirements on communication protocols. Smart watches not only need to achieve seamless connection with smart phones for data synchronization, message push, remote control and other operations, but also need to ensure stability and low power consumption in various complex environments.
[0003] However, smart watches usually need to communicate with multiple different manufacturers and different operating systems. For example, Android devices usually support a wide range of Bluetooth profiles, while iOS devices may have their own specific protocol requirements. Different platforms may have different support for protocols and function implementations, resulting in some functions of smart watches requiring additional work or even not being fully implemented. Summary of the invention
[0004] The present invention aims to solve the problem that different platforms have different support for smart watch protocols and function implementations, resulting in some functions of smart watches requiring additional work or even failing to be fully implemented, and provides a communication protocol optimization method and system for smart watches.
[0005] The present invention adopts the following technical means to solve the technical problem:
[0006] The present invention provides a communication protocol optimization method for a smart watch, comprising:
[0007] Collect the communication protocol set by the user for the smart watch;
[0008] determining whether the communication protocol detects a preset platform difference;
[0009] If yes, then obtaining the requirement content preset by the user, constructing the cross-platform interface data of the smart watch based on the requirement content by using a preset programming language, dividing the interface information from the cross-platform interface data, selecting a corresponding development framework according to the interface information to establish the application code of the smart watch, and generating a test case of the requirement content in a preset test framework, wherein the interface information specifically includes interface functions, interface parameters and interface return values, and the test case specifically includes unit testing, integration testing and end-to-end testing;
[0010] Determine whether the test case can complete the preset automated test;
[0011] If not, identify the logical errors in the test case based on the test results, modify the test case code based on the logical errors, obtain the missing test code paths and missing scenarios from the test results, generate the boundary conditions of the test case through the missing test code paths and the missing scenarios, add the boundary conditions to the test case, and integrate the test case to verify the collaboration information of the smart watch for the required content, wherein the boundary conditions specifically include maximum values, minimum values and null values, and the collaboration information specifically includes data exchange, function calls and event triggering.
[0012] Furthermore, after the step of obtaining the user's preset requirement content and constructing the cross-platform interface data of the smart watch in a preset programming language based on the requirement content, the step further includes:
[0013] Identify a data model corresponding to the demand content, establish an interface data structure of the smart watch based on the data model, and select the programming language to construct an interface code according to the interface data structure, wherein the interface data structure specifically includes a request data format and a response data format;
[0014] Determine whether the interface code can realize the preset functional logic;
[0015] If not, an error log is generated, the corresponding error information and trace stack are searched from the error log, the key variable values and program execution path of the error log are recorded, the preset debugging tool is applied to execute the interface code step by step, and the running status data and variable change data of the application are generated.
[0016] Furthermore, the step of selecting a corresponding development framework according to the interface information to establish the application code of the smart watch and generating a test case of the required content in a preset test framework also includes:
[0017] Based on the branch strategy predefined in the test case, the deployment environment of the smart watch is configured, and a preset monitoring tool is applied to collect the running status of the application in real time, wherein the branch strategy specifically includes a main branch, a development branch, and a functional branch, and the deployment environment specifically includes a production environment and a test environment;
[0018] Determining whether the operating state meets the preset state;
[0019] If not, the key indicator data of the test case is monitored in real time, and the pre-written rollback script is deployed to the test case according to the pre-configured alarm rules of the smart watch. The rollback script is used to trigger the smart watch to restore to the pre-test version and re-enable the service content of the smart watch, wherein the key indicator data specifically include error rate, response time and memory usage.
[0020] Furthermore, the step of identifying the logical errors in the test case according to the test results and modifying the test case code based on the logical errors includes:
[0021] Classify failed test cases from the test cases, extract input data of the failed test cases, import the input data into a preset local development environment, re-run the failed test cases at least twice in the local development environment, and generate running results of the failed test cases;
[0022] Determining whether a repeatable error is detected in the operation result;
[0023] If so, change the configuration parameters of the local development environment, collect the output results of the failed test cases based on the configuration parameters, and record the log information of the output results, wherein the configuration parameters specifically include configuration files, log levels, and feature enablement and disablement, the output results specifically include test pass and test failure, and the log information specifically includes database connections and API endpoints.
[0024] Furthermore, the step of determining whether the communication protocol detects a preset platform difference further includes:
[0025] Based on the platform difference dimensions pre-recorded by the smart watch, recording the API document log generated by the user through the smart watch, wherein the platform difference dimensions specifically include operating system differences, hardware differences, software version differences, network environment differences and API version differences;
[0026] Determine whether the API document log detects a compatibility alarm preset by the smart watch;
[0027] If so, the difference information in the API document log is collected, the preset difference document is updated regularly according to the difference information, the latest communication status of the current protocol is mapped through the difference document, and the difference priority is adaptively generated according to the latest communication status.
[0028] Furthermore, the step of determining whether the test case can complete the preset automated test further includes:
[0029] Based on the test objectives preset in the test case, adjust the test requirement data of the automated test, and configure the test environment according to the test objectives and the test requirement data, wherein the test objectives specifically include functional verification, performance verification and compatibility testing, and the test requirement data specifically include input data, expected results and execution environment;
[0030] Determine whether the test environment matches the expected environment, wherein the expected environment specifically includes the operating system, browser version, dependent libraries, and network configuration;
[0031] If so, write the test script of the automated test based on the test requirement data, cover the expected functions and boundary conditions of the requirement content from the test script, and generate feasibility evaluation data of the test script, wherein the feasibility evaluation data specifically includes the stability and repeatability of the test case and whether it depends on dynamic data or environment.
[0032] Furthermore, the step of collecting the communication protocol set by the user for the smart watch includes:
[0033] Based on the preset communication protocol structure of the smart watch, the data exchange process of the communication protocol is divided, wherein the communication protocol structure specifically includes data format, protocol hierarchy and message type, and the data exchange process specifically includes request and response mechanism, status code and error handling;
[0034] Determining whether the data exchange process detects signal data packets of different protocols;
[0035] If so, the protocol type of the communication protocol is generated through the signal data packet, and the permission setting of the smart watch for the communication protocol is adaptively identified according to the protocol type.
[0036] The present invention also provides a communication protocol optimization system for a smart watch, comprising:
[0037] A collection module, used to collect the communication protocol set by the user for the smart watch;
[0038] A determination module, used to determine whether the communication protocol detects a preset platform difference;
[0039] An execution module, configured to, if yes, obtain the requirement content preset by the user, construct the cross-platform interface data of the smart watch in a preset programming language based on the requirement content, divide the interface information from the cross-platform interface data, select a corresponding development framework according to the interface information to establish the application code of the smart watch, and generate a test case of the requirement content in a preset test framework, wherein the interface information specifically includes interface functions, interface parameters and interface return values, and the test case specifically includes unit testing, integration testing and end-to-end testing;
[0040] A second judgment module is used to judge whether the test case can complete the preset automated test;
[0041] A second execution module is used to, if not, identify logical errors in the test case based on the test results, modify the test case code based on the logical errors, obtain missing test code paths and missing scenarios from the test results, generate boundary conditions of the test case through the missing test code paths and the missing scenarios, add the boundary conditions to the test case, and integrate the test case to verify the collaboration information of the smart watch for the required content, wherein the boundary conditions specifically include maximum values, minimum values and null values, and the collaboration information specifically includes data exchange, function calls and event triggering.
[0042] Furthermore, it also includes:
[0043] an identification module, used to identify a data model corresponding to the demand content, establish an interface data structure of the smart watch based on the data model, and select the programming language to construct an interface code according to the interface data structure, wherein the interface data structure specifically includes a request data format and a response data format;
[0044] A third judgment module is used to judge whether the interface code can realize the preset functional logic;
[0045] The third execution module is used to generate an error log if not, search for corresponding error information and trace stack from the error log, record key variable values and program execution path of the error log, apply a preset debugging tool to execute the interface code step by step, and generate running status data and variable change data of the application.
[0046] Furthermore, the execution module also includes:
[0047] A configuration unit, configured to configure the deployment environment of the smart watch based on the branch strategy predefined in the test case, and apply a preset monitoring tool to collect the running status of the application in real time, wherein the branch strategy specifically includes a main branch, a development branch, and a functional branch, and the deployment environment specifically includes a production environment and a test environment;
[0048] A judging unit, used to judge whether the running state conforms to a preset state;
[0049] The execution unit is used to monitor the key indicator data of the test case in real time if not, and deploy the pre-written rollback script to the test case according to the pre-configured alarm rules of the smart watch, so as to trigger the smart watch to recover to the pre-test version through the rollback script and re-enable the service content of the smart watch, wherein the key indicator data specifically include error rate, response time and memory usage.
[0050] The present invention provides a communication protocol optimization method and system for a smart watch, which has the following beneficial effects:
[0051] By collecting the communication protocols set by users for smart watches, the present invention can fully understand the specific needs and expectations of different users, ensure that the protocol design and implementation can meet the actual usage scenarios, and at the same time, by constructing cross-platform interface data through a preset programming language, a unified interface standard can be achieved, reducing the differences between different platforms, and selecting the corresponding development framework according to the interface information to ensure that the most appropriate tools and technologies can be selected on different platforms. Through unit testing, integration testing and end-to-end testing, the functions and performance are fully covered to ensure that all functions can be correctly implemented on different platforms. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] Figure 1 A schematic diagram of a flow chart of an embodiment of a communication protocol optimization method for a smart watch of the present invention;
[0053] Figure 2 The present invention is a block diagram of a communication protocol optimization system for a smart watch according to an embodiment of the present invention. DETAILED DESCRIPTION
[0054] It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. The implementation of the objectives, functional features and advantages of the present invention will be further described in conjunction with the embodiments and with reference to the accompanying drawings.
[0055] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0056] Reference Figure 1 , is a communication protocol optimization method for a smart watch in an embodiment of the present invention, comprising:
[0057] S1: Collect the communication protocol set by the user for the smart watch;
[0058] S2: Determine whether the communication protocol detects a preset platform difference;
[0059] S3: If yes, then obtain the requirement content preset by the user, construct the cross-platform interface data of the smart watch based on the requirement content by using a preset programming language, divide the interface information from the cross-platform interface data, select a corresponding development framework according to the interface information to establish the application code of the smart watch, and generate a test case of the requirement content in a preset test framework, wherein the interface information specifically includes interface functions, interface parameters and interface return values, and the test case specifically includes unit testing, integration testing and end-to-end testing;
[0060] S4: Determine whether the test case can complete the preset automated test;
[0061] S5: If not, identify the logical errors in the test case according to the test results, modify the test case code based on the logical errors, obtain the missing test code paths and the missing scenarios from the test results, generate the boundary conditions of the test case through the missing test code paths and the missing scenarios, add the boundary conditions to the test case, and integrate the test case to verify the collaboration information of the smart watch for the required content, wherein the boundary conditions specifically include maximum values, minimum values and null values, and the collaboration information specifically includes data exchange, function calls and event triggering.
[0062] In this embodiment, the system collects the required communication protocols set by the user for the smart watch, determines whether these communication protocols detect the preset platform differences, and executes the corresponding steps; for example, when the system determines that the required communication protocols set by the user for the smart watch do not detect the preset platform differences, the system will consider that these communication protocols can operate normally on different platforms, and there is no functional inconsistency problem caused by platform differences. The system will test and optimize the performance of the communication protocols on different platforms, including data transmission speed, delay and stability. According to the test and verification results, the design documents of the protocols are improved to ensure that the implementation details of all platforms are fully recorded. At the same time, the user's usage experience and feedback on different platforms are collected to understand the performance of the protocols in actual use, so that the backend management team can find out the subtle differences and improvement space that may exist in the protocols on different platforms, and implement automated testing on all target platforms to ensure that the communication protocols remain compatible in future updates and maintenance. Through logging and performance monitoring tools, the performance and operation of the protocols on different platforms are continuously monitored to timely discover and solve problems; for example, when the system determines that the required communication protocols set by the user for the smart watch can detect the preset platform differences, the system will consider These communication protocols cannot run on cross-platforms. The system will obtain the requirements pre-set by the user, build the cross-platform interface data of the smart watch based on different requirements through the pre-set programming language, divide the interface information from these cross-platform interface data, and the interface information specifically includes interface functions, interface parameters and interface return values. According to the interface information, the corresponding development framework is selected to establish the application code of the smart watch, and the test cases of the requirements are generated in the pre-set test framework. The test cases specifically include unit testing, integration testing and end-to-end testing; by building the cross-platform interface data of the smart watch, the system reduces the complexity of developing and maintaining codes for each platform separately. The use of a unified interface standard can ensure the consistency of implementation of each platform and reduce the problems caused by platform differences. At the same time, the most suitable development framework is selected according to the interface information to ensure that each platform can use best practices and tools. The appropriate development framework can improve development efficiency and reduce unnecessary duplication of work. The clear division of interface functions, parameters and return values makes the responsibilities of each interface clear, which is helpful for development and maintenance, because the clear interface definition makes the code more readable and convenient for subsequent maintenance and expansion; then the system determines whether these test cases can complete the pre-set automated tests to execute the corresponding steps;For example, when the system determines that the test case of the requirement content can complete the pre-set automated test, the system will consider that the test case has successfully verified the correctness and consistency of the smart watch function across platforms. The system will confirm the test results to ensure that the smart watch function can run stably on different platforms, check the logs of all test cases to ensure that there are no omissions or false positives, and record all test results in the test report, including the passed test cases, test data and test environment, and update the test results to the project document to ensure that the latest status of the document reflects the real-time status of the current smart watch, and ensure that the deployment environment configuration is consistent with the test environment to avoid problems caused by environmental differences. The backend management team can also collect user feedback to continuously improve the smart watch; for example, when the system determines that the test case of the requirement content cannot complete the pre-set automated test, the system will consider that the correctness and consistency of the smart watch function across platforms cannot be obtained. The system will identify logical errors in the test case based on the test results of the test case, modify the test case code based on the logical errors, obtain the missing code path and missing scenarios from these test results, and generate the boundary conditions of the test case through the missing test code and missing scenarios. Boundary conditions specifically include maximum value, minimum value and null value. These boundary conditions are added to the test cases, and the test cases are integrated to verify the collaboration information of the smart watch for the required content. The collaboration information specifically includes data exchange, function call and event triggering. By identifying logical errors in test cases, the system can quickly locate and clarify specific problems, improve problem solving efficiency, and accurately locate errors to reduce debugging time, so that the backend management team can focus on solving real problems. At the same time, missing code paths and scenarios are obtained to ensure that test cases cover all possible usage situations, including extreme conditions, and missing scenarios and code paths are supplemented to ensure that no functions or abnormal situations are missed, improve test completeness, and by adding boundary conditions such as maximum value, minimum value and null value, the performance of the system in extreme situations can be tested more accurately to ensure the robustness of the system. The refined boundary condition test reduces the possibility of missed errors and ensures that the system can handle various boundary situations. Finally, the integrated test cases verify the collaboration information of the smart watch for the required content, ensure the correctness and consistency of data exchange, function call and event triggering, verify the collaboration between different modules, and ensure the consistency and stability of the overall functions of the smart watch on different platforms. ;
[0063] It should be noted that the user's preset requirement content is obtained, and based on the requirement content, the cross-platform interface data of the smart watch is constructed by a preset programming language. The specific examples are as follows:
[0064] Suppose a user wants a smartwatch to have the following functions: real-time heart rate monitoring;
[0065] When the heart rate exceeds the preset threshold, the smartwatch will sound an alarm, and the heart rate data can be synchronized across different platforms (such as iOS and Android);
[0066] First, the system will obtain the user's preset requirements, that is, real-time heart rate monitoring. Through user surveys and interviews, the following requirements are collected:
[0067] 1. Monitor and record heart rate in real time;
[0068] 2. When the heart rate exceeds 120 beats per minute, an alarm will sound;
[0069] 3. Heart rate data needs to be synchronized across platforms;
[0070] The system will convert the requirements into technical specifications, specifically:
[0071] Interface functions include:
[0072] Get heart rate data;
[0073] Record heart rate data;
[0074] Send out heart rate alarm;
[0075] Synchronize heart rate data;
[0076] The interface parameters include:
[0077] Heart rate value (heartRate);
[0078] timestamp;
[0079] Platform type (platform);
[0080] The return value includes:
[0081] Success status (status);
[0082] Heart rate data recording results (data);
[0083] Through interface design and implementation, JavaScript and Node.js are selected to implement the interface to ensure cross-platform consistency. The interface implementation code is as follows:
[0084] javascript
[0085] const express = require('express'); const app = express();
[0086] app.use(express.json());
[0087] const heartRateData = []; / / Simulate database
[0088] / / Heart rate monitoring interface
[0089] app.post(' / monitorHeartRate', (req, res) =>{
[0090] const { heartRate, timestamp, platform} = req.body;
[0091] / / Verify parameters
[0092] if (!heartRate || !timestamp || !platform) {
[0093] return res.status(400).json({ error: 'Invalid parameters'});
[0094] }
[0095] / / Record heart rate data
[0096] const heartRateRecord = {
[0097] heartRate,
[0098] timestamp,
[0099] platform,
[0100] status: 'recorded'
[0101] };
[0102] heartRateData.push(heartRateRecord);
[0103] / / Check heart rate threshold
[0104] if (heartRate>120) {
[0105] heartRateRecord.alert = 'Heart rate exceeds 120!';
[0106] }
[0107] / / Return result
[0108] res.status(200).json(heartRateRecord);
[0109] });
[0110] / / Start the server
[0111] app.listen(3000, () => {
[0112] console.log('Server is running on port 3000');
[0113] });
[0114] Then the system needs to perform cross-platform interface testing. By using Mocha and Chai for interface testing, the unit test code is as follows:
[0115] javascript
[0116] const chai = require('chai');const chaiHttp = require('chai-http');const server = require('.. / app'); / / Assuming your Node.js application is in app.jsconst should = chai.should();
[0117] chai.use(chaiHttp);
[0118] describe('Heart Rate Monitor', () =>{
[0119] it('should record heart rate data successfully', (done) =>{
[0120] chai.request(server)
[0121] .post(' / monitorHeartRate')
[0122] .send({ heartRate: 75, timestamp: ', platform: 'iOS'})
[0123] .end((err, res) => {
[0124] res.should.have.status(200);
[0125] res.body.should.be.a('object');
[0126] res.body.should.have.property('heartRate').eql(75);
[0127] res.body.should.have.property('timestamp').eql;
[0128] res.body.should.have.property('platform').eql('iOS');
[0129] res.body.should.have.property('status').eql('recorded');
[0130] done();
[0131] });
[0132] });
[0133] it('should trigger alert for high heart rate', (done) =>{
[0134] chai.request(server)
[0135] .post(' / monitorHeartRate')
[0136] .send({ heartRate: 125, timestamp:, platform: 'Android'})
[0137] .end((err, res) =>{
[0138] res.should.have.status(200);
[0139] res.body.should.be.a('object');
[0140] res.body.should.have.property('heartRate').eql(125);
[0141] res.body.should.have.property('timestamp').eql;
[0142] res.body.should.have.property('platform').eql('Android');
[0143] res.body.should.have.property('status').eql('recorded');
[0144] res.body.should.have.property('alert').eql('Heart rateexceeds 120!');
[0145] done();
[0146] });
[0147] });
[0148] });
[0149] Finally, the system is iterated and improved, and optimized based on user feedback and test results. The optimization examples are as follows:
[0150] Assuming that users report that heart rate monitoring is unstable when the battery is low, add low battery detection and reminder functions;
[0151] javascript
[0152] app.post(' / monitorHeartRate', (req, res) =>{
[0153] const { heartRate, timestamp, platform, batteryLevel} =req.body;
[0154] / / Verify parameters
[0155] if (!heartRate || !timestamp || !platform || !batteryLevel) {
[0156] return res.status(400).json({ error: 'Invalid parameters'});
[0157] }
[0158] / / Check the power status
[0159] if (batteryLevel<20) {
[0160] return res.status(400).json({ error: 'Low battery, unable to monitor heart rate'});
[0161] }
[0162] / / Record heart rate data
[0163] const heartRateRecord = {
[0164] heartRate,
[0165] timestamp,
[0166] platform,
[0167] status: 'recorded'
[0168] };
[0169] heartRateData.push(heartRateRecord);
[0170] / / Check heart rate threshold
[0171] if (heartRate>120) {
[0172] heartRateRecord.alert = 'Heart rate exceeds 120!';
[0173] }
[0174] / / Return result
[0175] res.status(200).json(heartRateRecord);
[0176] });
[0177] In summary, the system can obtain the user's preset requirements and build the cross-platform interface data of the smart watch based on these requirements using the preset programming language, thereby ensuring the functional consistency and correctness of the smart watch on different platforms. The above example shows the entire process from requirement collection, interface design and implementation, cross-platform testing to continuous optimization, thereby improving product quality and user satisfaction.
[0178] In this embodiment, after obtaining the user's preset requirement content and constructing the cross-platform interface data of the smart watch in a preset programming language based on the requirement content in step S3, the method further includes:
[0179] S301: Identify a data model corresponding to the demand content, establish an interface data structure of the smart watch based on the data model, and select the programming language to construct an interface code according to the interface data structure, wherein the interface data structure specifically includes a request data format and a response data format;
[0180] S302: Determine whether the interface code can implement the preset functional logic;
[0181] S303: If not, generate an error log, search for corresponding error information and trace stack from the error log, record key variable values and program execution path of the error log, apply a preset debugging tool to execute the interface code step by step, and generate running status data and variable change data of the application.
[0182] In this embodiment, the system identifies the data model corresponding to the required content and establishes the interface data structure of the smart watch based on different data models. The interface data structure specifically includes the request data format and the response data format. According to these interface data structures, a programming language is selected to construct the interface code, and then the system determines whether these interface codes can realize the pre-set functional logic to execute the corresponding steps; for example, when the system determines that the interface code constructed by the programming language can realize the pre-set functional logic, the system will consider that the interface code has the expected function, meets the user's needs, and has passed the preliminary functional test, and the system will perform a test on the interface code. Performance testing and security testing ensure its stability and response speed under high concurrency and large data volume conditions, so that the interface code does not have security vulnerabilities, such as SQL injection or cross-site scripting (XSS), etc. At the same time, the interface code is integrated with other modules or systems to ensure the coordinated operation of the overall system and the correctness of the data flow. The end user or representative is also allowed to test and verify the performance of the interface code in the real usage scenario to ensure that it meets user needs and expectations. For example, when the system determines that the interface code of the programming language cannot implement the pre-set functional logic, the system will consider that the interface code does not have the expected function and does not meet user needs. The system will generate error logs, find the corresponding error messages and trace stacks from these error logs, record the key variable values and program execution paths of these error logs, apply the pre-set debugging tools to step by step execute these interface codes, and generate the running status data and variable change data of the application program; by generating error logs and recording error messages and trace stacks, the system can help developers quickly locate the specific location and cause of the problem, because the recording of key variable values and program execution paths further refines the scope of the problem, making the diagnosis process more efficient, and at the same time, using the pre-set debugging tools to step by step execute the interface code, the running status of the program and the changes in variables can be observed in real time, and this step-by-step execution method allows developers to deeply understand the behavior of the code, discover potential logical errors and abnormal situations, and through detailed error logs and debugging data, developers can clearly understand the problems in the code and fix them, which not only improves the reliability of the code, but also enhances the maintainability of the code, making the maintenance and expansion of future smart watches easier, because the error logs and debugging data provide detailed error information and context, reducing the time required to reproduce the problem, that is, developers can directly analyze and repair based on these data without spending a lot of time to reproduce the problem.
[0183] It should be noted that the interface data structure of the smart watch is established based on different data models. The interface data structure specifically includes a request data format and a response data format. The specific examples of selecting a programming language to construct an interface code based on these interface data structures are as follows:
[0184] Assume that a user needs to implement a function that monitors heart rate data in real time when the user wears a smart watch and issues an alarm when the heart rate exceeds 120 beats / minute. The heart rate data also needs to be synchronized to the server.
[0185] First, the system identifies the data model, including,
[0186] Heart rate data model: records heart rate, timestamp and platform information;
[0187] Alert data model: Generate an alert when the heart rate exceeds the threshold;
[0188] Synchronization data model: synchronize heart rate data to the server;
[0189] Then establish the interface data structure. For example, the code for the heart rate data format is as follows:
[0190] json
[0191] {
[0192] "heartRate": 75,
[0193] "platform": "iOS"
[0194] }
[0195] The code for the alert data format is as follows:
[0196] json
[0197] {
[0198] "alert": "Heart rate exceeds 120!",
[0199] "platform": "iOS"
[0200] }
[0201] The code for the synchronization data format is as follows:
[0202] json
[0203] {
[0204] "data": [
[0205] {
[0206] "heartRate": 75,
[0207] "platform": "iOS"
[0208] },
[0209] {
[0210] "heartRate": 80,
[0211] "platform": "Android"
[0212] }
[0213] ],
[0214] }
[0215] Then the system will use Node.js and Express to build the interface code. The heart rate monitoring interface code is as follows:
[0216] javascript
[0217] const express = require('express');
[0218] const app = express();
[0219] app.use(express.json());
[0220] app.post(' / monitorHeartRate', (req, res) =>{
[0221] const { heartRate, timestamp, platform} = req.body;
[0222] if (!heartRate || !timestamp || !platform) {
[0223] return res.status(400).json({ error: 'Invalid parameters'});
[0224] }
[0225] const heartRateRecord = {
[0226] heartRate,
[0227] timestamp,
[0228] platform,
[0229] status: 'recorded'
[0230] };
[0231] if (heartRate > 120) {
[0232] heartRateRecord.alert = 'Heart rate exceeds 120!';
[0233] }
[0234] res.status(200).json(heartRateRecord);
[0235] });
[0236] app.listen(3000, () => {
[0237] console.log('Server is running on port 3000');
[0238] });
[0239] The code for the data synchronization interface is as follows:
[0240] javascript
[0241] app.post(' / syncData', (req, res) => {
[0242] const { data, syncTimestamp} = req.body;
[0243] if (!data ||!syncTimestamp) {
[0244] return res.status(400).json({ error: 'Invalid parameters'});
[0245] }
[0246] const syncRecord = {
[0247] data,
[0248] syncTimestamp,
[0249] status:'synchronized'
[0250] };
[0251] res.status(200).json(syncRecord);
[0252] });
[0253] Finally, the system will test and verify, that is, send a request to test the heart rate monitoring interface. The code is as follows:
[0254] bash
[0255] curl -X POST http: / / localhost:3000 / monitorHeartRate -H "Content-Type:application / json" -d '{"heartRate": 130, "timestamp": , "platform": "iOS"}'
[0256] Send a request to test the data synchronization interface:
[0257] bash
[0258] curl -X POST http: / / localhost:3000 / syncData -H "Content-Type:application / json" -d
[0259] In summary, the system ensures that the interface can accurately handle heart rate monitoring and data synchronization functions by constructing a detailed data model and interface data structure. Because the data model contains platform information, it can support data synchronization on different platforms such as iOS and Android. The background management team can choose the appropriate programming language and framework, and can flexibly respond to different changes and expansions in requirements. Through detailed testing and verification, the reliability and stability of the interface code can be ensured, thereby accurately meeting user needs and improving user satisfaction with the functions of smart watches.
[0260] In this embodiment, the corresponding development framework is selected according to the interface information to establish the application code of the smart watch, and the step S3 of generating the test case of the required content in the preset test framework also includes:
[0261] S31: Based on the branch strategy predefined in the test case, configure the deployment environment of the smart watch, and apply a preset monitoring tool to collect the running status of the application in real time, wherein the branch strategy specifically includes a main branch, a development branch, and a functional branch, and the deployment environment specifically includes a production environment and a test environment;
[0262] S32: Determine whether the operating state meets the preset state;
[0263] S33: If not, monitor the key indicator data of the test case in real time, and deploy the pre-written rollback script to the test case according to the pre-configured alarm rules of the smart watch, and trigger the smart watch to restore to the pre-test version through the rollback script, and re-enable the service content of the smart watch, wherein the key indicator data specifically include error rate, response time and memory usage.
[0264] In this embodiment, the system configures the deployment environment of the smart watch based on the branch strategy predefined by the test case, the branch strategy specifically includes the main branch, the development branch and the functional branch, and the deployment environment specifically includes the production environment and the test environment. The pre-set monitoring tool is applied to collect the running status of the application in real time, and then the system determines whether the running status meets the pre-set status to execute the corresponding steps; for example, when the system determines that the running status of the application can meet the pre-set status, the system will consider that the application is running normally in the current deployment environment, meeting user needs and functional expectations, and the system will record the current deployment as a successful state, and update relevant logs and records, which will help subsequent tracking and backtracking. At the same time, the background management team, the test team and relevant business personnel are informed through the preset notification mechanism that the deployment has been successful and the application is running normally. According to the project management plan, the next step is promoted, such as further testing, user acceptance testing, and starting the development of new functions. Even if the current running status is normal, it is still necessary to continue to use the monitoring tool to collect the running status of the application in real time to ensure that potential problems can be discovered and handled in time during future operations; for example, when the system determines that the running status of the application cannot meet the pre-set status, the system will consider that the application is in the current deployment environment. In case of abnormal operation, the system will monitor the key indicator data of the test case in real time, including error rate, response time and memory usage. According to the pre-configured alarm rules of the smart watch, the pre-written rollback script will be deployed to the test case, and the rollback script will trigger the smart watch to restore to the pre-test version and re-enable the service content of the smart watch. The system can quickly restore to the previous stable version through the pre-configured rollback script when an abnormality is detected, ensuring that the core functions of the smart watch are not affected, thereby reducing service interruption time, because the automated rollback mechanism can promptly handle problems that arise during the deployment process and avoid accidents caused by abnormal conditions. A wider range of system failures and data losses can be prevented, reducing operational risks. At the same time, key indicator data such as error rate, response time and memory usage can be monitored in real time to ensure that the system runs in a stable state. Through automated monitoring and alarm mechanisms, potential problems can be discovered and handled early, improving the stability and reliability of the system. When an abnormality occurs, the system can quickly roll back and restore service to minimize the impact on users and ensure the continuity and stability of user experience. The automated rollback mechanism reduces the need for manual intervention and improves operation and maintenance efficiency, that is, the back-end management team can focus on analyzing problems and optimizing the system rather than emergency repairs and manual rollbacks.
[0265] In this embodiment, the step S5 of identifying the logic error in the test case according to the test result and modifying the test case code based on the logic error includes:
[0266] S51: dividing the failed test cases from the test cases, extracting input data of the failed test cases, importing the input data into a preset local development environment, re-running the failed test cases at least twice in the local development environment, and generating running results of the failed test cases;
[0267] S52: Determine whether a repeatable error is detected in the operation result;
[0268] S53: If so, change the configuration parameters of the local development environment, collect the output results of the failed test cases based on the configuration parameters, and record the log information of the output results, wherein the configuration parameters specifically include configuration files, log levels, and feature enablement and disablement, the output results specifically include test pass and test failure, and the log information specifically includes database connections and API endpoints.
[0269] In this embodiment, the system divides failed test cases from the test cases, extracts input data from these failed test cases, imports the input data into a pre-set local development environment, re-runs the failed test cases at least twice in the local development environment, generates running results of the failed test cases, and then the system determines whether these running results detect repeatable errors to execute corresponding steps; for example, when the system determines that the running results of the failed test cases do not detect repeatable errors, the system will consider that the test case did not fail in the same way in the local development environment, that is, the problem may be intermittent and may not occur every time it is run. The system will record in detail all differences between the production environment and the local development environment, including operating system version, database configuration, network settings, and dependency package versions, increase the number of runs of failed test cases in the local environment, collect as much running data as possible to determine whether the problem has intermittent characteristics, and simulate the production environment in the local development environment, and use containerization technology to create a test environment that is consistent with the production environment. Environment-consistent containers ensure the consistency of the environment, add more logging to test cases and applications, record the execution status and data status of each step in detail, so as to analyze the root cause of the problem, and confirm whether the failed test cases depend on specific data status. If so, try to reproduce these data status in the local environment, return to the previous stable version, rerun the failed test cases, and observe whether the errors can be reproduced. By comparing the changes in different versions, find out the code changes that may cause the problem; for example, when the system determines that the running results of failed test cases detect repeatable errors, the system will think that the test cases fail in the same way in the local development environment, and the system will change the configuration parameters of the local development environment. The configuration parameters specifically include configuration files, log levels, and feature enablement and disablement. Based on these configuration parameters, the output results of failed test cases are collected. The output results specifically include test pass and test failure. The log information of these output results is recorded. The log information specifically includes database connection and API endpoint;By changing configuration parameters and collecting output results, the system can more accurately locate the specific reasons that cause test case failures. For example, changing database connection parameters may reveal database configuration problems, and changing log levels can provide more detailed error information. At the same time, by recording detailed log information, including database connections and API endpoints, it can provide developers with more contextual information, thereby speeding up the debugging process and reducing the time for problem location and repair. By identifying and solving repeatable errors, the system can ensure that similar problems are avoided in the production environment, thereby improving the stability and reliability of the system. The system can automatically adjust and optimize configuration parameters based on the output results of failed test cases to ensure configuration consistency and optimal performance in different environments. By recording test output results and log information in detail, the backend management team can identify blind spots in test coverage and improve test cases to ensure that all possible scenarios are fully tested. ;
[0270] In this embodiment, the step S2 of determining whether the communication protocol detects a preset platform difference further includes:
[0271] S21: Based on the platform difference dimensions pre-recorded by the smart watch, recording the API document log generated by the user through the smart watch, wherein the platform difference dimensions specifically include operating system differences, hardware differences, software version differences, network environment differences and API version differences;
[0272] S22: Determine whether the API document log detects a compatibility alarm preset by the smart watch;
[0273] S23: If yes, then collect the difference information in the API document log, regularly update the preset difference document according to the difference information, map the latest communication status of the current protocol through the difference document, and adaptively generate the difference priority according to the latest communication status.
[0274] In this embodiment, the system records the API document logs generated by the user through the smart watch based on the platform difference dimensions pre-recorded by the smart watch, which specifically include operating system differences, hardware differences, software version differences, network environment differences, and API version differences. The system then determines whether these API document logs detect the compatibility warnings pre-set by the smart watch to execute corresponding steps. For example, when the system determines that the API document logs generated by the user through the smart watch do not detect the compatibility warnings pre-set by the smart watch, the system will deem that when the smart watch is running on the current platform and environment, no problems related to the preset compatibility differences are found, and the system will The success information of this test is recorded in the system log, including detailed environment information, test time and test results, which is helpful for subsequent audit and backtracking. At the same time, the relevant background management team is notified to confirm that the current configuration and code are working properly on all tested platforms and environments without compatibility issues. After confirming that there are no compatibility issues in the current environment and platform, other types of tests can be continued, such as performance testing and security testing, to ensure the overall stability and reliability of the system. Although no compatibility issues are currently detected, the system still needs to be continuously monitored and optimized to ensure good compatibility in future updates and changes; for example, when the system determines that the user has passed the intelligent The API document log generated by the smartwatch can detect the pre-set compatibility alarm of the smartwatch. At this time, the system will think that the smartwatch is running abnormally in the current platform and environment. The system will collect the difference information in these API document logs, and update the pre-set difference documents according to different difference information. The difference document maps the latest communication status of the current communication protocol, and adaptively generates difference priorities based on the latest communication status; the system can automatically detect compatibility issues and record relevant difference information, which ensures that the smartwatch can timely discover potential compatibility issues in different platforms and environments. By collecting difference information and updating difference documents, the system can quickly adapt to environmental changes and ensure timely response to new compatibility issues. At the same time, regular updates of difference documents can keep the system aware of the latest platform and environmental differences, so that the system can make judgments based on the latest data when problems are found, reducing erroneous responses caused by outdated documents. By automatically generating difference priorities, the system can prioritize key issues according to the severity and scope of the problem, improve processing efficiency, and generate difference priorities based on the latest communication status, so that the most critical and user-friendly issues are solved first, which helps to improve the stability and performance of the system. Timely identification and handling of compatibility issues can reduce the negative impact on users and maintain the high availability and reliability of the system.
[0275] It should be noted that the difference information in the API document log is collected, the preset difference document is updated regularly according to the difference information, the latest communication status of the current protocol is mapped through the difference document, and the difference priority is adaptively generated according to the latest communication status. The specific examples are as follows:
[0276] Assume that the backend management team is developing a smartwatch app that needs to support multiple platforms (such as iOS, Android, and Web). The following is a detailed example of how to deal with API compatibility issues;
[0277] First, the system collects the difference information in the API document log. By obtaining the API log, it extracts data from the API call logs of different platforms and compares the response time, data format and status code in the log, including PlatformA and PlatformB. The code is as follows:
[0278] Platform A (iOS) API Call Log:
[0279] plaintext
[0280] Endpoint: / api / user / profile
[0281] Method: GET
[0282] Response Time: 120ms
[0283] Response Format: JSON
[0284] Status Code: 200
[0285] Platform B (Android) API Call Log:
[0286] plaintext
[0287] Endpoint: / api / user / profile
[0288] Method: GET
[0289] Response Time: 350ms
[0290] Response Format: XML
[0291] Status Code: 200
[0292] The difference information can be obtained.
[0293] Response time: Platform A = 120ms, Platform B = 350ms
[0294] Data format: Platform A = JSON, Platform B = XML
[0295] Then the system will regularly update the preset difference document based on the difference information, create a difference document, record the difference information in the difference document, and regularly update the document to reflect the latest differences. The code is as follows:
[0296] plaintext
[0297] Difference Document:
[0298] - Platform A (iOS):
[0299] - Endpoint: / api / user / profile
[0300] - Response Time: 120ms
[0301] - Response Format: JSON
[0302] - Platform B (Android):
[0303] - Endpoint: / api / user / profile
[0304] - Response Time: 350ms
[0305] - Response Format: XML
[0306] - Observed Issues:
[0307] - Platform B has a higher response time and different data format.
[0308] The system then maps the latest communication status of the current protocol through the difference document, obtains and analyzes the recorded difference information, and applies the difference information to the current protocol to understand the latest communication status. The code is as follows:
[0309] plaintext
[0310] Current Communication Status:
[0311] - API Endpoint: / api / user / profile
[0312] - Protocol: REST
[0313] - Platform A (iOS):
[0314] - Status: Normal
[0315] - Response Time: 120ms
[0316] - Data Format: JSON
[0317] - Platform B (Android):
[0318] - Status: Issues Detected
[0319] - Response Time: 350ms (Higher than expected)
[0320] - Data Format: XML (Mismatch with Platform A)
[0321] Finally, the system will adaptively generate differential priorities based on the latest communication status, analyze the communication status of each platform, and set priorities based on the severity and impact of the problem. The code is as follows:
[0322] plaintext
[0323] Priority Assignment:
[0324] - Platform A (iOS):
[0325] - Priority: Low
[0326] - Justification: Normal response time and data format consistentwith specification.
[0327] - Platform B (Android):
[0328] - Priority: High
[0329] - Justification: High response time (350ms, expected<200ms) anddata format mismatch (XML vs. JSON). Immediate action required to fixresponse time and ensure data format consistency.
[0330] In summary, the system collects response time and data format from the API call logs of iOS and Android platforms, identifies differences, records these differences in difference documents, and updates them regularly. The difference documents are used to map out the latest communication status of each platform, and the difference priority is adaptively generated based on the communication status, giving priority to platforms with serious problems.
[0331] In this embodiment, the step S4 of judging whether the test case can complete the preset automated test further includes:
[0332] S41: Based on the test objectives preset in the test case, adjust the test requirement data of the automated test, and configure the test environment according to the test objectives and the test requirement data, wherein the test objectives specifically include function verification, performance verification and compatibility testing, and the test requirement data specifically include input data, expected results and execution environment;
[0333] S42: Determine whether the test environment matches the expected environment, wherein the expected environment specifically includes an operating system, a browser version, a dependency library, and a network configuration;
[0334] S43: If so, write the test script of the automated test based on the test requirement data, cover the expected functions and boundary conditions of the requirement content from the test script, and generate feasibility evaluation data of the test script, wherein the feasibility evaluation data specifically includes the stability and repeatability of the test case and whether it depends on dynamic data or environment.
[0335] In this embodiment, the system adjusts the test requirement data of the automated test based on the test objectives pre-set by the test case, the test objectives specifically include functional verification, performance verification and compatibility testing, the test requirement data specifically includes input data, expected results and execution environment, configures the test environment according to the test objectives and the test requirement data, and then the system determines whether the test environment matches the expected environment, the expected environment specifically includes the operating system, browser version, dependent library and network configuration, to execute the corresponding steps; for example, when the system determines that the test environment cannot match the expected environment, the system will consider that the current test environment is inconsistent with the expected configuration of the test case, which may cause inaccurate test results or test failure, the system will identify and record the specific differences between the current test environment and the expected environment, that is, the background management team can adjust the configuration in the test environment according to the recorded differences to make it meet the requirements of the expected environment, and after the adjustment is completed, re-check the test environment to ensure that all configuration items meet the requirements of the expected environment, and record the adjusted configuration in the environment configuration document to ensure that subsequent tests can be based on the correct environment configuration for example, when the system determines that the test environment can match the expected environment, the system will consider that the current test environment is consistent with the expected configuration of the test case and the test result is accurate. The system will write an automated test script based on the test requirement data, cover the expected functions and boundary conditions of the requirement content from the test script, and generate feasibility assessment data for the test script. The feasibility assessment data specifically includes the stability and repeatability of the test case and whether it depends on dynamic data or environment. The system ensures that the test environment is consistent with the expected configuration, and the test results can accurately reflect the actual performance and functions of the system, reduce test failures caused by inconsistent environments, and improve the credibility of the test. At the same time, the automated test script covers all functions and boundary conditions of the requirement content to ensure that all functional requirements are verified. Through feasibility assessment, potential problems in the test script are identified and resolved, and the stability and reliability of the test script are improved. The automated test script reduces the workload of manual testing and improves test efficiency. The stability and repeatability assessment ensure that the test script performs consistently in multiple runs, reducing the time for repeated debugging and repair.
[0336] In this embodiment, the step S1 of collecting the communication protocol set by the user for the smart watch includes:
[0337] S11: based on the preset communication protocol structure of the smart watch, dividing the data exchange process of the communication protocol, wherein the communication protocol structure specifically includes data format, protocol hierarchy and message type, and the data exchange process specifically includes request and response mechanism, status code and error handling;
[0338] S12: Determine whether the data exchange process detects signal data packets of different protocols;
[0339] S13: If yes, the protocol type of the communication protocol is generated through the signal data packet, and the permission setting of the smart watch for the communication protocol is adaptively identified according to the protocol type.
[0340] In this embodiment, the system is based on a communication protocol structure pre-set by the smart watch. The communication protocol structure specifically includes data format, protocol hierarchy and message type, and divides the data exchange process of the communication protocol. The data exchange process specifically includes request and response mechanisms, status codes and error handling. Then the system determines whether these data exchange processes detect signal data packets of different communication protocols to execute corresponding steps; for example, when the system determines that the data exchange process of the communication protocol does not detect signal data packets of different communication protocols, the system will consider that the communication protocol currently used by the smart watch does not recognize signals interacting with other communication protocols in the data exchange process. The system will analyze the data packet log to confirm whether there are missed or unrecorded signal packets, ensure that the log recording mechanism is complete and can capture all data exchange details, and check the communication protocol configuration of the smart watch to confirm that the configuration parameters of all protocols are correct, ensure that there are no conflicts or incompatibilities between the configurations of the communication protocols, and introduce more actual usage scenarios in the test environment. , ensuring that the test cases can cover all protocol interactions that the smart watch may encounter; for example, when the system determines that the data exchange process of the communication protocol detects signal data packets of different communication protocols, the system will think that the communication protocol used by the smart watch has signals that interact with other communication protocols in the data exchange process, and the system will generate the protocol type of the communication protocol through the signal data packet, and adaptively identify the permission settings of the smart watch for the communication protocol according to different protocol types; by detecting signal data packets of different communication protocols, the system can accurately identify the interaction between the protocols, which helps to ensure the compatibility of different protocols in the data exchange process and avoid conflicts or data loss. At the same time, according to the protocol type generated by the signal data packet, the system can adaptively adjust the permission settings for different communication protocols, so that the smart watch can dynamically adjust the communication strategy according to different environments and usage scenarios to improve communication efficiency, and by identifying and managing the permission settings of different communication protocols, the system can effectively prevent unauthorized protocol interactions and improve the security of the device.
[0341] Reference Figure 2 , is a communication protocol optimization system for a smart watch in one embodiment of the present invention, comprising:
[0342] The acquisition module 10 is used to acquire the communication protocol set by the user for the smart watch;
[0343] A determination module 20, used to determine whether the communication protocol detects a preset platform difference;
[0344] The execution module 30 is used for obtaining the requirement content preset by the user, constructing the cross-platform interface data of the smart watch based on the requirement content by using a preset programming language, dividing the interface information from the cross-platform interface data, selecting a corresponding development framework according to the interface information to establish the application code of the smart watch, and generating a test case of the requirement content in a preset test framework, wherein the interface information specifically includes interface functions, interface parameters and interface return values, and the test case specifically includes unit testing, integration testing and end-to-end testing;
[0345] A second judgment module 40 is used to judge whether the test case can complete the preset automated test;
[0346] The second execution module 50 is used to, if not, identify the logical errors in the test case according to the test results, modify the test case code based on the logical errors, obtain the missing test code path and the missing scenario from the test results, generate the boundary conditions of the test case through the missing test code path and the missing scenario, add the boundary conditions to the test case, and integrate the test case to verify the collaboration information of the smart watch for the required content, wherein the boundary conditions specifically include maximum value, minimum value and null value, and the collaboration information specifically includes data exchange, function call and event triggering.
[0347] In this embodiment, the collection module 10 collects the required communication protocols set by the user for the smart watch, and then the judgment module 20 judges whether these communication protocols detect the preset platform differences to execute the corresponding steps; for example, when the system determines that the required communication protocols set by the user for the smart watch do not detect the preset platform differences, the system will believe that these communication protocols can operate normally on different platforms, and there is no functional inconsistency problem caused by platform differences. The system will test and optimize the performance of the communication protocols on different platforms, including data transmission speed, delay and stability. According to the test and verification results, the design documents of the protocols are improved to ensure that the implementation details of all platforms are fully recorded. At the same time, the user's usage experience and feedback on different platforms are collected to understand the performance of the protocols in actual use, so that the backend management team can find out the subtle differences and improvement space that may exist in the protocols on different platforms, and implement automated testing on all target platforms to ensure that the communication protocols remain compatible in future updates and maintenance. Through logging and performance monitoring tools, the performance and operation of the protocols on different platforms are continuously monitored to timely discover and solve problems; for example, when the system determines that the required communication protocols set by the user for the smart watch can detect the preset platform differences, the execution module 30 will think that these communication protocols cannot run on cross-platforms. The system will obtain the user's pre-set requirements, build the cross-platform interface data of the smart watch based on different requirements through the pre-set programming language, divide the interface information from these cross-platform interface data, and the interface information specifically includes interface functions, interface parameters and interface return values. According to the interface information, the corresponding development framework is selected to establish the application code of the smart watch, and the test cases of the requirements are generated in the pre-set test framework. The test cases specifically include unit testing, integration testing and end-to-end testing. By building the cross-platform interface data of the smart watch, the system reduces the need to open a separate test for each platform. The complexity of developing and maintaining codes is reduced by adopting a unified interface standard, which can ensure the consistency of implementation of each platform and reduce the problems caused by platform differences. At the same time, the most suitable development framework is selected according to the interface information to ensure that each platform can use best practices and tools. The appropriate development framework can improve development efficiency and reduce unnecessary duplication of work. The clear division of interface functions, parameters and return values makes the responsibilities of each interface clear, which is helpful for development and maintenance, because the clear interface definition makes the code more readable and convenient for subsequent maintenance and expansion. Then the second judgment module 40 judges whether these test cases can complete the pre-set automated tests to execute the corresponding steps;For example, when the system determines that the test case of the requirement content can complete the pre-set automated test, the system will consider that the test case has successfully verified the correctness and consistency of the smart watch function across platforms. The system will confirm the test results to ensure that the smart watch function can run stably on different platforms, check the logs of all test cases to ensure that there are no omissions or false positives, and record all test results in the test report, including the passed test cases, test data and test environment, and update the test results to the project document to ensure that the latest status of the document reflects the real-time status of the current smart watch, and ensure that the deployment environment configuration is consistent with the test environment to avoid problems caused by environmental differences. The backend management team can also collect user feedback to continuously improve the smart watch; for example, when the system determines that the test case of the requirement content cannot complete the pre-set automated test, the second execution module 50 will consider that the correctness and consistency of the smart watch function across platforms cannot be obtained. The system will identify logical errors in the test case based on the test results of the test case, modify the test case code based on the logical errors, obtain the missing code path and missing scenarios from these test results, and generate the boundaries of the test case through the missing test code and missing scenarios. Conditions, boundary conditions specifically include maximum value, minimum value and null value, these boundary conditions are added to the test cases, and the test cases are integrated to verify the smart watch's collaborative information for the required content. The collaborative information specifically includes data exchange, function call and event triggering; by identifying logical errors in test cases, the system can quickly locate and clarify specific problems, improve problem solving efficiency, and accurate error location reduces debugging time, allowing the backend management team to focus on solving real problems. At the same time, missing code paths and scenarios are obtained to ensure that test cases cover all possible usage situations, including extreme conditions, and missing scenarios and code paths are supplemented to ensure that no functions or abnormal situations are missed, improve test completeness, and by adding boundary conditions such as maximum value, minimum value and null value, the system's performance in extreme situations can be tested more accurately to ensure the robustness of the system, while detailed boundary condition testing reduces the possibility of missed errors and ensures that the system can handle various boundary situations. Finally, the integrated test cases verify the smart watch's collaborative information for the required content, ensure the correctness and consistency of data exchange, function call and event triggering, to verify the collaboration between different modules, and ensure the consistency and stability of the overall functions of the smart watch on different platforms. ;
[0348] In this embodiment, it also includes:
[0349] an identification module, used to identify a data model corresponding to the demand content, establish an interface data structure of the smart watch based on the data model, and select the programming language to construct an interface code according to the interface data structure, wherein the interface data structure specifically includes a request data format and a response data format;
[0350] A third judgment module is used to judge whether the interface code can realize the preset functional logic;
[0351] The third execution module is used to generate an error log if not, search for corresponding error information and trace stack from the error log, record key variable values and program execution path of the error log, apply a preset debugging tool to execute the interface code step by step, and generate running status data and variable change data of the application.
[0352] In this embodiment, the system identifies the data model corresponding to the required content and establishes the interface data structure of the smart watch based on different data models. The interface data structure specifically includes the request data format and the response data format. According to these interface data structures, a programming language is selected to construct the interface code, and then the system determines whether these interface codes can realize the pre-set functional logic to execute the corresponding steps; for example, when the system determines that the interface code constructed by the programming language can realize the pre-set functional logic, the system will consider that the interface code has the expected function, meets the user's needs, and has passed the preliminary functional test, and the system will perform a test on the interface code. Performance testing and security testing ensure its stability and response speed under high concurrency and large data volume conditions, so that the interface code does not have security vulnerabilities, such as SQL injection or cross-site scripting (XSS), etc. At the same time, the interface code is integrated with other modules or systems to ensure the coordinated operation of the overall system and the correctness of the data flow. The end user or representative is also allowed to test and verify the performance of the interface code in the real usage scenario to ensure that it meets user needs and expectations. For example, when the system determines that the interface code of the programming language cannot implement the pre-set functional logic, the system will consider that the interface code does not have the expected function and does not meet user needs. The system will generate error logs, find the corresponding error messages and trace stacks from these error logs, record the key variable values and program execution paths of these error logs, apply the pre-set debugging tools to step by step execute these interface codes, and generate the running status data and variable change data of the application program; by generating error logs and recording error messages and trace stacks, the system can help developers quickly locate the specific location and cause of the problem, because the recording of key variable values and program execution paths further refines the scope of the problem, making the diagnosis process more efficient, and at the same time, using the pre-set debugging tools to step by step execute the interface code, the running status of the program and the changes in variables can be observed in real time, and this step-by-step execution method allows developers to deeply understand the behavior of the code, discover potential logical errors and abnormal situations, and through detailed error logs and debugging data, developers can clearly understand the problems in the code and fix them, which not only improves the reliability of the code, but also enhances the maintainability of the code, making the maintenance and expansion of future smart watches easier, because the error logs and debugging data provide detailed error information and context, reducing the time required to reproduce the problem, that is, developers can directly analyze and repair based on these data without spending a lot of time to reproduce the problem.
[0353] In this embodiment, the execution module further includes:
[0354] A configuration unit, configured to configure the deployment environment of the smart watch based on the branch strategy predefined in the test case, and apply a preset monitoring tool to collect the running status of the application in real time, wherein the branch strategy specifically includes a main branch, a development branch, and a functional branch, and the deployment environment specifically includes a production environment and a test environment;
[0355] A judging unit, used to judge whether the running state conforms to a preset state;
[0356] The execution unit is used to monitor the key indicator data of the test case in real time if not, and deploy the pre-written rollback script to the test case according to the pre-configured alarm rules of the smart watch, so as to trigger the smart watch to recover to the pre-test version through the rollback script and re-enable the service content of the smart watch, wherein the key indicator data specifically include error rate, response time and memory usage.
[0357] In this embodiment, the system configures the deployment environment of the smart watch based on the branch strategy predefined by the test case, the branch strategy specifically includes the main branch, the development branch and the functional branch, and the deployment environment specifically includes the production environment and the test environment. The pre-set monitoring tool is applied to collect the running status of the application in real time, and then the system determines whether the running status meets the pre-set status to execute the corresponding steps; for example, when the system determines that the running status of the application can meet the pre-set status, the system will consider that the application is running normally in the current deployment environment, meeting user needs and functional expectations, and the system will record the current deployment as a successful state, and update relevant logs and records, which will help subsequent tracking and backtracking. At the same time, the background management team, the test team and relevant business personnel are informed through the preset notification mechanism that the deployment has been successful and the application is running normally. According to the project management plan, the next step is promoted, such as further testing, user acceptance testing, and starting the development of new functions. Even if the current running status is normal, it is still necessary to continue to use the monitoring tool to collect the running status of the application in real time to ensure that potential problems can be discovered and handled in time during future operations; for example, when the system determines that the running status of the application cannot meet the pre-set status, the system will consider that the application is in the current deployment environment. In case of abnormal operation, the system will monitor the key indicator data of the test case in real time, including error rate, response time and memory usage. According to the pre-configured alarm rules of the smart watch, the pre-written rollback script will be deployed to the test case, and the rollback script will trigger the smart watch to restore to the pre-test version and re-enable the service content of the smart watch. The system can quickly restore to the previous stable version through the pre-configured rollback script when an abnormality is detected, ensuring that the core functions of the smart watch are not affected, thereby reducing service interruption time, because the automated rollback mechanism can promptly handle problems that arise during the deployment process and avoid accidents caused by abnormal conditions. A wider range of system failures and data losses can be prevented, reducing operational risks. At the same time, key indicator data such as error rate, response time and memory usage can be monitored in real time to ensure that the system runs in a stable state. Through automated monitoring and alarm mechanisms, potential problems can be discovered and handled early, improving the stability and reliability of the system. When an abnormality occurs, the system can quickly roll back and restore service to minimize the impact on users and ensure the continuity and stability of user experience. The automated rollback mechanism reduces the need for manual intervention and improves operation and maintenance efficiency, that is, the back-end management team can focus on analyzing problems and optimizing the system rather than emergency repairs and manual rollbacks.
[0358] In this embodiment, the second execution module further includes:
[0359] A generating unit, configured to divide failed test cases from the test cases, extract input data of the failed test cases, import the input data into a preset local development environment, re-run the failed test cases at least twice in the local development environment, and generate running results of the failed test cases;
[0360] The second judgment unit is used to judge whether a repeatable error is detected in the operation result;
[0361] The second execution unit is used to change the configuration parameters of the local development environment, collect the output results of the failed test cases based on the configuration parameters, and record the log information of the output results, wherein the configuration parameters specifically include configuration files, log levels, and feature enabling and disabling, the output results specifically include test pass and test failure, and the log information specifically includes database connections and API endpoints.
[0362] In this embodiment, the system divides failed test cases from the test cases, extracts input data from these failed test cases, imports the input data into a pre-set local development environment, re-runs the failed test cases at least twice in the local development environment, generates running results of the failed test cases, and then the system determines whether these running results detect repeatable errors to execute corresponding steps; for example, when the system determines that the running results of the failed test cases do not detect repeatable errors, the system will consider that the test case did not fail in the same way in the local development environment, that is, the problem may be intermittent and may not occur every time it is run. The system will record in detail all differences between the production environment and the local development environment, including operating system version, database configuration, network settings, and dependency package versions, increase the number of runs of failed test cases in the local environment, collect as much running data as possible to determine whether the problem has intermittent characteristics, and simulate the production environment in the local development environment, and use containerization technology to create a test environment that is consistent with the production environment. Environment-consistent containers ensure the consistency of the environment, add more logging to test cases and applications, record the execution status and data status of each step in detail, so as to analyze the root cause of the problem, and confirm whether the failed test cases depend on specific data status. If so, try to reproduce these data status in the local environment, return to the previous stable version, rerun the failed test cases, and observe whether the errors can be reproduced. By comparing the changes in different versions, find out the code changes that may cause the problem; for example, when the system determines that the running results of failed test cases detect repeatable errors, the system will think that the test cases fail in the same way in the local development environment, and the system will change the configuration parameters of the local development environment. The configuration parameters specifically include configuration files, log levels, and feature enablement and disablement. Based on these configuration parameters, the output results of failed test cases are collected. The output results specifically include test pass and test failure. The log information of these output results is recorded. The log information specifically includes database connection and API endpoint;By changing configuration parameters and collecting output results, the system can more accurately locate the specific reasons that cause test case failures. For example, changing database connection parameters may reveal database configuration problems, and changing log levels can provide more detailed error information. At the same time, by recording detailed log information, including database connections and API endpoints, it can provide developers with more contextual information, thereby speeding up the debugging process and reducing the time for problem location and repair. By identifying and solving repeatable errors, the system can ensure that similar problems are avoided in the production environment, thereby improving the stability and reliability of the system. The system can automatically adjust and optimize configuration parameters based on the output results of failed test cases to ensure configuration consistency and optimal performance in different environments. By recording test output results and log information in detail, the backend management team can identify blind spots in test coverage and improve test cases to ensure that all possible scenarios are fully tested. ;
[0363] In this embodiment, the judgment module further includes:
[0364] A recording unit, configured to record the API document log generated by the user through the smart watch based on the platform difference dimensions pre-recorded by the smart watch, wherein the platform difference dimensions specifically include operating system differences, hardware differences, software version differences, network environment differences, and API version differences;
[0365] A third judgment unit, used to judge whether the API document log detects a compatibility alarm preset by the smart watch;
[0366] The third execution unit is used to collect the difference information in the API document log, regularly update the preset difference document according to the difference information, map the latest communication status of the current protocol through the difference document, and adaptively generate the difference priority according to the latest communication status.
[0367] In this embodiment, the system records the API document logs generated by the user through the smart watch based on the platform difference dimensions pre-recorded by the smart watch, which specifically include operating system differences, hardware differences, software version differences, network environment differences, and API version differences. The system then determines whether these API document logs detect the compatibility warnings pre-set by the smart watch to execute corresponding steps. For example, when the system determines that the API document logs generated by the user through the smart watch do not detect the compatibility warnings pre-set by the smart watch, the system will deem that when the smart watch is running on the current platform and environment, no problems related to the preset compatibility differences are found, and the system will The success information of this test is recorded in the system log, including detailed environment information, test time and test results, which is helpful for subsequent audit and backtracking. At the same time, the relevant background management team is notified to confirm that the current configuration and code are working properly on all tested platforms and environments without compatibility issues. After confirming that there are no compatibility issues in the current environment and platform, other types of tests can be continued, such as performance testing and security testing, to ensure the overall stability and reliability of the system. Although no compatibility issues are currently detected, the system still needs to be continuously monitored and optimized to ensure good compatibility in future updates and changes; for example, when the system determines that the user has passed the intelligent The API document log generated by the smartwatch can detect the pre-set compatibility alarm of the smartwatch. At this time, the system will think that the smartwatch is running abnormally in the current platform and environment. The system will collect the difference information in these API document logs, and update the pre-set difference documents according to different difference information. The difference document maps the latest communication status of the current communication protocol, and adaptively generates difference priorities based on the latest communication status; the system can automatically detect compatibility issues and record relevant difference information, which ensures that the smartwatch can timely discover potential compatibility issues in different platforms and environments. By collecting difference information and updating difference documents, the system can quickly adapt to environmental changes and ensure timely response to new compatibility issues. At the same time, regular updates of difference documents can keep the system aware of the latest platform and environmental differences, so that the system can make judgments based on the latest data when problems are found, reducing erroneous responses caused by outdated documents. By automatically generating difference priorities, the system can prioritize key issues according to the severity and scope of the problem, improve processing efficiency, and generate difference priorities based on the latest communication status, so that the most critical and user-friendly issues are solved first, which helps to improve the stability and performance of the system. Timely identification and handling of compatibility issues can reduce the negative impact on users and maintain the high availability and reliability of the system.
[0368] In this embodiment, the second determination module further includes:
[0369] A second configuration unit is used to adjust the test requirement data of the automated test based on the test objectives preset in the test case, and configure the test environment according to the test objectives and the test requirement data, wherein the test objectives specifically include functional verification, performance verification and compatibility testing, and the test requirement data specifically includes input data, expected results and execution environment;
[0370] A fourth judgment unit, used to judge whether the test environment matches the expected environment, wherein the expected environment specifically includes an operating system, a browser version, a dependency library, and a network configuration;
[0371] The fourth execution unit is used to write the test script of the automated test based on the test requirement data, cover the expected functions and boundary conditions of the requirement content from the test script, and generate feasibility evaluation data of the test script, wherein the feasibility evaluation data specifically includes the stability and repeatability of the test case and whether it depends on dynamic data or environment.
[0372] In this embodiment, the system adjusts the test requirement data of the automated test based on the test objectives pre-set by the test case, the test objectives specifically include functional verification, performance verification and compatibility testing, the test requirement data specifically includes input data, expected results and execution environment, configures the test environment according to the test objectives and the test requirement data, and then the system determines whether the test environment matches the expected environment, the expected environment specifically includes the operating system, browser version, dependent library and network configuration, to execute the corresponding steps; for example, when the system determines that the test environment cannot match the expected environment, the system will consider that the current test environment is inconsistent with the expected configuration of the test case, which may cause inaccurate test results or test failure, the system will identify and record the specific differences between the current test environment and the expected environment, that is, the background management team can adjust the configuration in the test environment according to the recorded differences to make it meet the requirements of the expected environment, and after the adjustment is completed, re-check the test environment to ensure that all configuration items meet the requirements of the expected environment, and record the adjusted configuration in the environment configuration document to ensure that subsequent tests can be based on the correct environment configuration for example, when the system determines that the test environment can match the expected environment, the system will consider that the current test environment is consistent with the expected configuration of the test case and the test result is accurate. The system will write an automated test script based on the test requirement data, cover the expected functions and boundary conditions of the requirement content from the test script, and generate feasibility assessment data for the test script. The feasibility assessment data specifically includes the stability and repeatability of the test case and whether it depends on dynamic data or environment. The system ensures that the test environment is consistent with the expected configuration, and the test results can accurately reflect the actual performance and functions of the system, reduce test failures caused by inconsistent environments, and improve the credibility of the test. At the same time, the automated test script covers all functions and boundary conditions of the requirement content to ensure that all functional requirements are verified. Through feasibility assessment, potential problems in the test script are identified and resolved, and the stability and reliability of the test script are improved. The automated test script reduces the workload of manual testing and improves test efficiency. The stability and repeatability assessment ensure that the test script performs consistently in multiple runs, reducing the time for repeated debugging and repair.
[0373] In this embodiment, the acquisition module further includes:
[0374] A division unit, configured to divide the data exchange process of the communication protocol based on the communication protocol structure preset by the smart watch, wherein the communication protocol structure specifically includes a data format, a protocol layer and a message type, and the data exchange process specifically includes a request and response mechanism, a status code and an error handling;
[0375] A fifth determination unit, configured to determine whether the data exchange process detects a signal data packet of a different protocol;
[0376] The fifth execution unit is used to generate a protocol type of the communication protocol through the signal data packet, and adaptively identify the permission setting of the smart watch for the communication protocol according to the protocol type.
[0377] In this embodiment, the system is based on a communication protocol structure pre-set by the smart watch. The communication protocol structure specifically includes data format, protocol hierarchy and message type, and divides the data exchange process of the communication protocol. The data exchange process specifically includes request and response mechanisms, status codes and error handling. Then the system determines whether these data exchange processes detect signal data packets of different communication protocols to execute corresponding steps; for example, when the system determines that the data exchange process of the communication protocol does not detect signal data packets of different communication protocols, the system will consider that the communication protocol currently used by the smart watch does not recognize signals interacting with other communication protocols in the data exchange process. The system will analyze the data packet log to confirm whether there are missed or unrecorded signal packets, ensure that the log recording mechanism is complete and can capture all data exchange details, and check the communication protocol configuration of the smart watch to confirm that the configuration parameters of all protocols are correct, ensure that there are no conflicts or incompatibilities between the configurations of the communication protocols, and introduce more actual usage scenarios in the test environment. , ensuring that the test cases can cover all protocol interactions that the smart watch may encounter; for example, when the system determines that the data exchange process of the communication protocol detects signal data packets of different communication protocols, the system will think that the communication protocol used by the smart watch has signals that interact with other communication protocols in the data exchange process, and the system will generate the protocol type of the communication protocol through the signal data packet, and adaptively identify the permission settings of the smart watch for the communication protocol according to different protocol types; by detecting signal data packets of different communication protocols, the system can accurately identify the interaction between the protocols, which helps to ensure the compatibility of different protocols in the data exchange process and avoid conflicts or data loss. At the same time, according to the protocol type generated by the signal data packet, the system can adaptively adjust the permission settings for different communication protocols, so that the smart watch can dynamically adjust the communication strategy according to different environments and usage scenarios to improve communication efficiency, and by identifying and managing the permission settings of different communication protocols, the system can effectively prevent unauthorized protocol interactions and improve the security of the device.
[0378] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.
Claims
1. A communication protocol optimization method for a smart watch, characterized in that: The following steps are involved: Collect the communication protocol set by the user for the smart watch; determining whether the communication protocol detects a preset platform difference; If yes, then obtaining the requirement content preset by the user, constructing the cross-platform interface data of the smart watch based on the requirement content by using a preset programming language, dividing the interface information from the cross-platform interface data, selecting a corresponding development framework according to the interface information to establish the application code of the smart watch, and generating a test case of the requirement content in a preset test framework, wherein the interface information specifically includes interface functions, interface parameters and interface return values, and the test case specifically includes unit testing, integration testing and end-to-end testing; Determine whether the test case can complete the preset automated test; If not, identify the logical errors in the test case according to the test results, modify the test case code based on the logical errors, obtain the missing test code path and the missing scenario from the test results, generate the boundary conditions of the test case through the missing test code path and the missing scenario, add the boundary conditions to the test case, and integrate the test case to verify the collaboration information of the smart watch for the required content, wherein the boundary conditions specifically include the maximum value, the minimum value and the null value, and the collaboration information specifically includes data exchange, function call and event triggering; Wherein, after the step of obtaining the user's preset requirement content and constructing the cross-platform interface data of the smart watch in a preset programming language based on the requirement content, the step further includes: Identify a data model corresponding to the demand content, establish an interface data structure of the smart watch based on the data model, and select the programming language to construct an interface code according to the interface data structure, wherein the interface data structure specifically includes a request data format and a response data format; Determine whether the interface code can realize the preset functional logic; If not, an error log is generated, the corresponding error information and trace stack are searched from the error log, key variable values and program execution paths of the error log are recorded, the interface code is executed step by step using a preset debugging tool, and running status data and variable change data of the application are generated; Among them, the step of selecting a corresponding development framework according to the interface information to establish the application code of the smart watch and generating a test case of the required content in a preset test framework also includes: Based on the branch strategy predefined in the test case, the deployment environment of the smart watch is configured, and a preset monitoring tool is applied to collect the running status of the application in real time, wherein the branch strategy specifically includes a main branch, a development branch, and a functional branch, and the deployment environment specifically includes a production environment and a test environment; Determining whether the operating state meets the preset state; If not, the key indicator data of the test case is monitored in real time, and the pre-written rollback script is deployed to the test case according to the pre-configured alarm rules of the smart watch. The rollback script is used to trigger the smart watch to restore to the pre-test version and re-enable the service content of the smart watch, wherein the key indicator data specifically include error rate, response time and memory usage.
2. The communication protocol optimization method of a smart watch according to claim 1, characterized in that: The step of identifying the logical errors in the test case according to the test results and modifying the test case code based on the logical errors includes: Classifying failed test cases from the test cases, extracting input data of the failed test cases, importing the input data into a preset local development environment, re-running the failed test cases at least twice in the local development environment, and generating running results of the failed test cases; Determining whether a repeatable error is detected in the operation result; If so, change the configuration parameters of the local development environment, collect the output results of the failed test cases based on the configuration parameters, and record the log information of the output results, wherein the configuration parameters specifically include configuration files, log levels, and feature enablement and disablement, the output results specifically include test pass and test failure, and the log information specifically includes database connections and API endpoints.
3. The communication protocol optimization method of a smart watch according to claim 1, characterized in that: The step of determining whether the communication protocol detects a preset platform difference also includes: Based on the platform difference dimensions pre-recorded by the smart watch, recording the API document log generated by the user through the smart watch, wherein the platform difference dimensions specifically include operating system differences, hardware differences, software version differences, network environment differences and API version differences; Determine whether the API document log detects a compatibility alarm preset by the smart watch; If so, the difference information in the API document log is collected, a preset difference document is updated regularly according to the difference information, the latest communication status of the current protocol is mapped through the difference document, and the difference priority is adaptively generated according to the latest communication status.
4. The communication protocol optimization method of a smart watch according to claim 1, characterized in that: The step of determining whether the test case can complete the preset automated test also includes: Based on the test objectives preset in the test case, adjust the test requirement data of the automated test, and configure the test environment according to the test objectives and the test requirement data, wherein the test objectives specifically include functional verification, performance verification and compatibility testing, and the test requirement data specifically include input data, expected results and execution environment; Determine whether the test environment matches the expected environment, wherein the expected environment specifically includes the operating system, browser version, dependent libraries, and network configuration; If so, write the test script of the automated test based on the test requirement data, cover the expected functions and boundary conditions of the requirement content from the test script, and generate feasibility evaluation data of the test script, wherein the feasibility evaluation data specifically includes the stability and repeatability of the test case and whether it depends on dynamic data or environment.
5. The communication protocol optimization method of a smart watch according to claim 1, characterized in that: The step of collecting the communication protocol set by the user for the smart watch includes: Based on the preset communication protocol structure of the smart watch, the data exchange process of the communication protocol is divided, wherein the communication protocol structure specifically includes data format, protocol hierarchy and message type, and the data exchange process specifically includes request and response mechanism, status code and error handling; Determining whether the data exchange process detects signal data packets of different protocols; If so, the protocol type of the communication protocol is generated through the signal data packet, and the permission setting of the smart watch for the communication protocol is adaptively identified according to the protocol type.
6. A communication protocol optimization system for a smart watch, characterized in that: include: A collection module, used to collect the communication protocol set by the user for the smart watch; A determination module, used to determine whether the communication protocol detects a preset platform difference; An execution module, configured to, if yes, obtain the requirement content preset by the user, construct the cross-platform interface data of the smart watch in a preset programming language based on the requirement content, divide the interface information from the cross-platform interface data, select a corresponding development framework according to the interface information to establish the application code of the smart watch, and generate a test case of the requirement content in a preset test framework, wherein the interface information specifically includes interface functions, interface parameters and interface return values, and the test case specifically includes unit testing, integration testing and end-to-end testing; A second judgment module is used to judge whether the test case can complete the preset automated test; A second execution module is used for, if not, identifying a logic error in the test case according to the test result, modifying the test case code based on the logic error, obtaining a missing test code path and a missing scenario from the test result, generating a boundary condition of the test case through the missing test code path and the missing scenario, supplementing the boundary condition to the test case, integrating the test case to verify the collaboration information of the smart watch for the required content, wherein the boundary condition specifically includes a maximum value, a minimum value and a null value, and the collaboration information specifically includes data exchange, function call and event triggering; Among them, it also includes: an identification module, used to identify a data model corresponding to the demand content, establish an interface data structure of the smart watch based on the data model, and select the programming language to construct an interface code according to the interface data structure, wherein the interface data structure specifically includes a request data format and a response data format; A third judgment module is used to judge whether the interface code can realize the preset functional logic; The third execution module is used to generate an error log if no, search for corresponding error information and trace stack from the error log, record key variable values and program execution path of the error log, apply a preset debugging tool to execute the interface code step by step, and generate running status data and variable change data of the application program; Wherein, the execution module also includes: A configuration unit, configured to configure the deployment environment of the smart watch based on the branch strategy predefined in the test case, and apply a preset monitoring tool to collect the running status of the application in real time, wherein the branch strategy specifically includes a main branch, a development branch, and a functional branch, and the deployment environment specifically includes a production environment and a test environment; A judging unit, used to judge whether the running state conforms to a preset state; The execution unit is used to monitor the key indicator data of the test case in real time if not, and deploy the pre-written rollback script to the test case according to the pre-configured alarm rules of the smart watch, so as to trigger the smart watch to recover to the pre-test version through the rollback script and re-enable the service content of the smart watch, wherein the key indicator data specifically include error rate, response time and memory usage.
Citation Information
Patent Citations
Cross-platform test method and device, computer equipment and storage medium
CN116932356A