Playback test method and device, storage medium and electronic device
By calling the device's play test interface, the music list and play link are obtained and verified, solving the problem of low manual testing efficiency and achieving more efficient automated testing.
Patent Information
- Application Number
- CN202211649527.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-21
- Publication Date
- 2025-06-27
- Estimated Expiration
- 2042-12-21
AI Technical Summary
In the prior art, the equipment music testing is performed using manual methods, resulting in low testing efficiency and waste of manpower and time.
By calling the play test interface of the target device, obtaining the target file, determining the list of music to be tested and the play links of each music, and verifying these links, and determining the play test results based on the verification results.
It improves testing efficiency, saves labor costs, and solves the problem of low manual testing efficiency.
Smart Images

Figure CN116153345B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of smart homes. Specifically, it relates to a playback test method, device, storage medium, and electronic device. Background Art
[0002] Normally, a certain number of music links need to be built into the device. Then, before the device leaves the factory, it is necessary to conduct a music test on the device to determine whether the number of music links built into the device meets the requirements and whether the device can play music normally according to the built-in music links. The existing playback test method is to conduct the test manually. Specifically, the tester first says to play music. After the music is played, the tester says "next song", and the device plays another song. The tester then says "next song" again, and the device continues to switch songs for playback, so as to determine whether the number of music links meets the requirements and whether it can play music normally according to the built-in music links. However, this method requires the tester to constantly say "next song", which is a waste of manpower and time.
[0003] In view of the problem in the related art that the music test of the device is carried out manually, resulting in low test efficiency, no effective solution has been proposed yet.
[0004] Therefore, it is necessary to improve the related technology to overcome the above-mentioned defects in the related technology. Summary of the Invention
[0005] Embodiments of the present invention provide a playback test method, device, storage medium, and electronic device to at least solve the problem of low test efficiency caused by manually conducting a music test on a device.
[0006] According to an aspect of the embodiments of the present invention, a playback test method is provided, including: calling a playback test interface of a target device and obtaining a target file returned by the playback test interface; determining a music list to be tested from the target file according to a first index, and extracting a playback link of each music from the music list according to a second index; verifying the music list and the playback link of each music, and determining a playback test result according to the verification result.
[0007] In an exemplary embodiment, verifying the music list and each playback link includes: obtaining a list length of the music list and determining whether the list length is greater than or equal to a preset length; and sending a target request to a server through the playback link of each music, and determining whether the playback link of each music meets a preset condition according to a return result sent by the server in response to the target request.
[0008] In an exemplary embodiment, sending a target request to the server through the playback link of each piece of music includes: determining whether the playback link of each piece of music meets a preset format; and in the case where it is determined that the playback link of each piece of music meets the preset format, sending a target request to the server through the playback link of each piece of music.
[0009] In an exemplary embodiment, determining whether the playback link of each piece of music meets a preset format includes: determining whether a first character and a second character exist in the playback link of each piece of music; and in the case where it is determined that the first character exists in each music link and the second character does not exist, determining that the playback link of each piece of music meets the preset format.
[0010] In an exemplary embodiment, determining whether the playback link of each piece of music meets a preset condition according to the return result sent by the server in response to the target request includes: determining the return time of the return result corresponding to the playback link of each piece of music, and parsing the return result to obtain a return code, a return header, and a return body; and in the case where the return time is less than a preset time, the return code is a target return code, the return header indicates that the format of the music is a target format, and the return body indicates that the size of the music is within a target range, determining that the playback link of each piece of music meets the preset condition.
[0011] In an exemplary embodiment, determining a playback test result according to a verification result includes: in the case where the verification result indicates that the list length of the music list is greater than or equal to a preset length and the playback link of each piece of music in the music list meets the preset condition, determining that the playback test of the target device is successful; and in the case where the verification result indicates that the list length of the music list is less than the preset length, or there is a playback link of a piece of music in the music list that does not meet the preset condition, determining that the playback test of the target device fails.
[0012] In an exemplary embodiment, after determining that the playback test of the target device fails, the method further includes: determining the reason for the failure of the playback test of the target device; in the case where the reason is that the list length of the music list is less than the preset length, adding music information of multiple pieces of music to the music list so that the list length of the music list is the preset length, where the music information at least includes a playback link that meets the preset condition; and / or in the case where the target reason is that there are a target number of playback links of music in the music list that do not meet the preset condition, replacing the playback links of the target number of music in the music list with playback links that meet the preset condition.
[0013] According to another aspect of the embodiments of the present invention, there is also provided a playback test device, including: an acquisition module, configured to call a playback test interface of a target device and acquire a target file returned by the playback test interface; a first determination module, configured to determine a music list to be tested from the target file according to a first index, and extract a playback link of each music from the music list according to a second index; a second determination module, configured to verify the music list and the playback link of each music, and determine a playback test result according to the verification result.
[0014] In an exemplary embodiment, the second determination module is further configured to acquire a list length of the music list, and determine whether the list length is greater than or equal to a preset length; and send a target request to a server through the playback link of each music, and determine whether the playback link of each music meets a preset condition according to a return result sent by the server in response to the target request.
[0015] In an exemplary embodiment, the second determination module is further configured to determine whether the playback link of each music meets a preset format; and in the case where it is determined that the playback link of each music meets the preset format, send a target request to a server through the playback link of each music.
[0016] In an exemplary embodiment, the second determination module is further configured to determine whether a first character and a second character exist in the playback link of each music; and in the case where it is determined that the first character exists in each music link and the second character does not exist, determine that the playback link of each music meets the preset format.
[0017] In an exemplary embodiment, the second determination module is further configured to determine a return time of a return result corresponding to the playback link of each music, and parse the return result to obtain a return code, a return header, and a return body; and in the case where the return time is less than a preset time, the return code is a target return code, the return header indicates that the format of the music is a target format, and the return body indicates that the size of the music is within a target range, determine that the playback link of each music meets the preset condition.
[0018] In an exemplary embodiment, the second determination module is further configured to determine that the playback test of the target device is successful in the case where the verification result indicates that the list length of the music list is greater than or equal to a preset length and the playback link of each music in the music list meets the preset condition; and determine that the playback test of the target device fails in the case where the verification result indicates that the list length of the music list is less than the preset length or there is a playback link of a music in the music list that does not meet the preset condition.
[0019] In an exemplary embodiment, the device further includes: a processing module, configured to determine the reason for the failure of the playback test of the target device after determining that the playback test of the target device fails; in the case that the reason is that the list length of the music list is less than a preset length, add music information of a plurality of pieces of music to the music list so that the list length of the music list is the preset length, where the music information at least includes a playback link that meets the preset condition; and / or in the case that the target reason is that the playback links of a target number of pieces of music in the music list do not meet the preset condition, replace the playback links of the target number of pieces of music in the music list with playback links that meet the preset condition.
[0020] According to another aspect of the embodiments of the present invention, there is also provided a computer-readable storage medium, in which a computer program is stored, where the computer program is configured to execute the above playback test method when running.
[0021] According to another aspect of the embodiments of the present invention, there is also provided an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, where the above processor executes the above playback test method through the computer program.
[0022] Through the present invention, a target file returned by a playback test interface is obtained, and a music list to be tested and a playback link of each piece of music are determined from the target file, and then the music list and the playback link of each piece of music are verified, and a playback test result is determined according to the verification result. Since the music test of the device is performed in a machine manner, the test efficiency is improved, the labor cost is saved, and the problem of low test efficiency caused by performing the music test of the device in a manual manner is solved. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] The drawings here are incorporated into the description and form a part of this description, showing embodiments consistent with the present application, and are used together with the description to explain the principles of the present application.
[0024] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, for those of ordinary skill in the art, other drawings can be obtained according to these drawings without creative efforts.
[0025] Figure 1 is a schematic diagram of the hardware environment of a playback test method according to an embodiment of the present application;
[0026] Figure 2is a flowchart of a playback test method according to an embodiment of the present invention (I);
[0027] Figure 3 is a flowchart of a playback test method according to an embodiment of the present invention (II);
[0028] Figure 4 is a structural block diagram of a playback test device according to an embodiment of the present invention (I);
[0029] Figure 5 2 is a structural block diagram of a playback test device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0030] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.
[0031] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0032] According to one aspect of an embodiment of the present application, a playback test method is provided. The playback test method is widely used in smart home (Smart Home), smart home, smart home device ecology, smart residential (IntelligenceHouse) ecology and other whole-house intelligent digital control application scenarios. Optionally, in this embodiment, the above-mentioned playback test method can be applied to Figure 1 In the hardware environment composed of the terminal device 102 and the server 104 shown in FIG. Figure 1As shown in the figure, the server 104 is connected to the terminal device 102 through a network, and can be used to provide services (such as application services, etc.) for the terminal or the client installed on the terminal. A database can be set on the server or independently of the server to provide data storage services for the server 104. Cloud computing and / or edge computing services can be configured on the server or independently of the server to provide data operation services for the server 104.
[0033] The above network can include, but is not limited to, at least one of the following: wired network, wireless network. The above wired network can include, but is not limited to, at least one of the following: wide area network, metropolitan area network, local area network. The above wireless network can include, but is not limited to, at least one of the following: WIFI (Wireless Fidelity), Bluetooth. The terminal device 102 is not limited to being a PC, mobile phone, tablet computer, smart air conditioner, smart range hood, smart refrigerator, smart oven, smart stove, smart washing machine, smart water heater, smart washing equipment, smart dishwasher, smart projection device, smart TV, smart drying rack, smart curtain, smart audio and video, smart socket, smart speaker, smart sound box, smart fresh air device, smart kitchen and bathroom equipment, smart bathroom equipment, smart floor sweeping robot, smart window cleaning robot, smart mopping robot, smart air purification device, smart steam box, smart microwave oven, smart kitchen water heater, smart purifier, smart water dispenser, smart door lock, etc.
[0034] To solve the above problems, in this embodiment, a playback test method is provided, including but not limited to being applied in an automated test script. Figure 2 It is a flowchart (one) of the playback test method according to an embodiment of the present invention. The process includes the following steps:
[0035] Step S202, call the playback test interface of the target device, and obtain the target file returned by the playback test interface;
[0036] As an optional example, the target device includes the above terminal device 102.
[0037] Step S204, determine the music list to be tested from the target file according to the first index, and extract the playback link of each music from the music list according to the second index;
[0038] It should be noted that the music list has music information of multiple musics. The music information includes, but is not limited to: music name, singer, playback link, etc.
[0039] As an alternative example, the format of the target file includes but is not limited to JSON format and dictionary format. When the format of the target file is in dictionary format, the first index is the "key" corresponding to the target file dictionary, and the music list is the "value" corresponding to the target file dictionary. Exemplarily, the first index is data-skillResult-list.
[0040] As an alternative example, the format of the music information in the music list is in dictionary format. The second index is the "key" corresponding to the music information dictionary, and the play link is the "value" corresponding to the music information dictionary. Exemplarily, the second index is url.
[0041] As an alternative example, each music's play link can also be directly determined from the target file according to the third index. Exemplarily, the third index is data-skillResult-list[*]-url.
[0042] In this embodiment, by using the above method, the music list to be tested in the target device and the music link of each music in the music list can be obtained quickly and accurately.
[0043] Step S206: Verify the music list and the play link of each music, and determine the play test result according to the verification result.
[0044] In an exemplary embodiment, verifying the music list and the play link of each music can be implemented through the following steps S11 - S12:
[0045] Step S11: Obtain the list length of the music list, and determine whether the list length is greater than or equal to a preset length;
[0046] It should be noted that the list length of the music list can be obtained through a target function, where the target function is a function for calculating the length of the list.
[0047] Step S12: Send a target request to the server through the play link of each music, and determine whether the play link of each music meets the preset conditions according to the return result sent by the server in response to the target request.
[0048] It should be noted that there is no execution sequence for the above steps S11 and S12.
[0049] In an exemplary embodiment, it is necessary to determine whether the play link of each music meets the preset format; and when it is determined that the play link of each music meets the preset format, a target request is sent to the server through the play link of each music.
[0050] It should be noted that if the playback link of the music does not meet the preset format, it can be directly determined that the playback link of this music does not meet the preset conditions, and thus there is no need to send a target request to the server through this music playback link.
[0051] Through the above steps, it is possible to avoid sending a target request to the server through this music link to verify whether it meets the preset conditions when the playback link of the music does not meet the preset format.
[0052] In an exemplary embodiment, the following method can be used to determine whether the playback link of each music meets the preset format: determine whether there is a first character and a second character in the playback link of each music; in the case where it is determined that the first character exists in the playback link of each music and the second character does not exist, determine that the playback link of each music meets the preset format.
[0053] It should be noted that the first character includes: the keyword of the channel provider that provides the music; the second character includes: illegal characters. If the first character does not exist in the music link or the second character exists in the music link, the music link does not meet the preset format.
[0054] In an exemplary embodiment, according to the return result sent by the server in response to the target request, determining whether the playback link of each music meets the preset conditions can be achieved through the following steps S21 - S22:
[0055] Step S21: Determine the return time of the return result corresponding to the playback link of each music, and parse the return result to obtain a return code, a return header, and a return body;
[0056] It should be noted that the return result includes: a return code, a return header, and a return body.
[0057] It should be noted that the return time is used to indicate the response time of the server, that is, the return time is equal to the moment when the return result sent by the server is obtained minus the moment when the target request is sent to the server.
[0058] Step S22: In the case where the return time is less than the preset time, the return code is the target return code, the return header indicates that the format of the music is the target format, and the return body indicates that the size of the music is within the target range, determine that the playback link of each music meets the preset conditions.
[0059] It should be noted that if the return time is greater than or equal to the preset time, it indicates that the server response times out, and thus the playback link of the music does not meet the preset conditions; if the format of the music is not the target format, the music cannot be played, and thus the playback link of the music does not meet the preset conditions; if the size of the music is not within the target range, it indicates that the music is too small or too large, and thus the playback link of the music does not meet the preset conditions.
[0060] As an optional example, the target return code is 200, the target format is the mp4 format, and the target range is 1 - 10 MB.
[0061] In an exemplary embodiment, determining the playback test result according to the verification result includes: when the verification result indicates that the list length of the music list is greater than or equal to the preset length, and the playback link of each music in the music list meets the preset conditions, determining that the playback test of the target device is successful; when the verification result indicates that the list length of the music list is less than the preset length, or there is a music playback link in the music list that does not meet the preset conditions, determining that the playback test of the target device fails.
[0062] As an optional example, the preset length can be 20.
[0063] Through the above steps, obtain the target file returned by the playback test interface, determine the music list to be tested and the playback link of each music from the target file, then verify the music list and the playback link of each music, and determine the playback test result according to the verification result. Since the music test of the device is carried out by machine, the test efficiency is improved, the labor cost is saved, and the problem of low test efficiency caused by manually testing the device is solved.
[0064] In an exemplary embodiment, after determining that the playback test of the target device fails, the method further includes the following steps S31 - S33:
[0065] Step S31: Determine the reason for the failure of the playback test of the target device;
[0066] Step S32: When the reason is that the list length of the music list is less than the preset length, add the music information of multiple musics to the music list to make the list length of the music list the preset length, where the music information at least includes the playback link, and the playback link meets the preset conditions; and / or
[0067] Step S33: In the case that the target reason is that the play links of the target number of music in the music list do not meet the preset conditions, replace the play links of the target number of music in the music list with play links that meet the preset conditions.
[0068] In this embodiment, when the target device fails the playback test, the music list is actively modified so that the target device can pass the playback test after modifying the music list, avoiding subsequent modification of the music list by the operation and maintenance personnel and saving time and labor costs.
[0069] Obviously, the above-described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. To better understand the above method, the following describes the above process in conjunction with embodiments, but does not limit the technical solutions of the embodiments of the present invention. Specifically:
[0070] In an alternative embodiment, the automated test idea of the present application is: call the interface to test the corpus of "playing music", obtain the music list, write assertion rules, and verify whether the length of the music list meets the requirements and whether the music link is valid. Specifically, Figure 3 is the flowchart (two) of the playback test method according to the embodiment of the present invention, having the following steps:
[0071] Step S302: Start;
[0072] Step S304: Send a request to play music;
[0073] Step S306: Obtain the interface return result;
[0074] It should be noted that the obtained return result of the interface includes: the target file;
[0075] Step S308: Extract the music list according to the hierarchy;
[0076] It should be noted that the hierarchy includes the above first index, for example, data-skillResult-list.
[0077] Step S310: Verify whether the format of the music list is correct. If it is correct, execute Step S314; otherwise, execute Step S312;
[0078] It should be noted that if the format of the obtained music list is in list format, the format is correct; otherwise, the format is incorrect.
[0079] Step S312: Determine that the return format is incorrect and the test fails;
[0080] Step S314: Verify whether the length of the music list is greater than or equal to the expected value (equivalent to the above preset length). If so, execute Step S318; otherwise, execute Step S316.
[0081] It should be noted that the length of the music list can be verified by 'data-skillResult-list': ['length>=', 20]. Here, 'data-skillResult-list' represents the extraction level of the interface return result, and the music list is extracted according to this level. ['length>=', 20] means that the length of the music list needs to be greater than or equal to 20 songs.
[0082] Step S316: Determine that the number of music is insufficient and the test fails.
[0083] Step S318: Extract all music links in the music list according to the level.
[0084] Step S320: Traverse all music links and verify whether the music links are valid. If valid, execute Step S324; otherwise, execute Step S322.
[0085] It should be noted that the validity of the music links can be verified by 'data-skillResult-list[*]-url': ['judgeurl', ""]. Here, 'data-skillResult-list[*]-url' represents the extraction level of the interface return result, and all music links in the music list are extracted according to this level. ['judgeurl', ""] means that all music links need to be verified for validity.
[0086] As an optional example, verifying the validity of the link includes the following:
[0087] 1) According to the agreed characters, verify whether the link contains illegal characters (equivalent to the above second character). If it contains illegal characters, it is determined as garbled, that is, the link is invalid.
[0088] 2) Verify whether the link contains the keyword of the channel provider (equivalent to the above first character). If the keyword of the channel provider is not included, it is determined that the link is invalid.
[0089] 3) Send a request to the URL (i.e., the playback link of the music) and obtain the return result of the server.
[0090] It should be noted that if the return result is not obtained within the maximum response time, it is determined as a timeout, and the link is abnormal; if the return code in the return result is not 200, the request is abnormal, that is, the link is abnormal; if the return format is not a playable format (such as mp4) according to the return header in the return result, the link is abnormal; if the returned file size determined according to the return body in the return result exceeds the maximum threshold or is less than the minimum threshold, it is determined as an invalid song, that is, the link is invalid.
[0091] Step S322: Determine that the music link is invalid and the test fails.
[0092] Step S324: Determine that the test passes.
[0093] That is to say, in this embodiment, a general assertion rule can be written to test whether the music list is normal in the form of an automated script. The automated script can cover various master devices, such as speakers, refrigerators, water heaters, air conditioners, etc. The automated script has a fast execution speed, is not affected by the test environment, has accurate test results, and saves labor and time costs.
[0094] Through the description of the above implementation manners, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by means of software plus a necessary general hardware platform. Of course, it can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art can be embodied in the form of a software product. The computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disc), and includes several instructions for causing a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods of the various embodiments of the present invention.
[0095] In this embodiment, a playback test device is further provided. The device is used to implement the above embodiments and preferred implementation manners, and those that have been described will not be repeated. As used below, the term "module" can be a combination of software and / or hardware that can implement a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware is also possible and contemplated.
[0096] Figure 4 It is a structural block diagram (one) of the playback test device according to an embodiment of the present invention. The device includes:
[0097] An acquisition module 42, configured to call a playback test interface of a target device and acquire a target file returned by the playback test interface;
[0098] The first determination module 44 is configured to determine a music list to be tested from the target file according to a first index, and extract the play link of each music from the music list according to a second index;
[0099] The second determination module 46 is configured to verify the music list and the play link of each music, and determine a play test result according to the verification result.
[0100] With the above device, a target file returned by a play test interface is obtained, a music list to be tested and the play link of each music are determined from the target file, and then the music list and the play link of each music are verified, and a play test result is determined according to the verification result. Since the music test of the device is performed in a machine way, the test efficiency is improved, the labor cost is saved, and the problem of low test efficiency caused by the manual music test of the device is solved.
[0101] In an exemplary embodiment, the second determination module 46 is further configured to obtain the list length of the music list, and determine whether the list length is greater than or equal to a preset length; and send a target request to the server through the play link of each music, and determine whether the play link of each music meets a preset condition according to the return result sent by the server in response to the target request.
[0102] In an exemplary embodiment, the second determination module 46 is further configured to determine whether the play link of each music meets a preset format; in the case where it is determined that the play link of each music meets the preset format, send a target request to the server through the play link of each music.
[0103] In an exemplary embodiment, the second determination module 46 is further configured to determine whether a first character and a second character exist in the play link of each music; in the case where it is determined that the first character exists in each music link and the second character does not exist, it is determined that the play link of each music meets the preset format.
[0104] In an exemplary embodiment, the second determination module 46 is further configured to determine the return time of the return result corresponding to the play link of each music, and parse the return result to obtain a return code, a return header, and a return body; in the case where the return time is less than a preset time, the return code is a target return code, the return header indicates that the format of the music is a target format, and the return body indicates that the size of the music is within a target range, it is determined that the play link of each music meets the preset condition.
[0105] In an exemplary embodiment, the second determination module 46 is further configured to determine that the playback test of the target device is successful when the verification result indicates that the list length of the music list is greater than or equal to a preset length and the playback link of each music in the music list meets the preset condition; and determine that the playback test of the target device fails when the verification result indicates that the list length of the music list is less than the preset length, or there is a music in the music list whose playback link does not meet the preset condition.
[0106] In an exemplary embodiment, Figure 5 is a structural block diagram (II) of a playback test device according to an embodiment of the present invention, as Figure 5 shown, the above device further includes: a processing module 48, configured to determine the reason for the failure of the playback test of the target device after determining that the playback test of the target device fails; when the reason is that the list length of the music list is less than the preset length, add music information of multiple musics to the music list to make the list length of the music list the preset length, where the music information at least includes a playback link that meets the preset condition; and / or when the target reason is that there are a target number of music playback links in the music list that do not meet the preset condition, replace the playback links of the target number of musics in the music list with playback links that meet the preset condition.
[0107] An embodiment of the present invention further provides a computer-readable storage medium, in which a computer program is stored, and the computer program is configured to execute the steps in any one of the above method embodiments when running.
[0108] Optionally, in this embodiment, the above storage medium may be configured to store a computer program for executing the following steps:
[0109] S1, call the playback test interface of the target device and obtain the target file returned by the playback test interface;
[0110] S2, determine the music list to be tested from the target file according to the first index, and extract the playback link of each music from the music list according to the second index;
[0111] S3, verify the music list and the playback link of each music, and determine the playback test result according to the verification result.
[0112] In an exemplary embodiment, the above computer-readable storage medium may include, but is not limited to: various media such as USB flash drives, read-only memory (ROM for short), random access memory (RAM for short), external hard drives, magnetic disks, or optical discs that can store computer programs.
[0113] Specific examples in this embodiment may refer to the examples described in the above embodiments and exemplary embodiments, and will not be elaborated herein.
[0114] An embodiment of the present invention also provides an electronic device, including a memory and a processor. A computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0115] Optionally, in this embodiment, the above processor may be configured to execute the following steps through a computer program:
[0116] S1, call the playback test interface of the target device, and obtain the target file returned by the playback test interface;
[0117] S2, determine the music list to be tested from the target file according to the first index, and extract the playback link of each music from the music list according to the second index;
[0118] S3, verify the music list and the playback link of each music, and determine the playback test result according to the verification result.
[0119] In an exemplary embodiment, the above electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the above processor, and the input / output device is connected to the above processor.
[0120] Specific examples in this embodiment may refer to the examples described in the above embodiments and exemplary embodiments, and will not be elaborated herein.
[0121] Obviously, those skilled in the art should understand that the above modules or steps of the present invention can be implemented by a general-purpose computing device. They can be concentrated on a single computing device or distributed on a network composed of multiple computing devices. They can be implemented by program codes executable by the computing device, so that they can be stored in a storage device and executed by the computing device. And in some cases, the steps shown or described can be executed in a different order than here, or they can be separately made into individual integrated circuit modules, or multiple modules or steps of them can be made into a single integrated circuit module to implement. In this way, the present invention is not limited to any specific combination of hardware and software.
[0122] The above are only the preferred embodiments of the present application. It should be noted that for those of ordinary skill in the art, without departing from the principle of the present application, several improvements and refinements can be made, and these improvements and refinements should also be regarded as the protection scope of the present application.
Claims
1. A playback test method, characterized in that, Including: Invoking the playback test interface of the target device and obtaining the target file returned by the playback test interface; Determining a music list to be tested from the target file according to a first index, and extracting the playback link of each music from the music list according to a second index; Verifying the music list and the playback link of each music, and determining the playback test result of the target device according to the verification result; Among them, verifying the music list and each playback link includes: obtaining the list length of the music list and determining whether the list length is greater than or equal to a preset length; and sending a target request to the server through the playback link of each music, and determining whether the playback link of each music meets the preset conditions according to the return result sent by the server in response to the target request; Among them, determining whether the playback link of each music meets the preset conditions according to the return result sent by the server in response to the target request includes: determining the return time of the return result corresponding to the playback link of each music, and parsing the return result to obtain a return code, a return header, and a return body; in the case where the return time is less than a preset time, the return code is a target return code, the return header indicates that the format of the music is a target format, and the return body indicates that the size of the music is within a target range, determining that the playback link of each music meets the preset conditions.
2. The method according to claim 1, characterized in that Sending a target request to the server through the playback link of each music includes: Determining whether the playback link of each music meets a preset format; In the case where it is determined that the playback link of each music meets the preset format, sending a target request to the server through the playback link of each music.
3. The method according to claim 2, wherein Determining whether the playback link of each music meets a preset format includes: Determining whether there is a first character and a second character in the playback link of each music; In the case where it is determined that the first character exists in each music link and the second character does not exist, determining that each music link meets the preset format.
4. The method according to any one of claims 1 to 3, characterized in that, Determining the playback test result of the target device according to the verification result includes: In the case where the verification result indicates that the list length of the music list is greater than or equal to the preset length and the playback link of each music in the music list meets the preset conditions, determining that the playback test of the target device is successful; In the case where the verification result indicates that the list length of the music list is less than the preset length, or there is a playback link of a music in the music list that does not meet the preset conditions, determining that the playback test of the target device fails.
5. The method according to claim 4, characterized in that, After determining that the playback test of the target device fails, the method further includes: Determining the reason for the failure of the playback test of the target device; In the case where the reason is that the list length of the music list is less than the preset length, adding music information of multiple musics to the music list to make the list length of the music list the preset length, where the music information includes at least a playback link that meets the preset conditions; and / or In the case where the reason is that the play links of the target number of music in the music list do not meet the preset conditions, replace the play links of the target number of music in the music list with play links that meet the preset conditions.
6. A playback test device, characterized in that, Including: An acquisition module, configured to call a play test interface of a target device and acquire a target file returned by the play test interface; A first determination module, configured to determine a music list to be tested from the target file according to a first index, and extract the play link of each music from the music list according to a second index; A second determination module, configured to verify the music list and the play link of each music, and determine a play test result according to the verification result; Wherein, the second determination module is further configured to acquire the list length of the music list and determine whether the list length is greater than or equal to a preset length; and send a target request to a server through the play link of each music, and determine whether the play link of each music meets the preset conditions according to a return result sent by the server in response to the target request; Wherein, the second determination module is further configured to determine the return time of the return result corresponding to the play link of each music, and parse the return result to obtain a return code, a return header, and a return body; In the case where the return time is less than a preset time, the return code is a target return code, the return header indicates that the format of the music is a target format, and the return body indicates that the size of the music is within a target range, determine that the play link of each music meets the preset conditions.
7. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored program, wherein the program, when running, executes the method according to any one of claims 1 to 5.
8. An electronic device, comprising a memory and a processor, characterized in that, A computer program is stored in the memory, and the processor is configured to execute the method according to any one of claims 1 to 5 through the computer program.
Citation Information
Patent Citations
Invalid link address processing method and device
CN104036053A
Processing method, device and system for multimedia data
CN105657456A
Music playing control method and device and computer readable storage medium
CN113590079A